@tabler/charts 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/README.md +19 -1
  2. package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
  3. package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
  4. package/dist/{annotations-BszTTjf9.js → annotations-D0YQ0IoA.js} +6 -7
  5. package/dist/{annotations-BszTTjf9.js.map → annotations-D0YQ0IoA.js.map} +1 -1
  6. package/dist/{annotations-DpETO8dE.cjs → annotations-DdRdeBUB.cjs} +6 -7
  7. package/dist/{annotations-DpETO8dE.cjs.map → annotations-DdRdeBUB.cjs.map} +1 -1
  8. package/dist/annotations.cjs +3 -5
  9. package/dist/annotations.cjs.map +1 -1
  10. package/dist/annotations.d.cts +2 -1
  11. package/dist/annotations.d.ts +2 -1
  12. package/dist/annotations.js +3 -4
  13. package/dist/{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-DQsLERhx.js → area-0-L1bG9B.js} +5 -6
  18. package/dist/{area-DQsLERhx.js.map → area-0-L1bG9B.js.map} +1 -1
  19. package/dist/{area-sHCE3pg5.cjs → area-4eRs3c0K.cjs} +5 -6
  20. package/dist/{area-sHCE3pg5.cjs.map → area-4eRs3c0K.cjs.map} +1 -1
  21. package/dist/{area-CF__HOwL.d.ts → area-CJX9219z.d.cts} +3 -6
  22. package/dist/{area-DIxaAbYZ.d.cts → area-d11XePuw.d.ts} +3 -6
  23. package/dist/area.cjs +1 -1
  24. package/dist/area.d.cts +2 -1
  25. package/dist/area.d.ts +2 -1
  26. package/dist/area.js +1 -2
  27. package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
  28. package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
  29. package/dist/{bar-DM16NUvV.js → bar-B5n2oq9-.js} +3 -4
  30. package/dist/{bar-DM16NUvV.js.map → bar-B5n2oq9-.js.map} +1 -1
  31. package/dist/{bar-BBM8RhoL.d.ts → bar-BDLR4p9c.d.cts} +4 -7
  32. package/dist/{bar-jZEoao74.js → bar-BNZ3GhIw.js} +20 -20
  33. package/dist/bar-BNZ3GhIw.js.map +1 -0
  34. package/dist/{bar-C-7zR2qp.cjs → bar-Da6dE_nI.cjs} +20 -20
  35. package/dist/bar-Da6dE_nI.cjs.map +1 -0
  36. package/dist/{bar-DGuUN3nc.cjs → bar-LYIF8MEz.cjs} +3 -4
  37. package/dist/{bar-DGuUN3nc.cjs.map → bar-LYIF8MEz.cjs.map} +1 -1
  38. package/dist/{bar-CRKLDg98.d.cts → bar-XwzM6Pb0.d.ts} +4 -7
  39. package/dist/bar.cjs +1 -1
  40. package/dist/bar.d.cts +2 -1
  41. package/dist/bar.d.ts +2 -1
  42. package/dist/bar.js +1 -2
  43. package/dist/{candlestick-DuXwAFID.js → candlestick-BHQkQfxH.js} +6 -7
  44. package/dist/{candlestick-DuXwAFID.js.map → candlestick-BHQkQfxH.js.map} +1 -1
  45. package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CYCQXgky.cjs} +6 -7
  46. package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CYCQXgky.cjs.map} +1 -1
  47. package/dist/{candlestick-D_vV0_XZ.d.ts → candlestick-D0xKkdqd.d.ts} +3 -6
  48. package/dist/{candlestick-__pXl_pV.d.cts → candlestick-Dq7qp-F0.d.cts} +3 -6
  49. package/dist/candlestick.cjs +4 -5
  50. package/dist/candlestick.d.cts +1 -1
  51. package/dist/candlestick.d.ts +1 -1
  52. package/dist/candlestick.js +4 -6
  53. package/dist/{cartesian-Cr0AF0nG.js → cartesian-CI2x6N7N.js} +27 -27
  54. package/dist/cartesian-CI2x6N7N.js.map +1 -0
  55. package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DV02PsBe.cjs} +27 -27
  56. package/dist/cartesian-DV02PsBe.cjs.map +1 -0
  57. package/dist/{chart-BF2CK9I_.js → chart-DWn9v6qw.js} +35 -24
  58. package/dist/chart-DWn9v6qw.js.map +1 -0
  59. package/dist/{chart-DyN7bcx8.d.ts → chart-QilhWP8Z.d.ts} +32 -49
  60. package/dist/{chart-CowF_lWY.cjs → chart-e2VqomCI.cjs} +35 -24
  61. package/dist/chart-e2VqomCI.cjs.map +1 -0
  62. package/dist/{chart-D7ooEFnk.d.cts → chart-kqFMEwDo.d.cts} +58 -49
  63. package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
  64. package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
  65. package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
  66. package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
  67. package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
  68. package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
  69. package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
  70. package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
  71. package/dist/{core-CegR_j55.js → core-BKRQvPAT.js} +33 -41
  72. package/dist/core-BKRQvPAT.js.map +1 -0
  73. package/dist/{core-RzS9IQO5.cjs → core-DIOC61up.cjs} +33 -41
  74. package/dist/core-DIOC61up.cjs.map +1 -0
  75. package/dist/{core-DcbemzGf.d.ts → core-DRUCk67j.d.ts} +4 -41
  76. package/dist/{core-D1vO1LrC.d.cts → core-PAX5ogLk.d.cts} +22 -67
  77. package/dist/core.cjs +28 -24
  78. package/dist/core.d.cts +23 -21
  79. package/dist/core.d.ts +23 -21
  80. package/dist/core.js +27 -25
  81. package/dist/{dates-CG-FvioW.js → dates-C2RzY3rE.js} +4 -5
  82. package/dist/{dates-CG-FvioW.js.map → dates-C2RzY3rE.js.map} +1 -1
  83. package/dist/{dates-Btm7Zm6W.cjs → dates-DurEr9WT.cjs} +4 -5
  84. package/dist/{dates-Btm7Zm6W.cjs.map → dates-DurEr9WT.cjs.map} +1 -1
  85. package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
  86. package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
  87. package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
  88. package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
  89. package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
  90. package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
  91. package/dist/decimate.cjs +3 -4
  92. package/dist/decimate.d.cts +1 -1
  93. package/dist/decimate.d.ts +1 -1
  94. package/dist/decimate.js +3 -4
  95. package/dist/{dom-vP3IcMak.js → dom-CuceR8gt.js} +4 -6
  96. package/dist/{dom-vP3IcMak.js.map → dom-CuceR8gt.js.map} +1 -1
  97. package/dist/{dom-CLF868Qs.cjs → dom-D_g13XWY.cjs} +4 -6
  98. package/dist/{dom-CLF868Qs.cjs.map → dom-D_g13XWY.cjs.map} +1 -1
  99. package/dist/{export-chart-9w8t3rjZ.js → export-chart-83UYH48t.js} +3 -4
  100. package/dist/{export-chart-9w8t3rjZ.js.map → export-chart-83UYH48t.js.map} +1 -1
  101. package/dist/{export-chart-BhhYgksr.cjs → export-chart-mYgEfK-L.cjs} +3 -4
  102. package/dist/{export-chart-BhhYgksr.cjs.map → export-chart-mYgEfK-L.cjs.map} +1 -1
  103. package/dist/export.cjs +3 -5
  104. package/dist/export.cjs.map +1 -1
  105. package/dist/export.d.cts +8 -1
  106. package/dist/export.d.ts +8 -1
  107. package/dist/export.js +3 -4
  108. package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
  109. package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
  110. package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
  111. package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
  112. package/dist/{fade-Cs74puQS.cjs → fade-DVTkhrFU.cjs} +4 -6
  113. package/dist/{fade-Cs74puQS.cjs.map → fade-DVTkhrFU.cjs.map} +1 -1
  114. package/dist/{fade-D3NxH5Qg.js → fade-GGxcBdss.js} +4 -6
  115. package/dist/{fade-D3NxH5Qg.js.map → fade-GGxcBdss.js.map} +1 -1
  116. package/dist/{features-wASyHGic.js → features-BMxkqCyS.js} +2 -3
  117. package/dist/{features-wASyHGic.js.map → features-BMxkqCyS.js.map} +1 -1
  118. package/dist/{features-BclHgg2W.cjs → features-DCXEvoya.cjs} +2 -3
  119. package/dist/{features-BclHgg2W.cjs.map → features-DCXEvoya.cjs.map} +1 -1
  120. package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
  121. package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
  122. package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
  123. package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
  124. package/dist/{gauge-zpia05t2.d.ts → gauge-0VJuAHWF.d.ts} +5 -8
  125. package/dist/{gauge-DP_EB2z3.d.cts → gauge-BSist7My.d.cts} +5 -8
  126. package/dist/{gauge-D-FYhuds.cjs → gauge-DXkjXNCD.cjs} +10 -11
  127. package/dist/gauge-DXkjXNCD.cjs.map +1 -0
  128. package/dist/{gauge-Dh423FHh.js → gauge-ts0kqN1-.js} +10 -11
  129. package/dist/{gauge-Dh423FHh.js.map → gauge-ts0kqN1-.js.map} +1 -1
  130. package/dist/gauge.cjs +1 -1
  131. package/dist/gauge.d.cts +2 -1
  132. package/dist/gauge.d.ts +2 -1
  133. package/dist/gauge.js +1 -2
  134. package/dist/{heatmap-DSZ2bVIa.js → heatmap-19BGJTKF.js} +20 -22
  135. package/dist/heatmap-19BGJTKF.js.map +1 -0
  136. package/dist/{heatmap-BectCEeE.d.ts → heatmap-59lmClj9.d.ts} +4 -7
  137. package/dist/{heatmap-BK18EBgJ.cjs → heatmap-CXhlrLTl.cjs} +20 -22
  138. package/dist/heatmap-CXhlrLTl.cjs.map +1 -0
  139. package/dist/{heatmap-CCso6m61.d.cts → heatmap-Dp_oyEe0.d.cts} +4 -7
  140. package/dist/heatmap.cjs +1 -1
  141. package/dist/heatmap.d.cts +2 -1
  142. package/dist/heatmap.d.ts +2 -1
  143. package/dist/heatmap.js +1 -2
  144. package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
  145. package/dist/{hydrate-CxwTXDqO.cjs → hydrate-CmN1k8Mo.cjs} +3 -4
  146. package/dist/hydrate-CmN1k8Mo.cjs.map +1 -0
  147. package/dist/{hydrate-DDNIHYv_.js → hydrate-OA6R2_Pn.js} +3 -4
  148. package/dist/{hydrate-DDNIHYv_.js.map → hydrate-OA6R2_Pn.js.map} +1 -1
  149. package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
  150. package/dist/hydrate.cjs +3 -4
  151. package/dist/hydrate.cjs.map +1 -1
  152. package/dist/hydrate.d.cts +1 -1
  153. package/dist/hydrate.d.ts +1 -1
  154. package/dist/hydrate.js +3 -4
  155. package/dist/index.cjs +49 -46
  156. package/dist/index.cjs.map +1 -1
  157. package/dist/index.d.cts +24 -27
  158. package/dist/index.d.ts +24 -27
  159. package/dist/index.js +44 -43
  160. package/dist/index.js.map +1 -1
  161. package/dist/{layout-B3hiqVEw.js → layout-DmrrLjwN.js} +9 -4
  162. package/dist/layout-DmrrLjwN.js.map +1 -0
  163. package/dist/{layout-CtMBhNd9.cjs → layout-JY2aR-yE.cjs} +14 -3
  164. package/dist/layout-JY2aR-yE.cjs.map +1 -0
  165. package/dist/{line-B3Ed6u7j.js → line-DO66LtwH.js} +9 -10
  166. package/dist/{line-B3Ed6u7j.js.map → line-DO66LtwH.js.map} +1 -1
  167. package/dist/{line-fQbtP_jL.cjs → line-Dbt6KFRK.cjs} +9 -10
  168. package/dist/{line-fQbtP_jL.cjs.map → line-Dbt6KFRK.cjs.map} +1 -1
  169. package/dist/{line-CN4uZ9ZX.d.ts → line-DtSh7HQU.d.ts} +4 -7
  170. package/dist/{line-W7VD_qs1.d.cts → line-_rNdeKmS.d.cts} +5 -7
  171. package/dist/line.cjs +4 -5
  172. package/dist/line.cjs.map +1 -1
  173. package/dist/line.d.cts +1 -1
  174. package/dist/line.d.ts +1 -1
  175. package/dist/line.js +4 -6
  176. package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
  177. package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
  178. package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
  179. package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
  180. package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
  181. package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
  182. package/dist/log.cjs +3 -5
  183. package/dist/log.cjs.map +1 -1
  184. package/dist/log.d.cts +1 -1
  185. package/dist/log.d.ts +1 -1
  186. package/dist/log.js +3 -4
  187. package/dist/{morph-CqYDu1bY.cjs → morph-9_LJL0ra.cjs} +4 -5
  188. package/dist/morph-9_LJL0ra.cjs.map +1 -0
  189. package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
  190. package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
  191. package/dist/{morph-Bgg-24l8.js → morph-DnRxuwR-.js} +4 -5
  192. package/dist/{morph-Bgg-24l8.js.map → morph-DnRxuwR-.js.map} +1 -1
  193. package/dist/morph.cjs +3 -4
  194. package/dist/morph.cjs.map +1 -1
  195. package/dist/morph.d.cts +1 -1
  196. package/dist/morph.d.ts +1 -1
  197. package/dist/morph.js +3 -4
  198. package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
  199. package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
  200. package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
  201. package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
  202. package/dist/others-DWdK7vKp.cjs +60 -0
  203. package/dist/others-DWdK7vKp.cjs.map +1 -0
  204. package/dist/others-J7NCAMA0.js +49 -0
  205. package/dist/others-J7NCAMA0.js.map +1 -0
  206. package/dist/{parliament-1Zv2Xh0D.d.ts → parliament-CLCI7tUO.d.ts} +5 -8
  207. package/dist/{parliament-DdrLVZwt.d.cts → parliament-CgsVnWEe.d.cts} +5 -8
  208. package/dist/{parliament-Dw0sOERi.js → parliament-Cru4IcuM.js} +8 -9
  209. package/dist/parliament-Cru4IcuM.js.map +1 -0
  210. package/dist/{parliament-CpWnoEvG.cjs → parliament-x5hcFaQ3.cjs} +8 -9
  211. package/dist/parliament-x5hcFaQ3.cjs.map +1 -0
  212. package/dist/parliament.cjs +1 -1
  213. package/dist/parliament.d.cts +2 -1
  214. package/dist/parliament.d.ts +2 -1
  215. package/dist/parliament.js +1 -2
  216. package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
  217. package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
  218. package/dist/{patterns-DtgcnA8o.js → patterns-CufKZYhm.js} +4 -5
  219. package/dist/{patterns-DtgcnA8o.js.map → patterns-CufKZYhm.js.map} +1 -1
  220. package/dist/{patterns-LfcQAWCy.cjs → patterns-D3-wQagb.cjs} +4 -5
  221. package/dist/{patterns-LfcQAWCy.cjs.map → patterns-D3-wQagb.cjs.map} +1 -1
  222. package/dist/patterns.cjs +3 -5
  223. package/dist/patterns.cjs.map +1 -1
  224. package/dist/patterns.d.cts +5 -1
  225. package/dist/patterns.d.ts +5 -1
  226. package/dist/patterns.js +3 -4
  227. package/dist/percentage-bar-B6tNOqNn.js +157 -0
  228. package/dist/percentage-bar-B6tNOqNn.js.map +1 -0
  229. package/dist/percentage-bar-nhTeakD_.d.ts +62 -0
  230. package/dist/percentage-bar-tepMr7Hd.d.cts +62 -0
  231. package/dist/percentage-bar-ybNS3goo.cjs +162 -0
  232. package/dist/percentage-bar-ybNS3goo.cjs.map +1 -0
  233. package/dist/percentage-bar.cjs +3 -0
  234. package/dist/percentage-bar.d.cts +3 -0
  235. package/dist/percentage-bar.d.ts +3 -0
  236. package/dist/percentage-bar.js +1 -0
  237. package/dist/{pie-5z1fDdKO.d.ts → pie-BXg2gNpb.d.cts} +14 -8
  238. package/dist/{pie-BxTZt6Go.cjs → pie-BpjvSPnz.cjs} +13 -17
  239. package/dist/pie-BpjvSPnz.cjs.map +1 -0
  240. package/dist/{pie-BF9yI5mE.d.cts → pie-CFptILSm.d.ts} +14 -8
  241. package/dist/{pie-DzUXDTcn.js → pie-CVsc-6qD.js} +13 -17
  242. package/dist/pie-CVsc-6qD.js.map +1 -0
  243. package/dist/pie.cjs +1 -1
  244. package/dist/pie.d.cts +2 -1
  245. package/dist/pie.d.ts +2 -1
  246. package/dist/pie.js +1 -2
  247. package/dist/{point-shapes-CGl4dugc.cjs → point-shapes--_gmdTyK.cjs} +3 -4
  248. package/dist/{point-shapes-CGl4dugc.cjs.map → point-shapes--_gmdTyK.cjs.map} +1 -1
  249. package/dist/{point-shapes-DI84NNpI.js → point-shapes-DD2Ektzm.js} +3 -4
  250. package/dist/{point-shapes-DI84NNpI.js.map → point-shapes-DD2Ektzm.js.map} +1 -1
  251. package/dist/point-shapes.cjs +3 -4
  252. package/dist/point-shapes.d.cts +5 -1
  253. package/dist/point-shapes.d.ts +5 -1
  254. package/dist/point-shapes.js +3 -4
  255. package/dist/{radar-1-EryihA.d.ts → radar-BC9Skgpj.d.ts} +4 -7
  256. package/dist/{radar-CYPab_I4.js → radar-BR-mumDd.js} +7 -8
  257. package/dist/{radar-CYPab_I4.js.map → radar-BR-mumDd.js.map} +1 -1
  258. package/dist/{radar-DBW4O0Vt.d.cts → radar-D1-lItDy.d.cts} +4 -7
  259. package/dist/{radar-CoGUNNSb.cjs → radar-HPDrIdzc.cjs} +7 -8
  260. package/dist/{radar-CoGUNNSb.cjs.map → radar-HPDrIdzc.cjs.map} +1 -1
  261. package/dist/radar.cjs +1 -1
  262. package/dist/radar.d.cts +2 -1
  263. package/dist/radar.d.ts +2 -1
  264. package/dist/radar.js +1 -2
  265. package/dist/rect-D6VhynBM.cjs +16 -0
  266. package/dist/rect-D6VhynBM.cjs.map +1 -0
  267. package/dist/rect-DSVmUZrD.js +11 -0
  268. package/dist/rect-DSVmUZrD.js.map +1 -0
  269. package/dist/{sankey-B4PNKusJ.js → sankey-D6JeZfK5.js} +33 -29
  270. package/dist/sankey-D6JeZfK5.js.map +1 -0
  271. package/dist/{sankey-OV_WoPrl.d.ts → sankey-D_v7KxnJ.d.ts} +4 -7
  272. package/dist/{sankey-DuGI3Qc5.d.cts → sankey-Dk7jUt8x.d.cts} +4 -7
  273. package/dist/{sankey-Bacx4fVe.cjs → sankey-fCoo1cpz.cjs} +33 -29
  274. package/dist/sankey-fCoo1cpz.cjs.map +1 -0
  275. package/dist/sankey.cjs +1 -1
  276. package/dist/sankey.d.cts +2 -1
  277. package/dist/sankey.d.ts +2 -1
  278. package/dist/sankey.js +1 -2
  279. package/dist/{scatter-kgtgR318.js → scatter-C0TWjFpW.js} +21 -18
  280. package/dist/scatter-C0TWjFpW.js.map +1 -0
  281. package/dist/{scatter-BqzgJqdX.d.ts → scatter-CXEsioOJ.d.ts} +8 -9
  282. package/dist/{scatter-DgMN9zRy.cjs → scatter-DVqB_fP9.cjs} +21 -18
  283. package/dist/scatter-DVqB_fP9.cjs.map +1 -0
  284. package/dist/{scatter-DbxLyZX0.d.cts → scatter-DZeEIfyo.d.cts} +8 -9
  285. package/dist/scatter.cjs +1 -1
  286. package/dist/scatter.d.cts +2 -1
  287. package/dist/scatter.d.ts +2 -1
  288. package/dist/scatter.js +1 -2
  289. package/dist/{sparkline-BS9-hltA.cjs → sparkline-B39NA0Mi.cjs} +14 -13
  290. package/dist/sparkline-B39NA0Mi.cjs.map +1 -0
  291. package/dist/{sparkline-CWlJDKyh.d.cts → sparkline-DAP6jtzw.d.cts} +5 -8
  292. package/dist/{sparkline-BQzt27Fr.js → sparkline-XO_TqCNP.js} +14 -13
  293. package/dist/sparkline-XO_TqCNP.js.map +1 -0
  294. package/dist/{sparkline-BfyO_oNM.d.ts → sparkline-cbvRkWqS.d.ts} +5 -8
  295. package/dist/sparkline.cjs +1 -1
  296. package/dist/sparkline.d.cts +2 -1
  297. package/dist/sparkline.d.ts +2 -1
  298. package/dist/sparkline.js +1 -2
  299. package/dist/{stack-DRbwTeF3.js → stack-2H2Gfs1Q.js} +3 -4
  300. package/dist/{stack-DRbwTeF3.js.map → stack-2H2Gfs1Q.js.map} +1 -1
  301. package/dist/{stack-DVhJWaki.cjs → stack-BgPzoQmv.cjs} +3 -4
  302. package/dist/{stack-DVhJWaki.cjs.map → stack-BgPzoQmv.cjs.map} +1 -1
  303. package/dist/{stack-CpR6RGKd.d.ts → stack-DR0eQTsB.d.ts} +1 -4
  304. package/dist/{stack-CpR6RGKd.d.cts → stack-Dagxq7l2.d.cts} +2 -4
  305. package/dist/style.css +1 -1
  306. package/dist/{sweep-CbfR7--d.js → sweep-BpRPlhs6.js} +5 -6
  307. package/dist/{sweep-CbfR7--d.js.map → sweep-BpRPlhs6.js.map} +1 -1
  308. package/dist/{sweep-DaTEDDuC.cjs → sweep-Dnp6LDBz.cjs} +5 -6
  309. package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
  310. package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
  311. package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
  312. package/dist/{time-axis-VSX34_Tb.cjs → time-axis-BjZ1bYTK.cjs} +9 -10
  313. package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-BjZ1bYTK.cjs.map} +1 -1
  314. package/dist/{time-axis-Bc9eHX1r.js → time-axis-FLONo54E.js} +9 -10
  315. package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-FLONo54E.js.map} +1 -1
  316. package/dist/time.cjs +4 -6
  317. package/dist/time.cjs.map +1 -1
  318. package/dist/time.d.cts +1 -1
  319. package/dist/time.d.ts +1 -1
  320. package/dist/time.js +4 -5
  321. package/dist/treemap-BAkhmVQc.d.cts +55 -0
  322. package/dist/treemap-BNpxFBao.d.ts +55 -0
  323. package/dist/treemap-BWpEUlDh.cjs +303 -0
  324. package/dist/treemap-BWpEUlDh.cjs.map +1 -0
  325. package/dist/treemap-CQdavQ9u.js +298 -0
  326. package/dist/treemap-CQdavQ9u.js.map +1 -0
  327. package/dist/treemap.cjs +3 -0
  328. package/dist/treemap.d.cts +3 -0
  329. package/dist/treemap.d.ts +3 -0
  330. package/dist/treemap.js +1 -0
  331. package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
  332. package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
  333. package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
  334. package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
  335. package/dist/{value-labels-IZIQPhfk.js → value-labels-BBuSi4i0.js} +7 -7
  336. package/dist/value-labels-BBuSi4i0.js.map +1 -0
  337. package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-BV9keAuL.cjs} +7 -7
  338. package/dist/value-labels-BV9keAuL.cjs.map +1 -0
  339. package/dist/value-labels.cjs +3 -5
  340. package/dist/value-labels.cjs.map +1 -1
  341. package/dist/value-labels.d.cts +5 -1
  342. package/dist/value-labels.d.ts +5 -1
  343. package/dist/value-labels.js +3 -4
  344. package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
  345. package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
  346. package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
  347. package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
  348. package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
  349. package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
  350. package/package.json +21 -1
  351. package/dist/bar-C-7zR2qp.cjs.map +0 -1
  352. package/dist/bar-jZEoao74.js.map +0 -1
  353. package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
  354. package/dist/cartesian-Cr0AF0nG.js.map +0 -1
  355. package/dist/chart-BF2CK9I_.js.map +0 -1
  356. package/dist/chart-CowF_lWY.cjs.map +0 -1
  357. package/dist/core-CegR_j55.js.map +0 -1
  358. package/dist/core-RzS9IQO5.cjs.map +0 -1
  359. package/dist/gauge-D-FYhuds.cjs.map +0 -1
  360. package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
  361. package/dist/heatmap-DSZ2bVIa.js.map +0 -1
  362. package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
  363. package/dist/layout-B3hiqVEw.js.map +0 -1
  364. package/dist/layout-CtMBhNd9.cjs.map +0 -1
  365. package/dist/morph-CqYDu1bY.cjs.map +0 -1
  366. package/dist/parliament-CpWnoEvG.cjs.map +0 -1
  367. package/dist/parliament-Dw0sOERi.js.map +0 -1
  368. package/dist/pie-BxTZt6Go.cjs.map +0 -1
  369. package/dist/pie-DzUXDTcn.js.map +0 -1
  370. package/dist/sankey-B4PNKusJ.js.map +0 -1
  371. package/dist/sankey-Bacx4fVe.cjs.map +0 -1
  372. package/dist/scatter-DgMN9zRy.cjs.map +0 -1
  373. package/dist/scatter-kgtgR318.js.map +0 -1
  374. package/dist/sparkline-BQzt27Fr.js.map +0 -1
  375. package/dist/sparkline-BS9-hltA.cjs.map +0 -1
  376. package/dist/sweep-DaTEDDuC.cjs.map +0 -1
  377. package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
  378. package/dist/value-labels-IZIQPhfk.js.map +0 -1
