@mui/x-charts 8.11.2 → 8.12.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 (330) hide show
  1. package/BarChart/BarChart.d.ts +2 -2
  2. package/BarChart/BarChart.js +1 -0
  3. package/BarChart/BarChart.plugins.d.ts +3 -2
  4. package/BarChart/BarChart.plugins.js +2 -1
  5. package/BarChart/BarElement.js +10 -2
  6. package/BarChart/index.d.ts +2 -0
  7. package/BarChart/index.js +12 -0
  8. package/BarChart/useBarChartProps.d.ts +2 -2
  9. package/BarChart/useBarChartProps.js +4 -3
  10. package/CHANGELOG.md +231 -0
  11. package/ChartContainer/ChartContainer.js +4 -2
  12. package/ChartContainer/useChartContainerProps.js +4 -2
  13. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
  14. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
  15. package/ChartsLegend/ChartsLegend.js +2 -1
  16. package/ChartsLegend/ContinuousColorLegend.js +1 -0
  17. package/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
  18. package/ChartsLegend/PiecewiseColorLegend.js +33 -22
  19. package/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
  20. package/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
  21. package/ChartsSurface/ChartsSurface.js +22 -2
  22. package/ChartsWrapper/ChartsWrapper.d.ts +5 -0
  23. package/ChartsWrapper/ChartsWrapper.js +87 -36
  24. package/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
  25. package/ChartsXAxis/ChartsXAxisImpl.js +3 -3
  26. package/ChartsXAxis/getVisibleLabels.js +5 -1
  27. package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  28. package/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
  29. package/ChartsYAxis/ChartsYAxisImpl.js +3 -3
  30. package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  31. package/LineChart/FocusedMark.d.ts +2 -0
  32. package/LineChart/FocusedMark.js +44 -0
  33. package/LineChart/LineChart.d.ts +2 -2
  34. package/LineChart/LineChart.js +3 -1
  35. package/LineChart/LineChart.plugins.d.ts +3 -2
  36. package/LineChart/LineChart.plugins.js +2 -1
  37. package/LineChart/index.d.ts +1 -0
  38. package/LineChart/index.js +12 -0
  39. package/LineChart/useAreaPlotData.js +2 -2
  40. package/LineChart/useLineChartProps.d.ts +2 -2
  41. package/LineChart/useLineChartProps.js +2 -1
  42. package/LineChart/useLinePlotData.js +2 -2
  43. package/PieChart/PieArc.d.ts +1 -0
  44. package/PieChart/PieArc.js +7 -3
  45. package/PieChart/PieArcPlot.js +1 -0
  46. package/PieChart/PieChart.js +2 -0
  47. package/PieChart/PieChart.plugins.d.ts +2 -1
  48. package/PieChart/PieChart.plugins.js +2 -1
  49. package/PieChart/dataTransform/useTransformData.d.ts +1 -0
  50. package/PieChart/dataTransform/useTransformData.js +9 -1
  51. package/PieChart/index.d.ts +1 -0
  52. package/PieChart/index.js +12 -0
  53. package/RadarChart/RadarAxis/useRadarAxis.js +2 -2
  54. package/RadarChart/RadarChart.plugins.d.ts +1 -1
  55. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  56. package/RadarChart/index.d.ts +2 -1
  57. package/RadarChart/index.js +12 -0
  58. package/RadarChart/useRadarChartProps.d.ts +2 -2
  59. package/RadarChart/useRadarChartProps.js +2 -1
  60. package/ScatterChart/BatchScatter.d.ts +32 -0
  61. package/ScatterChart/BatchScatter.js +171 -0
  62. package/ScatterChart/Scatter.js +13 -5
  63. package/ScatterChart/ScatterChart.d.ts +4 -4
  64. package/ScatterChart/ScatterChart.js +13 -2
  65. package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  66. package/ScatterChart/ScatterChart.plugins.js +3 -2
  67. package/ScatterChart/ScatterPlot.d.ts +10 -0
  68. package/ScatterChart/ScatterPlot.js +14 -2
  69. package/ScatterChart/index.d.ts +1 -0
  70. package/ScatterChart/index.js +12 -0
  71. package/ScatterChart/useScatterChartProps.d.ts +2 -2
  72. package/ScatterChart/useScatterChartProps.js +10 -6
  73. package/SparkLineChart/SparkLineChart.js +10 -5
  74. package/colorPalettes/types.d.ts +1 -1
  75. package/context/ChartApi.d.ts +6 -6
  76. package/esm/BarChart/BarChart.d.ts +2 -2
  77. package/esm/BarChart/BarChart.js +1 -0
  78. package/esm/BarChart/BarChart.plugins.d.ts +3 -2
  79. package/esm/BarChart/BarChart.plugins.js +2 -1
  80. package/esm/BarChart/BarElement.js +10 -2
  81. package/esm/BarChart/index.d.ts +2 -0
  82. package/esm/BarChart/index.js +1 -0
  83. package/esm/BarChart/useBarChartProps.d.ts +2 -2
  84. package/esm/BarChart/useBarChartProps.js +4 -3
  85. package/esm/ChartContainer/ChartContainer.js +4 -2
  86. package/esm/ChartContainer/useChartContainerProps.js +4 -2
  87. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
  88. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
  89. package/esm/ChartsLegend/ChartsLegend.js +2 -1
  90. package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
  91. package/esm/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
  92. package/esm/ChartsLegend/PiecewiseColorLegend.js +33 -22
  93. package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
  94. package/esm/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
  95. package/esm/ChartsSurface/ChartsSurface.js +22 -2
  96. package/esm/ChartsWrapper/ChartsWrapper.d.ts +5 -0
  97. package/esm/ChartsWrapper/ChartsWrapper.js +87 -36
  98. package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
  99. package/esm/ChartsXAxis/ChartsXAxisImpl.js +3 -3
  100. package/esm/ChartsXAxis/getVisibleLabels.js +5 -1
  101. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  102. package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
  103. package/esm/ChartsYAxis/ChartsYAxisImpl.js +3 -3
  104. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  105. package/esm/LineChart/FocusedMark.d.ts +2 -0
  106. package/esm/LineChart/FocusedMark.js +38 -0
  107. package/esm/LineChart/LineChart.d.ts +2 -2
  108. package/esm/LineChart/LineChart.js +3 -1
  109. package/esm/LineChart/LineChart.plugins.d.ts +3 -2
  110. package/esm/LineChart/LineChart.plugins.js +2 -1
  111. package/esm/LineChart/index.d.ts +1 -0
  112. package/esm/LineChart/index.js +1 -0
  113. package/esm/LineChart/useAreaPlotData.js +2 -2
  114. package/esm/LineChart/useLineChartProps.d.ts +2 -2
  115. package/esm/LineChart/useLineChartProps.js +2 -1
  116. package/esm/LineChart/useLinePlotData.js +2 -2
  117. package/esm/PieChart/PieArc.d.ts +1 -0
  118. package/esm/PieChart/PieArc.js +7 -3
  119. package/esm/PieChart/PieArcPlot.js +1 -0
  120. package/esm/PieChart/PieChart.js +2 -0
  121. package/esm/PieChart/PieChart.plugins.d.ts +2 -1
  122. package/esm/PieChart/PieChart.plugins.js +2 -1
  123. package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
  124. package/esm/PieChart/dataTransform/useTransformData.js +9 -1
  125. package/esm/PieChart/index.d.ts +1 -0
  126. package/esm/PieChart/index.js +1 -0
  127. package/esm/RadarChart/RadarAxis/useRadarAxis.js +2 -2
  128. package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
  129. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  130. package/esm/RadarChart/index.d.ts +2 -1
  131. package/esm/RadarChart/index.js +2 -1
  132. package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
  133. package/esm/RadarChart/useRadarChartProps.js +2 -1
  134. package/esm/ScatterChart/BatchScatter.d.ts +32 -0
  135. package/esm/ScatterChart/BatchScatter.js +165 -0
  136. package/esm/ScatterChart/Scatter.js +13 -5
  137. package/esm/ScatterChart/ScatterChart.d.ts +4 -4
  138. package/esm/ScatterChart/ScatterChart.js +13 -2
  139. package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  140. package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
  141. package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
  142. package/esm/ScatterChart/ScatterPlot.js +14 -2
  143. package/esm/ScatterChart/index.d.ts +1 -0
  144. package/esm/ScatterChart/index.js +1 -0
  145. package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
  146. package/esm/ScatterChart/useScatterChartProps.js +10 -6
  147. package/esm/SparkLineChart/SparkLineChart.js +10 -5
  148. package/esm/colorPalettes/types.d.ts +1 -1
  149. package/esm/context/ChartApi.d.ts +6 -6
  150. package/esm/hooks/useAxis.d.ts +5 -5
  151. package/esm/hooks/useDrawingArea.d.ts +20 -2
  152. package/esm/hooks/useFocusedItem.d.ts +15 -0
  153. package/esm/hooks/useFocusedItem.js +20 -0
  154. package/esm/hooks/useIsItemFocused.d.ts +12 -0
  155. package/esm/hooks/useIsItemFocused.js +15 -0
  156. package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
  157. package/esm/hooks/useIsItemFocusedGetter.js +14 -0
  158. package/esm/hooks/useScale.js +8 -2
  159. package/esm/hooks/useTicks.js +2 -2
  160. package/esm/hooks/useTicksGrouped.js +2 -2
  161. package/esm/index.d.ts +1 -0
  162. package/esm/index.js +2 -1
  163. package/esm/internals/animation/Transition.js +1 -3
  164. package/esm/internals/index.d.ts +4 -3
  165. package/esm/internals/index.js +4 -3
  166. package/esm/internals/invertScale.js +2 -2
  167. package/esm/internals/plugins/allPlugins.d.ts +5 -4
  168. package/esm/internals/plugins/allPlugins.js +3 -2
  169. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  170. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  171. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
  172. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  173. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  174. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  175. package/{internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
  176. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
  177. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
  178. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +123 -0
  179. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
  180. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  181. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  182. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +46 -4
  183. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
  184. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +32 -21
  185. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  186. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
  187. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  188. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
  189. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  190. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
  191. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  192. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  193. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
  194. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  195. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
  196. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  197. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
  198. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  199. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
  200. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  201. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  202. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
  203. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +210 -0
  204. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
  205. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +7 -0
  206. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
  207. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
  208. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
  209. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  210. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  211. package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  212. package/esm/internals/scaleGuards.d.ts +11 -0
  213. package/esm/internals/scaleGuards.js +9 -0
  214. package/esm/locales/elGR.d.ts +96 -0
  215. package/esm/locales/elGR.js +100 -0
  216. package/esm/locales/enUS.d.ts +96 -0
  217. package/esm/locales/enUS.js +99 -1
  218. package/esm/locales/frFR.d.ts +96 -0
  219. package/esm/locales/frFR.js +100 -2
  220. package/esm/locales/ptBR.d.ts +96 -0
  221. package/esm/locales/ptBR.js +100 -0
  222. package/esm/locales/ptPT.d.ts +96 -0
  223. package/esm/locales/ptPT.js +100 -0
  224. package/esm/locales/svSE.d.ts +97 -1
  225. package/esm/locales/svSE.js +100 -0
  226. package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  227. package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
  228. package/esm/models/axis.d.ts +3 -0
  229. package/esm/plugins/index.d.ts +6 -0
  230. package/esm/plugins/index.js +12 -0
  231. package/hooks/useAxis.d.ts +5 -5
  232. package/hooks/useDrawingArea.d.ts +20 -2
  233. package/hooks/useFocusedItem.d.ts +15 -0
  234. package/hooks/useFocusedItem.js +26 -0
  235. package/hooks/useIsItemFocused.d.ts +12 -0
  236. package/hooks/useIsItemFocused.js +20 -0
  237. package/hooks/useIsItemFocusedGetter.d.ts +8 -0
  238. package/hooks/useIsItemFocusedGetter.js +18 -0
  239. package/hooks/useScale.js +8 -2
  240. package/hooks/useTicks.js +2 -2
  241. package/hooks/useTicksGrouped.js +2 -2
  242. package/index.d.ts +1 -0
  243. package/index.js +13 -1
  244. package/internals/animation/Transition.js +0 -2
  245. package/internals/index.d.ts +4 -3
  246. package/internals/index.js +24 -12
  247. package/internals/invertScale.js +2 -2
  248. package/internals/plugins/allPlugins.d.ts +5 -4
  249. package/internals/plugins/allPlugins.js +3 -2
  250. package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  251. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  252. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
  253. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  254. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  255. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  256. package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
  257. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
  258. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
  259. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +134 -0
  260. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
  261. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  262. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  263. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +47 -5
  264. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
  265. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +33 -22
  266. package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  267. package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
  268. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  269. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
  270. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  271. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
  272. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  273. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  274. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
  275. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  276. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
  277. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  278. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
  279. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  280. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
  281. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  282. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  283. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
  284. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +218 -0
  285. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
  286. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +13 -0
  287. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
  288. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
  289. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
  290. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  291. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  292. package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  293. package/internals/scaleGuards.d.ts +11 -0
  294. package/internals/scaleGuards.js +17 -0
  295. package/locales/elGR.d.ts +96 -0
  296. package/locales/elGR.js +100 -0
  297. package/locales/enUS.d.ts +96 -0
  298. package/locales/enUS.js +99 -1
  299. package/locales/frFR.d.ts +96 -0
  300. package/locales/frFR.js +100 -2
  301. package/locales/ptBR.d.ts +96 -0
  302. package/locales/ptBR.js +100 -0
  303. package/locales/ptPT.d.ts +96 -0
  304. package/locales/ptPT.js +100 -0
  305. package/locales/svSE.d.ts +97 -1
  306. package/locales/svSE.js +100 -0
  307. package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  308. package/locales/utils/getChartsLocalization.d.ts +96 -0
  309. package/models/axis.d.ts +3 -0
  310. package/package.json +4 -4
  311. package/plugins/index.d.ts +6 -0
  312. package/plugins/index.js +47 -0
  313. package/esm/internals/isBandScale.d.ts +0 -5
  314. package/esm/internals/isBandScale.js +0 -3
  315. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
  316. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  317. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
  318. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  319. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  320. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
  321. package/internals/isBandScale.d.ts +0 -5
  322. package/internals/isBandScale.js +0 -9
  323. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
  324. package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  325. package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
  326. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  327. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  328. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
  329. /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
  330. /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
@@ -16,11 +16,12 @@ var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
16
16
  var _useStore = require("../internals/store/useStore");
17
17
  var _useSelector = require("../internals/store/useSelector");
18
18
  var _useItemHighlightedGetter = require("../hooks/useItemHighlightedGetter");
19
- var _useChartVoronoi = require("../internals/plugins/featurePlugins/useChartVoronoi");
19
+ var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
20
20
  var _ScatterMarker = require("./ScatterMarker");
21
21
  var _scatterClasses = require("./scatterClasses");
22
22
  var _useScatterPlotData = require("./useScatterPlotData");
23
23
  var _ChartProvider = require("../context/ChartProvider");
24
+ var _useIsItemFocusedGetter = require("../hooks/useIsItemFocusedGetter");
24
25
  var _jsxRuntime = require("react/jsx-runtime");
25
26
  const _excluded = ["ownerState"];
26
27
  /**
@@ -49,12 +50,13 @@ function Scatter(props) {
49
50
  instance
50
51
  } = (0, _ChartProvider.useChartContext)();
51
52
  const store = (0, _useStore.useStore)();
52
- const isVoronoiEnabled = (0, _useSelector.useSelector)(store, _useChartVoronoi.selectorChartsVoronoiIsVoronoiEnabled);
53
+ const isVoronoiEnabled = (0, _useSelector.useSelector)(store, _useChartClosestPoint.selectorChartsIsVoronoiEnabled);
53
54
  const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
54
55
  const {
55
56
  isFaded,
56
57
  isHighlighted
57
58
  } = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
59
+ const isFocused = (0, _useIsItemFocusedGetter.useIsItemFocusedGetter)();
58
60
  const scatterPlotData = (0, _useScatterPlotData.useScatterPlotData)(series, xScale, yScale, instance.isPointInside);
59
61
  const Marker = slots?.marker ?? _ScatterMarker.ScatterMarker;
60
62
  const _useSlotProps = (0, _useSlotProps2.default)({
@@ -71,12 +73,17 @@ function Scatter(props) {
71
73
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
72
74
  "data-series": series.id,
73
75
  className: classes.root,
74
- children: scatterPlotData.map((dataPoint, i) => {
76
+ children: scatterPlotData.map(dataPoint => {
75
77
  const isItemHighlighted = isHighlighted(dataPoint);
76
78
  const isItemFaded = !isItemHighlighted && isFaded(dataPoint);
79
+ const isItemFocused = isFocused({
80
+ seriesType: 'scatter',
81
+ seriesId: series.id,
82
+ dataIndex: dataPoint.dataIndex
83
+ });
77
84
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Marker, (0, _extends2.default)({
78
85
  dataIndex: dataPoint.dataIndex,
79
- color: colorGetter ? colorGetter(i) : color,
86
+ color: colorGetter ? colorGetter(dataPoint.dataIndex) : color,
80
87
  isHighlighted: isItemHighlighted,
81
88
  isFaded: isItemFaded,
82
89
  x: dataPoint.x,
@@ -87,7 +94,8 @@ function Scatter(props) {
87
94
  dataIndex: dataPoint.dataIndex
88
95
  })),
89
96
  "data-highlighted": isItemHighlighted || undefined,
90
- "data-faded": isItemFaded || undefined
97
+ "data-faded": isItemFaded || undefined,
98
+ "data-focused": isItemFocused || undefined
91
99
  }, skipInteractionHandlers ? undefined : (0, _useInteractionItemProps.getInteractionItemProps)(instance, dataPoint), markerProps), dataPoint.id ?? dataPoint.dataIndex);
92
100
  })
93
101
  });
@@ -13,8 +13,8 @@ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "
13
13
  import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
14
14
  import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
15
15
  import { ChartsGridProps } from "../ChartsGrid/index.js";
16
- import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/useChartVoronoi/index.js";
17
- import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
16
+ import { UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
17
+ import { ScatterChartPluginSignatures } from "./ScatterChart.plugins.js";
18
18
  export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
19
19
  export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, Omit<ChartsTooltipSlotProps, 'tooltip'>, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {
20
20
  /**
@@ -24,7 +24,7 @@ export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotS
24
24
  tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
25
25
  }
26
26
  export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
27
- export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
27
+ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ScatterPlotProps, 'renderer'> {
28
28
  /**
29
29
  * The series to display in the scatter chart.
30
30
  * An array of [[ScatterSeries]] objects.
@@ -69,7 +69,7 @@ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', S
69
69
  * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element if using Voronoi cells. Or the Mouse event from the scatter element, when `disableVoronoi=true`.
70
70
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
71
71
  */
72
- onItemClick?: ScatterPlotProps['onItemClick'] | UseChartVoronoiSignature['params']['onItemClick'];
72
+ onItemClick?: ScatterPlotProps['onItemClick'] | UseChartClosestPointSignature['params']['onItemClick'];
73
73
  }
