@tabler/charts 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +92 -4
  2. package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
  3. package/dist/{annotations-BszTTjf9.js → annotations-BQ8l-qHs.js} +6 -7
  4. package/dist/{annotations-BszTTjf9.js.map → annotations-BQ8l-qHs.js.map} +1 -1
  5. package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
  6. package/dist/{annotations-DpETO8dE.cjs → annotations-CpCWA29b.cjs} +6 -7
  7. package/dist/{annotations-DpETO8dE.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
  8. package/dist/annotations.cjs +3 -5
  9. package/dist/annotations.cjs.map +1 -1
  10. package/dist/annotations.d.cts +2 -1
  11. package/dist/annotations.d.ts +2 -1
  12. package/dist/annotations.js +3 -4
  13. package/dist/{arc-a1tRTEw7.js → arc-B3V5IR0w.js} +2 -3
  14. package/dist/{arc-a1tRTEw7.js.map → arc-B3V5IR0w.js.map} +1 -1
  15. package/dist/{arc-BXpLrt9b.cjs → arc-CYhI62kO.cjs} +2 -3
  16. package/dist/{arc-BXpLrt9b.cjs.map → arc-CYhI62kO.cjs.map} +1 -1
  17. package/dist/{area-CF__HOwL.d.ts → area-DEFQm_SQ.d.ts} +3 -6
  18. package/dist/{area-sHCE3pg5.cjs → area-DYdQ_sMV.cjs} +5 -6
  19. package/dist/{area-sHCE3pg5.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
  20. package/dist/{area-DQsLERhx.js → area-WdtfqvhX.js} +5 -6
  21. package/dist/{area-DQsLERhx.js.map → area-WdtfqvhX.js.map} +1 -1
  22. package/dist/{area-DIxaAbYZ.d.cts → area-h_FvieFb.d.cts} +3 -6
  23. package/dist/area.cjs +1 -1
  24. package/dist/area.d.cts +2 -1
  25. package/dist/area.d.ts +2 -1
  26. package/dist/area.js +1 -2
  27. package/dist/axis-MMaVoSWB.js +235 -0
  28. package/dist/axis-MMaVoSWB.js.map +1 -0
  29. package/dist/axis-YfAerNBA.cjs +300 -0
  30. package/dist/axis-YfAerNBA.cjs.map +1 -0
  31. package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
  32. package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
  33. package/dist/{bar-jZEoao74.js → bar-BOcRcArc.js} +80 -62
  34. package/dist/bar-BOcRcArc.js.map +1 -0
  35. package/dist/{bar-C-7zR2qp.cjs → bar-CVkOJ7WA.cjs} +82 -64
  36. package/dist/bar-CVkOJ7WA.cjs.map +1 -0
  37. package/dist/{bar-DM16NUvV.js → bar-CgpC2EpX.js} +3 -4
  38. package/dist/{bar-DM16NUvV.js.map → bar-CgpC2EpX.js.map} +1 -1
  39. package/dist/{bar-BBM8RhoL.d.ts → bar-D9B_arKf.d.ts} +4 -7
  40. package/dist/{bar-CRKLDg98.d.cts → bar-DZCQ-kyf.d.cts} +4 -7
  41. package/dist/{bar-DGuUN3nc.cjs → bar-wVykm1us.cjs} +3 -4
  42. package/dist/{bar-DGuUN3nc.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  43. package/dist/bar.cjs +1 -1
  44. package/dist/bar.d.cts +2 -1
  45. package/dist/bar.d.ts +2 -1
  46. package/dist/bar.js +1 -2
  47. package/dist/calendar-BSvO8nRb.d.cts +106 -0
  48. package/dist/calendar-BXgIX5H1.js +502 -0
  49. package/dist/calendar-BXgIX5H1.js.map +1 -0
  50. package/dist/calendar-Bq3vFzPl.d.ts +106 -0
  51. package/dist/calendar-DAFXjV99.cjs +507 -0
  52. package/dist/calendar-DAFXjV99.cjs.map +1 -0
  53. package/dist/calendar.cjs +3 -0
  54. package/dist/calendar.d.cts +3 -0
  55. package/dist/calendar.d.ts +3 -0
  56. package/dist/calendar.js +1 -0
  57. package/dist/{candlestick-D_vV0_XZ.d.ts → candlestick-B3WcLzph.d.ts} +3 -6
  58. package/dist/{candlestick-__pXl_pV.d.cts → candlestick-BcomxeVG.d.cts} +3 -6
  59. package/dist/{candlestick-DuXwAFID.js → candlestick-BtT9glp9.js} +19 -18
  60. package/dist/{candlestick-DuXwAFID.js.map → candlestick-BtT9glp9.js.map} +1 -1
  61. package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CSmRuZ4v.cjs} +19 -18
  62. package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
  63. package/dist/candlestick.cjs +4 -5
  64. package/dist/candlestick.d.cts +1 -1
  65. package/dist/candlestick.d.ts +1 -1
  66. package/dist/candlestick.js +4 -6
  67. package/dist/{cartesian-Cr0AF0nG.js → cartesian-BrPqb5Qn.js} +138 -264
  68. package/dist/cartesian-BrPqb5Qn.js.map +1 -0
  69. package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DRSXHxWe.cjs} +162 -324
  70. package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
  71. package/dist/{chart-BF2CK9I_.js → chart-B6TTY4Kr.js} +120 -77
  72. package/dist/chart-B6TTY4Kr.js.map +1 -0
  73. package/dist/{chart-DyN7bcx8.d.ts → chart-CYrrUCi3.d.ts} +222 -102
  74. package/dist/{chart-D7ooEFnk.d.cts → chart-CbPzP5Dp.d.cts} +248 -102
  75. package/dist/{chart-CowF_lWY.cjs → chart-D_lyOy-M.cjs} +132 -83
  76. package/dist/chart-D_lyOy-M.cjs.map +1 -0
  77. package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
  78. package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
  79. package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
  80. package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
  81. package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
  82. package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
  83. package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
  84. package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
  85. package/dist/{core-D1vO1LrC.d.cts → core-9BnLEW4K.d.cts} +31 -72
  86. package/dist/{core-DcbemzGf.d.ts → core-C3qEppSm.d.ts} +10 -46
  87. package/dist/{core-CegR_j55.js → core-CQ0FaJ4G.js} +138 -99
  88. package/dist/core-CQ0FaJ4G.js.map +1 -0
  89. package/dist/{core-RzS9IQO5.cjs → core-D2PSked3.cjs} +139 -100
  90. package/dist/core-D2PSked3.cjs.map +1 -0
  91. package/dist/core.cjs +47 -33
  92. package/dist/core.d.cts +26 -21
  93. package/dist/core.d.ts +26 -21
  94. package/dist/core.js +31 -25
  95. package/dist/{dates-CG-FvioW.js → dates-DLe2Ww64.js} +4 -5
  96. package/dist/{dates-CG-FvioW.js.map → dates-DLe2Ww64.js.map} +1 -1
  97. package/dist/{dates-Btm7Zm6W.cjs → dates-DerXTb1J.cjs} +4 -5
  98. package/dist/{dates-Btm7Zm6W.cjs.map → dates-DerXTb1J.cjs.map} +1 -1
  99. package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
  100. package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
  101. package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
  102. package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
  103. package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
  104. package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
  105. package/dist/decimate.cjs +3 -4
  106. package/dist/decimate.d.cts +1 -1
  107. package/dist/decimate.d.ts +1 -1
  108. package/dist/decimate.js +3 -4
  109. package/dist/{dom-CLF868Qs.cjs → dom-C33zvtPo.cjs} +5 -11
  110. package/dist/dom-C33zvtPo.cjs.map +1 -0
  111. package/dist/{dom-vP3IcMak.js → dom-CTse6Rvd.js} +5 -11
  112. package/dist/dom-CTse6Rvd.js.map +1 -0
  113. package/dist/{export-chart-BhhYgksr.cjs → export-chart-CPtXmZvi.cjs} +18 -14
  114. package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
  115. package/dist/{export-chart-9w8t3rjZ.js → export-chart-DoeiAyR2.js} +18 -14
  116. package/dist/export-chart-DoeiAyR2.js.map +1 -0
  117. package/dist/export.cjs +3 -5
  118. package/dist/export.cjs.map +1 -1
  119. package/dist/export.d.cts +8 -1
  120. package/dist/export.d.ts +8 -1
  121. package/dist/export.js +3 -4
  122. package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
  123. package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
  124. package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
  125. package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
  126. package/dist/{fade-D3NxH5Qg.js → fade-CDrQjnDz.js} +59 -83
  127. package/dist/fade-CDrQjnDz.js.map +1 -0
  128. package/dist/{fade-Cs74puQS.cjs → fade-CRqcKMWY.cjs} +59 -83
  129. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  130. package/dist/{features-wASyHGic.js → features-B55rwpQC.js} +5 -4
  131. package/dist/features-B55rwpQC.js.map +1 -0
  132. package/dist/{features-BclHgg2W.cjs → features-DEDP5CEQ.cjs} +10 -3
  133. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  134. package/dist/fit-BPyPRnsK.js +16 -0
  135. package/dist/fit-BPyPRnsK.js.map +1 -0
  136. package/dist/fit-D4MIIQQz.cjs +21 -0
  137. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  138. package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
  139. package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
  140. package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
  141. package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
  142. package/dist/funnel-BdcfUkb5.d.ts +50 -0
  143. package/dist/funnel-CFEEulw_.cjs +244 -0
  144. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  145. package/dist/funnel-CYCv8cq2.js +239 -0
  146. package/dist/funnel-CYCv8cq2.js.map +1 -0
  147. package/dist/funnel-CarOh8w_.d.cts +50 -0
  148. package/dist/funnel.cjs +3 -0
  149. package/dist/funnel.d.cts +3 -0
  150. package/dist/funnel.d.ts +3 -0
  151. package/dist/funnel.js +1 -0
  152. package/dist/{gauge-D-FYhuds.cjs → gauge-6HfDcLMJ.cjs} +35 -36
  153. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  154. package/dist/{gauge-Dh423FHh.js → gauge-DiTk5aWO.js} +35 -36
  155. package/dist/gauge-DiTk5aWO.js.map +1 -0
  156. package/dist/{gauge-zpia05t2.d.ts → gauge-Ds9k1UV2.d.cts} +5 -8
  157. package/dist/{gauge-DP_EB2z3.d.cts → gauge-Zy25jfps.d.ts} +5 -8
  158. package/dist/gauge.cjs +1 -1
  159. package/dist/gauge.d.cts +2 -1
  160. package/dist/gauge.d.ts +2 -1
  161. package/dist/gauge.js +1 -2
  162. package/dist/{heatmap-DSZ2bVIa.js → heatmap-C1v8bwpq.js} +43 -43
  163. package/dist/heatmap-C1v8bwpq.js.map +1 -0
  164. package/dist/{heatmap-BectCEeE.d.ts → heatmap-CJ-0dfhJ.d.cts} +4 -7
  165. package/dist/{heatmap-BK18EBgJ.cjs → heatmap-Dcc_bsoQ.cjs} +47 -47
  166. package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
  167. package/dist/{heatmap-CCso6m61.d.cts → heatmap-Jp5sHRTo.d.ts} +4 -7
  168. package/dist/heatmap.cjs +1 -1
  169. package/dist/heatmap.d.cts +2 -1
  170. package/dist/heatmap.d.ts +2 -1
  171. package/dist/heatmap.js +1 -2
  172. package/dist/{hydrate-DDNIHYv_.js → hydrate-BB3MlR36.js} +3 -4
  173. package/dist/{hydrate-DDNIHYv_.js.map → hydrate-BB3MlR36.js.map} +1 -1
  174. package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
  175. package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
  176. package/dist/{hydrate-CxwTXDqO.cjs → hydrate-m0I5m6ue.cjs} +3 -4
  177. package/dist/hydrate-m0I5m6ue.cjs.map +1 -0
  178. package/dist/hydrate.cjs +3 -4
  179. package/dist/hydrate.cjs.map +1 -1
  180. package/dist/hydrate.d.cts +1 -1
  181. package/dist/hydrate.d.ts +1 -1
  182. package/dist/hydrate.js +3 -4
  183. package/dist/index.cjs +72 -56
  184. package/dist/index.cjs.map +1 -1
  185. package/dist/index.d.cts +28 -28
  186. package/dist/index.d.ts +28 -28
  187. package/dist/index.js +52 -44
  188. package/dist/index.js.map +1 -1
  189. package/dist/interaction-DXYSjgnP.cjs +32 -0
  190. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  191. package/dist/interaction-En1KlwFO.js +21 -0
  192. package/dist/interaction-En1KlwFO.js.map +1 -0
  193. package/dist/{layout-CtMBhNd9.cjs → layout-Cfg9x1k2.cjs} +45 -3
  194. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  195. package/dist/{layout-B3hiqVEw.js → layout-DqAte3H8.js} +34 -4
  196. package/dist/layout-DqAte3H8.js.map +1 -0
  197. package/dist/{line-CN4uZ9ZX.d.ts → line-Bpr5uVLQ.d.ts} +4 -7
  198. package/dist/{line-B3Ed6u7j.js → line-CxR4tg1Q.js} +49 -38
  199. package/dist/line-CxR4tg1Q.js.map +1 -0
  200. package/dist/{line-fQbtP_jL.cjs → line-YiCuhVMI.cjs} +49 -38
  201. package/dist/line-YiCuhVMI.cjs.map +1 -0
  202. package/dist/{line-W7VD_qs1.d.cts → line-vyWO030v.d.cts} +4 -7
  203. package/dist/line.cjs +4 -5
  204. package/dist/line.cjs.map +1 -1
  205. package/dist/line.d.cts +1 -1
  206. package/dist/line.d.ts +1 -1
  207. package/dist/line.js +4 -6
  208. package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
  209. package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
  210. package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
  211. package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
  212. package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
  213. package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
  214. package/dist/log.cjs +3 -5
  215. package/dist/log.cjs.map +1 -1
  216. package/dist/log.d.cts +1 -1
  217. package/dist/log.d.ts +1 -1
  218. package/dist/log.js +3 -4
  219. package/dist/map-49FcfdmJ.d.cts +156 -0
  220. package/dist/map-BMC61J-P.d.ts +156 -0
  221. package/dist/map-BqrZ80vT.cjs +818 -0
  222. package/dist/map-BqrZ80vT.cjs.map +1 -0
  223. package/dist/map-C15NC7kW.js +807 -0
  224. package/dist/map-C15NC7kW.js.map +1 -0
  225. package/dist/map.cjs +4 -0
  226. package/dist/map.d.cts +3 -0
  227. package/dist/map.d.ts +3 -0
  228. package/dist/map.js +1 -0
  229. package/dist/maps/world.cjs +875 -0
  230. package/dist/maps/world.cjs.map +1 -0
  231. package/dist/maps/world.d.cts +2 -0
  232. package/dist/maps/world.d.ts +2 -0
  233. package/dist/maps/world.js +874 -0
  234. package/dist/maps/world.js.map +1 -0
  235. package/dist/{morph-CqYDu1bY.cjs → morph-3I1Nf_tR.cjs} +4 -5
  236. package/dist/morph-3I1Nf_tR.cjs.map +1 -0
  237. package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
  238. package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
  239. package/dist/{morph-Bgg-24l8.js → morph-GfBab-b3.js} +4 -5
  240. package/dist/{morph-Bgg-24l8.js.map → morph-GfBab-b3.js.map} +1 -1
  241. package/dist/morph.cjs +3 -4
  242. package/dist/morph.cjs.map +1 -1
  243. package/dist/morph.d.cts +1 -1
  244. package/dist/morph.d.ts +1 -1
  245. package/dist/morph.js +3 -4
  246. package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
  247. package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
  248. package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
  249. package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
  250. package/dist/others-DBIGE6jr.js +57 -0
  251. package/dist/others-DBIGE6jr.js.map +1 -0
  252. package/dist/others-DBO4Kjwl.d.ts +29 -0
  253. package/dist/others-WfjCsjqT.cjs +68 -0
  254. package/dist/others-WfjCsjqT.cjs.map +1 -0
  255. package/dist/others-ls5eKtZ4.d.cts +31 -0
  256. package/dist/{parliament-Dw0sOERi.js → parliament-BKN6ikBJ.js} +36 -36
  257. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  258. package/dist/{parliament-1Zv2Xh0D.d.ts → parliament-C7V8UJj1.d.cts} +5 -8
  259. package/dist/{parliament-DdrLVZwt.d.cts → parliament-Cz9n_DoK.d.ts} +5 -8
  260. package/dist/{parliament-CpWnoEvG.cjs → parliament-DhxAaIZ3.cjs} +36 -36
  261. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  262. package/dist/parliament.cjs +1 -1
  263. package/dist/parliament.d.cts +2 -1
  264. package/dist/parliament.d.ts +2 -1
  265. package/dist/parliament.js +1 -2
  266. package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
  267. package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
  268. package/dist/{patterns-DtgcnA8o.js → patterns-BMUINoka.js} +4 -5
  269. package/dist/{patterns-DtgcnA8o.js.map → patterns-BMUINoka.js.map} +1 -1
  270. package/dist/{patterns-LfcQAWCy.cjs → patterns-Dw7OMD_2.cjs} +4 -5
  271. package/dist/{patterns-LfcQAWCy.cjs.map → patterns-Dw7OMD_2.cjs.map} +1 -1
  272. package/dist/patterns.cjs +3 -5
  273. package/dist/patterns.cjs.map +1 -1
  274. package/dist/patterns.d.cts +5 -1
  275. package/dist/patterns.d.ts +5 -1
  276. package/dist/patterns.js +3 -4
  277. package/dist/percentage-bar-BChkTRoz.cjs +164 -0
  278. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  279. package/dist/percentage-bar-CaInxrL8.js +159 -0
  280. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  281. package/dist/percentage-bar-R1--2grK.d.cts +58 -0
  282. package/dist/percentage-bar-cSeiLdwU.d.ts +58 -0
  283. package/dist/percentage-bar.cjs +3 -0
  284. package/dist/percentage-bar.d.cts +3 -0
  285. package/dist/percentage-bar.d.ts +3 -0
  286. package/dist/percentage-bar.js +1 -0
  287. package/dist/{pie-BF9yI5mE.d.cts → pie-BQQkvy1N.d.ts} +11 -11
  288. package/dist/{pie-DzUXDTcn.js → pie-Bd8wyrtY.js} +52 -55
  289. package/dist/pie-Bd8wyrtY.js.map +1 -0
  290. package/dist/{pie-BxTZt6Go.cjs → pie-BseZlCgP.cjs} +52 -55
  291. package/dist/pie-BseZlCgP.cjs.map +1 -0
  292. package/dist/{pie-5z1fDdKO.d.ts → pie-vD5-g8je.d.cts} +11 -11
  293. package/dist/pie.cjs +1 -1
  294. package/dist/pie.d.cts +2 -1
  295. package/dist/pie.d.ts +2 -1
  296. package/dist/pie.js +1 -2
  297. package/dist/{point-shapes-CGl4dugc.cjs → point-shapes-BRawRM78.cjs} +24 -24
  298. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  299. package/dist/{point-shapes-DI84NNpI.js → point-shapes-DI6GhcI7.js} +19 -25
  300. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  301. package/dist/point-shapes.cjs +7 -6
  302. package/dist/point-shapes.cjs.map +1 -1
  303. package/dist/point-shapes.d.cts +6 -2
  304. package/dist/point-shapes.d.ts +6 -2
  305. package/dist/point-shapes.js +8 -7
  306. package/dist/point-shapes.js.map +1 -1
  307. package/dist/{radar-1-EryihA.d.ts → radar-7I6hsY_h.d.cts} +4 -7
  308. package/dist/{radar-CYPab_I4.js → radar-D6XqkFWQ.js} +25 -27
  309. package/dist/radar-D6XqkFWQ.js.map +1 -0
  310. package/dist/{radar-CoGUNNSb.cjs → radar-DjISDnSf.cjs} +26 -28
  311. package/dist/radar-DjISDnSf.cjs.map +1 -0
  312. package/dist/{radar-DBW4O0Vt.d.cts → radar-vLxilcr4.d.ts} +4 -7
  313. package/dist/radar.cjs +1 -1
  314. package/dist/radar.d.cts +2 -1
  315. package/dist/radar.d.ts +2 -1
  316. package/dist/radar.js +1 -2
  317. package/dist/rect-CZTNvMlf.js +11 -0
  318. package/dist/rect-CZTNvMlf.js.map +1 -0
  319. package/dist/rect-DPr9QRxl.cjs +16 -0
  320. package/dist/rect-DPr9QRxl.cjs.map +1 -0
  321. package/dist/{sankey-Bacx4fVe.cjs → sankey-0CSp_Er9.cjs} +100 -95
  322. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  323. package/dist/{sankey-OV_WoPrl.d.ts → sankey-7As41Fo4.d.ts} +4 -7
  324. package/dist/{sankey-B4PNKusJ.js → sankey-Dp4CuLVe.js} +100 -95
  325. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  326. package/dist/{sankey-DuGI3Qc5.d.cts → sankey-DqiuxUx7.d.cts} +4 -7
  327. package/dist/sankey.cjs +1 -1
  328. package/dist/sankey.d.cts +2 -1
  329. package/dist/sankey.d.ts +2 -1
  330. package/dist/sankey.js +1 -2
  331. package/dist/{scatter-DbxLyZX0.d.cts → scatter-BXkXGgM_.d.ts} +14 -9
  332. package/dist/{scatter-DgMN9zRy.cjs → scatter-Bwkblr4L.cjs} +47 -42
  333. package/dist/scatter-Bwkblr4L.cjs.map +1 -0
  334. package/dist/{scatter-kgtgR318.js → scatter-DCMAtt5L.js} +45 -40
  335. package/dist/scatter-DCMAtt5L.js.map +1 -0
  336. package/dist/{scatter-BqzgJqdX.d.ts → scatter-DL0zAV09.d.cts} +14 -9
  337. package/dist/scatter.cjs +1 -1
  338. package/dist/scatter.d.cts +2 -1
  339. package/dist/scatter.d.ts +2 -1
  340. package/dist/scatter.js +1 -2
  341. package/dist/{sparkline-BfyO_oNM.d.ts → sparkline-BElUSd0r.d.ts} +5 -8
  342. package/dist/{sparkline-BS9-hltA.cjs → sparkline-BMSuEPHP.cjs} +22 -23
  343. package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
  344. package/dist/{sparkline-BQzt27Fr.js → sparkline-NDmq90kP.js} +22 -23
  345. package/dist/sparkline-NDmq90kP.js.map +1 -0
  346. package/dist/{sparkline-CWlJDKyh.d.cts → sparkline-RYly7bR0.d.cts} +5 -8
  347. package/dist/sparkline.cjs +1 -1
  348. package/dist/sparkline.d.cts +2 -1
  349. package/dist/sparkline.d.ts +2 -1
  350. package/dist/sparkline.js +1 -2
  351. package/dist/{stack-DVhJWaki.cjs → stack-BO4624CY.cjs} +3 -4
  352. package/dist/{stack-DVhJWaki.cjs.map → stack-BO4624CY.cjs.map} +1 -1
  353. package/dist/{stack-CpR6RGKd.d.ts → stack-BTWYIwLO.d.cts} +2 -4
  354. package/dist/{stack-CpR6RGKd.d.cts → stack-DR0eQTsB.d.ts} +1 -4
  355. package/dist/{stack-DRbwTeF3.js → stack-jVKvg2x_.js} +3 -4
  356. package/dist/{stack-DRbwTeF3.js.map → stack-jVKvg2x_.js.map} +1 -1
  357. package/dist/style.css +1 -1
  358. package/dist/{sweep-CbfR7--d.js → sweep-BpRPlhs6.js} +5 -6
  359. package/dist/{sweep-CbfR7--d.js.map → sweep-BpRPlhs6.js.map} +1 -1
  360. package/dist/{sweep-DaTEDDuC.cjs → sweep-Dnp6LDBz.cjs} +5 -6
  361. package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
  362. package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
  363. package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
  364. package/dist/{time-axis-VSX34_Tb.cjs → time-axis-B3VekUfX.cjs} +11 -11
  365. package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
  366. package/dist/{time-axis-Bc9eHX1r.js → time-axis-CLjqOakA.js} +10 -10
  367. package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-CLjqOakA.js.map} +1 -1
  368. package/dist/time.cjs +4 -6
  369. package/dist/time.cjs.map +1 -1
  370. package/dist/time.d.cts +1 -1
  371. package/dist/time.d.ts +1 -1
  372. package/dist/time.js +4 -5
  373. package/dist/treemap-25vHO_UK.d.cts +65 -0
  374. package/dist/treemap-BCXUbixd.d.ts +65 -0
  375. package/dist/treemap-C4glsx-g.js +293 -0
  376. package/dist/treemap-C4glsx-g.js.map +1 -0
  377. package/dist/treemap-CZk8kKFD.cjs +298 -0
  378. package/dist/treemap-CZk8kKFD.cjs.map +1 -0
  379. package/dist/treemap.cjs +3 -0
  380. package/dist/treemap.d.cts +3 -0
  381. package/dist/treemap.d.ts +3 -0
  382. package/dist/treemap.js +1 -0
  383. package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
  384. package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
  385. package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
  386. package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
  387. package/dist/{value-labels-IZIQPhfk.js → value-labels-C7GrhOXJ.js} +30 -10
  388. package/dist/value-labels-C7GrhOXJ.js.map +1 -0
  389. package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-DzaKIWKp.cjs} +30 -10
  390. package/dist/value-labels-DzaKIWKp.cjs.map +1 -0
  391. package/dist/value-labels.cjs +3 -5
  392. package/dist/value-labels.cjs.map +1 -1
  393. package/dist/value-labels.d.cts +5 -1
  394. package/dist/value-labels.d.ts +5 -1
  395. package/dist/value-labels.js +3 -4
  396. package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
  397. package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
  398. package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
  399. package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
  400. package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
  401. package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
  402. package/package.json +94 -214
  403. package/dist/bar-C-7zR2qp.cjs.map +0 -1
  404. package/dist/bar-jZEoao74.js.map +0 -1
  405. package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
  406. package/dist/cartesian-Cr0AF0nG.js.map +0 -1
  407. package/dist/chart-BF2CK9I_.js.map +0 -1
  408. package/dist/chart-CowF_lWY.cjs.map +0 -1
  409. package/dist/core-CegR_j55.js.map +0 -1
  410. package/dist/core-RzS9IQO5.cjs.map +0 -1
  411. package/dist/dom-CLF868Qs.cjs.map +0 -1
  412. package/dist/dom-vP3IcMak.js.map +0 -1
  413. package/dist/export-chart-9w8t3rjZ.js.map +0 -1
  414. package/dist/export-chart-BhhYgksr.cjs.map +0 -1
  415. package/dist/fade-Cs74puQS.cjs.map +0 -1
  416. package/dist/fade-D3NxH5Qg.js.map +0 -1
  417. package/dist/features-BclHgg2W.cjs.map +0 -1
  418. package/dist/features-wASyHGic.js.map +0 -1
  419. package/dist/gauge-D-FYhuds.cjs.map +0 -1
  420. package/dist/gauge-Dh423FHh.js.map +0 -1
  421. package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
  422. package/dist/heatmap-DSZ2bVIa.js.map +0 -1
  423. package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
  424. package/dist/layout-B3hiqVEw.js.map +0 -1
  425. package/dist/layout-CtMBhNd9.cjs.map +0 -1
  426. package/dist/line-B3Ed6u7j.js.map +0 -1
  427. package/dist/line-fQbtP_jL.cjs.map +0 -1
  428. package/dist/morph-CqYDu1bY.cjs.map +0 -1
  429. package/dist/parliament-CpWnoEvG.cjs.map +0 -1
  430. package/dist/parliament-Dw0sOERi.js.map +0 -1
  431. package/dist/pie-BxTZt6Go.cjs.map +0 -1
  432. package/dist/pie-DzUXDTcn.js.map +0 -1
  433. package/dist/point-shapes-CGl4dugc.cjs.map +0 -1
  434. package/dist/point-shapes-DI84NNpI.js.map +0 -1
  435. package/dist/radar-CYPab_I4.js.map +0 -1
  436. package/dist/radar-CoGUNNSb.cjs.map +0 -1
  437. package/dist/sankey-B4PNKusJ.js.map +0 -1
  438. package/dist/sankey-Bacx4fVe.cjs.map +0 -1
  439. package/dist/scatter-DgMN9zRy.cjs.map +0 -1
  440. package/dist/scatter-kgtgR318.js.map +0 -1
  441. package/dist/sparkline-BQzt27Fr.js.map +0 -1
  442. package/dist/sparkline-BS9-hltA.cjs.map +0 -1
  443. package/dist/sweep-DaTEDDuC.cjs.map +0 -1
  444. package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
  445. package/dist/value-labels-IZIQPhfk.js.map +0 -1
