@mui/x-charts 8.11.3 → 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 (282) 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 +1 -0
  7. package/BarChart/index.js +12 -0
  8. package/BarChart/useBarChartProps.d.ts +2 -2
  9. package/CHANGELOG.md +151 -6
  10. package/ChartContainer/ChartContainer.js +4 -2
  11. package/ChartContainer/useChartContainerProps.js +4 -2
  12. package/ChartsLegend/ContinuousColorLegend.js +1 -0
  13. package/ChartsLegend/PiecewiseColorLegend.js +1 -0
  14. package/ChartsSurface/ChartsSurface.js +21 -2
  15. package/ChartsWrapper/ChartsWrapper.d.ts +2 -1
  16. package/ChartsWrapper/ChartsWrapper.js +49 -46
  17. package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  18. package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  19. package/LineChart/FocusedMark.d.ts +2 -0
  20. package/LineChart/FocusedMark.js +44 -0
  21. package/LineChart/LineChart.d.ts +2 -2
  22. package/LineChart/LineChart.js +3 -1
  23. package/LineChart/LineChart.plugins.d.ts +3 -2
  24. package/LineChart/LineChart.plugins.js +2 -1
  25. package/LineChart/index.d.ts +1 -0
  26. package/LineChart/index.js +12 -0
  27. package/LineChart/useLineChartProps.d.ts +2 -2
  28. package/PieChart/PieArc.d.ts +1 -0
  29. package/PieChart/PieArc.js +7 -3
  30. package/PieChart/PieArcPlot.js +1 -0
  31. package/PieChart/PieChart.js +1 -0
  32. package/PieChart/PieChart.plugins.d.ts +2 -1
  33. package/PieChart/PieChart.plugins.js +2 -1
  34. package/PieChart/dataTransform/useTransformData.d.ts +1 -0
  35. package/PieChart/dataTransform/useTransformData.js +9 -1
  36. package/PieChart/index.d.ts +1 -0
  37. package/PieChart/index.js +12 -0
  38. package/RadarChart/RadarChart.plugins.d.ts +1 -1
  39. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  40. package/RadarChart/index.d.ts +2 -1
  41. package/RadarChart/index.js +12 -0
  42. package/RadarChart/useRadarChartProps.d.ts +2 -2
  43. package/ScatterChart/BatchScatter.d.ts +32 -0
  44. package/ScatterChart/BatchScatter.js +171 -0
  45. package/ScatterChart/Scatter.js +13 -5
  46. package/ScatterChart/ScatterChart.d.ts +4 -4
  47. package/ScatterChart/ScatterChart.js +13 -2
  48. package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  49. package/ScatterChart/ScatterChart.plugins.js +3 -2
  50. package/ScatterChart/ScatterPlot.d.ts +10 -0
  51. package/ScatterChart/ScatterPlot.js +14 -2
  52. package/ScatterChart/index.d.ts +1 -0
  53. package/ScatterChart/index.js +12 -0
  54. package/ScatterChart/useScatterChartProps.d.ts +2 -2
  55. package/ScatterChart/useScatterChartProps.js +8 -5
  56. package/SparkLineChart/SparkLineChart.js +10 -5
  57. package/Toolbar/Toolbar.js +1 -2
  58. package/colorPalettes/types.d.ts +1 -1
  59. package/context/ChartApi.d.ts +6 -6
  60. package/esm/BarChart/BarChart.d.ts +2 -2
  61. package/esm/BarChart/BarChart.js +1 -0
  62. package/esm/BarChart/BarChart.plugins.d.ts +3 -2
  63. package/esm/BarChart/BarChart.plugins.js +2 -1
  64. package/esm/BarChart/BarElement.js +10 -2
  65. package/esm/BarChart/index.d.ts +1 -0
  66. package/esm/BarChart/index.js +1 -0
  67. package/esm/BarChart/useBarChartProps.d.ts +2 -2
  68. package/esm/ChartContainer/ChartContainer.js +4 -2
  69. package/esm/ChartContainer/useChartContainerProps.js +4 -2
  70. package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
  71. package/esm/ChartsLegend/PiecewiseColorLegend.js +1 -0
  72. package/esm/ChartsSurface/ChartsSurface.js +21 -2
  73. package/esm/ChartsWrapper/ChartsWrapper.d.ts +2 -1
  74. package/esm/ChartsWrapper/ChartsWrapper.js +49 -46
  75. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  76. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  77. package/esm/LineChart/FocusedMark.d.ts +2 -0
  78. package/esm/LineChart/FocusedMark.js +38 -0
  79. package/esm/LineChart/LineChart.d.ts +2 -2
  80. package/esm/LineChart/LineChart.js +3 -1
  81. package/esm/LineChart/LineChart.plugins.d.ts +3 -2
  82. package/esm/LineChart/LineChart.plugins.js +2 -1
  83. package/esm/LineChart/index.d.ts +1 -0
  84. package/esm/LineChart/index.js +1 -0
  85. package/esm/LineChart/useLineChartProps.d.ts +2 -2
  86. package/esm/PieChart/PieArc.d.ts +1 -0
  87. package/esm/PieChart/PieArc.js +7 -3
  88. package/esm/PieChart/PieArcPlot.js +1 -0
  89. package/esm/PieChart/PieChart.js +1 -0
  90. package/esm/PieChart/PieChart.plugins.d.ts +2 -1
  91. package/esm/PieChart/PieChart.plugins.js +2 -1
  92. package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
  93. package/esm/PieChart/dataTransform/useTransformData.js +9 -1
  94. package/esm/PieChart/index.d.ts +1 -0
  95. package/esm/PieChart/index.js +1 -0
  96. package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
  97. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  98. package/esm/RadarChart/index.d.ts +2 -1
  99. package/esm/RadarChart/index.js +2 -1
  100. package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
  101. package/esm/ScatterChart/BatchScatter.d.ts +32 -0
  102. package/esm/ScatterChart/BatchScatter.js +165 -0
  103. package/esm/ScatterChart/Scatter.js +13 -5
  104. package/esm/ScatterChart/ScatterChart.d.ts +4 -4
  105. package/esm/ScatterChart/ScatterChart.js +13 -2
  106. package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  107. package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
  108. package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
  109. package/esm/ScatterChart/ScatterPlot.js +14 -2
  110. package/esm/ScatterChart/index.d.ts +1 -0
  111. package/esm/ScatterChart/index.js +1 -0
  112. package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
  113. package/esm/ScatterChart/useScatterChartProps.js +8 -5
  114. package/esm/SparkLineChart/SparkLineChart.js +10 -5
  115. package/esm/Toolbar/Toolbar.js +1 -2
  116. package/esm/colorPalettes/types.d.ts +1 -1
  117. package/esm/context/ChartApi.d.ts +6 -6
  118. package/esm/hooks/useAxis.d.ts +5 -5
  119. package/esm/hooks/useDrawingArea.d.ts +20 -2
  120. package/esm/hooks/useFocusedItem.d.ts +15 -0
  121. package/esm/hooks/useFocusedItem.js +20 -0
  122. package/esm/hooks/useIsItemFocused.d.ts +12 -0
  123. package/esm/hooks/useIsItemFocused.js +15 -0
  124. package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
  125. package/esm/hooks/useIsItemFocusedGetter.js +14 -0
  126. package/esm/hooks/useScale.js +6 -0
  127. package/esm/index.d.ts +1 -0
  128. package/esm/index.js +2 -1
  129. package/esm/internals/animation/Transition.js +1 -3
  130. package/esm/internals/index.d.ts +3 -2
  131. package/esm/internals/index.js +3 -2
  132. package/esm/internals/plugins/allPlugins.d.ts +5 -4
  133. package/esm/internals/plugins/allPlugins.js +3 -2
  134. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  135. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  136. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
  137. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  138. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  139. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  140. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
  141. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
  142. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
  143. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +123 -0
  144. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  145. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  146. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +46 -4
  147. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
  148. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +32 -21
  149. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  150. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
  151. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  152. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
  153. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  154. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
  155. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  156. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  157. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
  158. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  159. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
  160. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  161. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
  162. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  163. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
  164. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  165. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  166. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
  167. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +210 -0
  168. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
  169. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +7 -0
  170. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
  171. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
  172. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  173. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  174. package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  175. package/esm/internals/scaleGuards.d.ts +7 -0
  176. package/esm/internals/scaleGuards.js +6 -0
  177. package/esm/locales/elGR.d.ts +96 -0
  178. package/esm/locales/elGR.js +100 -0
  179. package/esm/locales/enUS.d.ts +96 -0
  180. package/esm/locales/enUS.js +99 -1
  181. package/esm/locales/frFR.d.ts +96 -0
  182. package/esm/locales/frFR.js +100 -2
  183. package/esm/locales/ptBR.d.ts +96 -0
  184. package/esm/locales/ptBR.js +100 -0
  185. package/esm/locales/ptPT.d.ts +96 -0
  186. package/esm/locales/ptPT.js +100 -0
  187. package/esm/locales/svSE.d.ts +97 -1
  188. package/esm/locales/svSE.js +100 -0
  189. package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  190. package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
  191. package/esm/plugins/index.d.ts +6 -0
  192. package/esm/plugins/index.js +12 -0
  193. package/hooks/useAxis.d.ts +5 -5
  194. package/hooks/useDrawingArea.d.ts +20 -2
  195. package/hooks/useFocusedItem.d.ts +15 -0
  196. package/hooks/useFocusedItem.js +26 -0
  197. package/hooks/useIsItemFocused.d.ts +12 -0
  198. package/hooks/useIsItemFocused.js +20 -0
  199. package/hooks/useIsItemFocusedGetter.d.ts +8 -0
  200. package/hooks/useIsItemFocusedGetter.js +18 -0
  201. package/hooks/useScale.js +6 -0
  202. package/index.d.ts +1 -0
  203. package/index.js +13 -1
  204. package/internals/animation/Transition.js +0 -2
  205. package/internals/index.d.ts +3 -2
  206. package/internals/index.js +20 -8
  207. package/internals/plugins/allPlugins.d.ts +5 -4
  208. package/internals/plugins/allPlugins.js +3 -2
  209. package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  210. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  211. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
  212. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  213. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  214. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  215. package/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
  216. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
  217. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
  218. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +134 -0
  219. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  220. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  221. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +47 -5
  222. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
  223. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +33 -22
  224. package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  225. package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
  226. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  227. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
  228. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  229. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
  230. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  231. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  232. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
  233. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  234. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
  235. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  236. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
  237. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  238. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
  239. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  240. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  241. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
  242. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +218 -0
  243. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
  244. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +13 -0
  245. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
  246. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
  247. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  248. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  249. package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  250. package/internals/scaleGuards.d.ts +7 -0
  251. package/internals/scaleGuards.js +8 -0
  252. package/locales/elGR.d.ts +96 -0
  253. package/locales/elGR.js +100 -0
  254. package/locales/enUS.d.ts +96 -0
  255. package/locales/enUS.js +99 -1
  256. package/locales/frFR.d.ts +96 -0
  257. package/locales/frFR.js +100 -2
  258. package/locales/ptBR.d.ts +96 -0
  259. package/locales/ptBR.js +100 -0
  260. package/locales/ptPT.d.ts +96 -0
  261. package/locales/ptPT.js +100 -0
  262. package/locales/svSE.d.ts +97 -1
  263. package/locales/svSE.js +100 -0
  264. package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  265. package/locales/utils/getChartsLocalization.d.ts +96 -0
  266. package/package.json +4 -4
  267. package/plugins/index.d.ts +6 -0
  268. package/plugins/index.js +47 -0
  269. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
  270. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  271. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
  272. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  273. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  274. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
  275. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
  276. package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  277. package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
  278. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  279. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  280. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
  281. /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
  282. /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
