@mui/x-charts 8.16.0 → 8.18.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 (485) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +1 -1
  2. package/BarChart/BarChart.js +1 -0
  3. package/BarChart/BarClipPath.d.ts +1 -1
  4. package/BarChart/BarElement.d.ts +1 -1
  5. package/BarChart/BarElement.js +6 -8
  6. package/BarChart/BarLabel/BarLabel.d.ts +6 -0
  7. package/BarChart/BarLabel/BarLabel.js +41 -4
  8. package/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
  9. package/BarChart/BarLabel/BarLabelItem.js +4 -2
  10. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
  11. package/BarChart/BarLabel/BarLabelPlot.js +42 -38
  12. package/BarChart/BarPlot.d.ts +13 -3
  13. package/BarChart/BarPlot.js +8 -3
  14. package/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
  15. package/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
  16. package/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
  17. package/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
  18. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
  19. package/BarChart/seriesConfig/bar/legend.d.ts +3 -0
  20. package/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
  21. package/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
  22. package/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
  23. package/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
  24. package/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
  25. package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
  26. package/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
  27. package/BarChart/seriesConfig/index.d.ts +1 -1
  28. package/BarChart/seriesConfig/index.js +9 -9
  29. package/BarChart/types.d.ts +2 -0
  30. package/BarChart/useBarPlotData.js +5 -3
  31. package/CHANGELOG.md +208 -1
  32. package/ChartDataProvider/ChartDataProvider.d.ts +1 -1
  33. package/ChartsAxis/ChartsAxis.d.ts +1 -2
  34. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
  35. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
  36. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
  37. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
  38. package/ChartsClipPath/ChartsClipPath.d.ts +1 -2
  39. package/ChartsClipPath/ChartsClipPath.js +0 -2
  40. package/ChartsGrid/ChartsGrid.d.ts +1 -2
  41. package/ChartsGrid/ChartsGrid.js +0 -2
  42. package/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
  43. package/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
  44. package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  45. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  46. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
  47. package/ChartsOverlay/ChartsLoadingOverlay.js +0 -2
  48. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
  49. package/ChartsOverlay/ChartsNoDataOverlay.js +0 -2
  50. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  51. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
  52. package/ChartsReferenceLine/ChartsReferenceLine.js +0 -2
  53. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
  54. package/ChartsReferenceLine/ChartsXReferenceLine.js +0 -2
  55. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
  56. package/ChartsReferenceLine/ChartsYReferenceLine.js +0 -2
  57. package/ChartsSurface/ChartsSurface.js +8 -9
  58. package/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
  59. package/ChartsSurface/chartsSurfaceClasses.js +21 -0
  60. package/ChartsSurface/index.d.ts +2 -1
  61. package/ChartsSurface/index.js +12 -1
  62. package/ChartsText/ChartsText.d.ts +1 -1
  63. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
  64. package/ChartsTooltip/ChartsAxisTooltipContent.js +0 -2
  65. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
  66. package/ChartsTooltip/ChartsItemTooltipContent.js +0 -2
  67. package/ChartsTooltip/ChartsTooltip.d.ts +1 -2
  68. package/ChartsTooltip/ChartsTooltip.js +0 -2
  69. package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  70. package/ChartsTooltip/ChartsTooltipContainer.js +13 -14
  71. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  72. package/ChartsWrapper/ChartsWrapper.d.ts +1 -1
  73. package/ChartsWrapper/ChartsWrapper.js +3 -5
  74. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
  75. package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
  76. package/ChartsXAxis/ChartsXAxis.d.ts +1 -2
  77. package/ChartsXAxis/ChartsXAxis.js +0 -2
  78. package/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
  79. package/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
  80. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
  81. package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
  82. package/ChartsYAxis/ChartsYAxis.d.ts +1 -2
  83. package/ChartsYAxis/ChartsYAxis.js +0 -2
  84. package/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
  85. package/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
  86. package/Gauge/GaugeProvider.d.ts +1 -1
  87. package/Gauge/GaugeReferenceArc.d.ts +1 -1
  88. package/Gauge/GaugeValueArc.d.ts +1 -1
  89. package/Gauge/GaugeValueText.d.ts +1 -2
  90. package/Gauge/GaugeValueText.js +0 -2
  91. package/LineChart/AnimatedArea.d.ts +1 -1
  92. package/LineChart/AppearingMask.d.ts +1 -1
  93. package/LineChart/AreaElement.d.ts +1 -1
  94. package/LineChart/AreaPlot.d.ts +1 -1
  95. package/LineChart/CircleMarkElement.d.ts +1 -1
  96. package/LineChart/FocusedMark.d.ts +1 -2
  97. package/LineChart/FocusedMark.js +0 -2
  98. package/LineChart/LineElement.d.ts +1 -1
  99. package/LineChart/LineHighlightElement.d.ts +1 -1
  100. package/LineChart/LineHighlightPlot.d.ts +1 -1
  101. package/LineChart/LinePlot.d.ts +1 -1
  102. package/LineChart/MarkElement.d.ts +1 -1
  103. package/LineChart/MarkPlot.d.ts +1 -1
  104. package/LineChart/seriesConfig/getColor.js +28 -5
  105. package/LineChart/seriesConfig/index.d.ts +1 -1
  106. package/LineChart/seriesConfig/index.js +2 -2
  107. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  108. package/PieChart/PieArcPlot.d.ts +1 -1
  109. package/PieChart/PiePlot.d.ts +1 -2
  110. package/PieChart/PiePlot.js +0 -2
  111. package/PieChart/seriesConfig/index.d.ts +1 -1
  112. package/PieChart/seriesConfig/index.js +2 -2
  113. package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  114. package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
  115. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
  116. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -3
  117. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
  118. package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
  119. package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
  120. package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
  121. package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
  122. package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
  123. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
  124. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
  125. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
  126. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
  127. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
  128. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -3
  129. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
  130. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
  131. package/RadarChart/seriesConfig/getColor.js +12 -1
  132. package/ScatterChart/BatchScatter.d.ts +1 -2
  133. package/ScatterChart/BatchScatter.js +4 -4
  134. package/ScatterChart/Scatter.d.ts +7 -2
  135. package/ScatterChart/Scatter.js +7 -3
  136. package/ScatterChart/ScatterMarker.d.ts +1 -1
  137. package/ScatterChart/ScatterPlot.d.ts +1 -1
  138. package/ScatterChart/ScatterPlot.js +1 -1
  139. package/ScatterChart/seriesConfig/getColor.js +36 -7
  140. package/ScatterChart/seriesConfig/index.d.ts +1 -1
  141. package/ScatterChart/seriesConfig/index.js +2 -2
  142. package/context/ChartProvider/ChartProvider.d.ts +1 -1
  143. package/context/ChartProvider/ChartProvider.js +4 -4
  144. package/context/ChartProvider/ChartProvider.types.d.ts +3 -3
  145. package/context/ChartsSlotsContext.d.ts +1 -1
  146. package/esm/BarChart/AnimatedBarElement.d.ts +1 -1
  147. package/esm/BarChart/BarChart.js +1 -0
  148. package/esm/BarChart/BarClipPath.d.ts +1 -1
  149. package/esm/BarChart/BarElement.d.ts +1 -1
  150. package/esm/BarChart/BarElement.js +6 -8
  151. package/esm/BarChart/BarLabel/BarLabel.d.ts +6 -0
  152. package/esm/BarChart/BarLabel/BarLabel.js +41 -4
  153. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
  154. package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
  155. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
  156. package/esm/BarChart/BarLabel/BarLabelPlot.js +42 -37
  157. package/esm/BarChart/BarPlot.d.ts +13 -3
  158. package/esm/BarChart/BarPlot.js +8 -3
  159. package/esm/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
  160. package/esm/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
  161. package/esm/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
  162. package/esm/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
  163. package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
  164. package/esm/BarChart/seriesConfig/bar/legend.d.ts +3 -0
  165. package/esm/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
  166. package/esm/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
  167. package/esm/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
  168. package/esm/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
  169. package/esm/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
  170. package/esm/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
  171. package/esm/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
  172. package/esm/BarChart/seriesConfig/index.d.ts +1 -1
  173. package/esm/BarChart/seriesConfig/index.js +8 -8
  174. package/esm/BarChart/types.d.ts +2 -0
  175. package/esm/BarChart/useBarPlotData.js +5 -3
  176. package/esm/ChartDataProvider/ChartDataProvider.d.ts +1 -1
  177. package/esm/ChartsAxis/ChartsAxis.d.ts +1 -2
  178. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
  179. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
  180. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
  181. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
  182. package/esm/ChartsClipPath/ChartsClipPath.d.ts +1 -2
  183. package/esm/ChartsClipPath/ChartsClipPath.js +0 -1
  184. package/esm/ChartsGrid/ChartsGrid.d.ts +1 -2
  185. package/esm/ChartsGrid/ChartsGrid.js +0 -1
  186. package/esm/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
  187. package/esm/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
  188. package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  189. package/esm/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  190. package/esm/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
  191. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +0 -1
  192. package/esm/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
  193. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +0 -1
  194. package/esm/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  195. package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
  196. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +0 -1
  197. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
  198. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +0 -1
  199. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
  200. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +0 -1
  201. package/esm/ChartsSurface/ChartsSurface.js +9 -10
  202. package/esm/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
  203. package/esm/ChartsSurface/chartsSurfaceClasses.js +13 -0
  204. package/esm/ChartsSurface/index.d.ts +2 -1
  205. package/esm/ChartsSurface/index.js +2 -1
  206. package/esm/ChartsText/ChartsText.d.ts +1 -1
  207. package/esm/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
  208. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  209. package/esm/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
  210. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  211. package/esm/ChartsTooltip/ChartsTooltip.d.ts +1 -2
  212. package/esm/ChartsTooltip/ChartsTooltip.js +0 -1
  213. package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  214. package/esm/ChartsTooltip/ChartsTooltipContainer.js +13 -14
  215. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  216. package/esm/ChartsWrapper/ChartsWrapper.d.ts +1 -1
  217. package/esm/ChartsWrapper/ChartsWrapper.js +4 -6
  218. package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
  219. package/esm/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
  220. package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -2
  221. package/esm/ChartsXAxis/ChartsXAxis.js +0 -1
  222. package/esm/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
  223. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
  224. package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
  225. package/esm/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
  226. package/esm/ChartsYAxis/ChartsYAxis.d.ts +1 -2
  227. package/esm/ChartsYAxis/ChartsYAxis.js +0 -1
  228. package/esm/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
  229. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
  230. package/esm/Gauge/GaugeProvider.d.ts +1 -1
  231. package/esm/Gauge/GaugeReferenceArc.d.ts +1 -1
  232. package/esm/Gauge/GaugeValueArc.d.ts +1 -1
  233. package/esm/Gauge/GaugeValueText.d.ts +1 -2
  234. package/esm/Gauge/GaugeValueText.js +0 -1
  235. package/esm/LineChart/AnimatedArea.d.ts +1 -1
  236. package/esm/LineChart/AppearingMask.d.ts +1 -1
  237. package/esm/LineChart/AreaElement.d.ts +1 -1
  238. package/esm/LineChart/AreaPlot.d.ts +1 -1
  239. package/esm/LineChart/CircleMarkElement.d.ts +1 -1
  240. package/esm/LineChart/FocusedMark.d.ts +1 -2
  241. package/esm/LineChart/FocusedMark.js +0 -1
  242. package/esm/LineChart/LineElement.d.ts +1 -1
  243. package/esm/LineChart/LineHighlightElement.d.ts +1 -1
  244. package/esm/LineChart/LineHighlightPlot.d.ts +1 -1
  245. package/esm/LineChart/LinePlot.d.ts +1 -1
  246. package/esm/LineChart/MarkElement.d.ts +1 -1
  247. package/esm/LineChart/MarkPlot.d.ts +1 -1
  248. package/esm/LineChart/seriesConfig/getColor.js +28 -5
  249. package/esm/LineChart/seriesConfig/index.d.ts +1 -1
  250. package/esm/LineChart/seriesConfig/index.js +1 -1
  251. package/esm/PieChart/PieArcLabelPlot.d.ts +1 -1
  252. package/esm/PieChart/PieArcPlot.d.ts +1 -1
  253. package/esm/PieChart/PiePlot.d.ts +1 -2
  254. package/esm/PieChart/PiePlot.js +0 -1
  255. package/esm/PieChart/seriesConfig/index.d.ts +1 -1
  256. package/esm/PieChart/seriesConfig/index.js +1 -1
  257. package/esm/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  258. package/esm/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
  259. package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
  260. package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -2
  261. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
  262. package/esm/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
  263. package/esm/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
  264. package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
  265. package/esm/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
  266. package/esm/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
  267. package/esm/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
  268. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
  269. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
  270. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
  271. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
  272. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -2
  273. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
  274. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
  275. package/esm/RadarChart/seriesConfig/getColor.js +12 -1
  276. package/esm/ScatterChart/BatchScatter.d.ts +1 -2
  277. package/esm/ScatterChart/BatchScatter.js +4 -4
  278. package/esm/ScatterChart/Scatter.d.ts +7 -2
  279. package/esm/ScatterChart/Scatter.js +7 -3
  280. package/esm/ScatterChart/ScatterMarker.d.ts +1 -1
  281. package/esm/ScatterChart/ScatterPlot.d.ts +1 -1
  282. package/esm/ScatterChart/ScatterPlot.js +1 -1
  283. package/esm/ScatterChart/seriesConfig/getColor.js +36 -7
  284. package/esm/ScatterChart/seriesConfig/index.d.ts +1 -1
  285. package/esm/ScatterChart/seriesConfig/index.js +1 -1
  286. package/esm/context/ChartProvider/ChartProvider.d.ts +1 -1
  287. package/esm/context/ChartProvider/ChartProvider.js +4 -4
  288. package/esm/context/ChartProvider/ChartProvider.types.d.ts +3 -3
  289. package/esm/context/ChartsSlotsContext.d.ts +1 -1
  290. package/esm/hooks/animation/useAnimateBarLabel.d.ts +1 -1
  291. package/esm/hooks/animation/useAnimateBarLabel.js +61 -12
  292. package/esm/hooks/index.d.ts +1 -0
  293. package/esm/hooks/index.js +1 -0
  294. package/esm/hooks/useAxis.d.ts +116 -16
  295. package/esm/hooks/useAxis.js +122 -18
  296. package/esm/hooks/useDataset.d.ts +6 -0
  297. package/esm/hooks/useDataset.js +13 -0
  298. package/esm/hooks/useInteractionItemProps.js +2 -5
  299. package/esm/hooks/useIsItemFocused.js +5 -3
  300. package/esm/hooks/useItemHighlighted.js +2 -2
  301. package/esm/hooks/useItemHighlightedGetter.js +0 -1
  302. package/esm/hooks/useScale.d.ts +25 -6
  303. package/esm/hooks/useScale.js +29 -8
  304. package/esm/index.js +1 -1
  305. package/esm/internals/colorScale.d.ts +1 -1
  306. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
  307. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
  308. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -1
  309. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
  310. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -1
  311. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
  312. package/esm/internals/createSeriesSelectorOfType.js +5 -3
  313. package/esm/internals/getSeriesColorFn.d.ts +5 -0
  314. package/esm/internals/getSeriesColorFn.js +3 -0
  315. package/esm/internals/index.d.ts +1 -1
  316. package/esm/internals/index.js +1 -1
  317. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
  318. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
  319. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
  320. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
  321. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
  322. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
  323. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
  324. package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
  325. package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
  326. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
  327. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
  328. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
  329. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +8 -1
  330. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
  331. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
  332. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
  333. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
  334. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
  335. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +21 -5
  336. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
  337. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
  338. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +15 -9
  339. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
  340. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +69 -45
  341. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
  342. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
  343. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
  344. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -22
  345. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
  346. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
  347. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
  348. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
  349. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
  350. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
  351. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
  352. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
  353. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
  354. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
  355. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -0
  356. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
  357. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
  358. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
  359. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +11 -10
  360. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
  361. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
  362. package/esm/internals/plugins/models/plugin.d.ts +3 -2
  363. package/esm/internals/plugins/utils/selectors.d.ts +13 -17
  364. package/esm/internals/plugins/utils/selectors.js +3 -35
  365. package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
  366. package/esm/internals/plugins/utils/useLazySelectorEffect.js +2 -2
  367. package/esm/internals/store/useCharts.d.ts +3 -4
  368. package/esm/internals/store/useCharts.js +2 -2
  369. package/esm/internals/store/useSelector.d.ts +2 -4
  370. package/esm/internals/store/useSelector.js +2 -8
  371. package/esm/internals/store/useStore.d.ts +3 -5
  372. package/esm/locales/index.d.ts +2 -1
  373. package/esm/locales/index.js +1 -0
  374. package/esm/locales/nbNO.d.ts +115 -0
  375. package/esm/locales/nbNO.js +113 -0
  376. package/esm/models/seriesType/bar.d.ts +16 -0
  377. package/esm/models/seriesType/common.d.ts +22 -6
  378. package/esm/models/seriesType/config.d.ts +7 -16
  379. package/hooks/animation/useAnimateBarLabel.d.ts +1 -1
  380. package/hooks/animation/useAnimateBarLabel.js +61 -12
  381. package/hooks/index.d.ts +1 -0
  382. package/hooks/index.js +12 -0
  383. package/hooks/useAxis.d.ts +116 -16
  384. package/hooks/useAxis.js +122 -18
  385. package/hooks/useDataset.d.ts +6 -0
  386. package/hooks/useDataset.js +18 -0
  387. package/hooks/useInteractionItemProps.js +2 -5
  388. package/hooks/useIsItemFocused.js +5 -3
  389. package/hooks/useItemHighlighted.js +2 -2
  390. package/hooks/useScale.d.ts +25 -6
  391. package/hooks/useScale.js +29 -8
  392. package/index.js +1 -1
  393. package/internals/colorScale.d.ts +1 -1
  394. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
  395. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
  396. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -2
  397. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
  398. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -2
  399. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
  400. package/internals/createSeriesSelectorOfType.js +6 -3
  401. package/internals/getSeriesColorFn.d.ts +5 -0
  402. package/internals/getSeriesColorFn.js +9 -0
  403. package/internals/index.d.ts +1 -1
  404. package/internals/index.js +1 -1
  405. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
  406. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
  407. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
  408. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
  409. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
  410. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
  411. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
  412. package/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
  413. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
  414. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
  415. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
  416. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
  417. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +9 -2
  418. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
  419. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
  420. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
  421. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
  422. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
  423. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +22 -6
  424. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
  425. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
  426. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +14 -8
  427. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
  428. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +70 -46
  429. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
  430. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
  431. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
  432. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -23
  433. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
  434. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
  435. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
  436. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
  437. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
  438. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
  439. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
  440. package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
  441. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
  442. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
  443. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +4 -1
  444. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
  445. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
  446. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
  447. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +12 -10
  448. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
  449. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
  450. package/internals/plugins/models/plugin.d.ts +3 -2
  451. package/internals/plugins/utils/selectors.d.ts +13 -17
  452. package/internals/plugins/utils/selectors.js +3 -35
  453. package/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
  454. package/internals/plugins/utils/useLazySelectorEffect.js +2 -2
  455. package/internals/store/useCharts.d.ts +3 -4
  456. package/internals/store/useCharts.js +2 -2
  457. package/internals/store/useSelector.d.ts +2 -4
  458. package/internals/store/useSelector.js +2 -10
  459. package/internals/store/useStore.d.ts +3 -5
  460. package/locales/index.d.ts +2 -1
  461. package/locales/index.js +11 -0
  462. package/locales/nbNO.d.ts +115 -0
  463. package/locales/nbNO.js +119 -0
  464. package/models/seriesType/bar.d.ts +16 -0
  465. package/models/seriesType/common.d.ts +22 -6
  466. package/models/seriesType/config.d.ts +7 -16
  467. package/package.json +5 -5
  468. package/BarChart/seriesConfig/getColor.d.ts +0 -3
  469. package/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  470. package/BarChart/seriesConfig/legend.d.ts +0 -3
  471. package/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
  472. package/BarChart/seriesConfig/tooltip.d.ts +0 -4
  473. package/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
  474. package/esm/BarChart/seriesConfig/getColor.d.ts +0 -3
  475. package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  476. package/esm/BarChart/seriesConfig/legend.d.ts +0 -3
  477. package/esm/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
  478. package/esm/BarChart/seriesConfig/tooltip.d.ts +0 -4
  479. package/esm/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
  480. package/esm/internals/plugins/utils/ChartStore.d.ts +0 -13
  481. package/esm/internals/plugins/utils/ChartStore.js +0 -22
  482. package/internals/plugins/utils/ChartStore.d.ts +0 -13
  483. package/internals/plugins/utils/ChartStore.js +0 -29
  484. /package/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
  485. /package/esm/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