@@ -0,0 +1,300 @@
1
+ const require_format = require("./format-CAE5ruy6.cjs");
2
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
3
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
4
+ // src/scales/ticks.ts
5
+ const E10 = Math.sqrt(50);
6
+ const E5 = Math.sqrt(10);
7
+ const E2 = Math.sqrt(2);
8
+ /**
9
+ * Integer tick indices `[i1, i2]` and an increment `inc`. A negative `inc`
10
+ * means "divide by -inc", which keeps decimal ticks exact (0.3, not
11
+ * 0.30000000000000004).
12
+ */
13
+ function tickSpec(start, stop, count) {
14
+ const step = (stop - start) / Math.max(0, count);
15
+ const power = Math.floor(Math.log10(step));
16
+ const error = step / 10 ** power;
17
+ const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;
18
+ let i1;
19
+ let i2;
20
+ let inc;
21
+ if (power < 0) {
22
+ inc = 10 ** -power / factor;
23
+ i1 = Math.round(start * inc);
24
+ i2 = Math.round(stop * inc);
25
+ if (i1 / inc < start) ++i1;
26
+ if (i2 / inc > stop) --i2;
27
+ inc = -inc;
28
+ } else {
29
+ inc = 10 ** power * factor;
30
+ i1 = Math.round(start / inc);
31
+ i2 = Math.round(stop / inc);
32
+ if (i1 * inc < start) ++i1;
33
+ if (i2 * inc > stop) --i2;
34
+ }
35
+ if (i2 < i1 && count >= .5 && count < 2) return tickSpec(start, stop, count * 2);
36
+ return [
37
+ i1,
38
+ i2,
39
+ inc
40
+ ];
41
+ }
42
+ /**
43
+ * Roughly `count` evenly spaced, "nice" values (multiples of 1, 2 or 5 × 10ⁿ)
44
+ * between `start` and `stop`, inclusive. Order follows `start → stop`.
45
+ */
46
+ function ticks(start, stop, count = 5) {
47
+ if (!(count > 0) || !Number.isFinite(start) || !Number.isFinite(stop)) return [];
48
+ if (start === stop) return [start];
49
+ const reverse = stop < start;
50
+ const [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
51
+ if (!(i2 >= i1)) return [];
52
+ const n = i2 - i1 + 1;
53
+ const out = new Array(n);
54
+ for (let i = 0; i < n; i++) {
55
+ const index = reverse ? i2 - i : i1 + i;
56
+ out[i] = inc < 0 ? index / -inc : index * inc;
57
+ }
58
+ return out;
59
+ }
60
+ /**
61
+ * Signed tick increment: positive values are the step, negative values `-k`
62
+ * mean a step of `1 / k`.
63
+ */
64
+ function tickIncrement(start, stop, count) {
65
+ return tickSpec(start, stop, count)[2];
66
+ }
67
+ /** Distance between ticks produced by {@link ticks} for the same arguments. */
68
+ function tickStep(start, stop, count = 5) {
69
+ const reverse = stop < start;
70
+ const inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
71
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
72
+ }
73
+ /**
74
+ * Extend `[start, stop]` to round tick values, e.g. `[0.2, 9.7] → [0, 10]`.
75
+ * Iterates because rounding can change the ideal step; if the step does not
76
+ * settle (e.g. very low `count` around zero keeps doubling the domain), the
77
+ * domain is returned unchanged, matching d3.
78
+ */
79
+ function niceDomain(start, stop, count = 5) {
80
+ if (!Number.isFinite(start) || !Number.isFinite(stop) || start === stop || !(count > 0)) return [start, stop];
81
+ const reverse = stop < start;
82
+ let lo = reverse ? stop : start;
83
+ let hi = reverse ? start : stop;
84
+ let prev;
85
+ for (let i = 0; i < 10; i++) {
86
+ const step = tickIncrement(lo, hi, count);
87
+ if (step === prev) return reverse ? [hi, lo] : [lo, hi];
88
+ if (step > 0) {
89
+ lo = Math.floor(lo / step) * step;
90
+ hi = Math.ceil(hi / step) * step;
91
+ } else if (step < 0) {
92
+ lo = Math.ceil(lo * step) / step;
93
+ hi = Math.floor(hi * step) / step;
94
+ } else break;
95
+ prev = step;
96
+ }
97
+ return [start, stop];
98
+ }
99
+ // src/components/axis.ts
100
+ /** Ticks for a linear scale, labelled with a shared precision. */
101
+ function linearTicks(scale, options = {}) {
102
+ const { count = 5, format, locale } = options;
103
+ const [d0, d1] = scale.domain;
104
+ const fmt = require_format.formatTicks(tickStep(d0, d1, count), format, locale);
105
+ return scale.ticks(count).map((value) => ({
106
+ value,
107
+ position: scale(value),
108
+ label: fmt(value)
109
+ }));
110
+ }
111
+ /** Ticks at the center of every band. */
112
+ function bandTicks(scale, format = String) {
113
+ return scale.domain.map((key, i) => ({
114
+ value: key,
115
+ position: scale.at(i) + scale.bandwidth / 2,
116
+ label: format(key, i)
117
+ }));
118
+ }
119
+ /** Whether labels are laid out along x (horizontal axes). */
120
+ const isHorizontal = (position) => position === "top" || position === "bottom";
121
+ /**
122
+ * Keep every n-th tick (smallest n) so labels do not overlap along the axis.
123
+ * The first and the last tick are always kept: when the last one does not
124
+ * land on the step, it replaces the last kept tick if they would collide.
125
+ */
126
+ function thinTicks(ticks, position, fontSize, gap = 8) {
127
+ if (ticks.length < 2) return ticks.slice();
128
+ const size = (tick) => isHorizontal(position) ? require_layout.estimateTextWidth(tick.label, fontSize) : fontSize * require_layout.LINE_HEIGHT;
129
+ const sizes = ticks.map(size);
130
+ const fitsBetween = (i, j) => Math.abs(ticks[j].position - ticks[i].position) >= (sizes[i] + sizes[j]) / 2 + gap;
131
+ const last = ticks.length - 1;
132
+ const span = Math.abs(ticks[last].position - ticks[0].position);
133
+ const total = sizes.reduce((sum, size) => sum + size + gap, 0);
134
+ const first = span > 0 ? Math.max(1, Math.floor(total / span)) : last;
135
+ for (let step = first; step <= last; step++) {
136
+ let fits = true;
137
+ for (let i = step; i <= last && fits; i += step) fits = fitsBetween(i - step, i);
138
+ if (!fits) continue;
139
+ const kept = [];
140
+ for (let i = 0; i <= last; i += step) kept.push(i);
141
+ const tail = kept[kept.length - 1];
142
+ if (tail !== last) {
143
+ if (fitsBetween(tail, last)) kept.push(last);
144
+ else if (kept.length > 1 && fitsBetween(kept[kept.length - 2], last)) kept[kept.length - 1] = last;
145
+ }
146
+ return kept.map((i) => ticks[i]);
147
+ }
148
+ return ticks.slice(0, 1);
149
+ }
150
+ /** Pixels an axis occupies perpendicular to the plot edge (for margins). */
151
+ function axisSize(position, ticks, fontSize, options = {}) {
152
+ const { tickSize = 0, tickPadding = 8 } = options;
153
+ if (ticks.length === 0) return 0;
154
+ const labels = isHorizontal(position) ? fontSize * require_layout.LINE_HEIGHT : ticks.reduce((max, t) => Math.max(max, require_layout.estimateTextWidth(t.label, fontSize)), 0) + 3;
155
+ return Math.ceil(labels + tickSize + tickPadding);
156
+ }
157
+ /** Space between the tick labels and the axis title. */
158
+ const TITLE_GAP = 6;
159
+ /** Pixels an axis title adds to the axis (for margins): none without a title. */
160
+ const axisTitleSize = (title, fontSize) => title ? Math.ceil(fontSize * require_layout.LINE_HEIGHT) + TITLE_GAP : 0;
161
+ /**
162
+ * Render the title of an axis as `<text class="tc-axis-title tc-axis-title-{position}">`,
163
+ * past the labels of `ticks` and centered on the plot: along the axis at the
164
+ * bottom, turned 90° beside the plot to read away from it (bottom to top on
165
+ * the left, top to bottom on the right).
166
+ */
167
+ function axisTitle(position, ticks, area, title, fontSize) {
168
+ const reach = axisSize(position, ticks, fontSize) + TITLE_GAP;
169
+ const sign = position === "left" ? -1 : 1;
170
+ const side = reach + fontSize * require_layout.LINE_HEIGHT / 2;
171
+ return require_vnode.h("text", {
172
+ key: `axis-title-${position}`,
173
+ class: `tc-axis-title tc-axis-title-${position}`,
174
+ transform: position === "bottom" ? `translate(${require_layout.round(area.x + area.width / 2)},${require_layout.round(area.y + area.height + reach)})` : `translate(${require_layout.round(position === "left" ? area.x - side : area.x + area.width + side)},${require_layout.round(area.y + area.height / 2)}) rotate(${sign * 90})`,
175
+ dy: position === "bottom" ? "0.71em" : "0.32em",
176
+ "text-anchor": "middle",
177
+ "aria-hidden": "true"
178
+ }, title);
179
+ }
180
+ /**
181
+ * Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
182
+ * with one `<g class="tc-tick">` per tick, keyed by value so ticks can
183
+ * transition when the scale changes.
184
+ */
185
+ function axis(options) {
186
+ const { position, ticks, area, tickSize = 0, tickPadding = 8, line = false } = options;
187
+ const horizontal = isHorizontal(position);
188
+ const sign = position === "top" || position === "left" ? -1 : 1;
189
+ const offset = sign * (tickSize + tickPadding);
190
+ const edge = position === "top" ? area.y : position === "bottom" ? area.y + area.height : position === "left" ? area.x : area.x + area.width;
191
+ const label = horizontal ? {
192
+ y: offset,
193
+ dy: position === "top" ? "0em" : "0.71em",
194
+ "text-anchor": "middle"
195
+ } : {
196
+ x: offset,
197
+ dy: "0.32em",
198
+ "text-anchor": position === "left" ? "end" : "start"
199
+ };
200
+ const tickLine = horizontal ? { y2: sign * tickSize } : { x2: sign * tickSize };
201
+ return require_vnode.h("g", {
202
+ key: `axis-${position}`,
203
+ class: [
204
+ "tc-axis",
205
+ horizontal ? "tc-axis-x" : "tc-axis-y",
206
+ `tc-axis-${position}`
207
+ ],
208
+ "aria-hidden": "true"
209
+ }, line && require_vnode.h("line", horizontal ? {
210
+ class: "tc-axis-line",
211
+ x1: area.x,
212
+ x2: area.x + area.width,
213
+ y1: edge,
214
+ y2: edge
215
+ } : {
216
+ class: "tc-axis-line",
217
+ x1: edge,
218
+ x2: edge,
219
+ y1: area.y,
220
+ y2: area.y + area.height
221
+ }), ticks.map((tick) => require_vnode.h("g", {
222
+ key: tick.value,
223
+ class: "tc-tick",
224
+ style: horizontal ? `transform:translate(${require_layout.round(tick.position)}px,${require_layout.round(edge)}px)` : `transform:translate(${require_layout.round(edge)}px,${require_layout.round(tick.position)}px)`
225
+ }, tickSize > 0 && require_vnode.h("line", {
226
+ class: "tc-tick-line",
227
+ ...tickLine
228
+ }), require_vnode.h("text", {
229
+ class: "tc-tick-label",
230
+ ...label
231
+ }, tick.label))));
232
+ }
233
+ Object.defineProperty(exports, "axis", {
234
+ enumerable: true,
235
+ get: function() {
236
+ return axis;
237
+ }
238
+ });
239
+ Object.defineProperty(exports, "axisSize", {
240
+ enumerable: true,
241
+ get: function() {
242
+ return axisSize;
243
+ }
244
+ });
245
+ Object.defineProperty(exports, "axisTitle", {
246
+ enumerable: true,
247
+ get: function() {
248
+ return axisTitle;
249
+ }
250
+ });
251
+ Object.defineProperty(exports, "axisTitleSize", {
252
+ enumerable: true,
253
+ get: function() {
254
+ return axisTitleSize;
255
+ }
256
+ });
257
+ Object.defineProperty(exports, "bandTicks", {
258
+ enumerable: true,
259
+ get: function() {
260
+ return bandTicks;
261
+ }
262
+ });
263
+ Object.defineProperty(exports, "linearTicks", {
264
+ enumerable: true,
265
+ get: function() {
266
+ return linearTicks;
267
+ }
268
+ });
269
+ Object.defineProperty(exports, "niceDomain", {
270
+ enumerable: true,
271
+ get: function() {
272
+ return niceDomain;
273
+ }
274
+ });
275
+ Object.defineProperty(exports, "thinTicks", {
276
+ enumerable: true,
277
+ get: function() {
278
+ return thinTicks;
279
+ }
280
+ });
281
+ Object.defineProperty(exports, "tickIncrement", {
282
+ enumerable: true,
283
+ get: function() {
284
+ return tickIncrement;
285
+ }
286
+ });
287
+ Object.defineProperty(exports, "tickStep", {
288
+ enumerable: true,
289
+ get: function() {
290
+ return tickStep;
291
+ }
292
+ });
293
+ Object.defineProperty(exports, "ticks", {
294
+ enumerable: true,
295
+ get: function() {
296
+ return ticks;
297
+ }
298
+ });
299
+
300
+ //# sourceMappingURL=axis-YfAerNBA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axis-YfAerNBA.cjs","names":["formatTicks","estimateTextWidth","LINE_HEIGHT","h","round"],"sources":["../src/scales/ticks.ts","../src/components/axis.ts"],"sourcesContent":["const E10 = Math.sqrt(50)\nconst E5 = Math.sqrt(10)\nconst E2 = Math.sqrt(2)\n\n/**\n * Integer tick indices `[i1, i2]` and an increment `inc`. A negative `inc`\n * means \"divide by -inc\", which keeps decimal ticks exact (0.3, not\n * 0.30000000000000004).\n */\nfunction tickSpec(start: number, stop: number, count: number): [number, number, number] {\n const step = (stop - start) / Math.max(0, count)\n const power = Math.floor(Math.log10(step))\n const error = step / 10 ** power\n const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1\n let i1: number\n let i2: number\n let inc: number\n if (power < 0) {\n inc = 10 ** -power / factor\n i1 = Math.round(start * inc)\n i2 = Math.round(stop * inc)\n if (i1 / inc < start) ++i1\n if (i2 / inc > stop) --i2\n inc = -inc\n } else {\n inc = 10 ** power * factor\n i1 = Math.round(start / inc)\n i2 = Math.round(stop / inc)\n if (i1 * inc < start) ++i1\n if (i2 * inc > stop) --i2\n }\n if (i2 < i1 && count >= 0.5 && count < 2) return tickSpec(start, stop, count * 2)\n return [i1, i2, inc]\n}\n\n/**\n * Roughly `count` evenly spaced, \"nice\" values (multiples of 1, 2 or 5 × 10ⁿ)\n * between `start` and `stop`, inclusive. Order follows `start → stop`.\n */\nexport function ticks(start: number, stop: number, count = 5): number[] {\n if (!(count > 0) || !Number.isFinite(start) || !Number.isFinite(stop)) return []\n if (start === stop) return [start]\n const reverse = stop < start\n const [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count)\n if (!(i2 >= i1)) return []\n const n = i2 - i1 + 1\n const out = new Array<number>(n)\n for (let i = 0; i < n; i++) {\n const index = reverse ? i2 - i : i1 + i\n out[i] = inc < 0 ? index / -inc : index * inc\n }\n return out\n}\n\n/**\n * Signed tick increment: positive values are the step, negative values `-k`\n * mean a step of `1 / k`.\n */\nexport function tickIncrement(start: number, stop: number, count: number): number {\n return tickSpec(start, stop, count)[2]\n}\n\n/** Distance between ticks produced by {@link ticks} for the same arguments. */\nexport function tickStep(start: number, stop: number, count = 5): number {\n const reverse = stop < start\n const inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count)\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc)\n}\n\n/**\n * Extend `[start, stop]` to round tick values, e.g. `[0.2, 9.7] → [0, 10]`.\n * Iterates because rounding can change the ideal step; if the step does not\n * settle (e.g. very low `count` around zero keeps doubling the domain), the\n * domain is returned unchanged, matching d3.\n */\nexport function niceDomain(start: number, stop: number, count = 5): [number, number] {\n if (!Number.isFinite(start) || !Number.isFinite(stop) || start === stop || !(count > 0)) {\n return [start, stop]\n }\n const reverse = stop < start\n let lo = reverse ? stop : start\n let hi = reverse ? start : stop\n let prev: number | undefined\n for (let i = 0; i < 10; i++) {\n const step = tickIncrement(lo, hi, count)\n if (step === prev) return reverse ? [hi, lo] : [lo, hi]\n if (step > 0) {\n lo = Math.floor(lo / step) * step\n hi = Math.ceil(hi / step) * step\n } else if (step < 0) {\n lo = Math.ceil(lo * step) / step\n hi = Math.floor(hi * step) / step\n } else {\n break\n }\n prev = step\n }\n return [start, stop]\n}\n","import { formatTicks, type Locale, type NumberFormat } from '../format.ts'\nimport { estimateTextWidth, LINE_HEIGHT, type Rect, round } from '../layout.ts'\nimport type { BandKey, BandScale } from '../scales/band.ts'\nimport type { LinearScale } from '../scales/linear.ts'\nimport { tickStep } from '../scales/ticks.ts'\nimport { h, type VNode } from '../vnode.ts'\n\nexport type AxisPosition = 'top' | 'right' | 'bottom' | 'left'\n\n/** A single axis tick: its data value, pixel position along the axis and label. */\nexport interface Tick {\n value: number | BandKey\n position: number\n label: string\n}\n\nexport interface LinearTicksOptions {\n /** Approximate number of ticks. Defaults to `5`. */\n count?: number\n format?: NumberFormat\n locale?: Locale\n}\n\n/** Ticks for a linear scale, labelled with a shared precision. */\nexport function linearTicks(scale: LinearScale, options: LinearTicksOptions = {}): Tick[] {\n const { count = 5, format, locale } = options\n const [d0, d1] = scale.domain\n const fmt = formatTicks(tickStep(d0, d1, count), format, locale)\n return scale.ticks(count).map((value) => ({ value, position: scale(value), label: fmt(value) }))\n}\n\n/** Ticks at the center of every band. */\nexport function bandTicks(\n scale: BandScale,\n format: (key: BandKey, index: number) => string = String,\n): Tick[] {\n return scale.domain.map((key, i) => ({\n value: key,\n position: scale.at(i) + scale.bandwidth / 2,\n label: format(key, i),\n }))\n}\n\n/** Whether labels are laid out along x (horizontal axes). */\nconst isHorizontal = (position: AxisPosition): boolean =>\n position === 'top' || position === 'bottom'\n\n/**\n * Keep every n-th tick (smallest n) so labels do not overlap along the axis.\n * The first and the last tick are always kept: when the last one does not\n * land on the step, it replaces the last kept tick if they would collide.\n */\nexport function thinTicks(\n ticks: readonly Tick[],\n position: AxisPosition,\n fontSize: number,\n gap = 8,\n): Tick[] {\n if (ticks.length < 2) return ticks.slice()\n const size = (tick: Tick) =>\n isHorizontal(position) ? estimateTextWidth(tick.label, fontSize) : fontSize * LINE_HEIGHT\n const sizes = ticks.map(size)\n const fitsBetween = (i: number, j: number) =>\n Math.abs((ticks[j] as Tick).position - (ticks[i] as Tick).position) >=\n ((sizes[i] as number) + (sizes[j] as number)) / 2 + gap\n\n const last = ticks.length - 1\n // Start from the step the total label size demands, instead of trying every one.\n const span = Math.abs((ticks[last] as Tick).position - (ticks[0] as Tick).position)\n const total = sizes.reduce((sum, size) => sum + size + gap, 0)\n const first = span > 0 ? Math.max(1, Math.floor(total / span)) : last\n for (let step = first; step <= last; step++) {\n let fits = true\n for (let i = step; i <= last && fits; i += step) fits = fitsBetween(i - step, i)\n if (!fits) continue\n\n const kept: number[] = []\n for (let i = 0; i <= last; i += step) kept.push(i)\n const tail = kept[kept.length - 1] as number\n if (tail !== last) {\n if (fitsBetween(tail, last)) kept.push(last)\n else if (kept.length > 1 && fitsBetween(kept[kept.length - 2] as number, last))\n kept[kept.length - 1] = last\n }\n return kept.map((i) => ticks[i] as Tick)\n }\n return ticks.slice(0, 1)\n}\n\nexport interface AxisOptions {\n position: AxisPosition\n ticks: readonly Tick[]\n /** Plot area the axis is attached to. */\n area: Rect\n /** Length of tick marks. Defaults to `0` (labels only). */\n tickSize?: number\n /** Distance between tick marks and labels. Defaults to `8`. */\n tickPadding?: number\n /** Draw the axis line along the plot edge. Defaults to `false`. */\n line?: boolean\n}\n\n/** Pixels an axis occupies perpendicular to the plot edge (for margins). */\nexport function axisSize(\n position: AxisPosition,\n ticks: readonly Tick[],\n fontSize: number,\n options: { tickSize?: number; tickPadding?: number } = {},\n): number {\n const { tickSize = 0, tickPadding = 8 } = options\n if (ticks.length === 0) return 0\n // Beside the plot, labels are as wide as their text: a little slack covers\n // fonts wider than the estimate, so they do not touch the chart's edge.\n const labels = isHorizontal(position)\n ? fontSize * LINE_HEIGHT\n : ticks.reduce((max, t) => Math.max(max, estimateTextWidth(t.label, fontSize)), 0) + 3\n return Math.ceil(labels + tickSize + tickPadding)\n}\n\n/** Space between the tick labels and the axis title. */\nconst TITLE_GAP = 6\n\n/** Pixels an axis title adds to the axis (for margins): none without a title. */\nexport const axisTitleSize = (title: string | undefined, fontSize: number): number =>\n title ? Math.ceil(fontSize * LINE_HEIGHT) + TITLE_GAP : 0\n\n/**\n * Render the title of an axis as `<text class=\"tc-axis-title tc-axis-title-{position}\">`,\n * past the labels of `ticks` and centered on the plot: along the axis at the\n * bottom, turned 90° beside the plot to read away from it (bottom to top on\n * the left, top to bottom on the right).\n */\nexport function axisTitle(\n position: 'right' | 'bottom' | 'left',\n ticks: readonly Tick[],\n area: Rect,\n title: string,\n fontSize: number,\n): VNode {\n const reach = axisSize(position, ticks, fontSize) + TITLE_GAP\n const sign = position === 'left' ? -1 : 1\n const side = reach + (fontSize * LINE_HEIGHT) / 2\n return h(\n 'text',\n {\n key: `axis-title-${position}`,\n class: `tc-axis-title tc-axis-title-${position}`,\n transform:\n position === 'bottom'\n ? `translate(${round(area.x + area.width / 2)},${round(area.y + area.height + reach)})`\n : `translate(${round(position === 'left' ? area.x - side : area.x + area.width + side)},${round(area.y + area.height / 2)}) rotate(${sign * 90})`,\n dy: position === 'bottom' ? '0.71em' : '0.32em',\n 'text-anchor': 'middle',\n 'aria-hidden': 'true',\n },\n title,\n )\n}\n\n/**\n * Render an axis as `<g class=\"tc-axis tc-axis-{x|y} tc-axis-{position}\">`\n * with one `<g class=\"tc-tick\">` per tick, keyed by value so ticks can\n * transition when the scale changes.\n */\nexport function axis(options: AxisOptions): VNode {\n const { position, ticks, area, tickSize = 0, tickPadding = 8, line = false } = options\n const horizontal = isHorizontal(position)\n const sign = position === 'top' || position === 'left' ? -1 : 1\n const offset = sign * (tickSize + tickPadding)\n\n // Edge of the plot the axis sits on.\n const edge =\n position === 'top'\n ? area.y\n : position === 'bottom'\n ? area.y + area.height\n : position === 'left'\n ? area.x\n : area.x + area.width\n\n const label = horizontal\n ? { y: offset, dy: position === 'top' ? '0em' : '0.71em', 'text-anchor': 'middle' }\n : { x: offset, dy: '0.32em', 'text-anchor': position === 'left' ? 'end' : 'start' }\n\n const tickLine = horizontal ? { y2: sign * tickSize } : { x2: sign * tickSize }\n\n return h(\n 'g',\n {\n // Keyed, so an axis keeps its nodes when layers around it come and go.\n key: `axis-${position}`,\n class: ['tc-axis', horizontal ? 'tc-axis-x' : 'tc-axis-y', `tc-axis-${position}`],\n 'aria-hidden': 'true',\n },\n line &&\n h(\n 'line',\n horizontal\n ? { class: 'tc-axis-line', x1: area.x, x2: area.x + area.width, y1: edge, y2: edge }\n : { class: 'tc-axis-line', x1: edge, x2: edge, y1: area.y, y2: area.y + area.height },\n ),\n ticks.map((tick) =>\n h(\n 'g',\n {\n key: tick.value,\n class: 'tc-tick',\n // An inline style (not the transform attribute) so CSS can transition it.\n style: horizontal\n ? `transform:translate(${round(tick.position)}px,${round(edge)}px)`\n : `transform:translate(${round(edge)}px,${round(tick.position)}px)`,\n },\n tickSize > 0 && h('line', { class: 'tc-tick-line', ...tickLine }),\n h('text', { class: 'tc-tick-label', ...label }, tick.label),\n ),\n ),\n )\n}\n"],"mappings":";;;;AAAA,MAAM,MAAM,KAAK,KAAK,EAAE;AACxB,MAAM,KAAK,KAAK,KAAK,EAAE;AACvB,MAAM,KAAK,KAAK,KAAK,CAAC;;;;;;AAOtB,SAAS,SAAS,OAAe,MAAc,OAAyC;CACtF,MAAM,QAAQ,OAAO,SAAS,KAAK,IAAI,GAAG,KAAK;CAC/C,MAAM,QAAQ,KAAK,MAAM,KAAK,MAAM,IAAI,CAAC;CACzC,MAAM,QAAQ,OAAO,MAAM;CAC3B,MAAM,SAAS,SAAS,MAAM,KAAK,SAAS,KAAK,IAAI,SAAS,KAAK,IAAI;CACvE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,QAAQ,GAAG;EACb,MAAM,MAAM,CAAC,QAAQ;EACrB,KAAK,KAAK,MAAM,QAAQ,GAAG;EAC3B,KAAK,KAAK,MAAM,OAAO,GAAG;EAC1B,IAAI,KAAK,MAAM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A,EAAE,QAAQ;EAAE,OAAO;EAAiB,GAAG;CAAM,GAAG,KAAK,KAAK,CAC5D,CACF,CACF;AACF"}
@@ -1,4 +1,3 @@
1
- //#region src/scales/band.d.ts
2
1
  /** Category identifier used by band and point scales. */
3
2
  type BandKey = string | number;
4
3
  interface BandScaleOptions {
@@ -45,6 +44,4 @@ declare function point(domain: readonly BandKey[], range: readonly [number, numb
45
44
  padding?: number;
46
45
  align?: number;
47
46
  }): BandScale;
48
- //#endregion
49
- export { point as a, band as i, BandScale as n, BandScaleOptions as r, BandKey as t };
50
- //# sourceMappingURL=band-DTcNDAFO.d.ts.map
47
+ export { point as a, band as i, BandScale as n, BandScaleOptions as r, BandKey as t };
@@ -1,4 +1,3 @@
1
- //#region src/scales/band.d.ts
2
1
  /** Category identifier used by band and point scales. */
3
2
  type BandKey = string | number;
4
3
  interface BandScaleOptions {
@@ -45,6 +44,4 @@ declare function point(domain: readonly BandKey[], range: readonly [number, numb
45
44
  padding?: number;
46
45
  align?: number;
47
46
  }): BandScale;
48
- //#endregion
49
- export { point as a, band as i, BandScale as n, BandScaleOptions as r, BandKey as t };
50
- //# sourceMappingURL=band-DTcNDAFO.d.cts.map
47
+ export { point as a, band as i, BandScale as n, BandScaleOptions as r, BandKey as t };
@@ -1,11 +1,12 @@
1
- import { i as insets, n as estimateTextWidth, r as innerRect } from "./layout-B3hiqVEw.js";
2
- import { t as h } from "./vnode-tCWItoUH.js";
3
- import { E as bandTicks, O as thinTicks, T as axisSize, _ as valueAxis, a as labelFormatter, d as seriesAttrs, f as seriesKey, i as finishLayout, l as plottable, m as seriesTable, n as categoryInteraction, o as labelKey, p as seriesLegend, t as cartesianLayout, u as resolveLabels, x as band } from "./cartesian-Cr0AF0nG.js";
4
- import { n as feature } from "./features-wASyHGic.js";
5
- import { r as cleanSeries, t as cleanData } from "./clean-o1vDEhFV.js";
6
- import { n as stackSeries, t as stackBounds } from "./stack-DRbwTeF3.js";
7
- import { n as hbarPath, t as barPath } from "./bar-DM16NUvV.js";
8
- //#region src/charts/horizontal.ts
1
+ import { n as feature } from "./features-B55rwpQC.js";
2
+ import { n as hbarPath, t as barPath } from "./bar-CgpC2EpX.js";
3
+ import { t as h } from "./vnode-_EMUqysL.js";
4
+ import { _ as seriesTable, a as labelFormatter, b as valueAxis, d as resolveLabels, f as seriesAttrs, g as seriesScale, h as seriesLegend, i as finishLayout, l as plottable, m as seriesKey, n as categoryInteraction, o as labelKey, p as seriesAxes, t as cartesianLayout, w as band } from "./cartesian-BrPqb5Qn.js";
5
+ import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
6
+ import { a as bandTicks, i as axisTitleSize, n as axisSize, s as thinTicks } from "./axis-MMaVoSWB.js";
7
+ import { n as estimateTextWidth, o as plotFrame } from "./layout-DqAte3H8.js";
8
+ import { n as stackSeries, t as stackBounds } from "./stack-jVKvg2x_.js";
9
+ // src/charts/horizontal.ts
9
10
  /**
10
11
  * Cartesian layout with categories along y (labels on the left) and values
11
12
  * along x (labels at the bottom), for horizontal bars. Only bar charts use
@@ -14,9 +15,8 @@ import { n as hbarPath, t as barPath } from "./bar-DM16NUvV.js";
14
15
  function horizontalLayout(options, ctx, layout) {
15
16
  const yOptions = options.y ?? {};
16
17
  const xOptions = options.x ?? {};
17
- const { fontSize, width, height } = ctx;
18
+ const { fontSize, width } = ctx;
18
19
  const overhang = layout.overhang ?? 0;
19
- const pad = insets(options.padding);
20
20
  const labels = resolveLabels(options.data);
21
21
  const format = labelFormatter(options, ctx);
22
22
  const value = valueAxis(options, ctx, layout, Math.round(width / 80));
@@ -29,22 +29,21 @@ function horizontalLayout(options, ctx, layout) {
29
29
  label: format(label, i)
30
30
  }));
31
31
  const edgeLabel = (tick) => showValues && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0;
32
- const margins = {
32
+ const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({
33
33
  top: pad.top + Math.max(overhang, 4),
34
- right: pad.right + Math.max(edgeLabel(probeValues[probeValues.length - 1]), overhang, 8),
35
- bottom: pad.bottom + Math.max(showValues ? axisSize("bottom", probeValues, fontSize) : 0, overhang, 4),
36
- left: pad.left + Math.max(showCategories ? axisSize("left", probeCategories, fontSize) : 0, edgeLabel(probeValues[0]), overhang, 8)
37
- };
38
- const area = innerRect(width, height, margins);
34
+ bottom: pad.bottom + Math.max((showValues ? axisSize("bottom", probeValues, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize), overhang, 4),
35
+ start: pad.start + Math.max((showCategories ? axisSize("left", probeCategories, fontSize) : 0) + axisTitleSize(xOptions.title, fontSize), edgeLabel(probeValues[0]), overhang, 8),
36
+ end: pad.end + Math.max(edgeLabel(probeValues[probeValues.length - 1]), overhang, 8)
37
+ }));
39
38
  const keys = labels.map(labelKey);
40
39
  const x = band(keys, [area.y, area.y + area.height], {
41
40
  paddingInner: layout.paddingInner ?? .3,
42
41
  paddingOuter: layout.paddingOuter ?? .15
43
42
  });
44
- const y = value.scale([area.x, area.x + area.width]);
43
+ const y = value.scale(range());
45
44
  const yTicks = thinTicks(value.ticks(y), "bottom", fontSize);
46
45
  const xTicks = showCategories ? thinTicks(bandTicks(x, (_, i) => format(labels[i], i)), "left", fontSize) : [];
47
- return finishLayout(options, ctx, overhang, {
46
+ return finishLayout(options, ctx, side, overhang, {
48
47
  area,
49
48
  labels,
50
49
  x,
@@ -54,8 +53,7 @@ function horizontalLayout(options, ctx, layout) {
54
53
  yTicks
55
54
  }, keys);
56
55
  }
57
- //#endregion
58
- //#region src/charts/bar.ts
56
+ // src/charts/bar.ts
59
57
  /**
60
58
  * Bar chart: vertical bars per category, grouped side by side or stacked,
61
59
  * growing from zero (negative values grow down).
@@ -78,36 +76,51 @@ const bar = {
78
76
  const count = resolveLabels(options.data).length;
79
77
  const isLine = (index) => (series[index]?.type ?? "bar") !== "bar";
80
78
  const lineKeys = series.filter((_, index) => isLine(index)).map(seriesKey);
81
- const stackHidden = lineKeys.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...lineKeys]) : ctx.hidden;
79
+ const axisOf = seriesAxes(options);
80
+ const onY2 = (index) => axisOf(series[index]).second;
81
+ const apart = series.filter((_, index) => isLine(index) || onY2(index)).map(seriesKey);
82
+ const stackHidden = apart.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...apart]) : ctx.hidden;
82
83
  const stacks = stacked ? stackSeries(series, count, {
83
84
  percent: stacked === "percent",
84
85
  hidden: stackHidden
85
86
  }) : null;
87
+ const inStack = (index) => !!stacks && !isLine(index) && !onY2(index);
86
88
  const layoutOptions = {
87
89
  scale: "band",
88
90
  zero: true,
89
91
  paddingInner: groupPadding,
90
92
  paddingOuter: groupPadding / 2,
91
- ...stacks ? { values: [...stackBounds(stacks), ...series.flatMap((s, index) => isLine(index) ? s.values : [])] } : {},
93
+ zero2: series.some((s, index) => onY2(index) && s.type !== "line"),
94
+ ...stacks ? { values: [...stackBounds(stacks), ...series.flatMap((s, index) => isLine(index) && !onY2(index) ? s.values : [])] } : {},
92
95
  ...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
93
96
  };
94
97
  const layout = horizontal ? horizontalLayout(options, ctx, layoutOptions) : cartesianLayout(options, ctx, layoutOptions);
95
- const { x, y, labels } = layout;
98
+ const { x, labels } = layout;
99
+ const scaleOf = (index) => seriesScale(layout, series[index]);
96
100
  const slots = /* @__PURE__ */ new Map();
101
+ let used = 0;
102
+ let stackColumn = -1;
97
103
  series.forEach((s, index) => {
98
- if (!ctx.hidden.has(seriesKey(s)) && !isLine(index)) slots.set(index, slots.size);
104
+ if (ctx.hidden.has(seriesKey(s)) || isLine(index)) return;
105
+ if (!inStack(index)) slots.set(index, used++);
106
+ else {
107
+ if (stackColumn < 0) stackColumn = used++;
108
+ slots.set(index, stackColumn);
109
+ }
99
110
  });
100
111
  const order = [...slots.keys()];
101
- const columns = stacks ? 1 : Math.max(1, slots.size);
102
- const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth - (stacks ? 0 : gap * (columns - 1))) / columns));
103
- const groupWidth = barWidth * columns + (stacks ? 0 : gap * (columns - 1));
112
+ const columns = Math.max(1, used);
113
+ const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth - gap * (columns - 1)) / columns));
114
+ const groupWidth = barWidth * columns + gap * (columns - 1);
104
115
  const offset = (x.bandwidth - groupWidth) / 2;