74
74
  /**
75
75
  * Demos:
@@ -110,6 +110,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
110
110
  * @default false
111
111
  */
112
112
  disableVoronoi: _propTypes.default.bool,
113
+ enableKeyboardNavigation: _propTypes.default.bool,
113
114
  /**
114
115
  * Option to display a cartesian grid in the background.
115
116
  */
@@ -178,6 +179,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
178
179
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
179
180
  */
180
181
  onItemClick: _propTypes.default.func,
182
+ /**
183
+ * The type of renderer to use for the scatter plot.
184
+ * - `svg-single`: Renders every scatter item in a `<circle />` element.
185
+ * - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
186
+ * Read more: https://mui.com/x/react-charts/scatter/#performance
187
+ *
188
+ * @default 'svg-single'
189
+ */
190
+ renderer: _propTypes.default.oneOf(['svg-batch', 'svg-single']),
181
191
  /**
182
192
  * The series to display in the scatter chart.
183
193
  * An array of [[ScatterSeries]] objects.
@@ -207,10 +217,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
207
217
  theme: _propTypes.default.oneOf(['dark', 'light']),
208
218
  title: _propTypes.default.string,
209
219
  /**
210
- * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
220
+ * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
221
+ * If set to `'item'`, the radius is the `markerSize`.
211
222
  * If `undefined`, the radius is assumed to be infinite.
212
223
  */
