@tabler/charts 0.2.0 → 0.4.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 (420) hide show
  1. package/README.md +165 -17
  2. package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
  3. package/dist/annotations--m-HzMBM.cjs.map +1 -0
  4. package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
  5. package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
  6. package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
  7. package/dist/annotations-DGITy6th.js.map +1 -0
  8. package/dist/annotations.cjs +2 -2
  9. package/dist/annotations.d.cts +1 -1
  10. package/dist/annotations.d.ts +1 -1
  11. package/dist/annotations.js +2 -2
  12. package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
  13. package/dist/area-BN0uE9R0.js.map +1 -0
  14. package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
  15. package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
  16. package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
  17. package/dist/area-D_N8b4Ng.cjs.map +1 -0
  18. package/dist/area.cjs +1 -1
  19. package/dist/area.d.cts +1 -1
  20. package/dist/area.d.ts +1 -1
  21. package/dist/area.js +1 -1
  22. package/dist/axis-BzBkkC5X.cjs +305 -0
  23. package/dist/axis-BzBkkC5X.cjs.map +1 -0
  24. package/dist/axis-C5obgdJt.js +240 -0
  25. package/dist/axis-C5obgdJt.js.map +1 -0
  26. package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
  27. package/dist/bar-BrmfXugT.cjs.map +1 -0
  28. package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
  29. package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
  30. package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
  31. package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
  32. package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
  33. package/dist/bar-D_KKd2fL.js.map +1 -0
  34. package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
  35. package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  36. package/dist/bar.cjs +1 -1
  37. package/dist/bar.d.cts +1 -1
  38. package/dist/bar.d.ts +1 -1
  39. package/dist/bar.js +1 -1
  40. package/dist/calendar-B7843sQu.d.cts +106 -0
  41. package/dist/calendar-BG_q_NC_.cjs +507 -0
  42. package/dist/calendar-BG_q_NC_.cjs.map +1 -0
  43. package/dist/calendar-CF3gfDQk.js +502 -0
  44. package/dist/calendar-CF3gfDQk.js.map +1 -0
  45. package/dist/calendar-D10_ki1S.d.ts +106 -0
  46. package/dist/calendar.cjs +3 -0
  47. package/dist/calendar.d.cts +3 -0
  48. package/dist/calendar.d.ts +3 -0
  49. package/dist/calendar.js +1 -0
  50. package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
  51. package/dist/candlestick-B1onjo1o.js.map +1 -0
  52. package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
  53. package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
  54. package/dist/candlestick-BwrFKak_.cjs.map +1 -0
  55. package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
  56. package/dist/candlestick.cjs +3 -3
  57. package/dist/candlestick.d.cts +1 -1
  58. package/dist/candlestick.d.ts +1 -1
  59. package/dist/candlestick.js +3 -3
  60. package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
  61. package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
  62. package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
  63. package/dist/cartesian-COglz544.js.map +1 -0
  64. package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
  65. package/dist/chart-B97FBRCd.js.map +1 -0
  66. package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
  67. package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
  68. package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
  69. package/dist/chart-GUmmjJ7S.cjs.map +1 -0
  70. package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
  71. package/dist/core-7fgM3su0.js.map +1 -0
  72. package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
  73. package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
  74. package/dist/core-BZTrsPxc.cjs.map +1 -0
  75. package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
  76. package/dist/core.cjs +45 -31
  77. package/dist/core.d.cts +23 -18
  78. package/dist/core.d.ts +23 -18
  79. package/dist/core.js +28 -23
  80. package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
  81. package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
  82. package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
  83. package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
  84. package/dist/decimate.cjs +1 -1
  85. package/dist/decimate.js +1 -1
  86. package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
  87. package/dist/dom-C33zvtPo.cjs.map +1 -0
  88. package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
  89. package/dist/dom-CTse6Rvd.js.map +1 -0
  90. package/dist/end-labels-B3oRvjxw.js +114 -0
  91. package/dist/end-labels-B3oRvjxw.js.map +1 -0
  92. package/dist/end-labels-CS-fnpp-.cjs +119 -0
  93. package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
  94. package/dist/end-labels.cjs +11 -0
  95. package/dist/end-labels.cjs.map +1 -0
  96. package/dist/end-labels.d.cts +6 -0
  97. package/dist/end-labels.d.ts +6 -0
  98. package/dist/end-labels.js +11 -0
  99. package/dist/end-labels.js.map +1 -0
  100. package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
  101. package/dist/export-chart-BOH_nfcH.js.map +1 -0
  102. package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
  103. package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
  104. package/dist/export.cjs +5 -3
  105. package/dist/export.cjs.map +1 -1
  106. package/dist/export.d.cts +4 -3
  107. package/dist/export.d.ts +4 -3
  108. package/dist/export.js +5 -4
  109. package/dist/export.js.map +1 -1
  110. package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
  111. package/dist/fade-CDrQjnDz.js.map +1 -0
  112. package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
  113. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  114. package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
  115. package/dist/features-B55rwpQC.js.map +1 -0
  116. package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
  117. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  118. package/dist/fit-BPyPRnsK.js +16 -0
  119. package/dist/fit-BPyPRnsK.js.map +1 -0
  120. package/dist/fit-D4MIIQQz.cjs +21 -0
  121. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  122. package/dist/funnel-B9ridzNx.d.cts +50 -0
  123. package/dist/funnel-CFEEulw_.cjs +244 -0
  124. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  125. package/dist/funnel-CYCv8cq2.js +239 -0
  126. package/dist/funnel-CYCv8cq2.js.map +1 -0
  127. package/dist/funnel-FogM8flk.d.ts +50 -0
  128. package/dist/funnel.cjs +3 -0
  129. package/dist/funnel.d.cts +3 -0
  130. package/dist/funnel.d.ts +3 -0
  131. package/dist/funnel.js +1 -0
  132. package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
  133. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  134. package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
  135. package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
  136. package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
  137. package/dist/gauge-DiTk5aWO.js.map +1 -0
  138. package/dist/gauge.cjs +1 -1
  139. package/dist/gauge.d.cts +1 -1
  140. package/dist/gauge.d.ts +1 -1
  141. package/dist/gauge.js +1 -1
  142. package/dist/heat-Bsqq4zw9.js +38 -0
  143. package/dist/heat-Bsqq4zw9.js.map +1 -0
  144. package/dist/heat-DYsivvDq.cjs +49 -0
  145. package/dist/heat-DYsivvDq.cjs.map +1 -0
  146. package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
  147. package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
  148. package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
  149. package/dist/heatmap-J7fxG7MM.js.map +1 -0
  150. package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
  151. package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
  152. package/dist/heatmap.cjs +1 -1
  153. package/dist/heatmap.d.cts +1 -1
  154. package/dist/heatmap.d.ts +1 -1
  155. package/dist/heatmap.js +1 -1
  156. package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
  157. package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
  158. package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
  159. package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
  160. package/dist/hydrate.cjs +2 -2
  161. package/dist/hydrate.js +2 -2
  162. package/dist/index.cjs +69 -45
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.d.cts +24 -19
  165. package/dist/index.d.ts +24 -19
  166. package/dist/index.js +51 -37
  167. package/dist/index.js.map +1 -1
  168. package/dist/interaction-DXYSjgnP.cjs +32 -0
  169. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  170. package/dist/interaction-En1KlwFO.js +21 -0
  171. package/dist/interaction-En1KlwFO.js.map +1 -0
  172. package/dist/layout-CYerDebD.d.cts +29 -0
  173. package/dist/layout-CYerDebD.d.ts +29 -0
  174. package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
  175. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  176. package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
  177. package/dist/layout-DqAte3H8.js.map +1 -0
  178. package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
  179. package/dist/line-CXH0L10d.js.map +1 -0
  180. package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
  181. package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
  182. package/dist/line-DHbYCQy4.cjs.map +1 -0
  183. package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
  184. package/dist/line.cjs +3 -3
  185. package/dist/line.d.cts +1 -1
  186. package/dist/line.d.ts +1 -1
  187. package/dist/line.js +3 -3
  188. package/dist/log.cjs +1 -1
  189. package/dist/log.js +1 -1
  190. package/dist/map-BirylCmT.d.cts +156 -0
  191. package/dist/map-CYp6x-uS.js +784 -0
  192. package/dist/map-CYp6x-uS.js.map +1 -0
  193. package/dist/map-ChwSgooH.cjs +795 -0
  194. package/dist/map-ChwSgooH.cjs.map +1 -0
  195. package/dist/map-DNqog2Xs.d.ts +156 -0
  196. package/dist/map.cjs +4 -0
  197. package/dist/map.d.cts +3 -0
  198. package/dist/map.d.ts +3 -0
  199. package/dist/map.js +1 -0
  200. package/dist/maps/world.cjs +875 -0
  201. package/dist/maps/world.cjs.map +1 -0
  202. package/dist/maps/world.d.cts +2 -0
  203. package/dist/maps/world.d.ts +2 -0
  204. package/dist/maps/world.js +874 -0
  205. package/dist/maps/world.js.map +1 -0
  206. package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
  207. package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
  208. package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
  209. package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
  210. package/dist/morph.cjs +2 -2
  211. package/dist/morph.js +2 -2
  212. package/dist/others-CuNdpvjd.d.cts +31 -0
  213. package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
  214. package/dist/others-DBIGE6jr.js.map +1 -0
  215. package/dist/others-DBO4Kjwl.d.ts +29 -0
  216. package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
  217. package/dist/others-WfjCsjqT.cjs.map +1 -0
  218. package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
  219. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  220. package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
  221. package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
  222. package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
  223. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  224. package/dist/parliament.cjs +1 -1
  225. package/dist/parliament.d.cts +1 -1
  226. package/dist/parliament.d.ts +1 -1
  227. package/dist/parliament.js +1 -1
  228. package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
  229. package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
  230. package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
  231. package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
  232. package/dist/patterns.cjs +2 -2
  233. package/dist/patterns.d.cts +1 -1
  234. package/dist/patterns.d.ts +1 -1
  235. package/dist/patterns.js +2 -2
  236. package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
  237. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  238. package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
  239. package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
  240. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  241. package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
  242. package/dist/percentage-bar.cjs +1 -1
  243. package/dist/percentage-bar.d.cts +1 -1
  244. package/dist/percentage-bar.d.ts +1 -1
  245. package/dist/percentage-bar.js +1 -1
  246. package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
  247. package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
  248. package/dist/pie-Ch6Bx0ih.js.map +1 -0
  249. package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
  250. package/dist/pie-Cll1OrVZ.cjs.map +1 -0
  251. package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
  252. package/dist/pie.cjs +1 -1
  253. package/dist/pie.d.cts +1 -1
  254. package/dist/pie.d.ts +1 -1
  255. package/dist/pie.js +1 -1
  256. package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
  257. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  258. package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
  259. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  260. package/dist/point-shapes.cjs +6 -4
  261. package/dist/point-shapes.cjs.map +1 -1
  262. package/dist/point-shapes.d.cts +2 -2
  263. package/dist/point-shapes.d.ts +2 -2
  264. package/dist/point-shapes.js +7 -5
  265. package/dist/point-shapes.js.map +1 -1
  266. package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
  267. package/dist/radar-Bg-IiIWB.js.map +1 -0
  268. package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
  269. package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
  270. package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
  271. package/dist/radar-wDyX17S3.cjs.map +1 -0
  272. package/dist/radar.cjs +1 -1
  273. package/dist/radar.d.cts +1 -1
  274. package/dist/radar.d.ts +1 -1
  275. package/dist/radar.js +1 -1
  276. package/dist/range-bar-BnKjJP89.cjs +348 -0
  277. package/dist/range-bar-BnKjJP89.cjs.map +1 -0
  278. package/dist/range-bar-C4cRaaQE.d.ts +123 -0
  279. package/dist/range-bar-D32dIQOY.d.cts +123 -0
  280. package/dist/range-bar-Dx6ce0J1.js +343 -0
  281. package/dist/range-bar-Dx6ce0J1.js.map +1 -0
  282. package/dist/range-bar.cjs +3 -0
  283. package/dist/range-bar.d.cts +3 -0
  284. package/dist/range-bar.d.ts +3 -0
  285. package/dist/range-bar.js +1 -0
  286. package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
  287. package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
  288. package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
  289. package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
  290. package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
  291. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  292. package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
  293. package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
  294. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  295. package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
  296. package/dist/sankey.cjs +1 -1
  297. package/dist/sankey.d.cts +1 -1
  298. package/dist/sankey.d.ts +1 -1
  299. package/dist/sankey.js +1 -1
  300. package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
  301. package/dist/scatter-0Z7K_YUz.js.map +1 -0
  302. package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
  303. package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
  304. package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
  305. package/dist/scatter-CZ8do3Up.cjs.map +1 -0
  306. package/dist/scatter.cjs +1 -1
  307. package/dist/scatter.d.cts +2 -2
  308. package/dist/scatter.d.ts +2 -2
  309. package/dist/scatter.js +1 -1
  310. package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
  311. package/dist/slice-labels-C9ucsBVW.js +88 -0
  312. package/dist/slice-labels-C9ucsBVW.js.map +1 -0
  313. package/dist/slice-labels-CbFiy46l.cjs +93 -0
  314. package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
  315. package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
  316. package/dist/slice-labels.cjs +11 -0
  317. package/dist/slice-labels.cjs.map +1 -0
  318. package/dist/slice-labels.d.cts +6 -0
  319. package/dist/slice-labels.d.ts +6 -0
  320. package/dist/slice-labels.js +11 -0
  321. package/dist/slice-labels.js.map +1 -0
  322. package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
  323. package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
  324. package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
  325. package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
  326. package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
  327. package/dist/sparkline-_dxwtdli.js.map +1 -0
  328. package/dist/sparkline.cjs +1 -1
  329. package/dist/sparkline.d.cts +1 -1
  330. package/dist/sparkline.d.ts +1 -1
  331. package/dist/sparkline.js +1 -1
  332. package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
  333. package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
  334. package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
  335. package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
  336. package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
  337. package/dist/style.css +1 -1
  338. package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
  339. package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
  340. package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
  341. package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
  342. package/dist/time.cjs +3 -3
  343. package/dist/time.js +3 -3
  344. package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
  345. package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
  346. package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
  347. package/dist/treemap-PulGXZv0.cjs.map +1 -0
  348. package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
  349. package/dist/treemap-lbYxb-7h.js.map +1 -0
  350. package/dist/treemap.cjs +1 -1
  351. package/dist/treemap.d.cts +1 -1
  352. package/dist/treemap.d.ts +1 -1
  353. package/dist/treemap.js +1 -1
  354. package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
  355. package/dist/value-labels-B0VeheyE.js.map +1 -0
  356. package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
  357. package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
  358. package/dist/value-labels.cjs +2 -2
  359. package/dist/value-labels.d.cts +1 -1
  360. package/dist/value-labels.d.ts +1 -1
  361. package/dist/value-labels.js +2 -2
  362. package/dist/zoom.cjs +810 -0
  363. package/dist/zoom.cjs.map +1 -0
  364. package/dist/zoom.d.cts +34 -0
  365. package/dist/zoom.d.ts +34 -0
  366. package/dist/zoom.js +806 -0
  367. package/dist/zoom.js.map +1 -0
  368. package/package.json +120 -235
  369. package/dist/annotations-D0YQ0IoA.js.map +0 -1
  370. package/dist/annotations-DdRdeBUB.cjs.map +0 -1
  371. package/dist/area-0-L1bG9B.js.map +0 -1
  372. package/dist/area-4eRs3c0K.cjs.map +0 -1
  373. package/dist/bar-BNZ3GhIw.js.map +0 -1
  374. package/dist/bar-Da6dE_nI.cjs.map +0 -1
  375. package/dist/candlestick-BHQkQfxH.js.map +0 -1
  376. package/dist/candlestick-CYCQXgky.cjs.map +0 -1
  377. package/dist/cartesian-CI2x6N7N.js.map +0 -1
  378. package/dist/cartesian-DV02PsBe.cjs.map +0 -1
  379. package/dist/chart-DWn9v6qw.js.map +0 -1
  380. package/dist/chart-e2VqomCI.cjs.map +0 -1
  381. package/dist/core-BKRQvPAT.js.map +0 -1
  382. package/dist/core-DIOC61up.cjs.map +0 -1
  383. package/dist/dom-CuceR8gt.js.map +0 -1
  384. package/dist/dom-D_g13XWY.cjs.map +0 -1
  385. package/dist/export-chart-83UYH48t.js.map +0 -1
  386. package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
  387. package/dist/fade-DVTkhrFU.cjs.map +0 -1
  388. package/dist/fade-GGxcBdss.js.map +0 -1
  389. package/dist/features-BMxkqCyS.js.map +0 -1
  390. package/dist/features-DCXEvoya.cjs.map +0 -1
  391. package/dist/gauge-DXkjXNCD.cjs.map +0 -1
  392. package/dist/gauge-ts0kqN1-.js.map +0 -1
  393. package/dist/heatmap-19BGJTKF.js.map +0 -1
  394. package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
  395. package/dist/layout-DmrrLjwN.js.map +0 -1
  396. package/dist/layout-JY2aR-yE.cjs.map +0 -1
  397. package/dist/line-DO66LtwH.js.map +0 -1
  398. package/dist/line-Dbt6KFRK.cjs.map +0 -1
  399. package/dist/others-DWdK7vKp.cjs.map +0 -1
  400. package/dist/others-J7NCAMA0.js.map +0 -1
  401. package/dist/parliament-Cru4IcuM.js.map +0 -1
  402. package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
  403. package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
  404. package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
  405. package/dist/pie-BpjvSPnz.cjs.map +0 -1
  406. package/dist/pie-CVsc-6qD.js.map +0 -1
  407. package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
  408. package/dist/point-shapes-DD2Ektzm.js.map +0 -1
  409. package/dist/radar-BR-mumDd.js.map +0 -1
  410. package/dist/radar-HPDrIdzc.cjs.map +0 -1
  411. package/dist/sankey-D6JeZfK5.js.map +0 -1
  412. package/dist/sankey-fCoo1cpz.cjs.map +0 -1
  413. package/dist/scatter-C0TWjFpW.js.map +0 -1
  414. package/dist/scatter-DVqB_fP9.cjs.map +0 -1
  415. package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
  416. package/dist/sparkline-XO_TqCNP.js.map +0 -1
  417. package/dist/treemap-BWpEUlDh.cjs.map +0 -1
  418. package/dist/treemap-CQdavQ9u.js.map +0 -1
  419. package/dist/value-labels-BBuSi4i0.js.map +0 -1
  420. package/dist/value-labels-BV9keAuL.cjs.map +0 -1