105
- const barLeft = (seriesIndex, i) => x.at(i) + offset + (stacks ? 0 : (slots.get(seriesIndex) ?? 0) * (barWidth + gap));
116
+ const slotAt = (slot) => x.range[1] < x.range[0] ? columns - 1 - slot : slot;
117
+ const barLeft = (seriesIndex, i) => x.at(i) + offset + slotAt(slots.get(seriesIndex) ?? 0) * (barWidth + gap);
106
118
  /** Data extent of a bar: from zero to the value, or its stacked segment. */
107
119
  const segment = (seriesIndex, i) => {
108
- if (stacks) return stacks[seriesIndex]?.[i] ?? null;
109
- const v = series[seriesIndex]?.values[i];
110
- return plottable(v, options.y) ? {
120
+ if (inStack(seriesIndex)) return stacks?.[seriesIndex]?.[i] ?? null;
121
+ const s = series[seriesIndex];
122
+ const v = s?.values[i];
123
+ return plottable(v, axisOf(s).axis) ? {
111
124
  y0: 0,
112
125
  y1: v
113
126
  } : null;
@@ -116,6 +129,7 @@ const bar = {
116
129
  let up = -1;
117
130
  let down = -1;
118
131
  for (const index of order) {
132
+ if (!inStack(index)) continue;
119
133
  const seg = segment(index, i);
120
134
  if (!seg) continue;
121
135
  if (seg.y1 > seg.y0) up = index;
@@ -126,7 +140,8 @@ const bar = {
126
140
  down
127
141
  };
128
142
  });
129
- ctx.onHitTest(categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
143
+ const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
144
+ const y = scaleOf(seriesIndex);
130
145
  if (isLine(seriesIndex)) {
131
146
  const across = x.at(i) + x.bandwidth / 2;
132
147
  return horizontal ? {
@@ -165,28 +180,27 @@ const bar = {
165
180
  }, (px, py, i) => {
166
181
  const across = horizontal ? py : px;
167
182
  const along = horizontal ? px : py;
168
- if (stacks) {
169
- const left = barLeft(0, i);
170
- if (across < left - gap / 2 || across > left + barWidth + gap / 2) return void 0;
171
- return order.find((index) => {
172
- const seg = segment(index, i);
173
- if (!seg) return false;
174
- const a = y(seg.y0);
175
- const b = y(seg.y1);
176
- return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2;
177
- });
178
- }
179
- const slot = Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap));
180
- const seriesIndex = order[slot];
183
+ const column = slotAt(Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap)));
184
+ if (column === stackColumn) return order.find((index) => {
185
+ if (!inStack(index)) return false;
186
+ const seg = segment(index, i);
187
+ if (!seg) return false;
188
+ const y = scaleOf(index);
189
+ const a = y(seg.y0);
190
+ const b = y(seg.y1);
191
+ return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2;
192
+ });
193
+ const seriesIndex = order.find((index) => slots.get(index) === column);
181
194
  return seriesIndex !== void 0 && segment(seriesIndex, i) ? seriesIndex : void 0;
182
- }));
195
+ });
183
196
  const groups = series.map((s, index) => slots.has(index) && h("g", seriesAttrs(s, index), labels.map((label, i) => {
184
197
  const seg = segment(index, i);
185
198
  if (!seg) return null;
199
+ const y = scaleOf(index);
186
200
  const negative = seg.y1 < seg.y0;
187
- const away = (negative ? 1 : -1) * (horizontal ? -1 : 1);
201
+ const away = Math.sign(y(seg.y1) - y(seg.y0));
188
202
  const inner = seg.y0 === 0 ? 0 : away * gap;
189
- const rounded = !stacks || (negative ? outer[i]?.down : outer[i]?.up) === index;
203
+ const rounded = !inStack(index) || (negative ? outer[i]?.down : outer[i]?.up) === index;
190
204
  const draw = horizontal ? hbarPath : barPath;
191
205
  return h("path", {
192
206
  key: labelKey(label),
@@ -199,13 +213,15 @@ const bar = {
199
213
  });
200
214
  })));
201
215
  const paths = lineKeys.length ? feature("line") : null;
202
- const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
203
216
  const lines = series.map((s, index) => {
204
217
  if (!paths) return null;
205
218
  if (!isLine(index) || ctx.hidden.has(seriesKey(s))) return null;
219
+ const y = scaleOf(index);
220
+ const axis = axisOf(s).axis;
221
+ const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
206
222
  const points = labels.map((_, i) => {
207
223
  const v = s.values[i];
208
- if (!plottable(v, options.y)) return null;
224
+ if (!plottable(v, axis)) return null;
209
225
  const center = x.at(i) + x.bandwidth / 2;
210
226
  return horizontal ? [y(v), center] : [center, y(v)];
211
227
  });
@@ -218,21 +234,23 @@ const bar = {
218
234
  d: paths.linePath(points, { curve })
219
235
  }));
220
236
  });
221
- return [
222
- h("defs", { key: "defs" }, layout.clip.def),
223
- layout.background,
224
- h("g", {
225
- key: "series",
226
- class: "tc-series-list",
227
- "clip-path": layout.clip.url
228
- }, groups, lines),
229
- layout.foreground
230
- ];
237
+ return {
238
+ content: [
239
+ h("defs", { key: "defs" }, layout.clip.def),
240
+ layout.background,
241
+ h("g", {
242
+ key: "series",
243
+ class: "tc-series-list",
244
+ "clip-path": layout.clip.url
245
+ }, groups, lines),
246
+ layout.foreground
247
+ ],
248
+ interaction
249
+ };
231
250
  },
232
251
  legend: (options) => seriesLegend(options.data),
233
252
  table: (options, ctx, limit) => seriesTable(options, ctx, limit)
234
253
  };
235
- //#endregion
236
254
  export { bar as t };
237
255
 
238
- //# sourceMappingURL=bar-jZEoao74.js.map
256
+ //# sourceMappingURL=bar-BOcRcArc.js.map