213
- voronoiMaxRadius: _propTypes.default.number,
224
+ voronoiMaxRadius: _propTypes.default.oneOfType([_propTypes.default.oneOf(['item']), _propTypes.default.number]),
214
225
  /**
215
226
  * The width of the chart in px. If not defined, it takes the width of the parent element.
216
227
  */
@@ -3,6 +3,7 @@ import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlug
3
3
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
4
4
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
5
5
  import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
6
- import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/useChartVoronoi/index.js";
7
- export type ScatterChartPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature];
8
- export declare const SCATTER_CHART_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartPluginsSignatures>;
6
+ import { UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
7
+ import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
8
+ export type ScatterChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
9
+ export declare const SCATTER_CHART_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartPluginSignatures>;
@@ -8,5 +8,6 @@ var _useChartZAxis = require("../internals/plugins/featurePlugins/useChartZAxis"
8
8
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
9
9
  var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
10
10
  var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
11
- var _useChartVoronoi = require("../internals/plugins/featurePlugins/useChartVoronoi");
12
- const SCATTER_CHART_PLUGINS = exports.SCATTER_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartVoronoi.useChartVoronoi];
11
+ var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
12
+ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
13
+ const SCATTER_CHART_PLUGINS = exports.SCATTER_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
@@ -6,6 +6,7 @@ export interface ScatterPlotSlots extends ScatterSlots {
6
6
  export interface ScatterPlotSlotProps extends ScatterSlotProps {
7
7
  scatter?: Partial<ScatterProps>;
8
8
  }
9
+ export type RendererType = 'svg-single' | 'svg-batch';
9
10
  export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
10
11
  /**
11
12
  * Overridable component slots.
@@ -17,6 +18,15 @@ export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
17
18
  * @default {}
18
19
  */
19
20
  slotProps?: ScatterPlotSlotProps;
21
+ /**
22
+ * The type of renderer to use for the scatter plot.
23
+ * - `svg-single`: Renders every scatter item in a `<circle />` element.
24
+ * - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
25
+ * Read more: https://mui.com/x/react-charts/scatter/#performance
26
+ *
27
+ * @default 'svg-single'
28
+ */
29
+ renderer?: RendererType;
20
30
  }
21
31
  /**
22
32
  * Demos:
@@ -15,6 +15,7 @@ var _useScatterSeries = require("../hooks/useScatterSeries");
15
15
  var _hooks = require("../hooks");
16
16
  var _useZAxis = require("../hooks/useZAxis");
17
17
  var _seriesConfig = require("./seriesConfig");
18
+ var _BatchScatter = require("./BatchScatter");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
20
  /**
20
21
  * Demos:
@@ -30,7 +31,8 @@ function ScatterPlot(props) {
30
31
  const {
31
32
  slots,
32
33
  slotProps,
33
- onItemClick
34
+ onItemClick,
35
+ renderer
34
36
  } = props;
35
37
  const seriesData = (0, _useScatterSeries.useScatterSeriesContext)();
36
38
  const {
@@ -55,7 +57,8 @@ function ScatterPlot(props) {
55
57
  const defaultXAxisId = xAxisIds[0];
56
58
  const defaultYAxisId = yAxisIds[0];
57
59
  const defaultZAxisId = zAxisIds[0];
58
- const ScatterItems = slots?.scatter ?? _Scatter.Scatter;
60
+ const DefaultScatterItems = renderer === 'svg-batch' ? _BatchScatter.BatchScatter : _Scatter.Scatter;
61
+ const ScatterItems = slots?.scatter ?? DefaultScatterItems;
59
62
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
60
63
  children: seriesOrder.map(seriesId => {
61
64
  const {
@@ -92,6 +95,15 @@ process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
92
95
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
93
96
  */
94
97
  onItemClick: _propTypes.default.func,
98
+ /**
99
+ * The type of renderer to use for the scatter plot.
100
+ * - `svg-single`: Renders every scatter item in a `<circle />` element.
101
+ * - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
102
+ * Read more: https://mui.com/x/react-charts/scatter/#performance
103
+ *
104
+ * @default 'svg-single'
105
+ */
106
+ renderer: _propTypes.default.oneOf(['svg-batch', 'svg-single']),
95
107
  /**
96
108
  * The props used for each component slot.
97
109
  * @default {}
@@ -3,5 +3,6 @@ export * from "./ScatterPlot.js";
3
3
  export * from "./Scatter.js";
4
4
  export * from "./ScatterMarker.types.js";
5
5
  export * from "./ScatterMarker.js";
6
+ export * from "./ScatterChart.plugins.js";
6
7
  export type { ScatterClasses } from "./scatterClasses.js";
7
8
  export { scatterClasses } from "./scatterClasses.js";
@@ -72,4 +72,16 @@ Object.keys(_ScatterMarker2).forEach(function (key) {
72
72
  }
73
73
  });
74
74
  });
75
+ var _ScatterChart2 = require("./ScatterChart.plugins");
76
+ Object.keys(_ScatterChart2).forEach(function (key) {
77
+ if (key === "default" || key === "__esModule") return;
78
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
79
+ if (key in exports && exports[key] === _ScatterChart2[key]) return;
80
+ Object.defineProperty(exports, key, {
81
+ enumerable: true,
82
+ get: function () {
83
+ return _ScatterChart2[key];
84
+ }
85
+ });
86
+ });
75
87
  var _scatterClasses = require("./scatterClasses");
@@ -8,7 +8,7 @@ import { ChartContainerProps } from "../ChartContainer/index.js";
8
8
  import type { ScatterChartProps } from "./ScatterChart.js";
9
9
  import type { ScatterPlotProps } from "./ScatterPlot.js";
10
10
  import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
11
- import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
11
+ import { ScatterChartPluginSignatures } from "./ScatterChart.plugins.js";
12
12
  /**
13
13
  * A helper function that extracts ScatterChartProps from the input props
14
14
  * and returns an object with props for the children components of ScatterChart.
@@ -18,7 +18,7 @@ import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
18
18
  */
19
19
  export declare const useScatterChartProps: (props: ScatterChartProps) => {
20
20
  chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
21
- chartContainerProps: ChartContainerProps<"scatter", ScatterChartPluginsSignatures>;
21
+ chartContainerProps: ChartContainerProps<"scatter", ScatterChartPluginSignatures>;
22
22
  chartsAxisProps: ChartsAxisProps;
23
23
  gridProps: ChartsGridProps;
24
24
  scatterPlotProps: ScatterPlotProps;
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _ScatterChart = require("./ScatterChart.plugins");
14
- const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
14
+ const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar", "renderer"];
15
15
  /**
16
16
  * A helper function that extracts ScatterChartProps from the input props
17
17
  * and returns an object with props for the children components of ScatterChart.
@@ -41,12 +41,14 @@ const useScatterChartProps = props => {
41
41
  loading,
42
42
  highlightedItem,
43
43
  onHighlightChange,
44
- className
44
+ className,
45
+ renderer
45
46
  } = props,
46
47
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
47
48
  const seriesWithDefault = React.useMemo(() => series.map(s => (0, _extends2.default)({
48
49
  type: 'scatter'
49
50
  }, s)), [series]);
51
+ const useVoronoiOnItemClick = disableVoronoi !== true || renderer === 'svg-batch';
50
52
  const chartContainerProps = (0, _extends2.default)({}, other, {
51
53
  series: seriesWithDefault,
52
54
  width,
@@ -60,7 +62,7 @@ const useScatterChartProps = props => {
60
62
  onHighlightChange,
61
63
  disableVoronoi,
62
64
  voronoiMaxRadius,
63
- onItemClick: disableVoronoi ? undefined : onItemClick,
65
+ onItemClick: useVoronoiOnItemClick ? onItemClick : undefined,
64
66
  className,
65
67
  plugins: _ScatterChart.SCATTER_CHART_PLUGINS,
66
68
  slots,
@@ -75,9 +77,10 @@ const useScatterChartProps = props => {
75
77
  horizontal: grid?.horizontal
76
78
  };
77
79
  const scatterPlotProps = {
78
- onItemClick: disableVoronoi ? onItemClick : undefined,
80
+ onItemClick: useVoronoiOnItemClick ? undefined : onItemClick,
79
81
  slots,
80
- slotProps
82
+ slotProps,
83
+ renderer
81
84
  };
82
85
  const overlayProps = {
83
86
  loading,
@@ -95,7 +98,8 @@ const useScatterChartProps = props => {
95
98
  const chartsWrapperProps = {
96
99
  sx,
97
100
  legendPosition: props.slotProps?.legend?.position,
98
- legendDirection: props.slotProps?.legend?.direction
101
+ legendDirection: props.slotProps?.legend?.direction,
102
+ hideLegend: props.hideLegend ?? false
99
103
  };
100
104
  return {
101
105
  chartsWrapperProps,
@@ -20,6 +20,7 @@ var _ChartsSurface = require("../ChartsSurface");
20
20
  var _constants = require("../constants");
21
21
  var _ChartsTooltip = require("../ChartsTooltip");
22
22
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
23
+ var _FocusedMark = require("../LineChart/FocusedMark");
23
24
  var _jsxRuntime = require("react/jsx-runtime");
24
25
  const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "baseline", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className", "disableClipping", "clipAreaOffset", "onHighlightChange", "onHighlightedAxisChange", "highlightedAxis", "highlightedItem"];
25
26
  const SPARK_LINE_DEFAULT_MARGIN = 5;
@@ -144,9 +145,11 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
144
145
  slotProps: slotProps
145
146
  })]
146
147
  })]
147
- }), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, {
148
- slots: slots,
149
- slotProps: slotProps
148
+ }), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
149
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, {
150
+ slots: slots,
151
+ slotProps: slotProps
152
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedMark.FocusedMark, {})]
150
153
  }), disableClipping ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
151
154
  id: clipPathId,
152
155
  offset: clipPathOffset
@@ -232,6 +235,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
232
235
  * If true, the voronoi interaction are ignored.
233
236
  */
234
237
  disableVoronoi: _propTypes.default.bool,
238
+ enableKeyboardNavigation: _propTypes.default.bool,
235
239
  /**
236
240
  * The height of the chart in px. If not defined, it takes the height of the parent element.
237
241
  */
@@ -345,10 +349,11 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
345
349
  */
346
350
  valueFormatter: _propTypes.default.func,
347
351
  /**
348
- * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
352
+ * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
353
+ * If set to `'item'`, the radius is the `markerSize`.
349
354
  * If `undefined`, the radius is assumed to be infinite.
350
355
  */
351
- voronoiMaxRadius: _propTypes.default.number,
356
+ voronoiMaxRadius: _propTypes.default.oneOfType([_propTypes.default.oneOf(['item']), _propTypes.default.number]),
352
357
  /**
353
358
  * The width of the chart in px. If not defined, it takes the width of the parent element.
354
359
  */
@@ -1,4 +1,4 @@
1
1
  export type ChartsColorPaletteCallback = (mode: 'light' | 'dark') => string[];
2
- export type ChartsColorPalette = string[] | ChartsColorPaletteCallback;
2
+ export type ChartsColorPalette = readonly string[] | ChartsColorPaletteCallback;
3
3
  export type ChartsColorCallback = (mode: 'light' | 'dark') => string;
4
4
  export type ChartsColor = string | ChartsColorCallback;
@@ -1,14 +1,14 @@
1
1
  import type { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
2
- import type { BarChartPluginsSignatures } from "../BarChart/BarChart.plugins.js";
3
- import type { ScatterChartPluginsSignatures } from "../ScatterChart/ScatterChart.plugins.js";
4
- import type { LineChartPluginsSignatures } from "../LineChart/LineChart.plugins.js";
2
+ import type { BarChartPluginSignatures } from "../BarChart/BarChart.plugins.js";
3
+ import type { ScatterChartPluginSignatures } from "../ScatterChart/ScatterChart.plugins.js";
4
+ import type { LineChartPluginSignatures } from "../LineChart/LineChart.plugins.js";
5
5
  import type { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
6
6
  import type { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
7
7
  import type { ChartPublicAPI } from "../internals/plugins/models/index.js";
8
8
  export type PluginsPerSeriesType = {
9
- line: LineChartPluginsSignatures;
10
- scatter: ScatterChartPluginsSignatures;
11
- bar: BarChartPluginsSignatures;
9
+ line: LineChartPluginSignatures;
10
+ scatter: ScatterChartPluginSignatures;
11
+ bar: BarChartPluginSignatures;
12
12
  pie: PieChartPluginSignatures;
13
13
  composition: DefaultPluginSignatures;
14
14
  };
@@ -12,11 +12,11 @@ import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
12
12
  import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
13
13
  import { ChartsGridProps } from "../ChartsGrid/index.js";
14
14
  import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
15
- import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
15
+ import { BarChartPluginSignatures } from "./BarChart.plugins.js";
16
16
  export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
17
17
  export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
18
18
  export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
19
- export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
19
+ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
20
20
  /**
21
21
  * The series to display in the bar chart.
22
22
  * An array of [[BarSeries]] objects.
@@ -112,6 +112,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
112
112
  * @default false
113
113
  */
114
114
  disableAxisListener: PropTypes.bool,
115
+ enableKeyboardNavigation: PropTypes.bool,
115
116
  /**
116
117
  * Option to display a cartesian grid in the background.
117
118
  */
@@ -2,6 +2,7 @@ import { UseChartZAxisSignature } from "../internals/plugins/featurePlugins/useC
2
2
  import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
3
3
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
4
4
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
5
+ import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
5
6
  import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
6
- export type BarChartPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature];
7
- export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPluginsSignatures>;
7
+ export type BarChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
8
+ export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPluginSignatures>;
@@ -2,4 +2,5 @@ import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis
2
2
  import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
3
3
  import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
4
4
  import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
5
- export const BAR_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight];
5
+ import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
6
+ export const BAR_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
@@ -10,6 +10,7 @@ import { useUtilityClasses } from "./barElementClasses.js";
10
10
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
11
11
  import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
12
12
  import { AnimatedBarElement } from "./AnimatedBarElement.js";
13
+ import { useIsItemFocused } from "../hooks/useIsItemFocused.js";
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
14
15
  function BarElement(props) {
15
16
  const {
@@ -43,13 +44,19 @@ function BarElement(props) {
43
44
  seriesId: id,
44
45
  dataIndex
45
46
  });
47
+ const isFocused = useIsItemFocused({
48
+ seriesType: 'bar',
49
+ seriesId: id,
50
+ dataIndex
51
+ });
46
52
  const ownerState = {
47
53
  id,
48
54
  dataIndex,
49
55
  classes: innerClasses,
50
56
  color,
51
57
  isFaded,
52
- isHighlighted
58
+ isHighlighted,
59
+ isFocused
53
60
  };
54
61
  const classes = useUtilityClasses(ownerState);
55
62
  const Bar = slots?.bar ?? AnimatedBarElement;
@@ -73,7 +80,8 @@ function BarElement(props) {
73
80
  stroke: 'none',
74
81
  fill: color,
75
82
  skipAnimation,
76
- layout
83
+ layout,
84
+ 'data-focused': isFocused || undefined
77
85
  }),
78
86
  className: classes.root,
79
87
  ownerState
@@ -3,5 +3,7 @@ export * from "./BarPlot.js";
3
3
  export * from "./BarElement.js";
4
4
  export * from "./BarLabel/index.js";
5
5
  export * from "./barElementClasses.js";
6
+ export * from "./BarChart.plugins.js";
7
+ export { type BarProps } from "./AnimatedBarElement.js";
6
8
  export { barClasses, getBarUtilityClass } from "./barClasses.js";
7
9
  export type { BarClassKey, BarClasses } from "./barClasses.js";
@@ -3,4 +3,5 @@ export * from "./BarPlot.js";
3
3
  export * from "./BarElement.js";
4
4
  export * from "./BarLabel/index.js";
5
5
  export * from "./barElementClasses.js";
6
+ export * from "./BarChart.plugins.js";
6
7
  export { barClasses, getBarUtilityClass } from "./barClasses.js";
@@ -9,7 +9,7 @@ import { ChartsAxisProps } from "../ChartsAxis/index.js";
9
9
  import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
10
10
  import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
11
11
  import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
12
- import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
12
+ import { BarChartPluginSignatures } from "./BarChart.plugins.js";
13
13
  /**
14
14
  * A helper function that extracts BarChartProps from the input props
15
15
  * and returns an object with props for the children components of BarChart.
@@ -19,7 +19,7 @@ import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
19
19
  */
20
20
  export declare const useBarChartProps: (props: BarChartProps) => {
21
21
  chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
22
- chartContainerProps: ChartContainerProps<"bar", BarChartPluginsSignatures>;
22
+ chartContainerProps: ChartContainerProps<"bar", BarChartPluginSignatures>;
23
23
  barPlotProps: BarPlotProps;
24
24
  gridProps: ChartsGridProps;
25
25
  clipPathProps: ChartsClipPathProps;
@@ -41,7 +41,7 @@ export const useBarChartProps = props => {
41
41
  barLabel,
42
42
  className
43
43
  } = props,
44
- rest = _objectWithoutPropertiesLoose(props, _excluded);
44
+ other = _objectWithoutPropertiesLoose(props, _excluded);
45
45
  const id = useId();
46
46
  const clipPathId = `${id}-clip-path`;
47
47
  const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
@@ -82,7 +82,7 @@ export const useBarChartProps = props => {
82
82
  scaleType: 'band'
83
83
  }, axis)) : yAxis;
84
84
  }, [defaultYAxis, hasHorizontalSeries, yAxis]);