@@ -11,14 +11,12 @@ function barLabelPropsInterpolator(from, to) {
11
11
  const interpolateY = (0, _d3Interpolate.interpolateNumber)(from.y, to.y);
12
12
  const interpolateWidth = (0, _d3Interpolate.interpolateNumber)(from.width, to.width);
13
13
  const interpolateHeight = (0, _d3Interpolate.interpolateNumber)(from.height, to.height);
14
- return t => {
15
- return {
16
- x: interpolateX(t),
17
- y: interpolateY(t),
18
- width: interpolateWidth(t),
19
- height: interpolateHeight(t)
20
- };
21
- };
14
+ return t => ({
15
+ x: interpolateX(t),
16
+ y: interpolateY(t),
17
+ width: interpolateWidth(t),
18
+ height: interpolateHeight(t)
19
+ });
22
20
  }
23
21
 
24
22
  /**
@@ -31,15 +29,21 @@ function barLabelPropsInterpolator(from, to) {
31
29
  * pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
32
30
  */
33
31
  function useAnimateBarLabel(props) {
32
+ const {
33
+ initialX,
34
+ currentX,
35
+ initialY,
36
+ currentY
37
+ } = props.placement === 'outside' ? getOutsidePlacement(props) : getCenterPlacement(props);
34
38
  const initialProps = {
35
- x: props.layout === 'vertical' ? props.x + props.width / 2 : props.xOrigin,
36
- y: props.layout === 'vertical' ? props.yOrigin : props.y + props.height / 2,
39
+ x: initialX,
40
+ y: initialY,
37
41
  width: props.width,
38
42
  height: props.height
39
43
  };
40
44
  const currentProps = {
41
- x: props.x + props.width / 2,
42
- y: props.y + props.height / 2,
45
+ x: currentX,
46
+ y: currentY,
43
47
  width: props.width,
44
48
  height: props.height
45
49
  };
@@ -56,4 +60,49 @@ function useAnimateBarLabel(props) {
56
60
  skip: props.skipAnimation,
57
61
  ref: props.ref
58
62
  });