@@ -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.
@@ -119,6 +119,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
119
119
  * @default false
120
120
  */
121
121
  disableAxisListener: _propTypes.default.bool,
122
+ enableKeyboardNavigation: _propTypes.default.bool,
122
123
  /**
123
124
  * Option to display a cartesian grid in the background.
124
125
  */
@@ -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>;
@@ -8,4 +8,5 @@ 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
- const BAR_CHART_PLUGINS = exports.BAR_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight];
11
+ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
12
+ const BAR_CHART_PLUGINS = exports.BAR_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartKeyboardNavigation.useChartKeyboardNavigation];
@@ -16,6 +16,7 @@ var _barElementClasses = require("./barElementClasses");
16
16
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
17
17
  var _useItemHighlighted = require("../hooks/useItemHighlighted");
18
18
  var _AnimatedBarElement = require("./AnimatedBarElement");
19
+ var _useIsItemFocused = require("../hooks/useIsItemFocused");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick", "skipAnimation", "layout", "x", "xOrigin", "y", "yOrigin", "width", "height"];
21
22
  function BarElement(props) {
@@ -50,13 +51,19 @@ function BarElement(props) {
50
51
  seriesId: id,
51
52
  dataIndex
52
53
  });
54
+ const isFocused = (0, _useIsItemFocused.useIsItemFocused)({
55
+ seriesType: 'bar',
56
+ seriesId: id,
57
+ dataIndex
58
+ });
53
59
  const ownerState = {
54
60
  id,
55
61
  dataIndex,
56
62
  classes: innerClasses,
57
63
  color,
58
64
  isFaded,
59
- isHighlighted
65
+ isHighlighted,
66
+ isFocused
60
67
  };