85
- const chartContainerProps = _extends({}, rest, {
85
+ const chartContainerProps = _extends({}, other, {
86
86
  series: seriesWithDefault,
87
87
  width,
88
88
  height,
@@ -136,7 +136,8 @@ export const useBarChartProps = props => {
136
136
  const chartsWrapperProps = {
137
137
  sx,
138
138
  legendPosition: props.slotProps?.legend?.position,
139
- legendDirection: props.slotProps?.legend?.direction
139
+ legendDirection: props.slotProps?.legend?.direction,
140
+ hideLegend: props.hideLegend ?? false
140
141
  };
141
142
  return {
142
143
  chartsWrapperProps,
@@ -76,6 +76,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
76
76
  * If true, the voronoi interaction are ignored.
77
77
  */
78
78
  disableVoronoi: PropTypes.bool,
79
+ enableKeyboardNavigation: PropTypes.bool,
79
80
  /**
80
81
  * Options to enable features planned for the next major.
81
82
  */
@@ -658,10 +659,11 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
658
659
  theme: PropTypes.oneOf(['dark', 'light']),
659
660
  title: PropTypes.string,
660
661
  /**
661
- * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
662
+ * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
663
+ * If set to `'item'`, the radius is the `markerSize`.
662
664
  * If `undefined`, the radius is assumed to be infinite.
663
665
  */
664
- voronoiMaxRadius: PropTypes.number,
666
+ voronoiMaxRadius: PropTypes.oneOfType([PropTypes.oneOf(['item']), PropTypes.number]),
665
667
  /**
666
668
  * The width of the chart in px. If not defined, it takes the width of the parent element.
667
669
  */
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures"];
5
+ const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation"];
6
6
  import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
7
7
  export const useChartContainerProps = (props, ref) => {
8
8
  const _ref = props,
@@ -37,7 +37,8 @@ export const useChartContainerProps = (props, ref) => {
37
37
  localeText,
38
38
  slots,
39
39
  slotProps,
40
- experimentalFeatures
40
+ experimentalFeatures,
41
+ enableKeyboardNavigation
41
42
  } = _ref,
42
43
  other = _objectWithoutPropertiesLoose(_ref, _excluded);
43
44
  const chartsSurfaceProps = _extends({
@@ -71,6 +72,7 @@ export const useChartContainerProps = (props, ref) => {
71
72
  localeText,
72
73
  seriesConfig,
73
74
  experimentalFeatures,
75
+ enableKeyboardNavigation,
74
76
  plugins: plugins ?? DEFAULT_PLUGINS,
75
77
  slots,
76
78
  slotProps
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/useScale.js";
5
- import { isBandScale } from "../internals/isBandScale.js";
5
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
6
6
  import { useSelector } from "../internals/store/useSelector.js";
7
7
  import { useStore } from "../internals/store/useStore.js";
8
8
  import { selectorChartsHighlightXAxisValue, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
@@ -35,15 +35,15 @@ export default function ChartsXHighlight(props) {
35
35
  const xAxis = xAxes.axis[axisId];
36
36
  const xScale = xAxis.scale;
37
37
  const getXPosition = getValueToPositionMapper(xScale);
38
- const isBandScaleX = type === 'band' && value !== null && isBandScale(xScale);
38
+ const isXScaleOrdinal = type === 'band' && value !== null && isOrdinalScale(xScale);
39
39
  if (process.env.NODE_ENV !== 'production') {
40
- const isError = isBandScaleX && xScale(value) === undefined;
40
+ const isError = isXScaleOrdinal && xScale(value) === undefined;
41
41
  if (isError) {
42
42
  console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
43
43
  }
44
44
  }
45
45
  return /*#__PURE__*/_jsxs(React.Fragment, {
46
- children: [isBandScaleX && xScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
46
+ children: [isXScaleOrdinal && xScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
47
47
  d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
48
48
  className: classes.root,
49
49
  ownerState: {