63
+ }
64
+ const LABEL_OFFSET = 4;
65
+ function getCenterPlacement(props) {
66
+ return {
67
+ initialX: props.layout === 'vertical' ? props.x + props.width / 2 : props.xOrigin,
68
+ initialY: props.layout === 'vertical' ? props.yOrigin : props.y + props.height / 2,
69
+ currentX: props.x + props.width / 2,
70
+ currentY: props.y + props.height / 2
71
+ };
72
+ }
73
+ function getOutsidePlacement(props) {
74
+ let initialY = 0;
75
+ let currentY = 0;
76
+ let initialX = 0;
77
+ let currentX = 0;
78
+ if (props.layout === 'vertical') {
79
+ const shouldPlaceAbove = props.y < props.yOrigin;
80
+ if (shouldPlaceAbove) {
81
+ initialY = props.yOrigin - LABEL_OFFSET;
82
+ currentY = props.y - LABEL_OFFSET;
83
+ } else {
84
+ initialY = props.yOrigin + LABEL_OFFSET;
85
+ currentY = props.y + props.height + LABEL_OFFSET;
86
+ }
87
+ return {
88
+ initialX: props.x + props.width / 2,
89
+ currentX: props.x + props.width / 2,
90
+ initialY,
91
+ currentY
92
+ };
93
+ }
94
+ const shouldPlaceToTheLeft = props.x < props.xOrigin;
95
+ if (shouldPlaceToTheLeft) {
96
+ initialX = props.xOrigin;
97
+ currentX = props.x - LABEL_OFFSET;
98
+ } else {
99
+ initialX = props.xOrigin;
100
+ currentX = props.x + props.width + LABEL_OFFSET;
101
+ }
102
+ return {
103
+ initialX,
104
+ currentX,
105
+ initialY: props.y + props.height / 2,
106
+ currentY: props.y + props.height / 2
107
+ };
59
108
  }