61
68
  const classes = (0, _barElementClasses.useUtilityClasses)(ownerState);
62
69
  const Bar = slots?.bar ?? _AnimatedBarElement.AnimatedBarElement;
@@ -80,7 +87,8 @@ function BarElement(props) {
80
87
  stroke: 'none',
81
88
  fill: color,
82
89
  skipAnimation,
83
- layout
90
+ layout,
91
+ 'data-focused': isFocused || undefined
84
92
  }),
85
93
  className: classes.root,
86
94
  ownerState
@@ -3,6 +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";
6
7
  export { type BarProps } from "./AnimatedBarElement.js";
7
8
  export { barClasses, getBarUtilityClass } from "./barClasses.js";
8
9
  export type { BarClassKey, BarClasses } from "./barClasses.js";
package/BarChart/index.js CHANGED
@@ -79,4 +79,16 @@ Object.keys(_barElementClasses).forEach(function (key) {
79
79
  }
80
80
  });
81
81
  });
82
+ var _BarChart2 = require("./BarChart.plugins");
83
+ Object.keys(_BarChart2).forEach(function (key) {
84
+ if (key === "default" || key === "__esModule") return;
85
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
86
+ if (key in exports && exports[key] === _BarChart2[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _BarChart2[key];
91
+ }
92
+ });
93
+ });
82
94
  var _barClasses = require("./barClasses");