@@ -1,216 +1,11 @@
1
- import { i as formatTicks, n as formatDetail } from "./format-it1kepFG.js";
2
- import { a as mirrorSides, i as insets, n as estimateTextWidth, o as round, r as innerRect, t as LINE_HEIGHT } from "./layout-DmrrLjwN.js";
1
+ import { a as bandTicks, c as niceDomain, d as ticks, i as axisTitleSize, n as axisSize, o as linearTicks, r as axisTitle, s as thinTicks, t as axis } from "./axis-C5obgdJt.js";
2
+ import { n as estimateTextWidth, o as plotFrame, s as round, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
3
3
  import { t as h } from "./vnode-_EMUqysL.js";
4
- import { n as feature, r as features } from "./features-BMxkqCyS.js";
4
+ import { n as feature, r as features } from "./features-B55rwpQC.js";
5
+ import { i as formatTicks, n as formatDetail } from "./format-it1kepFG.js";
5
6
  import { t as extent } from "./extent-DOV8rs-6.js";
6
7
  import { i as finite } from "./clean-CkoQobGv.js";
7
8
  import { n as keyOf, r as legendItems, t as groupAttrs } from "./named-BOiBah6I.js";
8
- // src/scales/ticks.ts
9
- const E10 = Math.sqrt(50);
10
- const E5 = Math.sqrt(10);
11
- const E2 = Math.sqrt(2);
12
- /**
13
- * Integer tick indices `[i1, i2]` and an increment `inc`. A negative `inc`
14
- * means "divide by -inc", which keeps decimal ticks exact (0.3, not
15
- * 0.30000000000000004).
16
- */
17
- function tickSpec(start, stop, count) {
18
- const step = (stop - start) / Math.max(0, count);
19
- const power = Math.floor(Math.log10(step));
20
- const error = step / 10 ** power;
21
- const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;
22
- let i1;
23
- let i2;
24
- let inc;
25
- if (power < 0) {
26
- inc = 10 ** -power / factor;
27
- i1 = Math.round(start * inc);
28
- i2 = Math.round(stop * inc);
29
- if (i1 / inc < start) ++i1;
30
- if (i2 / inc > stop) --i2;
31
- inc = -inc;
32
- } else {
33
- inc = 10 ** power * factor;
34
- i1 = Math.round(start / inc);
35
- i2 = Math.round(stop / inc);
36
- if (i1 * inc < start) ++i1;
37
- if (i2 * inc > stop) --i2;
38
- }
39
- if (i2 < i1 && count >= .5 && count < 2) return tickSpec(start, stop, count * 2);
40
- return [
41
- i1,
42
- i2,
43
- inc
44
- ];
45
- }
46
- /**
47
- * Roughly `count` evenly spaced, "nice" values (multiples of 1, 2 or 5 × 10ⁿ)
48
- * between `start` and `stop`, inclusive. Order follows `start → stop`.
49
- */
50
- function ticks(start, stop, count = 5) {
51
- if (!(count > 0) || !Number.isFinite(start) || !Number.isFinite(stop)) return [];
52
- if (start === stop) return [start];
53
- const reverse = stop < start;
54
- const [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
55
- if (!(i2 >= i1)) return [];
56
- const n = i2 - i1 + 1;
57
- const out = new Array(n);
58
- for (let i = 0; i < n; i++) {
59
- const index = reverse ? i2 - i : i1 + i;
60
- out[i] = inc < 0 ? index / -inc : index * inc;
61
- }
62
- return out;
63
- }
64
- /**
65
- * Signed tick increment: positive values are the step, negative values `-k`
66
- * mean a step of `1 / k`.
67
- */
68
- function tickIncrement(start, stop, count) {
69
- return tickSpec(start, stop, count)[2];
70
- }
71
- /** Distance between ticks produced by {@link ticks} for the same arguments. */
72
- function tickStep(start, stop, count = 5) {
73
- const reverse = stop < start;
74
- const inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
75
- return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
76
- }
77
- /**
78
- * Extend `[start, stop]` to round tick values, e.g. `[0.2, 9.7] → [0, 10]`.
79
- * Iterates because rounding can change the ideal step; if the step does not
80
- * settle (e.g. very low `count` around zero keeps doubling the domain), the
81
- * domain is returned unchanged, matching d3.
82
- */
83
- function niceDomain(start, stop, count = 5) {
84
- if (!Number.isFinite(start) || !Number.isFinite(stop) || start === stop || !(count > 0)) return [start, stop];
85
- const reverse = stop < start;
86
- let lo = reverse ? stop : start;
87
- let hi = reverse ? start : stop;
88
- let prev;
89
- for (let i = 0; i < 10; i++) {
90
- const step = tickIncrement(lo, hi, count);
91
- if (step === prev) return reverse ? [hi, lo] : [lo, hi];
92
- if (step > 0) {
93
- lo = Math.floor(lo / step) * step;
94
- hi = Math.ceil(hi / step) * step;
95
- } else if (step < 0) {
96
- lo = Math.ceil(lo * step) / step;
97
- hi = Math.floor(hi * step) / step;
98
- } else break;
99
- prev = step;
100
- }
101
- return [start, stop];
102
- }
103
- // src/components/axis.ts
104
- /** Ticks for a linear scale, labelled with a shared precision. */
105
- function linearTicks(scale, options = {}) {
106
- const { count = 5, format, locale } = options;
107
- const [d0, d1] = scale.domain;
108
- const fmt = formatTicks(tickStep(d0, d1, count), format, locale);
109
- return scale.ticks(count).map((value) => ({
110
- value,
111
- position: scale(value),
112
- label: fmt(value)
113
- }));
114
- }
115
- /** Ticks at the center of every band. */
116
- function bandTicks(scale, format = String) {
117
- return scale.domain.map((key, i) => ({
118
- value: key,
119
- position: scale.at(i) + scale.bandwidth / 2,
120
- label: format(key, i)
121
- }));
122
- }
123
- /** Whether labels are laid out along x (horizontal axes). */
124
- const isHorizontal = (position) => position === "top" || position === "bottom";
125
- /**
126
- * Keep every n-th tick (smallest n) so labels do not overlap along the axis.
127
- * The first and the last tick are always kept: when the last one does not
128
- * land on the step, it replaces the last kept tick if they would collide.
129
- */
130
- function thinTicks(ticks, position, fontSize, gap = 8) {
131
- if (ticks.length < 2) return ticks.slice();
132
- const size = (tick) => isHorizontal(position) ? estimateTextWidth(tick.label, fontSize) : fontSize * LINE_HEIGHT;
133
- const sizes = ticks.map(size);
134
- const fitsBetween = (i, j) => Math.abs(ticks[j].position - ticks[i].position) >= (sizes[i] + sizes[j]) / 2 + gap;
135
- const last = ticks.length - 1;
136
- const span = Math.abs(ticks[last].position - ticks[0].position);
137
- const total = sizes.reduce((sum, size) => sum + size + gap, 0);
138
- const first = span > 0 ? Math.max(1, Math.floor(total / span)) : last;
139
- for (let step = first; step <= last; step++) {
140
- let fits = true;
141
- for (let i = step; i <= last && fits; i += step) fits = fitsBetween(i - step, i);
142
- if (!fits) continue;
143
- const kept = [];
144
- for (let i = 0; i <= last; i += step) kept.push(i);
145
- const tail = kept[kept.length - 1];
146
- if (tail !== last) {
147
- if (fitsBetween(tail, last)) kept.push(last);
148
- else if (kept.length > 1 && fitsBetween(kept[kept.length - 2], last)) kept[kept.length - 1] = last;
149
- }
150
- return kept.map((i) => ticks[i]);
151
- }
152
- return ticks.slice(0, 1);
153
- }
154
- /** Pixels an axis occupies perpendicular to the plot edge (for margins). */
155
- function axisSize(position, ticks, fontSize, options = {}) {
156
- const { tickSize = 0, tickPadding = 8 } = options;
157
- if (ticks.length === 0) return 0;
158
- const labels = isHorizontal(position) ? fontSize * LINE_HEIGHT : ticks.reduce((max, t) => Math.max(max, estimateTextWidth(t.label, fontSize)), 0) + 3;
159
- return Math.ceil(labels + tickSize + tickPadding);
160
- }
161
- /**
162
- * Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
163
- * with one `<g class="tc-tick">` per tick, keyed by value so ticks can
164
- * transition when the scale changes.
165
- */
166
- function axis(options) {
167
- const { position, ticks, area, tickSize = 0, tickPadding = 8, line = false } = options;
168
- const horizontal = isHorizontal(position);
169
- const sign = position === "top" || position === "left" ? -1 : 1;
170
- const offset = sign * (tickSize + tickPadding);
171
- const edge = position === "top" ? area.y : position === "bottom" ? area.y + area.height : position === "left" ? area.x : area.x + area.width;
172
- const label = horizontal ? {
173
- y: offset,
174
- dy: position === "top" ? "0em" : "0.71em",
175
- "text-anchor": "middle"
176
- } : {
177
- x: offset,
178
- dy: "0.32em",
179
- "text-anchor": position === "left" ? "end" : "start"
180
- };
181
- const tickLine = horizontal ? { y2: sign * tickSize } : { x2: sign * tickSize };
182
- return h("g", {
183
- key: `axis-${position}`,
184
- class: [
185
- "tc-axis",
186
- horizontal ? "tc-axis-x" : "tc-axis-y",
187
- `tc-axis-${position}`
188
- ],
189
- "aria-hidden": "true"
190
- }, line && h("line", horizontal ? {
191
- class: "tc-axis-line",
192
- x1: area.x,
193
- x2: area.x + area.width,
194
- y1: edge,
195
- y2: edge
196
- } : {
197
- class: "tc-axis-line",
198
- x1: edge,
199
- x2: edge,
200
- y1: area.y,
201
- y2: area.y + area.height
202
- }), ticks.map((tick) => h("g", {
203
- key: tick.value,
204
- class: "tc-tick",
205
- style: horizontal ? `transform:translate(${round(tick.position)}px,${round(edge)}px)` : `transform:translate(${round(edge)}px,${round(tick.position)}px)`
206
- }, tickSize > 0 && h("line", {
207
- class: "tc-tick-line",
208
- ...tickLine
209
- }), h("text", {
210
- class: "tc-tick-label",
211
- ...label
212
- }, tick.label))));
213
- }
214
9
  // src/components/grid.ts
215
10
  /**
216
11
  * Render grid lines as `<g class="tc-grid tc-grid-{x|y}">`. The line at
@@ -351,8 +146,36 @@ function linear(domain, range, options = {}) {
351
146
  // src/charts/cartesian.ts
352
147
  /** A label as a `key` for keyed rendering (dates by their timestamp). */
353
148
  const labelKey = (label) => label instanceof Date ? label.getTime() : label;
149
+ /**
150
+ * The options a chart type draws: the ones given, or only the categories of
151
+ * their `view` (`prepare()` of the chart types that can be zoomed).
152
+ */
153
+ const windowed = (options) => options.view || options.zoom ? feature("zoom").window(options) : options;
354
154
  /** Stable key of a series: its `id`, or its name. */
355
155
  const seriesKey = keyOf;
156
+ /**
157
+ * Whether the chart draws a second value axis: a series asks for it with
158
+ * `axis: 'y2'`, and the values run along y (not in horizontal bars).
159
+ */
160
+ const hasY2 = (options) => options.orientation !== "horizontal" && options.data.series.some((s) => s.axis === "y2");
161
+ /**
162
+ * The value axis a series is read on: a function giving each series'
163
+ * axis options, and whether it is the second one.
164
+ */
165
+ function seriesAxes(options) {
166
+ const second = hasY2(options);
167
+ const y = {
168
+ second: false,
169
+ axis: options.y ?? {}
170
+ };
171
+ const y2 = {
172
+ second: true,
173
+ axis: options.y2 ?? {}
174
+ };
175
+ return (series) => second && series?.axis === "y2" ? y2 : y;
176
+ }
177
+ /** The scale of a series: the second one for series on `y2`. */
178
+ const seriesScale = (layout, series) => layout.y2 && series?.axis === "y2" ? layout.y2 : layout.y;
356
179
  /** Legend entries for series-based charts. */
357
180
  const seriesLegend = (data) => legendItems(data.series);
358
181
  /** Categories from `data.labels`, or `1…n` for the longest series. */
@@ -400,6 +223,23 @@ const markerShape = (options) => {
400
223
  const { shapes, patterns } = options;
401
224
  return shapes ?? patterns === true ? features["point-shapes"] : void 0;
402
225
  };
226
+ /**
227
+ * A point of the series in color slot `slot`: a circle, or the slot's marker
228
+ * when the chart has point shapes (see `markerShape`).
229
+ */
230
+ function pointMark(shape, slot, key, cls, cx, cy, r) {
231
+ return shape ? h("path", {
232
+ key,
233
+ class: [cls, "tc-marker"],
234
+ d: shape(slot, cx, cy, r)
235
+ }) : h("circle", {
236
+ key,
237
+ class: cls,
238
+ cx,
239
+ cy,
240
+ r
241
+ });
242
+ }
403
243
  /** The tick count asked for on an axis (a number up to 100), or `auto`. */
404
244
  const tickCount = (axis, auto) => Math.min(finite(axis?.ticks) ?? auto, 100);
405
245
  /** Y domain from the data and axis options. */
@@ -444,11 +284,20 @@ function notesFeature(options) {
444
284
  * measure the labels with (their positions mean nothing). `auto` is the
445
285
  * tick count the plot has room for, unless the axis asks for its own.
446
286
  */
447
- function valueAxis(options, ctx, layout, auto) {
448
- const axis = options.y ?? {};
287
+ function valueAxis(options, ctx, layout, auto, which) {
288
+ const second = which === "y2";
289
+ const axis = (second ? options.y2 : options.y) ?? {};
449
290
  const count = tickCount(axis, Math.max(2, auto));
450
- const domain = valueDomain(options.data, axis, layout.zero, count, ctx.hidden, layout.values, notesFeature(options)?.values(options.annotations));
451
- const format = layout.tickFormat ?? axis.format;
291
+ let domain;
292
+ if (second) {
293
+ const own = options.data.series.filter((s) => s.axis === "y2");
294
+ const shown = own.filter((s) => !ctx.hidden.has(seriesKey(s)));
295
+ domain = domainOf((shown.length ? shown : own).flatMap((s) => s.values), axis, layout.zero2 ?? layout.zero, count);
296
+ } else domain = valueDomain(which === "y" ? {
297
+ ...options.data,
298
+ series: options.data.series.filter((s) => s.axis !== "y2")
299
+ } : options.data, axis, layout.zero, count, ctx.hidden, layout.values, notesFeature(options)?.values(options.annotations));
300
+ const format = second ? axis.format : layout.tickFormat ?? axis.format;
452
301
  const scale = (range) => valueScale(domain, range, axis);
453
302
  const ticks = (of) => valueTicks(of, axis, count, format, ctx.locale);
454
303
  return {
@@ -461,12 +310,14 @@ function valueAxis(options, ctx, layout, auto) {
461
310
  * Finish a layout that has its plot area, scales and ticks with what is
462
311
  * drawn around the marks: grid lines and annotation bands below them,
463
312
  * annotation lines and the axes above. Values run along y and categories
464
- * along x, or the other way round when `horizontal`.
313
+ * along x, or the other way round when `horizontal`. The value axis (the
314
+ * category axis when `horizontal`) sits on the start `side`.
465
315
  */
466
- function finishLayout(options, ctx, overhang, plot, keys, time) {
467
- const { area, x, y, xTicks, yTicks, horizontal: flip } = plot;
316
+ function finishLayout(options, ctx, side, overhang, plot, keys, time) {
317
+ const { area, x, y, xTicks, yTicks, y2Ticks, horizontal: flip } = plot;
468
318
  const xOptions = options.x ?? {};
469
- const side = ctx.rtl ? "right" : "left";
319
+ const rotate = turned(options, !flip && !time && xOptions.show !== false);
320
+ const opposite = side === "left" ? "right" : "left";
470
321
  const notes = notesFeature(options)?.layers(options.annotations, {
471
322
  area,
472
323
  horizontal: flip,
@@ -485,8 +336,20 @@ function finishLayout(options, ctx, overhang, plot, keys, time) {
485
336
  position: flip ? side : "bottom",
486
337
  ticks: xTicks,
487
338
  area,
488
- line: xOptions.line === true
339
+ line: xOptions.line === true,
340
+ rotate
341
+ })];
342
+ const seconds = !!y2Ticks && options.y2?.show !== false && [axis({
343
+ position: opposite,
344
+ ticks: y2Ticks,
345
+ area
489
346
  })];
347
+ const title = (text, position, ticks) => !!text && axisTitle(position, ticks || [], area, text, ctx.fontSize, position === "bottom" && rotate);
348
+ const titles = [
349
+ title(options.y?.title, flip ? "bottom" : side, !!values && yTicks),
350
+ title(xOptions.title, flip ? side : "bottom", xTicks),
351
+ !!y2Ticks && title(options.y2?.title, opposite, !!seconds && y2Ticks)
352
+ ];
490
353
  const present = (parts) => parts.flatMap((part) => part || []);
491
354
  return {
492
355
  ...plot,
@@ -506,11 +369,15 @@ function finishLayout(options, ctx, overhang, plot, keys, time) {
506
369
  foreground: present([
507
370
  notes?.over,
508
371
  flip ? categories : values,
509
- flip ? values : categories
372
+ flip ? values : categories,
373
+ seconds,
374
+ ...titles
510
375
  ]),
511
376
  clip: plotClip(ctx, area, overhang)
512
377
  };
513
378
  }
379
+ /** Whether the category labels are turned 90° (`x.rotate`), when the axis can take it. */
380
+ const turned = (options, able) => able && options.x?.rotate === true;
514
381
  /** Compute scales, ticks, grid and axes shared by line, area and bar charts. */
515
382
  function cartesianLayout(options, ctx, layout) {
516
383
  const { data } = options;
@@ -520,14 +387,18 @@ function cartesianLayout(options, ctx, layout) {
520
387
  const overhang = layout.overhang ?? 0;
521
388
  const rtl = ctx.rtl === true;
522
389
  const reverse = xOptions.reverse ?? rtl;
523
- const pad = mirrorSides(insets(options.padding), rtl);
524
390
  const labels = resolveLabels(data);
525
391
  const format = labelFormatter(options, ctx);
526
392
  const showY = yOptions.show !== false;
527
393
  const showX = xOptions.show !== false && labels.length > 0;
528
394
  const timed = isTimeAxis(options) && layout.scale === "point";
529
- const value = valueAxis(options, ctx, layout, Math.round(height / 60));
395
+ const auto = Math.round(height / 60);
396
+ const second = hasY2(options);
397
+ const value = valueAxis(options, ctx, layout, auto, second ? "y" : void 0);
530
398
  const probeY = value.probe;
399
+ const y2Options = options.y2 ?? {};
400
+ const value2 = second ? valueAxis(options, ctx, layout, auto, "y2") : null;
401
+ const showY2 = !!value2 && y2Options.show !== false;
531
402
  const countX = Math.max(2, Math.round(width / 80));
532
403
  const keys = labels.map(labelKey);
533
404
  const labelAt = (i) => format(labels[i], i);
@@ -540,41 +411,54 @@ function cartesianLayout(options, ctx, layout) {
540
411
  ticks: (scale) => bandTicks(scale, (_, i) => labelAt(i))
541
412
  };
542
413
  const edgeLabels = xAxis.edges;
414
+ const rotate = turned(options, showX && !timed);
415
+ const allX = rotate ? labels.map((_, i) => ({
416
+ value: i,
417
+ position: 0,
418
+ label: labelAt(i)
419
+ })) : [];
543
420
  const halfLine = Math.ceil(fontSize * LINE_HEIGHT / 2);
544
- const edgeWidth = (last) => showX ? estimateTextWidth(edgeLabels[last ? edgeLabels.length - 1 : 0] ?? "", fontSize) : 0;
421
+ const edgeWidth = (last) => rotate ? fontSize * LINE_HEIGHT : showX ? estimateTextWidth(edgeLabels[last ? edgeLabels.length - 1 : 0] ?? "", fontSize) : 0;
545
422
  const firstLabel = edgeWidth(reverse !== rtl);
546
423
  const lastLabel = edgeWidth(reverse === rtl);
547
424
  const edgeX = layout.scale === "point";
548
- const valueWidth = showY ? axisSize("left", probeY, fontSize) : 0;
549
- const side = (halfStep) => {
550
- const overflow = (label) => edgeX ? Math.ceil(label / 2) : Math.max(0, Math.ceil(label / 2 - halfStep));
425
+ const valueWidth = (showY ? axisSize("left", probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize);
426
+ const value2Width = value2 ? (showY2 ? axisSize("right", value2.probe, fontSize) : 0) + axisTitleSize(y2Options.title, fontSize) : 0;
427
+ const { area, side, range } = plotFrame(ctx, options.padding, (pad) => {
428
+ const sides = (halfStep) => {
429
+ const overflow = (label) => edgeX ? Math.ceil(label / 2) : Math.max(0, Math.ceil(label / 2 - halfStep));
430
+ return {
431
+ start: pad.start + Math.max(valueWidth, overflow(firstLabel), overhang, showY ? 0 : 8),
432
+ end: pad.end + Math.max(value2Width, overflow(lastLabel), overhang, 8)
433
+ };
434
+ };
435
+ const steps = Math.max(1, labels.length) * 2;
436
+ let both = sides((width - pad.start - pad.end - valueWidth - value2Width) / steps);
437
+ if (!edgeX) both = sides((width - both.start - both.end) / steps);
551
438
  return {
552
- right: pad.right + Math.max(overflow(lastLabel), overhang, 8),
553
- left: pad.left + Math.max(valueWidth, overflow(firstLabel), overhang, showY ? 0 : 8)
439
+ top: pad.top + Math.max(showY || showY2 ? halfLine : 0, overhang, 4),
440
+ bottom: pad.bottom + Math.max((rotate ? axisSize("bottom", allX, fontSize, { rotate }) : showX ? axisSize("bottom", [probeY[0]], fontSize) : showY ? halfLine : 0) + axisTitleSize(xOptions.title, fontSize), overhang, 4),
441
+ ...both
554
442
  };
555
- };
556
- const steps = Math.max(1, labels.length) * 2;
557
- let sides = side((width - pad.left - pad.right - valueWidth) / steps);
558
- if (!edgeX) sides = side((width - sides.left - sides.right) / steps);
559
- const margins = {
560
- top: pad.top + Math.max(showY ? halfLine : 0, overhang, 4),
561
- bottom: pad.bottom + Math.max(showX ? axisSize("bottom", [probeY[0]], fontSize) : showY ? halfLine : 0, overhang, 4),
562
- ...mirrorSides(sides, rtl)
563
- };
564
- const area = innerRect(width, height, margins);
565
- const end = area.x + area.width;
566
- const x = xAxis.scale(reverse ? [end, area.x] : [area.x, end]);
443
+ });
444
+ const x = xAxis.scale(range(reverse));
567
445
  const y = value.scale([area.y + area.height, area.y]);
446
+ const y2 = value2?.scale([area.y + area.height, area.y]);
568
447
  const yTicks = thinTicks(value.ticks(y), "left", fontSize, 4);
569
- return finishLayout(options, ctx, overhang, {
448
+ const plot = {
570
449
  area,
571
450
  labels,
572
451
  x,
573
452
  y,
574
453
  horizontal: false,
575
- xTicks: showX ? thinTicks(xAxis.ticks(x), "bottom", fontSize) : [],
454
+ xTicks: showX ? rotate ? thinTicks(xAxis.ticks(x), "left", fontSize / LINE_HEIGHT, 2) : thinTicks(xAxis.ticks(x), "bottom", fontSize) : [],
576
455
  yTicks
577
- }, keys, xAxis.time);
456
+ };
457
+ if (value2 && y2) {
458
+ plot.y2 = y2;
459
+ plot.y2Ticks = thinTicks(value2.ticks(y2), "right", fontSize, 4);
460
+ }
461
+ return finishLayout(options, ctx, side, overhang, plot, keys, xAxis.time);
578
462
  }
579
463
  /** Clip path around the plot area, a little larger so strokes and dots are not cut. */
580
464
  function plotClip(ctx, area, overhang) {
@@ -615,7 +499,28 @@ function categoryInteraction(layout, options, ctx, anchor, markAt) {
615
499
  const { area, x, labels, horizontal } = layout;
616
500
  const { data } = options;
617
501
  const formatLabel = labelFormatter(options, ctx);
618
- const formatValue = formatDetail(options.y?.format, ctx.locale);
502
+ const axisOf = seriesAxes(options);
503
+ const axes = data.series.map((s) => axisOf(s).axis);
504
+ const formats = axes.map((axis) => formatDetail(axis.format, ctx.locale));
505
+ const yAxis = options.y ?? {};
506
+ const [d0, d1] = layout.y.domain;
507
+ const [r0, r1] = layout.y.range;
508
+ const cursorText = yAxis.scale === "log" || r0 === r1 ? formatDetail(yAxis.format, ctx.locale) : formatTicks(Math.abs((d1 - d0) / (r1 - r0)), yAxis.format, ctx.locale);
509
+ const cursorAt = (px, py) => {
510
+ const position = horizontal ? px : py;
511
+ const lo = Math.min(r0, r1);
512
+ const hi = Math.max(r0, r1);
513
+ const value = layout.y.invert(position);
514
+ if (position < lo || position > hi || !Number.isFinite(value)) return void 0;
515
+ const cursor = {
516
+ value,
517
+ text: cursorText(value),
518
+ position,
519
+ side: horizontal ? "bottom" : ctx.rtl ? "right" : "left"
520
+ };
521
+ if (yAxis.show === false) cursor.inside = true;
522
+ return cursor;
523
+ };
619
524
  const hitAt = (index) => {
620
525
  const start = x.at(index);
621
526
  const center = start + x.bandwidth / 2;
@@ -631,13 +536,13 @@ function categoryInteraction(layout, options, ctx, anchor, markAt) {
631
536
  data.series.forEach((series, seriesIndex) => {
632
537
  if (ctx.hidden.has(seriesKey(series))) return;
633
538
  const raw = series.values[index];
634
- const value = plottable(raw, options.y) ? raw : null;
539
+ const value = plottable(raw, axes[seriesIndex]) ? raw : null;
635
540
  const point = value === null ? empty : anchor(seriesIndex, index, value);
636
541
  const item = {
637
542
  name: series.name,
638
543
  seriesIndex,
639
544
  value,
640
- text: value === null ? "–" : formatValue(value),
545
+ text: value === null ? "–" : formats[seriesIndex](value),
641
546
  ...point
642
547
  };
643
548
  if (series.color) item.color = series.color;
@@ -655,12 +560,14 @@ function categoryInteraction(layout, options, ctx, anchor, markAt) {
655
560
  hit.y = center;
656
561
  hit.axis = "y";
657
562
  }
658
- if (x.bandwidth > 0) hit.band = horizontal ? {
563
+ if (x.bandwidth > 0) hit.highlight = horizontal ? {
564
+ kind: "band",
659
565
  x: area.x,
660
566
  y: start,
661
567
  width: area.width,
662
568
  height: x.bandwidth
663
569
  } : {
570
+ kind: "band",
664
571
  x: start,
665
572
  y: area.y,
666
573
  width: x.bandwidth,
@@ -678,6 +585,8 @@ function categoryInteraction(layout, options, ctx, anchor, markAt) {
678
585
  const hit = hitAt(index);
679
586
  const mark = markAt?.(px, py, index);
680
587
  if (mark !== void 0) hit.seriesIndex = mark;
588
+ const cursor = cursorAt(px, py);
589
+ if (cursor) hit.cursor = cursor;
681
590
  return hit;
682
591
  },
683
592
  hitIndex(index, seriesIndex) {
@@ -693,17 +602,18 @@ function seriesTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
693
602
  const all = resolveLabels(options.data);
694
603
  const labels = all.length > limit ? all.slice(0, limit) : all;
695
604
  const formatLabel = labelFormatter(options, ctx);
696
- const formatValue = formatDetail(options.y?.format, ctx.locale);
605
+ const axisOf = seriesAxes(options);
697
606
  const series = options.data.series.filter((s) => !ctx.hidden.has(seriesKey(s)));
607
+ const formats = series.map((s) => formatDetail(axisOf(s).axis.format, ctx.locale));
698
608
  return {
699
609
  columns: ["", ...series.map((s) => s.name)],
700
610
  total: all.length,
701
- rows: labels.map((label, i) => [formatLabel(label, i), ...series.map((s) => {
611
+ rows: labels.map((label, i) => [formatLabel(label, i), ...series.map((s, n) => {
702
612
  const v = s.values[i];
703
- return v == null || !Number.isFinite(v) ? "–" : formatValue(v);
613
+ return v == null || !Number.isFinite(v) ? "–" : formats[n](v);
704
614
  })])
705
615
  };
706
616
  }
707
- export { tickIncrement as A, grid as C, linearTicks as D, bandTicks as E, ticks as M, thinTicks as O, point as S, axisSize as T, valueAxis as _, labelFormatter as a, linear as b, plotClip as c, seriesAttrs as d, seriesKey as f, toMs as g, tickCount as h, finishLayout as i, tickStep as j, niceDomain as k, plottable as l, seriesTable as m, categoryInteraction as n, labelKey as o, seriesLegend as p, domainOf as r, markerShape as s, cartesianLayout as t, resolveLabels as u, valueScale as v, axis as w, band as x, valueTicks as y };
617
+ export { windowed as C, grid as D, point as E, valueTicks as S, band as T, seriesTable as _, labelFormatter as a, valueAxis as b, plotClip as c, resolveLabels as d, seriesAttrs as f, seriesScale as g, seriesLegend as h, finishLayout as i, plottable as l, seriesKey as m, categoryInteraction as n, labelKey as o, seriesAxes as p, domainOf as r, markerShape as s, cartesianLayout as t, pointMark as u, tickCount as v, linear as w, valueScale as x, toMs as y };
708
618
 
709
- //# sourceMappingURL=cartesian-CI2x6N7N.js.map
619
+ //# sourceMappingURL=cartesian-COglz544.js.map