package/hooks/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./useZAxis.js";
6
6
  export * from "./useColorScale.js";
7
7
  export * from "./useSvgRef.js";
8
8
  export * from "./useSeries.js";
9
+ export * from "./useDataset.js";
9
10
  export * from "./useScatterSeries.js";
10
11
  export * from "./usePieSeries.js";
11
12
  export * from "./useBarSeries.js";
package/hooks/index.js CHANGED
@@ -115,6 +115,18 @@ Object.keys(_useSeries).forEach(function (key) {
115
115
  }
116
116
  });
117
117
  });
118
+ var _useDataset = require("./useDataset");
119
+ Object.keys(_useDataset).forEach(function (key) {
120
+ if (key === "default" || key === "__esModule") return;
121
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
122
+ if (key in exports && exports[key] === _useDataset[key]) return;
123
+ Object.defineProperty(exports, key, {
124
+ enumerable: true,
125
+ get: function () {
126
+ return _useDataset[key];
127
+ }
128
+ });
129
+ });
118
130
  var _useScatterSeries = require("./useScatterSeries");
119
131
  Object.keys(_useScatterSeries).forEach(function (key) {
120
132
  if (key === "default" || key === "__esModule") return;
@@ -2,12 +2,17 @@ import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaul
2
2
  /**
3
3
  * Get all the x-axes.
4
4
  *
5
- * - `xAxis` is an object with the shape `{ [axisId]: axis }`.
6
- * - `xAxisIds` is an array of axis IDs.
5
+ * Returns all X axes configured in the chart along with their IDs.
6
+ * This is useful when you need to iterate over multiple axes or access all axis configurations at once.
7
7
  *
8
- * If access to a specific X axis is needed, use the `useXAxis` hook instead.
8
+ * @returns An object containing:
9
+ * - `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
10
+ * - `xAxisIds`: An array of all X axis IDs in the chart
9
11
  *
10
- * @returns `{ xAxis, xAxisIds }` - The x-axes and their IDs.
12
+ * @example
13
+ * const { xAxis, xAxisIds } = useXAxes();
14
+ *
15
+ * @see `useXAxis` for accessing a single X axis
11
16
  */
12
17
  export declare function useXAxes(): {
13
18
  xAxis: import("../internals/index.js").ComputedAxisConfig<ChartsXAxisProps>;
@@ -16,36 +21,131 @@ export declare function useXAxes(): {
16
21
  /**
17
22
  * Get all the y-axes.
18
23
  *
19
- * - `yAxis` is an object with the shape `{ [axisId]: axis }`.
20
- * - `yAxisIds` is an array of axis IDs.
24
+ * Returns all Y axes configured in the chart along with their IDs.
25
+ * This is useful when you need to iterate over multiple axes or access all axis configurations at once.
26
+ *
27
+ * @returns An object containing:
28
+ * - `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
29
+ * - `yAxisIds`: An array of all Y axis IDs in the chart
21
30
  *
22
- * If access to a specific Y axis is needed, use the `useYAxis` hook instead.
31
+ * @example
32
+ * const { yAxis, yAxisIds } = useYAxes();
23
33
  *
24
- * @returns `{ yAxis, yAxisIds }` - The y-axes and their IDs.
34
+ * @see `useYAxis` for accessing a single Y axis
25
35
  */
26
36
  export declare function useYAxes(): {
27
37
  yAxis: import("../internals/index.js").ComputedAxisConfig<ChartsYAxisProps>;
28
38
  yAxisIds: AxisId[];
29
39
  };
30
40
  /**
31
- * Get the X axis.
32
- * @param {AxisId | undefined} axisId - If provided returns the x axis with axisId, else returns the values for the default x axis.
33
- * @returns The X axis.
41
+ * Get a specific X axis or the default X axis.
42
+ *
43
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
44
+ * - A string or number matching the axis ID defined in the chart's `xAxis` prop
45
+ * - Undefined to get the default (first) X axis
46
+ * @returns The configuration for a single X axis.
47
+ *
48
+ * @example
49
+ * // Get the default X axis
50
+ * const xAxis = useXAxis();
51
+ *
52
+ * @example
53
+ * // Get a specific X axis by string ID
54
+ * const xAxis = useXAxis('revenue');
34
55
  */
35
56
  export declare function useXAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsXAxisProps>;
36
57
  /**
37
- * Get the Y axis.
38
- * @param {AxisId | undefined} axisId - If provided returns the y axis with axisId, else returns the values for the default y axis.
39
- * @returns The Y axis.
58
+ * Get a specific Y axis or the default Y axis.
59
+ *
60
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
61
+ * - A string or number matching the axis ID defined in the chart's `yAxis` prop
62
+ * - Undefined to get the default (first) Y axis
63
+ * @returns The configuration for a single Y axis.
64
+ *
65
+ * @example
66
+ * // Get the default Y axis
67
+ * const yAxis = useYAxis();
68
+ *
69
+ * @example
70
+ * // Get a specific Y axis by string ID
71
+ * const yAxis = useYAxis('temperature');
40
72
  */
41
73
  export declare function useYAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsYAxisProps>;
74
+ /**
75
+ * Get all the rotation axes for polar charts.
76
+ *
77
+ * Returns all rotation axes configured in polar charts along with their IDs.
78
+ * Rotation axes are used in charts like `RadarChart` to define angular positioning.
79
+ *
80
+ * @returns An object containing:
81
+ * - `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
82
+ * - `rotationAxisIds`: An array of all rotation axis IDs in the chart
83
+ *
84
+ * @example
85
+ * const { rotationAxis, rotationAxisIds } = useRotationAxes();
86
+ *
87
+ * @see `useRotationAxis` for accessing a single rotation axis
88
+ */
42
89
  export declare function useRotationAxes(): {
43
90
  rotationAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js").DefaultizedAxisConfig<ChartsRotationAxisProps>;
44
91
  rotationAxisIds: string[];
45
92
  };
93
+ /**
94
+ * Get all the radius axes for polar charts.
95
+ *
96
+ * Returns all radial axes configured in polar charts along with their IDs.
97
+ * Radius axes are used in charts like `RadarChart` to define radial positioning and scaling.
98
+ *
99
+ * @returns An object containing:
100
+ * - `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
101
+ * - `radiusAxisIds`: An array of all radius axis IDs in the chart
102
+ *
103
+ * @example
104
+ * const { radiusAxis, radiusAxisIds } = useRadiusAxes();
105
+ *
106
+ * @see `useRadiusAxis` for accessing a single radius axis
107
+ */
46
108
  export declare function useRadiusAxes(): {
47
109
  radiusAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js").DefaultizedAxisConfig<ChartsRadiusAxisProps>;
48
110
  radiusAxisIds: string[];
49
111
  };
50
- export declare function useRotationAxis(identifier?: number | string): PolarAxisDefaultized<ScaleName, any, ChartsRotationAxisProps> | undefined;
51
- export declare function useRadiusAxis(identifier?: number | string): PolarAxisDefaultized<ScaleName, any, ChartsRadiusAxisProps> | undefined;
112
+ /**
113
+ * Get a specific rotation axis or the default rotation axis for polar charts.
114
+ *
115
+ * Returns the configuration and scale for a rotation axis in polar charts.
116
+ * The rotation axis controls the angular positioning of data points around the circle.
117
+ *
118
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
119
+ * - A string or number matching the axis ID defined in the chart's rotation axis configuration
120
+ * - Undefined to get the default (first) rotation axis
121
+ * @returns The rotation axis configuration, or undefined if not found
122
+ *
123
+ * @example
124
+ * // Get the default rotation axis
125
+ * const rotationAxis = useRotationAxis();
126
+ *
127
+ * @example
128
+ * // Get a specific rotation axis by string ID
129
+ * const rotationAxis = useRotationAxis('categories');
130
+ */
131
+ export declare function useRotationAxis(axisId?: AxisId): PolarAxisDefaultized<ScaleName, any, ChartsRotationAxisProps> | undefined;
132
+ /**
133
+ * Get a specific radius axis or the default radius axis for polar charts.
134
+ *
135
+ * Returns the configuration and scale for a radial axis in polar charts.
136
+ * The radius axis controls the radial distance of data points from the center of the circle.
137
+ *
138
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
139
+ * - A string or number matching the axis ID defined in the chart's radius axis configuration
140
+ * - Undefined to get the default (first) radius axis
141
+ * @returns The radius axis configuration, or undefined if not found
142
+ *
143
+ * @example
144
+ * // Get the default radius axis
145
+ * const radiusAxis = useRadiusAxis();
146
+ *
147
+ * @example
148
+ * // Get a specific radius axis by string ID
149
+ * const radiusAxis = useRadiusAxis('magnitude');
150
+ */
151
+ export declare function useRadiusAxis(axisId?: AxisId): PolarAxisDefaultized<ScaleName, any, ChartsRadiusAxisProps> | undefined;
package/hooks/useAxis.js CHANGED
@@ -19,12 +19,17 @@ var _useStore = require("../internals/store/useStore");
19
19
  /**
20
20
  * Get all the x-axes.
21
21
  *
22
- * - `xAxis` is an object with the shape `{ [axisId]: axis }`.
23
- * - `xAxisIds` is an array of axis IDs.
22
+ * Returns all X axes configured in the chart along with their IDs.
23
+ * This is useful when you need to iterate over multiple axes or access all axis configurations at once.
24
24
  *
25
- * If access to a specific X axis is needed, use the `useXAxis` hook instead.
25
+ * @returns An object containing:
26
+ * - `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
27
+ * - `xAxisIds`: An array of all X axis IDs in the chart
26
28
  *
27
- * @returns `{ xAxis, xAxisIds }` - The x-axes and their IDs.
29
+ * @example
30
+ * const { xAxis, xAxisIds } = useXAxes();
31
+ *
32
+ * @see `useXAxis` for accessing a single X axis
28
33
  */
29
34
  function useXAxes() {
30
35
  const store = (0, _useStore.useStore)();
@@ -41,12 +46,17 @@ function useXAxes() {
41
46
  /**
42
47
  * Get all the y-axes.
43
48
  *
44
- * - `yAxis` is an object with the shape `{ [axisId]: axis }`.
45
- * - `yAxisIds` is an array of axis IDs.
49
+ * Returns all Y axes configured in the chart along with their IDs.
50
+ * This is useful when you need to iterate over multiple axes or access all axis configurations at once.
51
+ *
52
+ * @returns An object containing:
53
+ * - `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
54
+ * - `yAxisIds`: An array of all Y axis IDs in the chart
46
55
  *
47
- * If access to a specific Y axis is needed, use the `useYAxis` hook instead.
56
+ * @example
57
+ * const { yAxis, yAxisIds } = useYAxes();
48
58
  *
49
- * @returns `{ yAxis, yAxisIds }` - The y-axes and their IDs.
59
+ * @see `useYAxis` for accessing a single Y axis
50
60
  */
51
61
  function useYAxes() {
52
62
  const store = (0, _useStore.useStore)();
@@ -61,9 +71,20 @@ function useYAxes() {
61
71
  }
62
72
 
63
73
  /**
64
- * Get the X axis.
65
- * @param {AxisId | undefined} axisId - If provided returns the x axis with axisId, else returns the values for the default x axis.
66
- * @returns The X axis.
74
+ * Get a specific X axis or the default X axis.
75
+ *
76
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
77
+ * - A string or number matching the axis ID defined in the chart's `xAxis` prop
78
+ * - Undefined to get the default (first) X axis
79
+ * @returns The configuration for a single X axis.
80
+ *
81
+ * @example
82
+ * // Get the default X axis
83
+ * const xAxis = useXAxis();
84
+ *
85
+ * @example
86
+ * // Get a specific X axis by string ID
87
+ * const xAxis = useXAxis('revenue');
67
88
  */
68
89
  function useXAxis(axisId) {
69
90
  const store = (0, _useStore.useStore)();
@@ -76,9 +97,20 @@ function useXAxis(axisId) {
76
97
  }
77
98
 
78
99
  /**
79
- * Get the Y axis.
80
- * @param {AxisId | undefined} axisId - If provided returns the y axis with axisId, else returns the values for the default y axis.
81
- * @returns The Y axis.
100
+ * Get a specific Y axis or the default Y axis.
101
+ *
102
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
103
+ * - A string or number matching the axis ID defined in the chart's `yAxis` prop
104
+ * - Undefined to get the default (first) Y axis
105
+ * @returns The configuration for a single Y axis.
106
+ *
107
+ * @example
108
+ * // Get the default Y axis
109
+ * const yAxis = useYAxis();
110
+ *
111
+ * @example
112
+ * // Get a specific Y axis by string ID
113
+ * const yAxis = useYAxis('temperature');
82
114
  */
83
115
  function useYAxis(axisId) {
84
116
  const store = (0, _useStore.useStore)();
@@ -89,6 +121,22 @@ function useYAxis(axisId) {
89
121
  const id = axisId ?? yAxisIds[0];
90
122
  return yAxis[id];
91
123
  }
124
+
125
+ /**
126
+ * Get all the rotation axes for polar charts.
127
+ *
128
+ * Returns all rotation axes configured in polar charts along with their IDs.
129
+ * Rotation axes are used in charts like `RadarChart` to define angular positioning.
130
+ *
131
+ * @returns An object containing:
132
+ * - `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
133
+ * - `rotationAxisIds`: An array of all rotation axis IDs in the chart
134
+ *
135
+ * @example
136
+ * const { rotationAxis, rotationAxisIds } = useRotationAxes();
137
+ *
138
+ * @see `useRotationAxis` for accessing a single rotation axis
139
+ */
92
140
  function useRotationAxes() {
93
141
  const store = (0, _useStore.useStore)();
94
142
  const {
@@ -100,6 +148,22 @@ function useRotationAxes() {
100
148
  rotationAxisIds
101
149
  };
102
150
  }
151
+
152
+ /**
153
+ * Get all the radius axes for polar charts.
154
+ *
155
+ * Returns all radial axes configured in polar charts along with their IDs.
156
+ * Radius axes are used in charts like `RadarChart` to define radial positioning and scaling.
157
+ *
158
+ * @returns An object containing:
159
+ * - `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
160
+ * - `radiusAxisIds`: An array of all radius axis IDs in the chart
161
+ *
162
+ * @example
163
+ * const { radiusAxis, radiusAxisIds } = useRadiusAxes();
164
+ *
165
+ * @see `useRadiusAxis` for accessing a single radius axis
166
+ */
103
167
  function useRadiusAxes() {
104
168
  const store = (0, _useStore.useStore)();
105
169
  const {
@@ -111,21 +175,61 @@ function useRadiusAxes() {
111
175
  radiusAxisIds
112
176
  };
113
177
  }
114
- function useRotationAxis(identifier) {
178
+
179
+ /**
180
+ * Get a specific rotation axis or the default rotation axis for polar charts.
181
+ *
182
+ * Returns the configuration and scale for a rotation axis in polar charts.
183
+ * The rotation axis controls the angular positioning of data points around the circle.
184
+ *
185
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
186
+ * - A string or number matching the axis ID defined in the chart's rotation axis configuration
187
+ * - Undefined to get the default (first) rotation axis
188
+ * @returns The rotation axis configuration, or undefined if not found
189
+ *
190
+ * @example
191
+ * // Get the default rotation axis
192
+ * const rotationAxis = useRotationAxis();
193
+ *
194
+ * @example
195
+ * // Get a specific rotation axis by string ID
196
+ * const rotationAxis = useRotationAxis('categories');
197
+ */
198
+ function useRotationAxis(axisId) {
115
199
  const store = (0, _useStore.useStore)();
116
200
  const {
117
201
  axis: rotationAxis,
118
202
  axisIds: rotationAxisIds
119
203
  } = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRotationAxis);
120
- const id = typeof identifier === 'string' ? identifier : rotationAxisIds[identifier ?? 0];
204
+ const id = axisId ?? rotationAxisIds[0];
121
205
  return rotationAxis[id];
122
206
  }
123
- function useRadiusAxis(identifier) {
207
+
208
+ /**
209
+ * Get a specific radius axis or the default radius axis for polar charts.
210
+ *
211
+ * Returns the configuration and scale for a radial axis in polar charts.
212
+ * The radius axis controls the radial distance of data points from the center of the circle.
213
+ *
214
+ * @param {AxisId} [axisId] - The axis identifier. Can be:
215
+ * - A string or number matching the axis ID defined in the chart's radius axis configuration
216
+ * - Undefined to get the default (first) radius axis
217
+ * @returns The radius axis configuration, or undefined if not found
218
+ *
219
+ * @example
220
+ * // Get the default radius axis
221
+ * const radiusAxis = useRadiusAxis();
222
+ *
223
+ * @example
224
+ * // Get a specific radius axis by string ID
225
+ * const radiusAxis = useRadiusAxis('magnitude');
226
+ */
227
+ function useRadiusAxis(axisId) {
124
228
  const store = (0, _useStore.useStore)();
125
229
  const {
126
230
  axis: radiusAxis,
127
231
  axisIds: radiusAxisIds
128
232
  } = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRadiusAxis);
129
- const id = typeof identifier === 'string' ? identifier : radiusAxisIds[identifier ?? 0];
233
+ const id = axisId ?? radiusAxisIds[0];
130
234
  return radiusAxis[id];
131
235
  }
@@ -0,0 +1,6 @@
1
+ import { DatasetType } from "../models/seriesType/config.js";
2
+ /**
3
+ * Get access to the dataset used to populate series and axes data.
4
+ * @returns {DatasetType | undefined} The dataset array if provided, otherwise undefined.
5
+ */
6
+ export declare function useDataset<T extends DatasetType>(): Readonly<T> | undefined;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useDataset = useDataset;
8
+ var _useStore = require("../internals/store/useStore");
9
+ var _useSelector = require("../internals/store/useSelector");
10
+ var _useChartSeries = require("../internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors");
11
+ /**
12
+ * Get access to the dataset used to populate series and axes data.
13
+ * @returns {DatasetType | undefined} The dataset array if provided, otherwise undefined.
14
+ */
15
+ function useDataset() {
16
+ const store = (0, _useStore.useStore)();
17
+ return (0, _useSelector.useSelector)(store, _useChartSeries.selectorChartDataset);
18
+ }
@@ -41,14 +41,11 @@ const useInteractionItemProps = (data, skip) => {
41
41
  }
42
42
  };
43
43
  }, [onPointerLeave]);
44
- if (skip) {
45
- return {};
46
- }
47
- return {
44
+ return React.useMemo(() => skip ? {} : {
48
45
  onPointerEnter,
49
46
  onPointerLeave,
50
47
  onPointerDown
51
- };
48
+ }, [skip, onPointerEnter, onPointerLeave]);
52
49
  };
53
50
  exports.useInteractionItemProps = useInteractionItemProps;
54
51
  const useInteractionAllItemProps = (data, skip) => {
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useIsItemFocused = useIsItemFocused;
8
- var _useFocusedItem = require("./useFocusedItem");
8
+ var _useStore = require("../internals/store/useStore");
9
+ var _useSelector = require("../internals/store/useSelector");
10
+ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
9
11
  /**
10
12
  * A hook to check if an item has the focus.
11
13
  *
@@ -15,6 +17,6 @@ var _useFocusedItem = require("./useFocusedItem");
15
17
  * @returns {boolean} the focus state
16
18
  */
17
19
  function useIsItemFocused(item) {
18
- const focusedItem = (0, _useFocusedItem.useFocusedItem)();
19
- return focusedItem !== null && focusedItem.seriesType === item.seriesType && focusedItem.seriesId === item.seriesId && focusedItem.dataIndex === item.dataIndex;
20
+ const store = (0, _useStore.useStore)();
21
+ return (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsItemIsFocused, item);
20
22
  }
@@ -19,8 +19,8 @@ var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHi
19
19
  */
20
20
  function useItemHighlighted(item) {
21
21
  const store = (0, _useStore.useStore)();
22
- const isHighlighted = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartsIsHighlighted, [item]);
23
- const isFaded = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartsIsFaded, [item]);
22
+ const isHighlighted = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartsIsHighlighted, item);
23
+ const isFaded = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartsIsFaded, item);
24
24
  return {
25
25
  isHighlighted,
26
26
  isFaded: !isHighlighted && isFaded
@@ -13,16 +13,35 @@ export declare function getValueToPositionMapper<Domain extends {
13
13
  /**
14
14
  * Get the X scale.
15
15
  *
16
- * @param {AxisId | undefined} axisId - If provided returns the scale for the x axis with axisId, else returns the values for the default x axis.
17
- * @returns {AxisScaleConfig[S]['scale']} The scale for the specified X axis.
16
+ * @param axisId - The axis identifier. Can be:
17
+ * - A string or number matching the axis ID defined in the chart's `xAxis` prop
18
+ * - Undefined to get the default (first) X axis
19
+ * @returns The X axis scale
18
20
  */
19
21
  export declare function useXScale<S extends ScaleName>(axisId?: AxisId): AxisScaleConfig[S]['scale'];
20
22
  /**
21
23
  * Get the Y scale.
22
24
  *
23
- * @param {AxisId | undefined} axisId - If provided returns the scale for the y axis with axisId, else returns the values for the default y axis.
24
- * @returns {AxisScaleConfig[S]['scale']} The scale for the specified Y axis.
25
+ * @param axisId - The axis identifier. Can be:
26
+ * - A string or number matching the axis ID defined in the chart's `yAxis` prop
27
+ * - Undefined to get the default (first) Y axis
28
+ * @returns The Y axis scale
25
29
  */
26
30
  export declare function useYScale<S extends ScaleName>(axisId?: AxisId): AxisScaleConfig[S]['scale'];
27
- export declare function useRotationScale<S extends ScaleName>(identifier?: number | string): AxisScaleConfig[S]['scale'] | undefined;
28
- export declare function useRadiusScale<S extends ScaleName>(identifier?: number | string): AxisScaleConfig[S]['scale'] | undefined;
31
+ /**
32
+ * Get the rotation scale.
33
+ *
34
+ * @param axisId - The axis identifier. Can be:
35
+ * - A string or number matching the axis ID defined in the chart's `rotationAxis` prop
36
+ * - Undefined to get the default rotation axis
37
+ * @returns The rotation axis scale, or undefined if not found
38
+ */
39
+ export declare function useRotationScale<S extends ScaleName>(axisId?: number | string): AxisScaleConfig[S]['scale'] | undefined;
40
+ /**
41
+ * Get the radius scale.
42
+ * @param axisId - The axis identifier. Can be:
43
+ * - A string or number matching the axis ID defined in the chart's `radiusAxis` prop
44
+ * - Undefined to get the default radius axis
45
+ * @returns The radius axis scale, or undefined if not found
46
+ */
47
+ export declare function useRadiusScale<S extends ScaleName>(axisId?: number | string): AxisScaleConfig[S]['scale'] | undefined;