@@ -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;
package/CHANGELOG.md CHANGED
@@ -5,6 +5,151 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.12.0
9
+
10
+ _Sep 25, 2025_
11
+
12
+ We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🤝 Grid-Charts integration
15
+
16
+ ![Grid x Charts](https://github.com/user-attachments/assets/0817c36f-f87f-4688-8f30-fa0db638ca8c)
17
+
18
+ 👉 [🎥 Watch the full video](https://github.com/user-attachments/assets/28f1848e-dc85-4077-8756-a3e88afd4e54)
19
+
20
+ - ⌨️ Charts keyboard navigation
21
+ - ⚡️ Charts: Add new `renderer="svg-batch"` prop to Scatter charts that provides improved performance for large datasets
22
+ - 🐞 Bugfixes
23
+ - 📚 Documentation improvements
24
+ - 🧰 Codemod requires Node >=20.19
25
+
26
+ `@mui/x-codemod` minimum supported Node version is `20.19`.
27
+ This was only the case due to using the v18 `yargs` package; this now explicitly aligns with it. (#18979)
28
+
29
+ Special thanks go out to the community members for their valuable contributions:
30
+ @deade1e, @sai6855, @thomas-mcdonald
31
+
32
+ The following are all team members who have contributed to this release:
33
+ @alexfauquette, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @michelengelen, @prakhargupta1, @rita-codes, @siriwatknp, @arminmeh, @romgrk
34
+
35
+ ### Data Grid
36
+
37
+ #### `@mui/x-data-grid@8.12.0`
38
+
39
+ - [DataGrid] Fix flex column width diff calculation while resizing (#19667) @arminmeh
40
+
41
+ #### `@mui/x-data-grid-pro@8.12.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
42
+
43
+ Same changes as in `@mui/x-data-grid@8.12.0`.
44
+
45
+ #### `@mui/x-data-grid-premium@8.12.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
46
+
47
+ Same changes as in `@mui/x-data-grid-pro@8.12.0`, plus:
48
+
49
+ - [DataGridPremium] Grid-Charts integration (#18021) @arminmeh
50
+ - [DataGridPremium] Fix sorting and filtering of the tree group columns with aggregation (#19607) @arminmeh
51
+ - [DataGridPremium] Disable aggregation on the grouping column by default (#19692) @arminmeh
52
+ - [DataGridPremium] Do not rely on the group separation constant to retrieve the column name for the charts panel (#19677) @arminmeh
53
+ - [DataGridPremium] Fix stale aggregation state (#19690) @arminmeh
54
+ - [DataGridPremium] Fix pivot column being hidden on autosizing (#19699) @cherniavskii
55
+
56
+ ### Date and Time Pickers
57
+
58
+ #### `@mui/x-date-pickers@8.12.0`
59
+
60
+ - [pickers] Ensure reference value is not updated for invalid values (#19635) @michelengelen
61
+ - [pickers] Fix `slotProps.textField.slotProps.htmlInput` resolution (#19713) @LukasTy
62
+ - [pickers] Preserve time format when using single column layout on Time Range Picker (#19626) @sai6855
63
+ - [pickers] Preserve time format when using single column layout on Date Time Picker and Date Time Range Picker (#19608) @sai6855
64
+
65
+ #### `@mui/x-date-pickers-pro@8.12.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-date-pickers@8.12.0`.
68
+
69
+ ### Charts
70
+
71
+ #### `@mui/x-charts@8.12.0`
72
+
73
+ - [charts] Add batch renderer for scatter chart (#19075) @bernardobelchior
74
+ - [charts] Add renderer suffix to performance benchmarks (#19620) @bernardobelchior
75
+ - [charts] Document how plugins can be used (#19343) @alexfauquette
76
+ - [charts] Export chart plugins per series type (#19337) @alexfauquette
77
+ - [charts] Export plugins (#19335) @alexfauquette
78
+ - [charts] Fix horizontal layout and toolbar (#19655) @alexfauquette
79
+ - [charts] Fix performance issue with JS animations (#19606) @bernardobelchior
80
+ - [charts] Fix piecewise scale causing wrong colors in axis with min/max (#19610) @bernardobelchior
81
+ - [charts] Fix zoom discard inconsistency (#19535) @bernardobelchior
82
+ - [charts] Introduce keyboard navigation (#19155) @alexfauquette
83
+ - [charts] Refactor `getAxisExtremum` (#19627) @bernardobelchior
84
+ - [charts] Remove unused code path from `getAxisScale` (#19673) @bernardobelchior
85
+ - [charts] Make new hideLegend prop on ChartWrapper optional (#19694) @thomas-mcdonald
86
+ - [charts] Fix chart crash in test environment (#19711) @JCQuintas
87
+
88
+ #### `@mui/x-charts-pro@8.12.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
89
+
90
+ Same changes as in `@mui/x-charts@8.12.0`, plus:
91
+
92
+ - [charts-pro] Add `valueFormatter` to sankey (#19636) @JCQuintas
93
+ - [charts-pro] Allow `source/target` keywords in sankey link color (#19634) @JCQuintas
94
+ - [charts-pro] Allow exporting `SankeyChart` (#19659) @JCQuintas
95
+ - [charts-pro] Fix axis inversion when using axis `max` and `filterMode: 'discard'` (#19200) @bernardobelchior
96
+
97
+ #### `@mui/x-charts-premium@8.12.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
98
+
99
+ Same changes as in `@mui/x-charts-pro@8.12.0`, plus:
100
+
101
+ - [charts-premium] Grid-Charts integration (#18021) @arminmeh
102
+
103
+ ### Tree View
104
+
105
+ #### `@mui/x-tree-view@8.12.0`
106
+
107
+ - [tree view] Allow to pass `null` to the icon slots (#19569) @flaviendelangle
108
+ - [tree view] Fix `apiRef.current.isItemExpanded()` method (#19619) @flaviendelangle
109
+
110
+ #### `@mui/x-tree-view-pro@8.12.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
111
+
112
+ Same changes as in `@mui/x-tree-view@8.12.0`.
113
+
114
+ ### Codemod
115
+
116
+ #### `@mui/x-codemod@8.12.0`
117
+
118
+ - [codemod] Bump `engines.node` to `>=20.19` to align with `yargs` package (#18979) @LukasTy
119
+
120
+ ### Docs
121
+
122
+ - [docs] Add missing label to Charts example (#19616) @prakhargupta1
123
+ - [docs] Replace axis type and axis data with a table (#19618) @prakhargupta1
124
+ - [docs] Add Charts example collection page (#18353) @prakhargupta1
125
+ - [docs] Add a Charts demo showcasing bar and scatter composition (#19605) @prakhargupta1
126
+ - [docs] Add composition Charts demo for legends and tooltip (#19602) @prakhargupta1
127
+ - [docs] Add recipe about server-side data export (#19617) @siriwatknp
128
+ - [docs] Clarify DataGrid layout requirements (#19413) @romgrk
129
+ - [docs] Fix `ExportServerSideData` demo layout shift (#19669) @siriwatknp
130
+ - [docs] Improve server-side `updateRow()` description (#19554) @deade1e
131
+ - [docs] Show how to customize drawing area background (#19682) @alexfauquette
132
+ - [docs] Add hook documentation pages (#19334) @Copilot
133
+
134
+ ### Core
135
+
136
+ - [code-infra] Add copilot instructions specific to x repo (#19623) @JCQuintas
137
+ - [code-infra] Load `tsx` files in visual regression (#19595) @JCQuintas
138
+ - [code-infra] Remove renovate automerge (#19501) @Janpot
139
+ - [code-infra] Update `DEFAULT_TIMESTAMP` format to ISO 8601 (#19624) @Janpot
140
+ - [code-infra] Update `findLatestTaggedVersion` to filter tags based on major version (#19693) @michelengelen
141
+ - [code-infra] Fix changelog generation for charts premium (#19701) @JCQuintas
142
+ - [code-infra] Run prettier on `createReleasePR.mjs` (#19702) @bernardobelchior
143
+ - [code-infra] Make `x-charts-premium` releasable (#18959) @JCQuintas
144
+ - [docs-infra] Ensure `create-playground` script only runs if target file is absent (#19603) @michelengelen
145
+ - [docs-infra] Add @prakhargupta1 as a codeowner of the docs (#19679) @alexfauquette
146
+
147
+ ### Miscellaneous
148
+
149
+ - [test] Reduce time for wheel zoom test (#19571) @alexfauquette
150
+ - Change `matchPackageNames` to `matchDepNames` for date-fns-v2 @Janpot
151
+ - Remove groupName for date-fns-v2 in renovate.json @Janpot
152
+
8
153
  ## 8.11.3
9
154
 
10
155
  _Sep 16, 2025_
@@ -27,11 +172,11 @@ The following are all team members who have contributed to this release:
27
172
  - [DataGrid] Fix numeric font size not being applied (#19552) @cherniavskii
28
173
  - [DataGrid] Improve `operator` types to display literal values (#19529) @siriwatknp
29
174
 
30
- #### `@mui/x-data-grid-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
175
+ #### `@mui/x-data-grid-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
176
 
32
177
  Same changes as in `@mui/x-data-grid@8.11.3`.
33
178
 
34
- #### `@mui/x-data-grid-premium@8.11.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link "Premium plan")
179
+ #### `@mui/x-data-grid-premium@8.11.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
180
 
36
181
  Same changes as in `@mui/x-data-grid-pro@8.11.3`.
37
182
 
@@ -41,7 +186,7 @@ Same changes as in `@mui/x-data-grid-pro@8.11.3`.
41
186
 
42
187
  - [pickers] Refactor `slots` and `slotProps` propagation strategy (#18867) @LukasTy
43
188
 
44
- #### `@mui/x-date-pickers-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
189
+ #### `@mui/x-date-pickers-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
45
190
 
46
191
  Same changes as in `@mui/x-date-pickers@8.11.3`.
47
192
 
@@ -55,7 +200,7 @@ Same changes as in `@mui/x-date-pickers@8.11.3`.
55
200
  - [charts] Rename `isBandScale` to `isDiscreteScale` (#19514) @bernardobelchior
56
201
  - [charts] Fix legend position affecting toolbar's position (#19257) @sai6855
57
202
 
58
- #### `@mui/x-charts-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
203
+ #### `@mui/x-charts-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
59
204
 
60
205
  Same changes as in `@mui/x-charts@8.11.3`, plus:
61
206
 
@@ -69,7 +214,7 @@ Same changes as in `@mui/x-charts@8.11.3`, plus:
69
214
  - [tree view] Support flat DOM structure (#19350) @flaviendelangle
70
215
  - [tree view] Update cursor styles for disabled TreeItem (#19548) @sai6855
71
216
 
72
- #### `@mui/x-tree-view-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link "Pro plan")
217
+ #### `@mui/x-tree-view-pro@8.11.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
218
 
74
219
  Same changes as in `@mui/x-tree-view@8.11.3`.
75
220
 
@@ -83,7 +228,7 @@ Internal changes.
83
228
 
84
229
  - [docs] Add styling row group recipe (#19349) @siriwatknp
85
230
  - [docs] Group demos data into the dataset folder (#19549) @alexfauquette
86
- - [docs] Add `shiny` bar chart example at the top (#19416) @JCQuintas
231
+ - [docs] Add `shiny` bar chart example at the top (#19416) @JCQuintas
87
232
 
88
233
  ### Core
89
234
 
@@ -83,6 +83,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
83
83
  * If true, the voronoi interaction are ignored.
84
84
  */
85
85
  disableVoronoi: _propTypes.default.bool,
86
+ enableKeyboardNavigation: _propTypes.default.bool,
86
87
  /**
87
88
  * Options to enable features planned for the next major.
88
89
  */
@@ -665,10 +666,11 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
665
666
  theme: _propTypes.default.oneOf(['dark', 'light']),
666
667
  title: _propTypes.default.string,
667
668
  /**
668
- * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
669
+ * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
670
+ * If set to `'item'`, the radius is the `markerSize`.
669
671
  * If `undefined`, the radius is assumed to be infinite.
670
672
  */
671
- voronoiMaxRadius: _propTypes.default.number,
673
+ voronoiMaxRadius: _propTypes.default.oneOfType([_propTypes.default.oneOf(['item']), _propTypes.default.number]),
672
674
  /**
673
675
  * The width of the chart in px. If not defined, it takes the width of the parent element.
674
676
  */
@@ -9,7 +9,7 @@ exports.useChartContainerProps = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _allPlugins = require("../internals/plugins/allPlugins");
12
- 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"];
12
+ 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"];
13
13
  const useChartContainerProps = (props, ref) => {
14
14
  const _ref = props,
15
15
  {
@@ -43,7 +43,8 @@ const useChartContainerProps = (props, ref) => {
43
43
  localeText,
44
44
  slots,
45
45
  slotProps,
46
- experimentalFeatures
46
+ experimentalFeatures,
47
+ enableKeyboardNavigation
47
48
  } = _ref,
48
49
  other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
49
50
  const chartsSurfaceProps = (0, _extends2.default)({
@@ -77,6 +78,7 @@ const useChartContainerProps = (props, ref) => {
77
78
  localeText,
78
79
  seriesConfig,
79
80
  experimentalFeatures,
81
+ enableKeyboardNavigation,
80
82
  plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS,
81
83
  slots,
82
84
  slotProps
@@ -73,6 +73,7 @@ const RootElement = (0, _styles.styled)('ul', {
73
73
  paddingInlineStart: 0,
74
74
  marginBlock: theme.spacing(1),
75
75
  marginInline: theme.spacing(1),
76
+ gridArea: 'legend',
76
77
  [`&.${_continuousColorLegendClasses.continuousColorLegendClasses.horizontal}`]: {
77
78
  gridTemplateRows: 'min-content min-content',
78
79
  gridTemplateColumns: 'min-content auto min-content',
@@ -41,6 +41,7 @@ const RootElement = (0, _styles.styled)('ul', {
41
41
  marginBlock: theme.spacing(1),
42
42
  marginInline: theme.spacing(1),
43
43
  width: 'fit-content',
44
+ gridArea: 'legend',
44
45
  [`button.${classes.item}`]: {
45
46
  // Reset button styles
46
47
  background: 'none',
@@ -18,6 +18,7 @@ var _useSvgRef = require("../hooks/useSvgRef");
18
18
  var _useSelector = require("../internals/store/useSelector");
19
19
  var _useStore = require("../internals/store/useStore");
20
20
  var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors");
21
+ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
21
22
  var _jsxRuntime = require("react/jsx-runtime");
22
23
  const _excluded = ["children", "className", "title", "desc"];
23
24
  const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
@@ -38,7 +39,21 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
38
39
  // For example, prevent page scroll & zoom.
39
40
  touchAction: 'pan-y',
40
41
  userSelect: 'none',
41
- gridArea: 'chart'
42
+ gridArea: 'chart',
43
+ '&:focus': {
44
+ outline: 'none' // By default don't show focus on the SVG container
45
+ },
46
+ '&:focus-visible': {
47
+ // Show focus outline on the SVG container only when using keyboard navigation
48
+ outline: 'auto',
49
+ '&[data-has-focused-item=true]': {
50
+ // But not if the chart has a focused children item
51
+ outline: 'none'
52
+ }
53
+ },
54
+ '& [data-focused=true]': {
55
+ outline: 'auto'
56
+ }
42
57
  }));
43
58
 
44
59
  /**
@@ -65,6 +80,8 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
65
80
  width: propsWidth,
66
81
  height: propsHeight
67
82
  } = (0, _useSelector.useSelector)(store, _useChartDimensions.selectorChartPropsSize);
83
+ const isKeyboardNavigationEnabled = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsIsKeyboardNavigationEnabled);
84
+ const hasFocusedItem = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsHasFocusedItem);
68
85
  const svgRef = (0, _useSvgRef.useSvgRef)();
69
86
  const handleRef = (0, _useForkRef.default)(svgRef, ref);
70
87
  const themeProps = (0, _styles.useThemeProps)({
@@ -85,7 +102,9 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
85
102
  height: propsHeight
86
103
  },
87
104
  viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
88
- className: className
105
+ className: className,
106
+ tabIndex: isKeyboardNavigationEnabled ? 0 : undefined,
107
+ "data-has-focused-item": hasFocusedItem || undefined
89
108
  }, other, {
90
109
  ref: handleRef,
91
110
  children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
@@ -15,8 +15,9 @@ export interface ChartsWrapperProps {
15
15
  legendDirection?: Direction;
16
16
  /**
17
17
  * If `true`, the legend is not rendered.
18
+ * @default false
18
19
  */
19
- hideLegend: boolean;
20
+ hideLegend?: boolean;
20
21
  /**
21
22
  * If `true`, the chart wrapper set `height: 100%`.
22
23
  * @default `false` if the `height` prop is set. And `true` otherwise.
@@ -34,10 +34,6 @@ const getAlignItems = position => {
34
34
  }
35
35
  return 'center';
36
36
  };
37
- const addToolbar = template => {
38
- return `"toolbar"
39
- ${template}`;
40
- };
41
37
  const getGridTemplateAreas = (hideLegend, direction, position) => {
42
38
  if (hideLegend) {
43
39
  return `"chart"`;
@@ -55,26 +51,25 @@ const getGridTemplateAreas = (hideLegend, direction, position) => {
55
51
  return `"legend"
56
52
  "chart"`;
57
53
  };
58
- const getTemplateColumns = (hideLegend, direction, position, width) => {
59
- if (direction === 'vertical') {
60
- if (hideLegend) {
61
- return '1fr';
62
- }
63
- if (position?.horizontal === 'start') {
64
- return 'auto 1fr';
65
- }
66
- return `${width ? 'auto' : '1fr'} auto`;
54
+ const getTemplateColumns = (hideLegend = false, direction = 'horizontal', horizontalPosition = 'end', width = undefined) => {
55
+ const drawingAreaColumn = width ? 'auto' : '1fr';
56
+ if (direction === 'horizontal') {
57
+ return drawingAreaColumn;
58
+ }
59
+ if (hideLegend) {
60
+ return drawingAreaColumn;
67
61
  }
68
- return '100%';
62
+ return horizontalPosition === 'start' ? `auto ${drawingAreaColumn}` : `${drawingAreaColumn} auto`;
69
63
  };
70
- const getTemplateRows = (hideLegend, direction) => {
64
+ const getTemplateRows = (hideLegend = false, direction = 'horizontal', verticalPosition = 'top') => {
65
+ const drawingAreaRow = '1fr';
71
66
  if (direction === 'vertical') {
72
- if (hideLegend) {
73
- return 'auto';
74
- }
75
- return 'auto 1fr';
67
+ return drawingAreaRow;
68
+ }
69
+ if (hideLegend) {
70
+ return drawingAreaRow;
76
71
  }
77
- return 'auto 1fr';
72
+ return verticalPosition === 'bottom' ? `${drawingAreaRow} auto` : `auto ${drawingAreaRow}`;
78
73
  };
79
74
  const Root = (0, _styles.styled)('div', {
80
75
  name: 'MuiChartsWrapper',
@@ -83,32 +78,39 @@ const Root = (0, _styles.styled)('div', {
83
78
  })(({
84
79
  ownerState,
85
80
  width
86
- }) => ({
87
- variants: [{
88
- props: {
89
- extendVertically: true
81
+ }) => {
82
+ const gridTemplateColumns = getTemplateColumns(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.horizontal, width);
83
+ const gridTemplateRows = getTemplateRows(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.vertical);
84
+ const gridTemplateAreas = getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition);
85
+ return {
86
+ variants: [{
87
+ props: {
88
+ extendVertically: true
89
+ },
90
+ style: {
91
+ height: '100%'
92
+ }
93
+ }],
94
+ flex: 1,
95
+ display: 'grid',
96
+ gridTemplateColumns,
97
+ gridTemplateRows,
98
+ gridTemplateAreas,
99
+ [`&:has(.${_Toolbar.chartsToolbarClasses.root})`]: {
100
+ // Add a row for toolbar if there is one.
101
+ gridTemplateRows: `auto ${gridTemplateRows}`,
102
+ gridTemplateAreas: `"${gridTemplateColumns.split(' ').map(() => 'toolbar').join(' ')}"
103
+ ${gridTemplateAreas}`
90
104
  },
91
- style: {
92
- height: '100%'
93
- }
94
- }],
95
- flex: 1,
96
- display: 'grid',
97
- gridTemplateColumns: getTemplateColumns(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition, width),
98
- gridTemplateRows: getTemplateRows(ownerState.hideLegend, ownerState.legendDirection),
99
- [`&:has(.${_Toolbar.chartsToolbarClasses.root})`]: {
100
- gridTemplateAreas: addToolbar(getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition))
101
- },
102
- [`&:not(:has(.${_Toolbar.chartsToolbarClasses.root}))`]: {
103
- gridTemplateAreas: getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition)
104
- },
105
- justifyContent: 'center',
106
- justifyItems: getJustifyItems(ownerState.legendPosition),
107
- alignItems: getAlignItems(ownerState.legendPosition),
108
- [`& > .${_Toolbar.chartsToolbarClasses.root}`]: {
109
- justifySelf: 'center'
110
- }
111
- }));
105
+ [`& .${_Toolbar.chartsToolbarClasses.root}`]: {
106
+ gridArea: 'toolbar',
107
+ justifySelf: 'center'
108
+ },
109
+ justifyContent: 'center',
110
+ justifyItems: getJustifyItems(ownerState.legendPosition),
111
+ alignItems: getAlignItems(ownerState.legendPosition)
112
+ };
113
+ });
112
114
 
113
115
  /**
114
116
  * Wrapper for the charts components.
@@ -148,8 +150,9 @@ process.env.NODE_ENV !== "production" ? ChartsWrapper.propTypes = {
148
150
  extendVertically: _propTypes.default.bool,
149
151
  /**
150
152
  * If `true`, the legend is not rendered.
153
+ * @default false
151
154
  */
152
- hideLegend: _propTypes.default.bool.isRequired,
155
+ hideLegend: _propTypes.default.bool,
153
156
  /**
154
157
  * The direction of the legend.
155
158
  * @default 'horizontal'
@@ -3685,9 +3685,11 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
3685
3685
  x?: number | string | undefined | undefined;
3686
3686
  y?: number | string | undefined | undefined;
3687
3687
  radius?: number | string | undefined | undefined;
3688
+ href?: string | undefined | undefined;
3688
3689
  media?: string | undefined | undefined;
3689
- method?: string | undefined | undefined;
3690
3690
  target?: string | undefined | undefined;
3691
+ from?: number | string | undefined | undefined;
3692
+ method?: string | undefined | undefined;
3691
3693
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
3692
3694
  accentHeight?: number | string | undefined | undefined;
3693
3695
  accumulate?: "none" | "sum" | undefined | undefined;
@@ -3731,7 +3733,6 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
3731
3733
  focusable?: "auto" | (boolean | "true" | "false") | undefined;
3732
3734
  format?: number | string | undefined | undefined;
3733
3735
  fr?: number | string | undefined | undefined;
3734
- from?: number | string | undefined | undefined;
3735
3736
  fx?: number | string | undefined | undefined;
3736
3737
  fy?: number | string | undefined | undefined;
3737
3738
  g1?: number | string | undefined | undefined;
@@ -3744,7 +3745,6 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
3744
3745
  hanging?: number | string | undefined | undefined;
3745
3746
  horizAdvX?: number | string | undefined | undefined;
3746
3747
  horizOriginX?: number | string | undefined | undefined;
3747
- href?: string | undefined | undefined;
3748
3748
  ideographic?: number | string | undefined | undefined;
3749
3749
  in2?: number | string | undefined | undefined;
3750
3750
  in?: string | undefined | undefined;
@@ -3604,9 +3604,11 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
3604
3604
  x?: number | string | undefined | undefined;
3605
3605
  y?: number | string | undefined | undefined;
3606
3606
  radius?: number | string | undefined | undefined;
3607
+ href?: string | undefined | undefined;
3607
3608
  media?: string | undefined | undefined;
3608
- method?: string | undefined | undefined;
3609
3609
  target?: string | undefined | undefined;
3610
+ from?: number | string | undefined | undefined;
3611
+ method?: string | undefined | undefined;
3610
3612
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
3611
3613
  accentHeight?: number | string | undefined | undefined;
3612
3614
  accumulate?: "none" | "sum" | undefined | undefined;
@@ -3650,7 +3652,6 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
3650
3652
  focusable?: "auto" | (boolean | "true" | "false") | undefined;
3651
3653
  format?: number | string | undefined | undefined;
3652
3654
  fr?: number | string | undefined | undefined;
3653
- from?: number | string | undefined | undefined;
3654
3655
  fx?: number | string | undefined | undefined;
3655
3656
  fy?: number | string | undefined | undefined;
3656
3657
  g1?: number | string | undefined | undefined;
@@ -3663,7 +3664,6 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
3663
3664
  hanging?: number | string | undefined | undefined;
3664
3665
  horizAdvX?: number | string | undefined | undefined;
3665
3666
  horizOriginX?: number | string | undefined | undefined;
3666
- href?: string | undefined | undefined;
3667
3667
  ideographic?: number | string | undefined | undefined;
3668
3668
  in2?: number | string | undefined | undefined;
3669
3669
  in?: string | undefined | undefined;