@@ -0,0 +1,298 @@
1
+ import { o as getNumberFormat, r as formatNumber } from "./format-it1kepFG.js";
2
+ import { i as insets, n as estimateTextWidth, o as round, r as innerRect } from "./layout-DmrrLjwN.js";
3
+ import { t as rectPath } from "./rect-DSVmUZrD.js";
4
+ import { t as h } from "./vnode-_EMUqysL.js";
5
+ import { a as isRecord, c as named, i as finite, s as list, t as cleanData } from "./clean-CkoQobGv.js";
6
+ import { n as keyOf, r as legendItems, t as groupAttrs } from "./named-BOiBah6I.js";
7
+ // src/charts/treemap.ts
8
+ /** Levels of nesting read from the data, and the most nodes: enough for any chart, few enough to draw. */
9
+ const MAX_DEPTH = 8;
10
+ const MAX_NODES = 5e3;
11
+ /** Space between a tile's edge and its text. */
12
+ const INSET = 6;
13
+ function sized(nodes) {
14
+ return nodes.map((node) => {
15
+ if (node.children?.length) {
16
+ const children = sized(node.children);
17
+ return {
18
+ node,
19
+ children,
20
+ value: children.reduce((sum, child) => sum + child.value, 0)
21
+ };
22
+ }
23
+ return {
24
+ node,
25
+ value: Math.max(0, node.value ?? 0)
26
+ };
27
+ });
28
+ }
29
+ /** The top-level entries with their sizes and color slots, without the hidden ones. */
30
+ function visible(options, hidden) {
31
+ return sized(options.data).map((entry, index) => ({
32
+ entry,
33
+ index
34
+ })).filter(({ entry }) => !hidden.has(keyOf(entry.node)));
35
+ }
36
+ /**
37
+ * Squarified layout (Bruls, Huizing, van Wijk): `items`, largest first, fill
38
+ * the rectangle in rows along its shorter side, each row closed as soon as
39
+ * another item would make its tiles less square.
40
+ */
41
+ function squarify(items, x, y, w, hgt, place) {
42
+ const sorted = items.filter((item) => item.value > 0).sort((a, b) => b.value - a.value);
43
+ let left = sorted.reduce((sum, item) => sum + item.value, 0);
44
+ let i = 0;
45
+ while (i < sorted.length && w > 0 && hgt > 0) {
46
+ const short = Math.min(w, hgt);
47
+ const k = w * hgt / left;
48
+ const largest = sorted[i].value;
49
+ let sum = 0;
50
+ let best = Number.POSITIVE_INFINITY;
51
+ let j = i;
52
+ for (; j < sorted.length; j++) {
53
+ const next = sum + sorted[j].value;
54
+ const t2 = (next * k / short) ** 2;
55
+ const worst = Math.max(t2 / (sorted[j].value * k), largest * k / t2);
56
+ if (worst > best) break;
57
+ best = worst;
58
+ sum = next;
59
+ }
60
+ const thickness = sum * k / short;
61
+ let offset = 0;
62
+ for (; i < j; i++) {
63
+ const item = sorted[i];
64
+ const length = item.value * k / thickness;
65
+ if (w >= hgt) place(item, x, y + offset, thickness, length);
66
+ else place(item, x + offset, y, length, thickness);
67
+ offset += length;
68
+ }
69
+ if (w >= hgt) {
70
+ x += thickness;
71
+ w -= thickness;
72
+ } else {
73
+ y += thickness;
74
+ hgt -= thickness;
75
+ }
76
+ left -= sum;
77
+ }
78
+ }
79
+ /**
80
+ * The tiles of `items` in a rectangle, groups laid out inside their own.
81
+ * The gap is cut from the tiles after they are placed, so it does not change
82
+ * their arrangement: half of it on every side (a whole one between any two
83
+ * neighbors), none at the edge of the chart. `edges` are the half gaps of
84
+ * the rectangle itself.
85
+ */
86
+ function layout(items, x, y, w, hgt, gap, out, edges, top, slots) {
87
+ squarify(items, x, y, w, hgt, (item, tx, ty, tw, th) => {
88
+ const index = top?.index ?? slots?.[items.indexOf(item)];
89
+ const key = top ? `${top.key}/${keyOf(item.node)}` : keyOf(item.node);
90
+ const trail = top?.trail ?? [];
91
+ const near = .01;
92
+ const sides = [
93
+ tx - x < near ? edges[0] : 1,
94
+ ty - y < near ? edges[1] : 1,
95
+ x + w - tx - tw < near ? edges[2] : 1,
96
+ y + hgt - ty - th < near ? edges[3] : 1
97
+ ];
98
+ if (item.children) layout(item.children, tx, ty, tw, th, gap, out, sides, {
99
+ index,
100
+ key,
101
+ trail: [...trail, item.node.name]
102
+ });
103
+ else {
104
+ const half = gap / 2;
105
+ out.push({
106
+ node: item.node,
107
+ key,
108
+ top: index,
109
+ trail,
110
+ value: item.value,
111
+ x: tx + sides[0] * half,
112
+ y: ty + sides[1] * half,
113
+ width: Math.max(0, tw - (sides[0] + sides[2]) * half),
114
+ height: Math.max(0, th - (sides[1] + sides[3]) * half)
115
+ });
116
+ }
117
+ });
118
+ }
119
+ /** `text` cut to `width` pixels with an ellipsis, or `''` when not even a few letters fit. */
120
+ function fit(text, width, fontSize) {
121
+ if (estimateTextWidth(text, fontSize) <= width) return text;
122
+ const chars = [...text];
123
+ while (chars.length > 2) {
124
+ chars.pop();
125
+ const cut = `${chars.join("").trimEnd()}…`;
126
+ if (estimateTextWidth(cut, fontSize) <= width) return cut;
127
+ }
128
+ return "";
129
+ }
130
+ function renderTreemap(options, ctx) {
131
+ const { width, height, fontSize, locale } = ctx;
132
+ const gap = Math.max(0, options.gap ?? 2);
133
+ const radius = Math.max(0, options.radius ?? 3);
134
+ const area = innerRect(width, height, insets(options.padding, 0));
135
+ const entries = visible(options, ctx.hidden);
136
+ const total = entries.reduce((sum, { entry }) => sum + entry.value, 0);
137
+ const tiles = [];
138
+ layout(entries.map(({ entry }) => entry), area.x, area.y, area.width, area.height, gap, tiles, [
139
+ 0,
140
+ 0,
141
+ 0,
142
+ 0
143
+ ], void 0, entries.map(({ index }) => index));
144
+ const value = formatNumber(options.format, locale);
145
+ const share = getNumberFormat(locale, {
146
+ style: "percent",
147
+ maximumFractionDigits: 1
148
+ });
149
+ const hitFor = (tile, index) => {
150
+ const x = tile.x + tile.width / 2;
151
+ const item = {
152
+ name: tile.node.name,
153
+ seriesIndex: tile.top,
154
+ value: tile.value,
155
+ text: `${value(tile.value)} (${share.format(total > 0 ? tile.value / total : 0)})`,
156
+ x,
157
+ y: tile.y + tile.height / 2
158
+ };
159
+ const color = tile.node.color ?? options.data[tile.top]?.color;
160
+ if (color) item.color = color;
161
+ return {
162
+ index,
163
+ label: [...tile.trail, tile.node.name].join(" › "),
164
+ title: tile.trail.join(" › "),
165
+ x,
166
+ area,
167
+ items: [item],
168
+ seriesIndex: tile.top,
169
+ mark: {
170
+ d: rectPath(tile.x + 1, tile.y + 1, tile.width - 2, tile.height - 2, radius - 1),
171
+ x: 0,
172
+ y: 0
173
+ }
174
+ };
175
+ };
176
+ const interaction = {
177
+ count: tiles.length,
178
+ hitIndex: (index) => {
179
+ const tile = tiles[index];
180
+ return tile ? hitFor(tile, index) : null;
181
+ },
182
+ hitTest(px, py) {
183
+ const index = tiles.findIndex((tile) => px >= tile.x - gap / 2 && px <= tile.x + tile.width + gap / 2 && py >= tile.y - gap / 2 && py <= tile.y + tile.height + gap / 2);
184
+ return index < 0 ? null : hitFor(tiles[index], index);
185
+ }
186
+ };
187
+ ctx.onHitTest(interaction);
188
+ const groups = entries.map(({ entry, index }) => h("g", groupAttrs(entry.node, index), tiles.filter((tile) => tile.top === index).map((tile) => h("rect", {
189
+ key: tile.key,
190
+ class: ["tc-tile", tile.trail.length > 0 && tile.node.class],
191
+ x: round(tile.x),
192
+ y: round(tile.y),
193
+ width: round(tile.width),
194
+ height: round(tile.height),
195
+ rx: round(Math.min(radius, tile.width / 2, tile.height / 2)),
196
+ style: tile.trail.length > 0 ? { "--tc-series-color": tile.node.color } : void 0
197
+ }))));
198
+ const line = fontSize * 1.3;
199
+ const labels = options.labels !== false && tiles.flatMap((tile) => {
200
+ const room = tile.width - 12;
201
+ const name = tile.height >= line + INSET ? fit(tile.node.name, room, fontSize) : "";
202
+ if (!name) return [];
203
+ const text = value(tile.value);
204
+ const x = round(tile.x + INSET);
205
+ const y = tile.y + INSET + fontSize * .85;
206
+ return [h("text", {
207
+ key: tile.key,
208
+ class: "tc-treemap-label",
209
+ x,
210
+ y: round(y)
211
+ }, name), tile.height >= line * 2 + INSET * 1.5 && estimateTextWidth(text, fontSize) <= room && h("text", {
212
+ key: `${tile.key}/value`,
213
+ class: "tc-treemap-label tc-treemap-value",
214
+ x,
215
+ y: round(y + line)
216
+ }, text)];
217
+ });
218
+ return [h("g", { class: "tc-treemap-tiles" }, groups), labels && h("g", {
219
+ class: "tc-treemap-labels",
220
+ "aria-hidden": "true"
221
+ }, labels)];
222
+ }
223
+ function treemapTable(options, ctx, limit) {
224
+ const entries = visible(options, ctx.hidden);
225
+ const total = entries.reduce((sum, { entry }) => sum + entry.value, 0);
226
+ const value = formatNumber(options.format, ctx.locale);
227
+ const share = getNumberFormat(ctx.locale, {
228
+ style: "percent",
229
+ maximumFractionDigits: 1
230
+ });
231
+ const rows = [];
232
+ const walk = (items, trail) => {
233
+ for (const item of items) {
234
+ const path = [...trail, item.node.name];
235
+ if (item.children) walk(item.children, path);
236
+ else rows.push([
237
+ path.join(" › "),
238
+ value(item.value),
239
+ share.format(total > 0 ? item.value / total : 0)
240
+ ]);
241
+ }
242
+ };
243
+ walk(entries.map(({ entry }) => entry), []);
244
+ const table = {
245
+ columns: [
246
+ "",
247
+ "Value",
248
+ "Share"
249
+ ],
250
+ rows
251
+ };
252
+ if (rows.length > limit) {
253
+ table.rows = rows.slice(0, limit);
254
+ table.total = rows.length;
255
+ }
256
+ return table;
257
+ }
258
+ /** Nodes with text for names and finite values, at most `MAX_DEPTH` deep and `MAX_NODES` in all. */
259
+ function cleanNodes(data, depth = 0, budget = { left: MAX_NODES }) {
260
+ const nodes = [];
261
+ for (const r of list(data)) {
262
+ if (!isRecord(r) || budget.left <= 0) continue;
263
+ budget.left--;
264
+ const children = depth < MAX_DEPTH && Array.isArray(r.children) ? cleanNodes(r.children, depth + 1, budget) : void 0;
265
+ nodes.push({
266
+ ...named(r),
267
+ value: finite(r.value) ?? 0,
268
+ children
269
+ });
270
+ }
271
+ return nodes;
272
+ }
273
+ /**
274
+ * Treemap: parts of a whole as tiles, each as large as its value, laid out
275
+ * as close to squares as they go with the largest in the top left corner.
276
+ * Entries with `children` are groups: their tiles stay together and share
277
+ * the group's color.
278
+ *
279
+ * ```ts
280
+ * new Chart('#el', {
281
+ * type: treemap,
282
+ * data: [
283
+ * { name: 'Search', value: 42 },
284
+ * { name: 'Social', children: [{ name: 'Video', value: 18 }, { name: 'Posts', value: 9 }] },
285
+ * ],
286
+ * })
287
+ * ```
288
+ */
289
+ const treemap = {
290
+ name: "treemap",
291
+ clean: cleanData((data) => cleanNodes(data)),
292
+ render: renderTreemap,
293
+ legend: (options) => legendItems(options.data),
294
+ table: treemapTable
295
+ };
296
+ export { treemap as t };
297
+
298
+ //# sourceMappingURL=treemap-CQdavQ9u.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treemap-CQdavQ9u.js","names":[],"sources":["../src/charts/treemap.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext } from '../chart.ts'\nimport { formatNumber, getNumberFormat, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type InsetsInput, innerRect, insets, round } from '../layout.ts'\nimport { rectPath } from '../shapes/rect.ts'\nimport { type ChildInput, type ClassValue, h } from '../vnode.ts'\nimport { cleanData, finite, isRecord, list, named } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\n\n/** A tile of a treemap, or a group of them. */\nexport interface TreemapNode {\n name: string\n /** Size of the tile; a negative value is zero. A group is as large as its `children`. */\n value?: number\n /** Tiles (or groups) inside this one; they share its color. */\n children?: readonly TreemapNode[]\n /** Stable identity for keyed updates and legend toggles. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the group (top level) or the tile. */\n class?: ClassValue\n /** Start hidden (top level; toggle it back from the legend). */\n hidden?: boolean\n}\n\nexport interface TreemapOptions {\n /** Tiles, or groups of tiles; each top-level entry takes a palette color and a legend entry. */\n data: readonly TreemapNode[]\n /** Space between tiles in pixels. Defaults to `2`. */\n gap?: number\n /** Corner radius of the tiles. Defaults to `3`. */\n radius?: number\n /** Names (and values, where they fit) written in the tiles. Defaults to `true`. */\n labels?: boolean\n /** Format of the values (tiles, tooltip, table). */\n format?: NumberFormat\n /** Extra space around the chart, in pixels. */\n padding?: InsetsInput\n}\n\n/** Levels of nesting read from the data, and the most nodes: enough for any chart, few enough to draw. */\nconst MAX_DEPTH = 8\nconst MAX_NODES = 5000\n\n/** Space between a tile's edge and its text. */\nconst INSET = 6\n\n/** A node with its size worked out. */\ninterface Sized {\n node: TreemapNode\n value: number\n children?: Sized[]\n}\n\ninterface Tile {\n node: TreemapNode\n key: string\n /** Position of the top-level ancestor in `data` (the color slot). */\n top: number\n /** Names of the ancestors, outermost first. */\n trail: readonly string[]\n value: number\n x: number\n y: number\n width: number\n height: number\n}\n\nfunction sized(nodes: readonly TreemapNode[]): Sized[] {\n return nodes.map((node) => {\n if (node.children?.length) {\n const children = sized(node.children)\n return { node, children, value: children.reduce((sum, child) => sum + child.value, 0) }\n }\n return { node, value: Math.max(0, node.value ?? 0) }\n })\n}\n\n/** The top-level entries with their sizes and color slots, without the hidden ones. */\nfunction visible(options: TreemapOptions, hidden: ReadonlySet<string>) {\n return sized(options.data)\n .map((entry, index) => ({ entry, index }))\n .filter(({ entry }) => !hidden.has(keyOf(entry.node)))\n}\n\n/**\n * Squarified layout (Bruls, Huizing, van Wijk): `items`, largest first, fill\n * the rectangle in rows along its shorter side, each row closed as soon as\n * another item would make its tiles less square.\n */\nfunction squarify(\n items: readonly Sized[],\n x: number,\n y: number,\n w: number,\n hgt: number,\n place: (item: Sized, x: number, y: number, w: number, hgt: number) => void,\n): void {\n const sorted = items.filter((item) => item.value > 0).sort((a, b) => b.value - a.value)\n let left = sorted.reduce((sum, item) => sum + item.value, 0)\n let i = 0\n while (i < sorted.length && w > 0 && hgt > 0) {\n const short = Math.min(w, hgt)\n // Pixels of area per unit of value in what is left of the rectangle.\n const k = (w * hgt) / left\n const largest = (sorted[i] as Sized).value\n let sum = 0\n let best = Number.POSITIVE_INFINITY\n let j = i\n for (; j < sorted.length; j++) {\n const next = sum + (sorted[j] as Sized).value\n // Thickness of the row squared: its worst tile is the largest or the smallest.\n const t2 = ((next * k) / short) ** 2\n const worst = Math.max(t2 / ((sorted[j] as Sized).value * k), (largest * k) / t2)\n if (worst > best) break\n best = worst\n sum = next\n }\n const thickness = (sum * k) / short\n let offset = 0\n for (; i < j; i++) {\n const item = sorted[i] as Sized\n const length = (item.value * k) / thickness\n if (w >= hgt) place(item, x, y + offset, thickness, length)\n else place(item, x + offset, y, length, thickness)\n offset += length\n }\n if (w >= hgt) {\n x += thickness\n w -= thickness\n } else {\n y += thickness\n hgt -= thickness\n }\n left -= sum\n }\n}\n\n/** Half gaps left around a tile on its left, top, right and bottom side. */\ntype Edges = readonly [number, number, number, number]\n\n/**\n * The tiles of `items` in a rectangle, groups laid out inside their own.\n * The gap is cut from the tiles after they are placed, so it does not change\n * their arrangement: half of it on every side (a whole one between any two\n * neighbors), none at the edge of the chart. `edges` are the half gaps of\n * the rectangle itself.\n */\nfunction layout(\n items: readonly Sized[],\n x: number,\n y: number,\n w: number,\n hgt: number,\n gap: number,\n out: Tile[],\n edges: Edges,\n top?: { index: number; key: string; trail: readonly string[] },\n slots?: readonly number[],\n): void {\n squarify(items, x, y, w, hgt, (item, tx, ty, tw, th) => {\n const index = top?.index ?? (slots?.[items.indexOf(item)] as number)\n const key = top ? `${top.key}/${keyOf(item.node)}` : keyOf(item.node)\n const trail = top?.trail ?? []\n // A side on the border of the rectangle takes its half gap (none at the chart's edge), the others one.\n const near = 0.01\n const sides: Edges = [\n tx - x < near ? edges[0] : 1,\n ty - y < near ? edges[1] : 1,\n x + w - tx - tw < near ? edges[2] : 1,\n y + hgt - ty - th < near ? edges[3] : 1,\n ]\n if (item.children) {\n layout(item.children, tx, ty, tw, th, gap, out, sides, {\n index,\n key,\n trail: [...trail, item.node.name],\n })\n } else {\n const half = gap / 2\n out.push({\n node: item.node,\n key,\n top: index,\n trail,\n value: item.value,\n x: tx + sides[0] * half,\n y: ty + sides[1] * half,\n width: Math.max(0, tw - (sides[0] + sides[2]) * half),\n height: Math.max(0, th - (sides[1] + sides[3]) * half),\n })\n }\n })\n}\n\n/** `text` cut to `width` pixels with an ellipsis, or `''` when not even a few letters fit. */\nfunction fit(text: string, width: number, fontSize: number): string {\n if (estimateTextWidth(text, fontSize) <= width) return text\n const chars = [...text]\n while (chars.length > 2) {\n chars.pop()\n const cut = `${chars.join('').trimEnd()}…`\n if (estimateTextWidth(cut, fontSize) <= width) return cut\n }\n return ''\n}\n\nfunction renderTreemap(options: TreemapOptions, ctx: RenderContext): ChildInput {\n const { width, height, fontSize, locale } = ctx\n const gap = Math.max(0, options.gap ?? 2)\n const radius = Math.max(0, options.radius ?? 3)\n const area = innerRect(width, height, insets(options.padding, 0))\n const entries = visible(options, ctx.hidden)\n const total = entries.reduce((sum, { entry }) => sum + entry.value, 0)\n\n const tiles: Tile[] = []\n layout(\n entries.map(({ entry }) => entry),\n area.x,\n area.y,\n area.width,\n area.height,\n gap,\n tiles,\n [0, 0, 0, 0],\n undefined,\n entries.map(({ index }) => index),\n )\n\n const value = formatNumber(options.format, locale)\n const share = getNumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 })\n const hitFor = (tile: Tile, index: number): Hit => {\n const x = tile.x + tile.width / 2\n const item: HitItem = {\n name: tile.node.name,\n seriesIndex: tile.top,\n value: tile.value,\n text: `${value(tile.value)} (${share.format(total > 0 ? tile.value / total : 0)})`,\n x,\n y: tile.y + tile.height / 2,\n }\n const color = tile.node.color ?? options.data[tile.top]?.color\n if (color) item.color = color\n return {\n index,\n label: [...tile.trail, tile.node.name].join(' › '),\n title: tile.trail.join(' › '),\n x,\n area,\n items: [item],\n seriesIndex: tile.top,\n // A ring just inside the hovered tile.\n mark: {\n d: rectPath(tile.x + 1, tile.y + 1, tile.width - 2, tile.height - 2, radius - 1),\n x: 0,\n y: 0,\n },\n }\n }\n\n const interaction: Interaction = {\n count: tiles.length,\n hitIndex: (index) => {\n const tile = tiles[index]\n return tile ? hitFor(tile, index) : null\n },\n hitTest(px, py) {\n const index = tiles.findIndex(\n (tile) =>\n px >= tile.x - gap / 2 &&\n px <= tile.x + tile.width + gap / 2 &&\n py >= tile.y - gap / 2 &&\n py <= tile.y + tile.height + gap / 2,\n )\n return index < 0 ? null : hitFor(tiles[index] as Tile, index)\n },\n }\n ctx.onHitTest(interaction)\n\n const groups = entries.map(({ entry, index }) =>\n h(\n 'g',\n groupAttrs(entry.node, index),\n tiles\n .filter((tile) => tile.top === index)\n .map((tile) =>\n h('rect', {\n key: tile.key,\n class: ['tc-tile', tile.trail.length > 0 && tile.node.class],\n x: round(tile.x),\n y: round(tile.y),\n width: round(tile.width),\n height: round(tile.height),\n rx: round(Math.min(radius, tile.width / 2, tile.height / 2)),\n // A tile inside a group may have a color of its own.\n style: tile.trail.length > 0 ? { '--tc-series-color': tile.node.color } : undefined,\n }),\n ),\n ),\n )\n\n // Names where a few letters fit, values below where there is a second line.\n const line = fontSize * 1.3\n const labels =\n options.labels !== false &&\n tiles.flatMap((tile) => {\n const room = tile.width - INSET * 2\n const name = tile.height >= line + INSET ? fit(tile.node.name, room, fontSize) : ''\n if (!name) return []\n const text = value(tile.value)\n const x = round(tile.x + INSET)\n const y = tile.y + INSET + fontSize * 0.85\n return [\n h('text', { key: tile.key, class: 'tc-treemap-label', x, y: round(y) }, name),\n tile.height >= line * 2 + INSET * 1.5 &&\n estimateTextWidth(text, fontSize) <= room &&\n h(\n 'text',\n {\n key: `${tile.key}/value`,\n class: 'tc-treemap-label tc-treemap-value',\n x,\n y: round(y + line),\n },\n text,\n ),\n ]\n })\n\n return [\n h('g', { class: 'tc-treemap-tiles' }, groups),\n labels && h('g', { class: 'tc-treemap-labels', 'aria-hidden': 'true' }, labels),\n ]\n}\n\nfunction treemapTable(options: TreemapOptions, ctx: RenderContext, limit: number): DataTable {\n const entries = visible(options, ctx.hidden)\n const total = entries.reduce((sum, { entry }) => sum + entry.value, 0)\n const value = formatNumber(options.format, ctx.locale)\n const share = getNumberFormat(ctx.locale, { style: 'percent', maximumFractionDigits: 1 })\n const rows: string[][] = []\n const walk = (items: readonly Sized[], trail: readonly string[]) => {\n for (const item of items) {\n const path = [...trail, item.node.name]\n if (item.children) walk(item.children, path)\n else {\n rows.push([\n path.join(' › '),\n value(item.value),\n share.format(total > 0 ? item.value / total : 0),\n ])\n }\n }\n }\n walk(\n entries.map(({ entry }) => entry),\n [],\n )\n const table: DataTable = { columns: ['', 'Value', 'Share'], rows }\n if (rows.length > limit) {\n table.rows = rows.slice(0, limit)\n table.total = rows.length\n }\n return table\n}\n\n/** Nodes with text for names and finite values, at most `MAX_DEPTH` deep and `MAX_NODES` in all. */\nfunction cleanNodes(data: unknown, depth = 0, budget = { left: MAX_NODES }): TreemapNode[] {\n const nodes: TreemapNode[] = []\n for (const r of list(data)) {\n if (!isRecord(r) || budget.left <= 0) continue\n budget.left--\n const children =\n depth < MAX_DEPTH && Array.isArray(r.children)\n ? cleanNodes(r.children, depth + 1, budget)\n : undefined\n nodes.push({ ...named(r), value: finite(r.value) ?? 0, children } as unknown as TreemapNode)\n }\n return nodes\n}\n\n/**\n * Treemap: parts of a whole as tiles, each as large as its value, laid out\n * as close to squares as they go with the largest in the top left corner.\n * Entries with `children` are groups: their tiles stay together and share\n * the group's color.\n *\n * ```ts\n * new Chart('#el', {\n * type: treemap,\n * data: [\n * { name: 'Search', value: 42 },\n * { name: 'Social', children: [{ name: 'Video', value: 18 }, { name: 'Posts', value: 9 }] },\n * ],\n * })\n * ```\n */\nexport const treemap: ChartType<TreemapOptions> = {\n name: 'treemap',\n clean: cleanData((data) => cleanNodes(data)),\n render: renderTreemap,\n legend: (options) => legendItems(options.data),\n table: treemapTable,\n}\n"],"mappings":";;;;;;;;AA8CA,MAAM,YAAY;AAClB,MAAM,YAAY;;AAGlB,MAAM,QAAQ;AAuBd,SAAS,MAAM,OAAwC;CACrD,OAAO,MAAM,KAAK,SAAS;EACzB,IAAI,KAAK,UAAU,QAAQ;GACzB,MAAM,WAAW,MAAM,KAAK,QAAQ;GACpC,OAAO;IAAE;IAAM;IAAU,OAAO,SAAS,QAAQ,KAAK,UAAU,MAAM,MAAM,OAAO,CAAC;GAAE;EACxF;EACA,OAAO;GAAE;GAAM,OAAO,KAAK,IAAI,GAAG,KAAK,SAAS,CAAC;EAAE;CACrD,CAAC;AACH;;AAGA,SAAS,QAAQ,SAAyB,QAA6B;CACrE,OAAO,MAAM,QAAQ,IAAI,CAAC,CACvB,KAAK,OAAO,WAAW;EAAE;EAAO;CAAM,EAAE,CAAC,CACzC,QAAQ,EAAE,YAAY,CAAC,OAAO,IAAI,MAAM,MAAM,IAAI,CAAC,CAAC;AACzD;;;;;;AAOA,SAAS,SACP,OACA,GACA,GACA,GACA,KACA,OACM;CACN,MAAM,SAAS,MAAM,QAAQ,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;CACtF,IAAI,OAAO,OAAO,QAAQ,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;CAC3D,IAAI,IAAI;CACR,OAAO,IAAI,OAAO,UAAU,IAAI,KAAK,MAAM,GAAG;EAC5C,MAAM,QAAQ,KAAK,IAAI,GAAG,GAAG;EAE7B,MAAM,IAAK,IAAI,MAAO;EACtB,MAAM,UAAW,OAAO,EAAE,CAAW;EACrC,IAAI,MAAM;EACV,IAAI,OAAO,OAAO;EAClB,IAAI,IAAI;EACR,OAAO,IAAI,OAAO,QAAQ,KAAK;GAC7B,MAAM,OAAO,MAAO,OAAO,EAAE,CAAW;GAExC,MAAM,M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AK,OAAO,QAAQ,GAAG;EACtC,OAAO;EACP,MAAM,WACJ,QAAQ,aAAa,MAAM,QAAQ,EAAE,QAAQ,IACzC,WAAW,EAAE,UAAU,QAAQ,GAAG,MAAM,IACxC,KAAA;EACN,MAAM,KAAK;GAAE,GAAG,MAAM,CAAC;GAAG,OAAO,OAAO,EAAE,KAAK,KAAK;GAAG;EAAS,CAA2B;CAC7F;CACA,OAAO;AACT;;;;;;;;;;;;;;;;;AAkBA,MAAa,UAAqC;CAChD,MAAM;CACN,OAAO,WAAW,SAAS,WAAW,IAAI,CAAC;CAC3C,QAAQ;CACR,SAAS,YAAY,YAAY,QAAQ,IAAI;CAC7C,OAAO;AACT"}
@@ -0,0 +1,3 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_treemap = require("./treemap-BWpEUlDh.cjs");
3
+ exports.treemap = require_treemap.treemap;
@@ -0,0 +1,3 @@
1
+ /** Standalone entry: `import { treemap } from '@tabler/charts/treemap'`. */
2
+ import { n as TreemapOptions, r as treemap, t as TreemapNode } from "./treemap-BAkhmVQc.cjs";
3
+ export { type TreemapNode, type TreemapOptions, treemap };
@@ -0,0 +1,3 @@
1
+ /** Standalone entry: `import { treemap } from '@tabler/charts/treemap'`. */
2
+ import { n as TreemapOptions, r as treemap, t as TreemapNode } from "./treemap-BNpxFBao.js";
3
+ export { type TreemapNode, type TreemapOptions, treemap };
@@ -0,0 +1 @@
1
+ export { t as treemap } from "./treemap-CQdavQ9u.js";
@@ -1,4 +1,4 @@
1
- //#region src/render/tween.ts
1
+ // src/render/tween.ts
2
2
  /**
3
3
  * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go
4
4
  * from where they are to where they end with an ease-out curve, and each
@@ -34,7 +34,6 @@ function tween(el, origin, end, duration, draw, to) {
34
34
  running.set(el, state);
35
35
  state.frame = requestAnimationFrame(step);
36
36
  }
37
- //#endregion
38
37
  export { tween as n, stop as t };
39
38
 
40
- //# sourceMappingURL=tween-BCYd0RTY.js.map
39
+ //# sourceMappingURL=tween-BdQqUmmv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tween-BCYd0RTY.js","names":[],"sources":["../src/render/tween.ts"],"sourcesContent":["/**\n * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go\n * from where they are to where they end with an ease-out curve, and each\n * frame draws the `d` of the numbers in between.\n */\n\n/** The running tween of each path: its frame request and the numbers drawn now. */\nconst running = /* @__PURE__ */ new WeakMap<Element, { frame: number; now: number[] }>()\n\n/** Stop the tween of `el`, if any; returns the numbers it had reached. */\nexport function stop(el: Element): number[] | undefined {\n const current = running.get(el)\n if (current) cancelAnimationFrame(current.frame)\n running.delete(el)\n return current?.now\n}\n\n/**\n * Take the numbers from `origin` to `end` over `duration` ms, setting the\n * `d` of `el` to `draw(numbers)` on each frame and to `to` on the last.\n */\nexport function tween(\n el: Element,\n origin: readonly number[],\n end: readonly number[],\n duration: number,\n draw: (now: number[]) => string,\n to: string,\n): void {\n const state = { frame: 0, now: origin.slice() }\n const begin = performance.now()\n const step = (time: number) => {\n const t = Math.min(1, Math.max(0, (time - begin) / duration))\n // Ease out, close to the default --tc-easing (a custom easing is approximated).\n const k = 1 - (1 - t) ** 3\n state.now = end.map((value, i) => (origin[i] as number) + (value - (origin[i] as number)) * k)\n el.setAttribute('d', t < 1 ? draw(state.now) : to)\n if (t < 1) state.frame = requestAnimationFrame(step)\n else running.delete(el)\n }\n running.set(el, state)\n state.frame = requestAnimationFrame(step)\n}\n"],"mappings":";;;;;;;AAOA,MAAM,0BAA0B,IAAI,QAAmD;;AAGvF,SAAgB,KAAK,IAAmC;CACtD,MAAM,UAAU,QAAQ,IAAI,EAAE;CAC9B,IAAI,SAAS,qBAAqB,QAAQ,KAAK;CAC/C,QAAQ,OAAO,EAAE;CACjB,OAAO,SAAS;AAClB;;;;;AAMA,SAAgB,MACd,IACA,QACA,KACA,UACA,MACA,IACM;CACN,MAAM,QAAQ;EAAE,OAAO;EAAG,KAAK,OAAO,MAAM;CAAE;CAC9C,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,QAAQ,SAAiB;EAC7B,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,SAAS,QAAQ,CAAC;EAE5D,MAAM,IAAI,KAAK,IAAI,MAAM;EACzB,MAAM,MAAM,IAAI,KAAK,OAAO,MAAO,OAAO,MAAiB,QAAS,OAAO,MAAiB,CAAC;EAC7F,GAAG,aAAa,KAAK,IAAI,IAAI,KAAK,MAAM,GAAG,IAAI,EAAE;EACjD,IAAI,IAAI,GAAG,MAAM,QAAQ,sBAAsB,IAAI;OAC9C,QAAQ,OAAO,EAAE;CACxB;CACA,QAAQ,IAAI,IAAI,KAAK;CACrB,MAAM,QAAQ,sBAAsB,IAAI;AAC1C"}
1
+ {"version":3,"file":"tween-BdQqUmmv.js","names":[],"sources":["../src/render/tween.ts"],"sourcesContent":["/**\n * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go\n * from where they are to where they end with an ease-out curve, and each\n * frame draws the `d` of the numbers in between.\n */\n\n/** The running tween of each path: its frame request and the numbers drawn now. */\nconst running = /* @__PURE__ */ new WeakMap<Element, { frame: number; now: number[] }>()\n\n/** Stop the tween of `el`, if any; returns the numbers it had reached. */\nexport function stop(el: Element): number[] | undefined {\n const current = running.get(el)\n if (current) cancelAnimationFrame(current.frame)\n running.delete(el)\n return current?.now\n}\n\n/**\n * Take the numbers from `origin` to `end` over `duration` ms, setting the\n * `d` of `el` to `draw(numbers)` on each frame and to `to` on the last.\n */\nexport function tween(\n el: Element,\n origin: readonly number[],\n end: readonly number[],\n duration: number,\n draw: (now: number[]) => string,\n to: string,\n): void {\n const state = { frame: 0, now: origin.slice() }\n const begin = performance.now()\n const step = (time: number) => {\n const t = Math.min(1, Math.max(0, (time - begin) / duration))\n // Ease out, close to the default --tc-easing (a custom easing is approximated).\n const k = 1 - (1 - t) ** 3\n state.now = end.map((value, i) => (origin[i] as number) + (value - (origin[i] as number)) * k)\n el.setAttribute('d', t < 1 ? draw(state.now) : to)\n if (t < 1) state.frame = requestAnimationFrame(step)\n else running.delete(el)\n }\n running.set(el, state)\n state.frame = requestAnimationFrame(step)\n}\n"],"mappings":";;;;;;;AAOA,MAAM,0BAA0B,IAAI,QAAmD;;AAGvF,SAAgB,KAAK,IAAmC;CACtD,MAAM,UAAU,QAAQ,IAAI,EAAE;CAC9B,IAAI,SAAS,qBAAqB,QAAQ,KAAK;CAC/C,QAAQ,OAAO,EAAE;CACjB,OAAO,SAAS;AAClB;;;;;AAMA,SAAgB,MACd,IACA,QACA,KACA,UACA,MACA,IACM;CACN,MAAM,QAAQ;EAAE,OAAO;EAAG,KAAK,OAAO,MAAM;CAAE;CAC9C,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,QAAQ,SAAiB;EAC7B,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,SAAS,QAAQ,CAAC;EAE5D,MAAM,IAAI,KAAK,IAAI,MAAM;EACzB,MAAM,MAAM,IAAI,KAAK,OAAO,MAAO,OAAO,MAAiB,QAAS,OAAO,MAAiB,CAAC;EAC7F,GAAG,aAAa,KAAK,IAAI,IAAI,KAAK,MAAM,GAAG,IAAI,EAAE;EACjD,IAAI,IAAI,GAAG,MAAM,QAAQ,sBAAsB,IAAI;OAC9C,QAAQ,OAAO,EAAE;CACxB;CACA,QAAQ,IAAI,IAAI,KAAK;CACrB,MAAM,QAAQ,sBAAsB,IAAI;AAC1C"}
@@ -1,4 +1,4 @@
1
- //#region src/render/tween.ts
1
+ // src/render/tween.ts
2
2
  /**
3
3
  * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go
4
4
  * from where they are to where they end with an ease-out curve, and each
@@ -34,7 +34,6 @@ function tween(el, origin, end, duration, draw, to) {
34
34
  running.set(el, state);
35
35
  state.frame = requestAnimationFrame(step);
36
36
  }
37
- //#endregion
38
37
  Object.defineProperty(exports, "stop", {
39
38
  enumerable: true,
40
39
  get: function() {
@@ -48,4 +47,4 @@ Object.defineProperty(exports, "tween", {
48
47
  }
49
48
  });
50
49
 
51
- //# sourceMappingURL=tween-CIGBlryn.cjs.map
50
+ //# sourceMappingURL=tween-c3aOmfKE.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tween-CIGBlryn.cjs","names":[],"sources":["../src/render/tween.ts"],"sourcesContent":["/**\n * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go\n * from where they are to where they end with an ease-out curve, and each\n * frame draws the `d` of the numbers in between.\n */\n\n/** The running tween of each path: its frame request and the numbers drawn now. */\nconst running = /* @__PURE__ */ new WeakMap<Element, { frame: number; now: number[] }>()\n\n/** Stop the tween of `el`, if any; returns the numbers it had reached. */\nexport function stop(el: Element): number[] | undefined {\n const current = running.get(el)\n if (current) cancelAnimationFrame(current.frame)\n running.delete(el)\n return current?.now\n}\n\n/**\n * Take the numbers from `origin` to `end` over `duration` ms, setting the\n * `d` of `el` to `draw(numbers)` on each frame and to `to` on the last.\n */\nexport function tween(\n el: Element,\n origin: readonly number[],\n end: readonly number[],\n duration: number,\n draw: (now: number[]) => string,\n to: string,\n): void {\n const state = { frame: 0, now: origin.slice() }\n const begin = performance.now()\n const step = (time: number) => {\n const t = Math.min(1, Math.max(0, (time - begin) / duration))\n // Ease out, close to the default --tc-easing (a custom easing is approximated).\n const k = 1 - (1 - t) ** 3\n state.now = end.map((value, i) => (origin[i] as number) + (value - (origin[i] as number)) * k)\n el.setAttribute('d', t < 1 ? draw(state.now) : to)\n if (t < 1) state.frame = requestAnimationFrame(step)\n else running.delete(el)\n }\n running.set(el, state)\n state.frame = requestAnimationFrame(step)\n}\n"],"mappings":";;;;;;;AAOA,MAAM,0BAA0B,IAAI,QAAmD;;AAGvF,SAAgB,KAAK,IAAmC;CACtD,MAAM,UAAU,QAAQ,IAAI,EAAE;CAC9B,IAAI,SAAS,qBAAqB,QAAQ,KAAK;CAC/C,QAAQ,OAAO,EAAE;CACjB,OAAO,SAAS;AAClB;;;;;AAMA,SAAgB,MACd,IACA,QACA,KACA,UACA,MACA,IACM;CACN,MAAM,QAAQ;EAAE,OAAO;EAAG,KAAK,OAAO,MAAM;CAAE;CAC9C,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,QAAQ,SAAiB;EAC7B,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,SAAS,QAAQ,CAAC;EAE5D,MAAM,IAAI,KAAK,IAAI,MAAM;EACzB,MAAM,MAAM,IAAI,KAAK,OAAO,MAAO,OAAO,MAAiB,QAAS,OAAO,MAAiB,CAAC;EAC7F,GAAG,aAAa,KAAK,IAAI,IAAI,KAAK,MAAM,GAAG,IAAI,EAAE;EACjD,IAAI,IAAI,GAAG,MAAM,QAAQ,sBAAsB,IAAI;OAC9C,QAAQ,OAAO,EAAE;CACxB;CACA,QAAQ,IAAI,IAAI,KAAK;CACrB,MAAM,QAAQ,sBAAsB,IAAI;AAC1C"}
1
+ {"version":3,"file":"tween-c3aOmfKE.cjs","names":[],"sources":["../src/render/tween.ts"],"sourcesContent":["/**\n * Paths redrawn frame by frame, shared by `morph` and `sweep`: numbers go\n * from where they are to where they end with an ease-out curve, and each\n * frame draws the `d` of the numbers in between.\n */\n\n/** The running tween of each path: its frame request and the numbers drawn now. */\nconst running = /* @__PURE__ */ new WeakMap<Element, { frame: number; now: number[] }>()\n\n/** Stop the tween of `el`, if any; returns the numbers it had reached. */\nexport function stop(el: Element): number[] | undefined {\n const current = running.get(el)\n if (current) cancelAnimationFrame(current.frame)\n running.delete(el)\n return current?.now\n}\n\n/**\n * Take the numbers from `origin` to `end` over `duration` ms, setting the\n * `d` of `el` to `draw(numbers)` on each frame and to `to` on the last.\n */\nexport function tween(\n el: Element,\n origin: readonly number[],\n end: readonly number[],\n duration: number,\n draw: (now: number[]) => string,\n to: string,\n): void {\n const state = { frame: 0, now: origin.slice() }\n const begin = performance.now()\n const step = (time: number) => {\n const t = Math.min(1, Math.max(0, (time - begin) / duration))\n // Ease out, close to the default --tc-easing (a custom easing is approximated).\n const k = 1 - (1 - t) ** 3\n state.now = end.map((value, i) => (origin[i] as number) + (value - (origin[i] as number)) * k)\n el.setAttribute('d', t < 1 ? draw(state.now) : to)\n if (t < 1) state.frame = requestAnimationFrame(step)\n else running.delete(el)\n }\n running.set(el, state)\n state.frame = requestAnimationFrame(step)\n}\n"],"mappings":";;;;;;;AAOA,MAAM,0BAA0B,IAAI,QAAmD;;AAGvF,SAAgB,KAAK,IAAmC;CACtD,MAAM,UAAU,QAAQ,IAAI,EAAE;CAC9B,IAAI,SAAS,qBAAqB,QAAQ,KAAK;CAC/C,QAAQ,OAAO,EAAE;CACjB,OAAO,SAAS;AAClB;;;;;AAMA,SAAgB,MACd,IACA,QACA,KACA,UACA,MACA,IACM;CACN,MAAM,QAAQ;EAAE,OAAO;EAAG,KAAK,OAAO,MAAM;CAAE;CAC9C,MAAM,QAAQ,YAAY,IAAI;CAC9B,MAAM,QAAQ,SAAiB;EAC7B,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,SAAS,QAAQ,CAAC;EAE5D,MAAM,IAAI,KAAK,IAAI,MAAM;EACzB,MAAM,MAAM,IAAI,KAAK,OAAO,MAAO,OAAO,MAAiB,QAAS,OAAO,MAAiB,CAAC;EAC7F,GAAG,aAAa,KAAK,IAAI,IAAI,KAAK,MAAM,GAAG,IAAI,EAAE;EACjD,IAAI,IAAI,GAAG,MAAM,QAAQ,sBAAsB,IAAI;OAC9C,QAAQ,OAAO,EAAE;CACxB;CACA,QAAQ,IAAI,IAAI,KAAK;CACrB,MAAM,QAAQ,sBAAsB,IAAI;AAC1C"}
@@ -1,7 +1,7 @@
1
- import { a as round, n as estimateTextWidth } from "./layout-B3hiqVEw.js";
2
- import { t as h } from "./vnode-tCWItoUH.js";
3
- import { o as getNumberFormat, r as formatNumber } from "./format-lStwuc1L.js";
4
- //#region src/charts/value-labels.ts
1
+ import { o as getNumberFormat, r as formatNumber } from "./format-it1kepFG.js";
2
+ import { n as estimateTextWidth, o as round } from "./layout-DmrrLjwN.js";
3
+ import { t as h } from "./vnode-_EMUqysL.js";
4
+ // src/charts/value-labels.ts
5
5
  /** Space between a mark and its label, and around labels. */
6
6
  const GAP = 4;
7
7
  const overlaps = (a, b) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;
@@ -72,7 +72,8 @@ function valueLabels(config, interaction, ctx) {
72
72
  const reach = (horizontal ? width / 2 : height / 2) + GAP;
73
73
  const sign = down ? 1 : -1;
74
74
  const along = y + sign * reach;
75
- candidates.push(horizontal ? at(item.x - sign * reach, y, false) : at(item.x, along, false), ...horizontal ? [] : [at(box.x + width / 2 - 3, along, false), at(box.x + box.width - width / 2 + 3, along, false)], horizontal ? at(item.x + sign * reach, y, true) : at(item.x, y - sign * reach, true));
75
+ const side = ctx.rtl ? -sign : sign;
76
+ candidates.push(horizontal ? at(item.x - side * reach, y, false) : at(item.x, along, false), ...horizontal ? [] : [at(box.x + width / 2 - 3, along, false), at(box.x + box.width - width / 2 + 3, along, false)], horizontal ? at(item.x + side * reach, y, true) : at(item.x, y - sign * reach, true));
76
77
  } else candidates.push(at(box.x + box.width / 2, box.y + box.height / 2, true));
77
78
  } else {
78
79
  const side = width / 2 + GAP + 4;
@@ -117,7 +118,6 @@ function sliceFits(item, area, share, label) {
117
118
  }
118
119
  /** The step that adds the labels over the content of charts with `valueLabels`. */
119
120
  const labelsStep = (config, content, interaction, ctx) => config.valueLabels && interaction ? [content, valueLabels(config, interaction, ctx)] : content;
120
- //#endregion
121
121
  export { valueLabels as n, labelsStep as t };
122
122
 
123
- //# sourceMappingURL=value-labels-IZIQPhfk.js.map
123
+ //# sourceMappingURL=value-labels-BBuSi4i0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-labels-BBuSi4i0.js","names":[],"sources":["../src/charts/value-labels.ts"],"sourcesContent":["/**\n * Value labels: the value written on each mark, for charts read at a\n * glance. They are worked out from the chart's interaction, so every type\n * gets them the same way: bars at their end (inside when there is no room\n * outside), stacked segments and heatmap cells in their middle, lines and\n * points above their point (the last one by default), slices in their\n * middle with their share. A label that does not fit its mark or the plot,\n * or that would cover another one, is left out: labels never overlap.\n */\nimport type { ChartConfig, RenderContext } from '../chart.ts'\nimport type { PostStep } from '../features.ts'\nimport { formatNumber, getNumberFormat, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type Rect, round } from '../layout.ts'\nimport { h, type VNode } from '../vnode.ts'\n\nexport interface ValueLabelOptions {\n /** Format of the values. Defaults to the value axis format (slices: their share in percent). */\n format?: NumberFormat\n /** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */\n points?: 'last' | 'all'\n}\n\n/** Space between a mark and its label, and around labels. */\nconst GAP = 4\n\ninterface Placed {\n key: string\n text: string\n x: number\n y: number\n inside: boolean\n box: Rect\n}\n\nconst overlaps = (a: Rect, b: Rect): boolean =>\n a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height\n\nconst contains = (outer: Rect, inner: Rect): boolean =>\n inner.x >= outer.x - 1 &&\n inner.y >= outer.y - 1 &&\n inner.x + inner.width <= outer.x + outer.width + 1 &&\n inner.y + inner.height <= outer.y + outer.height + 1\n\n/** The labels layer of a chart, or `null` when nothing gets one. */\nexport function valueLabels(\n config: ChartConfig<object>,\n interaction: Interaction,\n ctx: RenderContext,\n): VNode | null {\n const option = config.valueLabels\n const options: ValueLabelOptions = typeof option === 'object' ? option : {}\n const { fontSize, locale } = ctx\n // What the chart type says about its marks (slices, cells) and its number format.\n const spec = config.type.valueLabels\n const pie = spec?.marks === 'slice'\n const cell = spec?.marks === 'cell'\n const stacked = !!(config as { stacked?: unknown }).stacked\n const format = options.format\n ? formatNumber(options.format, locale)\n : pie\n ? (v: number) =>\n getNumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(v)\n : spec?.format\n ? formatNumber(spec.format(config), locale)\n : undefined\n // Numbers have no descenders: one em is their height, with room to spare.\n const height = fontSize\n\n // Candidates in order of priority: every hit's items, and for points only the\n // last one of each series unless all are asked for.\n const items: [string, HitItem, Hit][] = []\n const last = new Map<number, number>()\n let total = 0\n for (let i = 0; i < interaction.count; i++) {\n const hit = interaction.hitIndex(i)\n for (const item of hit?.items ?? []) {\n if (item.value === null || item.y === null || !hit) continue\n total += Math.abs(item.value)\n if (!pie && !item.box && options.points !== 'all') last.set(item.seriesIndex, items.length)\n items.push([`${i}-${item.seriesIndex}`, item, hit])\n }\n }\n\n // Marks a label must not cover: every bar and cell but its own.\n const marks = items.flatMap(([, item]) => (item.box ? [item.box] : []))\n const placed: Placed[] = []\n items.forEach(([key, item, hit], n) => {\n const { area } = hit\n if (!pie && !item.box && options.points !== 'all' && last.get(item.seriesIndex) !== n) return\n const value = item.value as number\n const share = value / (total || 1)\n const text = format ? format(pie ? share : value) : item.text\n const width = estimateTextWidth(text, fontSize)\n const at = (x: number, y: number, inside: boolean): Placed => {\n // A point's label at the plot's edge (the last point) moves in.\n if (!item.box && !pie) {\n x = Math.max(area.x + width / 2 + 2, Math.min(x, area.x + area.width - width / 2 - 2))\n }\n return {\n key,\n text,\n x,\n y,\n inside,\n box: { x: x - width / 2 - 2, y: y - height / 2, width: width + 4, height },\n }\n }\n const y = item.y as number\n const candidates: Placed[] = []\n const { box } = item\n if (pie) {\n candidates.push(at(item.x, y, true))\n } else if (box) {\n const horizontal = hit.axis === 'y'\n const down = value < 0\n if (!stacked && !cell) {\n // Beyond the bar's end, then just inside it.\n const reach = (horizontal ? width / 2 : height / 2) + GAP\n const sign = down ? 1 : -1\n const along = y + sign * reach\n // Sideways, bars grow to the right, or to the left in a right-to-left chart.\n const side = ctx.rtl ? -sign : sign\n candidates.push(\n horizontal ? at(item.x - side * reach, y, false) : at(item.x, along, false),\n // A label wider than its bar may lean off a taller neighbour.\n ...(horizontal\n ? []\n : [\n at(box.x + width / 2 - 3, along, false),\n at(box.x + box.width - width / 2 + 3, along, false),\n ]),\n horizontal ? at(item.x + side * reach, y, true) : at(item.x, y - sign * reach, true),\n )\n } else {\n candidates.push(at(box.x + box.width / 2, box.y + box.height / 2, true))\n }\n } else {\n // Above the point, below it, or beside it (the end of a line, at the plot's edge).\n const side = width / 2 + GAP + 4\n candidates.push(\n at(item.x, y - height / 2 - GAP - 2, false),\n at(item.x, y + height / 2 + GAP + 2, false),\n at(item.x - side, y, false),\n at(item.x + side, y, false),\n )\n }\n // Labels may rise into the margin above the plot, not over the axes.\n const room = { ...area, y: 0, height: area.y + area.height }\n // Glyphs leave a little room at their sides (`slim`): a label may brush a neighbour.\n const fits = (p: Placed, slim = { ...p.box, x: p.box.x + 5, width: p.box.width - 10 }) =>\n contains(pie ? area : room, p.box) &&\n (!p.inside || !box || contains(box, p.box)) &&\n (!pie || sliceFits(item, area, share, p.box)) &&\n !placed.some((other) => overlaps(other.box, p.box)) &&\n !marks.some((mark) => mark !== box && overlaps(mark, slim))\n const spot = candidates.find((p) => fits(p))\n if (spot) placed.push(spot)\n })\n\n if (!placed.length) return null\n return h(\n 'g',\n { key: 'value-labels', class: 'tc-value-labels', 'aria-hidden': 'true' },\n placed.map((p) =>\n h(\n 'text',\n {\n key: p.key,\n class: ['tc-value-label', p.inside && 'tc-value-label-inside'],\n style: `transform:translate(${round(p.x)}px,${round(p.y)}px)`,\n 'text-anchor': 'middle',\n dy: '0.35em',\n },\n p.text,\n ),\n ),\n )\n}\n\n/**\n * Whether a label fits its slice: it sits at the slice's centroid, where the\n * slice is about its share of the circle wide and twice the distance to the\n * outer edge deep.\n */\nfunction sliceFits(item: HitItem, area: Rect, share: number, label: Rect): boolean {\n const outer = area.width / 2\n const radius = Math.hypot(item.x - area.x - outer, (item.y as number) - area.y - outer)\n const depth = 2 * (outer - radius)\n return label.width <= share * 2 * Math.PI * radius && label.height <= depth\n}\n\n/** The step that adds the labels over the content of charts with `valueLabels`. */\nexport const labelsStep: PostStep = (config, content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,EAAE,GAAG,OACxC,CAAC,OAAO,UAAU,MAAM,MAAM,OAAO,EAAE,GAAG,MAC3C,CAAC,OAAO,MAAM,UAAU,SAAS,MAAM,KAAK,EAAE,GAAG,CAAC,KAClD,CAAC,MAAM,MAAM,SAAS,SAAS,OAAO,SAAS,MAAM,IAAI,CAAC;EAC5D,MAAM,OAAO,WAAW,MAAM,MAAM,KAAK,CAAC,CAAC;EAC3C,IAAI,MAAM,OAAO,KAAK,IAAI;CAC5B,CAAC;CAED,IAAI,CAAC,OAAO,QAAQ,OAAO;CAC3B,OAAO,EACL,KACA;EAAE,KAAK;EAAgB,OAAO;EAAmB,eAAe;CAAO,GACvE,OAAO,KAAK,MACV,EACE,QACA;EACE,KAAK,EAAE;EACP,OAAO,CAAC,kBAAkB,EAAE,UAAU,uBAAuB;EAC7D,OAAO,uBAAuB,MAAM,EAAE,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC,EAAE;EACzD,eAAe;EACf,IAAI;CACN,GACA,EAAE,IACJ,CACF,CACF;AACF;;;;;;AAOA,SAAS,UAAU,MAAe,MAAY,OAAe,OAAsB;CACjF,MAAM,QAAQ,KAAK,QAAQ;CAC3B,MAAM,SAAS,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,OAAQ,KAAK,IAAe,KAAK,IAAI,KAAK;CACtF,MAAM,QAAQ,KAAK,QAAQ;CAC3B,OAAO,MAAM,SAAS,QAAQ,IAAI,KAAK,KAAK,UAAU,MAAM,UAAU;AACxE;;AAGA,MAAa,cAAwB,QAAQ,SAAS,aAAa,QACjE,OAAO,eAAe,cAAc,CAAC,SAAS,YAAY,QAAQ,aAAa,GAAG,CAAC,IAAI"}
@@ -1,7 +1,7 @@
1
- const require_layout = require("./layout-CtMBhNd9.cjs");
2
- const require_vnode = require("./vnode-CkQ27Cxe.cjs");
3
- const require_format = require("./format-B0yKXBTH.cjs");
4
- //#region src/charts/value-labels.ts
1
+ const require_format = require("./format-CAE5ruy6.cjs");
2
+ const require_layout = require("./layout-JY2aR-yE.cjs");
3
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
4
+ // src/charts/value-labels.ts
5
5
  /** Space between a mark and its label, and around labels. */
6
6
  const GAP = 4;
7
7
  const overlaps = (a, b) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;
@@ -72,7 +72,8 @@ function valueLabels(config, interaction, ctx) {
72
72
  const reach = (horizontal ? width / 2 : height / 2) + GAP;
73
73
  const sign = down ? 1 : -1;
74
74
  const along = y + sign * reach;
75
- candidates.push(horizontal ? at(item.x - sign * reach, y, false) : at(item.x, along, false), ...horizontal ? [] : [at(box.x + width / 2 - 3, along, false), at(box.x + box.width - width / 2 + 3, along, false)], horizontal ? at(item.x + sign * reach, y, true) : at(item.x, y - sign * reach, true));
75
+ const side = ctx.rtl ? -sign : sign;
76
+ candidates.push(horizontal ? at(item.x - side * reach, y, false) : at(item.x, along, false), ...horizontal ? [] : [at(box.x + width / 2 - 3, along, false), at(box.x + box.width - width / 2 + 3, along, false)], horizontal ? at(item.x + side * reach, y, true) : at(item.x, y - sign * reach, true));
76
77
  } else candidates.push(at(box.x + box.width / 2, box.y + box.height / 2, true));
77
78
  } else {
78
79
  const side = width / 2 + GAP + 4;
@@ -117,7 +118,6 @@ function sliceFits(item, area, share, label) {
117
118
  }
118
119
  /** The step that adds the labels over the content of charts with `valueLabels`. */
119
120
  const labelsStep = (config, content, interaction, ctx) => config.valueLabels && interaction ? [content, valueLabels(config, interaction, ctx)] : content;
120
- //#endregion
121
121
  Object.defineProperty(exports, "labelsStep", {
122
122
  enumerable: true,
123
123
  get: function() {
@@ -131,4 +131,4 @@ Object.defineProperty(exports, "valueLabels", {
131
131
  }
132
132
  });
133
133
 
134
- //# sourceMappingURL=value-labels-B0WJoJ7x.cjs.map
134
+ //# sourceMappingURL=value-labels-BV9keAuL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-labels-BV9keAuL.cjs","names":["formatNumber","getNumberFormat","estimateTextWidth","h","round"],"sources":["../src/charts/value-labels.ts"],"sourcesContent":["/**\n * Value labels: the value written on each mark, for charts read at a\n * glance. They are worked out from the chart's interaction, so every type\n * gets them the same way: bars at their end (inside when there is no room\n * outside), stacked segments and heatmap cells in their middle, lines and\n * points above their point (the last one by default), slices in their\n * middle with their share. A label that does not fit its mark or the plot,\n * or that would cover another one, is left out: labels never overlap.\n */\nimport type { ChartConfig, RenderContext } from '../chart.ts'\nimport type { PostStep } from '../features.ts'\nimport { formatNumber, getNumberFormat, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type Rect, round } from '../layout.ts'\nimport { h, type VNode } from '../vnode.ts'\n\nexport interface ValueLabelOptions {\n /** Format of the values. Defaults to the value axis format (slices: their share in percent). */\n format?: NumberFormat\n /** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */\n points?: 'last' | 'all'\n}\n\n/** Space between a mark and its label, and around labels. */\nconst GAP = 4\n\ninterface Placed {\n key: string\n text: string\n x: number\n y: number\n inside: boolean\n box: Rect\n}\n\nconst overlaps = (a: Rect, b: Rect): boolean =>\n a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height\n\nconst contains = (outer: Rect, inner: Rect): boolean =>\n inner.x >= outer.x - 1 &&\n inner.y >= outer.y - 1 &&\n inner.x + inner.width <= outer.x + outer.width + 1 &&\n inner.y + inner.height <= outer.y + outer.height + 1\n\n/** The labels layer of a chart, or `null` when nothing gets one. */\nexport function valueLabels(\n config: ChartConfig<object>,\n interaction: Interaction,\n ctx: RenderContext,\n): VNode | null {\n const option = config.valueLabels\n const options: ValueLabelOptions = typeof option === 'object' ? option : {}\n const { fontSize, locale } = ctx\n // What the chart type says about its marks (slices, cells) and its number format.\n const spec = config.type.valueLabels\n const pie = spec?.marks === 'slice'\n const cell = spec?.marks === 'cell'\n const stacked = !!(config as { stacked?: unknown }).stacked\n const format = options.format\n ? formatNumber(options.format, locale)\n : pie\n ? (v: number) =>\n getNumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(v)\n : spec?.format\n ? formatNumber(spec.format(config), locale)\n : undefined\n // Numbers have no descenders: one em is their height, with room to spare.\n const height = fontSize\n\n // Candidates in order of priority: every hit's items, and for points only the\n // last one of each series unless all are asked for.\n const items: [string, HitItem, Hit][] = []\n const last = new Map<number, number>()\n let total = 0\n for (let i = 0; i < interaction.count; i++) {\n const hit = interaction.hitIndex(i)\n for (const item of hit?.items ?? []) {\n if (item.value === null || item.y === null || !hit) continue\n total += Math.abs(item.value)\n if (!pie && !item.box && options.points !== 'all') last.set(item.seriesIndex, items.length)\n items.push([`${i}-${item.seriesIndex}`, item, hit])\n }\n }\n\n // Marks a label must not cover: every bar and cell but its own.\n const marks = items.flatMap(([, item]) => (item.box ? [item.box] : []))\n const placed: Placed[] = []\n items.forEach(([key, item, hit], n) => {\n const { area } = hit\n if (!pie && !item.box && options.points !== 'all' && last.get(item.seriesIndex) !== n) return\n const value = item.value as number\n const share = value / (total || 1)\n const text = format ? format(pie ? share : value) : item.text\n const width = estimateTextWidth(text, fontSize)\n const at = (x: number, y: number, inside: boolean): Placed => {\n // A point's label at the plot's edge (the last point) moves in.\n if (!item.box && !pie) {\n x = Math.max(area.x + width / 2 + 2, Math.min(x, area.x + area.width - width / 2 - 2))\n }\n return {\n key,\n text,\n x,\n y,\n inside,\n box: { x: x - width / 2 - 2, y: y - height / 2, width: width + 4, height },\n }\n }\n const y = item.y as number\n const candidates: Placed[] = []\n const { box } = item\n if (pie) {\n candidates.push(at(item.x, y, true))\n } else if (box) {\n const horizontal = hit.axis === 'y'\n const down = value < 0\n if (!stacked && !cell) {\n // Beyond the bar's end, then just inside it.\n const reach = (horizontal ? width / 2 : height / 2) + GAP\n const sign = down ? 1 : -1\n const along = y + sign * reach\n // Sideways, bars grow to the right, or to the left in a right-to-left chart.\n const side = ctx.rtl ? -sign : sign\n candidates.push(\n horizontal ? at(item.x - side * reach, y, false) : at(item.x, along, false),\n // A label wider than its bar may lean off a taller neighbour.\n ...(horizontal\n ? []\n : [\n at(box.x + width / 2 - 3, along, false),\n at(box.x + box.width - width / 2 + 3, along, false),\n ]),\n horizontal ? at(item.x + side * reach, y, true) : at(item.x, y - sign * reach, true),\n )\n } else {\n candidates.push(at(box.x + box.width / 2, box.y + box.height / 2, true))\n }\n } else {\n // Above the point, below it, or beside it (the end of a line, at the plot's edge).\n const side = width / 2 + GAP + 4\n candidates.push(\n at(item.x, y - height / 2 - GAP - 2, false),\n at(item.x, y + height / 2 + GAP + 2, false),\n at(item.x - side, y, false),\n at(item.x + side, y, false),\n )\n }\n // Labels may rise into the margin above the plot, not over the axes.\n const room = { ...area, y: 0, height: area.y + area.height }\n // Glyphs leave a little room at their sides (`slim`): a label may brush a neighbour.\n const fits = (p: Placed, slim = { ...p.box, x: p.box.x + 5, width: p.box.width - 10 }) =>\n contains(pie ? area : room, p.box) &&\n (!p.inside || !box || contains(box, p.box)) &&\n (!pie || sliceFits(item, area, share, p.box)) &&\n !placed.some((other) => overlaps(other.box, p.box)) &&\n !marks.some((mark) => mark !== box && overlaps(mark, slim))\n const spot = candidates.find((p) => fits(p))\n if (spot) placed.push(spot)\n })\n\n if (!placed.length) return null\n return h(\n 'g',\n { key: 'value-labels', class: 'tc-value-labels', 'aria-hidden': 'true' },\n placed.map((p) =>\n h(\n 'text',\n {\n key: p.key,\n class: ['tc-value-label', p.inside && 'tc-value-label-inside'],\n style: `transform:translate(${round(p.x)}px,${round(p.y)}px)`,\n 'text-anchor': 'middle',\n dy: '0.35em',\n },\n p.text,\n ),\n ),\n )\n}\n\n/**\n * Whether a label fits its slice: it sits at the slice's centroid, where the\n * slice is about its share of the circle wide and twice the distance to the\n * outer edge deep.\n */\nfunction sliceFits(item: HitItem, area: Rect, share: number, label: Rect): boolean {\n const outer = area.width / 2\n const radius = Math.hypot(item.x - area.x - outer, (item.y as number) - area.y - outer)\n const depth = 2 * (outer - radius)\n return label.width <= share * 2 * Math.PI * radius && label.height <= depth\n}\n\n/** The step that adds the labels over the content of charts with `valueLabels`. */\nexport const labelsStep: PostStep = (config, content, interaction, ctx) =>\n config.valueLabels && interaction ? [content, valueLabels(config, interaction, ctx)] : content\n"],"mappings":";;;;;AAwBA,MAAM,MAAM;AAWZ,MAAM,YAAY,GAAS,MACzB,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;AAEtF,MAAM,YAAY,OAAa,UAC7B,MAAM,KAAK,MAAM,IAAI,KACrB,MAAM,KAAK,MAAM,IAAI,KACrB,MAAM,IAAI,MAAM,SAAS,MAAM,IAAI,MAAM,QAAQ,KACjD,MAAM,IAAI,MAAM,UAAU,MAAM,IAAI,MAAM,SAAS;;AAGrD,SAAgB,YACd,QACA,aACA,KACc;CACd,MAAM,SAAS,OAAO;CACtB,MAAM,UAA6B,OAAO,WAAW,WAAW,SAAS,CAAC;CAC1E,MAAM,EAAE,UAAU,WAAW;CAE7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,MAAM,MAAM,UAAU;CAC5B,MAAM,OAAO,MAAM,UAAU;CAC7B,MAAM,UAAU,CAAC,CAAE,OAAiC;CACpD,MAAM,SAAS,QAAQ,SACnBA,eAAAA,aAAa,QAAQ,QAAQ,MAAM,IACnC,OACG,MACCC,eAAAA,gBAAgB,QAAQ;EAAE,OAAO;EAAW,uBAAuB;CAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAClF,MAAM,SACJD,eAAAA,aAAa,KAAK,OAAO,MAAM,GAAG,MAAM,IACxC,KAAA;CAER,MAAM,SAAS;CAIf,MAAM,QAAkC,CAAC;CACzC,MAAM,uBAAO,IAAI,IAAoB;CACrC,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,OAAO,KAAK;EAC1C,MAAM,MAAM,YA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, Symbol.toStringTag, { value: "Module" });
2
- const require_features = require("./features-BclHgg2W.cjs");
3
- const require_value_labels = require("./value-labels-B0WJoJ7x.cjs");
4
- //#region src/value-labels.ts
2
+ const require_value_labels = require("./value-labels-BV9keAuL.cjs");
3
+ // src/value-labels.ts
5
4
  /**
6
5
  * Standalone entry: `import '@tabler/charts/value-labels'` enables
7
6
  * `valueLabels` (values written on the marks) on the core.
8
7
  */
9
- require_features.addPost(require_value_labels.labelsStep);
10
- //#endregion
8
+ require("./features-DCXEvoya.cjs").addPost(require_value_labels.labelsStep);
11
9
  exports.labelsStep = require_value_labels.labelsStep;
12
10
  exports.valueLabels = require_value_labels.valueLabels;
13
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"value-labels.cjs","names":["addPost","labelsStep"],"sources":["../src/value-labels.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/value-labels'` enables\n * `valueLabels` (values written on the marks) on the core.\n */\nimport { labelsStep, valueLabels } from './charts/value-labels.ts'\nimport { addPost } from './features.ts'\n\naddPost(labelsStep)\n\nexport type { ValueLabelOptions } from './charts/value-labels.ts'\nexport { labelsStep, valueLabels }\n"],"mappings":";;;;;;;;AAOAA,iBAAAA,QAAQC,qBAAAA,UAAU"}
1
+ {"version":3,"file":"value-labels.cjs","names":["addPost","labelsStep"],"sources":["../src/value-labels.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/value-labels'` enables\n * `valueLabels` (values written on the marks) on the core.\n */\nimport { labelsStep, valueLabels } from './charts/value-labels.ts'\nimport { addPost } from './features.ts'\n\naddPost(labelsStep)\n\nexport type { ValueLabelOptions } from './charts/value-labels.ts'\nexport { labelsStep, valueLabels }\n"],"mappings":";;;;;;;A,iCAOAA,CAAAA,CAAAA,QAAQC,qBAAAA,UAAU"}
@@ -1,2 +1,6 @@
1
- import { A as labelsStep, j as valueLabels, k as ValueLabelOptions } from "./chart-D7ooEFnk.cjs";
1
+ /**
2
+ * Standalone entry: `import '@tabler/charts/value-labels'` enables
3
+ * `valueLabels` (values written on the marks) on the core.
4
+ */
5
+ import { A as labelsStep, j as valueLabels, k as ValueLabelOptions } from "./chart-kqFMEwDo.cjs";
2
6
  export { type ValueLabelOptions, labelsStep, valueLabels };
@@ -1,2 +1,6 @@
1
- import { A as labelsStep, j as valueLabels, k as ValueLabelOptions } from "./chart-DyN7bcx8.js";
1
+ /**
2
+ * Standalone entry: `import '@tabler/charts/value-labels'` enables
3
+ * `valueLabels` (values written on the marks) on the core.
4
+ */
5
+ import { A as labelsStep, j as valueLabels, k as ValueLabelOptions } from "./chart-QilhWP8Z.js";
2
6
  export { type ValueLabelOptions, labelsStep, valueLabels };
@@ -1,12 +1,11 @@
1
- import { t as addPost } from "./features-wASyHGic.js";
2
- import { n as valueLabels, t as labelsStep } from "./value-labels-IZIQPhfk.js";
3
- //#region src/value-labels.ts
1
+ import { n as valueLabels, t as labelsStep } from "./value-labels-BBuSi4i0.js";
2
+ import { t as addPost } from "./features-BMxkqCyS.js";
3
+ // src/value-labels.ts
4
4
  /**
5
5
  * Standalone entry: `import '@tabler/charts/value-labels'` enables
6
6
  * `valueLabels` (values written on the marks) on the core.
7
7
  */
8
8
  addPost(labelsStep);
9
- //#endregion
10
9
  export { labelsStep, valueLabels };
11
10
 
12
11
  //# sourceMappingURL=value-labels.js.map
@@ -1,4 +1,4 @@
1
- //#region src/vnode.ts
1
+ // src/vnode.ts
2
2
  /**
3
3
  * Create a virtual node.
4
4
  *
@@ -87,7 +87,6 @@ function flattenChildren(input, out) {
87
87
  else out.push(text);
88
88
  }
89
89
  }
90
- //#endregion
91
90
  Object.defineProperty(exports, "h", {
92
91
  enumerable: true,
93
92
  get: function() {
@@ -107,4 +106,4 @@ Object.defineProperty(exports, "normalizeStyle", {
107
106
  }
108
107
  });
109
108
 
110
- //# sourceMappingURL=vnode-CkQ27Cxe.cjs.map
109
+ //# sourceMappingURL=vnode-ClAiw28x.cjs.map