@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
@@ -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 { selectorChartsHighlightYAxisValue, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
@@ -35,15 +35,15 @@ export default function ChartsYHighlight(props) {
35
35
  const yAxis = yAxes.axis[axisId];
36
36
  const yScale = yAxis.scale;
37
37
  const getYPosition = getValueToPositionMapper(yScale);
38
- const isBandScaleY = type === 'band' && value !== null && isBandScale(yScale);
38
+ const isYScaleOrdinal = type === 'band' && value !== null && isOrdinalScale(yScale);
39
39
  if (process.env.NODE_ENV !== 'production') {
40
- const isError = isBandScaleY && yScale(value) === undefined;
40
+ const isError = isYScaleOrdinal && yScale(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: [isBandScaleY && yScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
46
+ children: [isYScaleOrdinal && yScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
47
47
  d: `M ${left} ${yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
48
48
  className: classes.root,
49
49
  ownerState: {
@@ -51,7 +51,8 @@ const RootElement = styled('ul', {
51
51
  display: ownerState.direction === 'vertical' ? 'flex' : 'inline-flex',
52
52
  alignItems: 'center',
53
53
  gap: theme.spacing(1)
54
- }
54
+ },
55
+ gridArea: 'legend'
55
56
  }));
56
57
  const ChartsLegend = consumeSlots('MuiChartsLegend', 'legend', {
57
58
  defaultProps: {
@@ -66,6 +66,7 @@ const RootElement = styled('ul', {
66
66
  paddingInlineStart: 0,
67
67
  marginBlock: theme.spacing(1),
68
68
  marginInline: theme.spacing(1),
69
+ gridArea: 'legend',
69
70
  [`&.${continuousColorLegendClasses.horizontal}`]: {
70
71
  gridTemplateRows: 'min-content min-content',
71
72
  gridTemplateColumns: 'min-content auto min-content',
@@ -20,10 +20,10 @@ export interface PiecewiseColorLegendProps extends ColorLegendSelector, PrependK
20
20
  */
21
21
  labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null;
22
22
  /**
23
- * Where to position the labels relative to the gradient.
23
+ * Where to position the labels relative to the color marks.
24
24
  * @default 'extremes'
25
25
  */
26
- labelPosition?: 'start' | 'end' | 'extremes';
26
+ labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end';
27
27
  /**
28
28
  * Callback fired when a legend item is clicked.
29
29
  * @param {React.MouseEvent<HTMLButtonElement, MouseEvent>} event The click event.
@@ -21,6 +21,7 @@ const RootElement = styled('ul', {
21
21
  theme,
22
22
  ownerState
23
23
  }) => {
24
+ const classes = piecewiseColorLegendClasses;
24
25
  return _extends({}, theme.typography.caption, {
25
26
  color: (theme.vars || theme).palette.text.primary,
26
27
  lineHeight: '100%',
@@ -32,8 +33,9 @@ const RootElement = styled('ul', {
32
33
  paddingInlineStart: 0,
33
34
  marginBlock: theme.spacing(1),
34
35
  marginInline: theme.spacing(1),
35
- width: 'max-content',
36
- [`button.${piecewiseColorLegendClasses.item}`]: {
36
+ width: 'fit-content',
37
+ gridArea: 'legend',
38
+ [`button.${classes.item}`]: {
37
39
  // Reset button styles
38
40
  background: 'none',
39
41
  border: 'none',
@@ -45,55 +47,62 @@ const RootElement = styled('ul', {
45
47
  letterSpacing: 'inherit',
46
48
  color: 'inherit'
47
49
  },
48
- [`.${piecewiseColorLegendClasses.item}`]: {
50
+ [`.${classes.item}`]: {
49
51
  display: 'flex',
50
52
  gap: theme.spacing(0.5)
51
53
  },
52
- [`li :not(.${piecewiseColorLegendClasses.minLabel}, .${piecewiseColorLegendClasses.maxLabel}) .${piecewiseColorLegendClasses?.mark}`]: {
54
+ [`li :not(.${classes.minLabel}, .${classes.maxLabel}) .${classes?.mark}`]: {
53
55
  alignSelf: 'center'
54
56
  },
55
- [`&.${piecewiseColorLegendClasses.start}`]: {
57
+ [`&.${classes.start}`]: {
56
58
  alignItems: 'end'
57
59
  },
58
- [`&.${piecewiseColorLegendClasses.end}`]: {
60
+ [`&.${classes.end}`]: {
59
61
  alignItems: 'start'
60
62
  },
61
- [`&.${piecewiseColorLegendClasses.horizontal}`]: {
63
+ [`&.${classes.horizontal}`]: {
62
64
  alignItems: 'center',
63
- [`.${piecewiseColorLegendClasses.item}`]: {
65
+ [`.${classes.item}`]: {
64
66
  flexDirection: 'column'
65
67
  },
66
- [`&.${piecewiseColorLegendClasses.start}`]: {
68
+ [`&.${classes.inlineStart}, &.${classes.inlineEnd}`]: {
69
+ gap: theme.spacing(1.5),
70
+ flexWrap: 'wrap',
71
+ [`.${classes.item}`]: {
72
+ flexDirection: 'row'
73
+ }
74
+ },
75
+ [`&.${classes.start}`]: {
67
76
  alignItems: 'end'
68
77
  },
69
- [`&.${piecewiseColorLegendClasses.end}`]: {
78
+ [`&.${classes.end}`]: {
70
79
  alignItems: 'start'
71
80
  },
72
- [`.${piecewiseColorLegendClasses.minLabel}`]: {
81
+ [`.${classes.minLabel}`]: {
73
82
  alignItems: 'end'
74
83
  },
75
- [`&.${piecewiseColorLegendClasses.extremes}`]: {
76
- [`.${piecewiseColorLegendClasses.minLabel}, .${piecewiseColorLegendClasses.maxLabel}`]: {
84
+ [`&.${classes.extremes}`]: {
85
+ [`.${classes.minLabel}, .${classes.maxLabel}`]: {
77
86
  alignItems: 'center',
78
87
  display: 'flex',
79
88
  flexDirection: 'row'
80
89
  }
81
90
  }
82
91
  },
83
- [`&.${piecewiseColorLegendClasses.vertical}`]: {
84
- [`.${piecewiseColorLegendClasses.item}`]: {
92
+ [`&.${classes.vertical}`]: {
93
+ [`.${classes.item}`]: {
85
94
  flexDirection: 'row',
86
95
  alignItems: 'center'
87
96
  },
88
- [`&.${piecewiseColorLegendClasses.start}`]: {
97
+ [`&.${classes.start}, &.${classes.inlineStart}`]: {
89
98
  alignItems: 'end'
90
99
  },
91
- [`&.${piecewiseColorLegendClasses.end}`]: {
100
+ [`&.${classes.end}, &.${classes.inlineEnd}`]: {
92
101
  alignItems: 'start'
93
102
  },
94
- [`&.${piecewiseColorLegendClasses.extremes}`]: {
103
+ [`&.${classes.extremes}`]: {
95
104
  alignItems: 'center',
96
- [`.${piecewiseColorLegendClasses.minLabel}, .${piecewiseColorLegendClasses.maxLabel}`]: {
105
+ [`.${classes.minLabel}, .${classes.maxLabel}`]: {
97
106
  alignItems: 'center',
98
107
  display: 'flex',
99
108
  flexDirection: 'column'
@@ -146,6 +155,8 @@ const PiecewiseColorLegend = consumeThemeProps('MuiPiecewiseColorLegend', {
146
155
  const isStart = labelPosition === 'start';
147
156
  const isEnd = labelPosition === 'end';
148
157
  const isExtremes = labelPosition === 'extremes';
158
+ const isInlineStart = labelPosition === 'inline-start';
159
+ const isInlineEnd = labelPosition === 'inline-end';
149
160
  return /*#__PURE__*/_jsx(RootElement, _extends({
150
161
  className: clsx(classes?.root, className),
151
162
  ref: ref
@@ -179,8 +190,8 @@ const PiecewiseColorLegend = consumeThemeProps('MuiPiecewiseColorLegend', {
179
190
  if (label === null || label === undefined) {
180
191
  return null;
181
192
  }
182
- const isTextBefore = isStart || isExtremes && isFirst;
183
- const isTextAfter = isEnd || isExtremes && isLast;
193
+ const isTextBefore = isStart || isExtremes && isFirst || isInlineStart;
194
+ const isTextAfter = isEnd || isExtremes && isLast || isInlineEnd;
184
195
  const clickObject = {
185
196
  type: 'piecewiseColor',
186
197
  color,
@@ -248,7 +259,7 @@ process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
248
259
  * Where to position the labels relative to the gradient.
249
260
  * @default 'extremes'
250
261
  */
251
- labelPosition: PropTypes.oneOf(['start', 'end', 'extremes']),
262
+ labelPosition: PropTypes.oneOf(['start', 'end', 'extremes', 'inline-start', 'inline-end']),
252
263
  /**
253
264
  * The type of the mark.
254
265
  * @default 'square'
@@ -19,6 +19,10 @@ export interface PiecewiseColorLegendClasses {
19
19
  end: string;
20
20
  /** Styles applied to the legend with the labels on the extremes of the color marks. */
21
21
  extremes: string;
22
+ /** Styles applied to the legend with the labels inlined before the color marks. */
23
+ inlineStart: string;
24
+ /** Styles applied to the legend with the labels inlined after the color marks. */
25
+ inlineEnd: string;
22
26
  /** Styles applied to the marks. */
23
27
  mark: string;
24
28
  /** Styles applied to the series label. */
@@ -11,7 +11,7 @@ export const useUtilityClasses = props => {
11
11
  labelPosition
12
12
  } = props;
13
13
  const slots = {
14
- root: ['root', direction, labelPosition],
14
+ root: ['root', direction, labelPosition?.replaceAll(/-(\w)/g, match => match[1].toUpperCase())],
15
15
  minLabel: ['minLabel'],
16
16
  maxLabel: ['maxLabel'],
17
17
  item: ['item'],
@@ -20,4 +20,4 @@ export const useUtilityClasses = props => {
20
20
  };
21
21
  return composeClasses(slots, getLegendUtilityClass, classes);
22
22
  };
23
- export const piecewiseColorLegendClasses = generateUtilityClasses('MuiPiecewiseColorLegendClasses', ['root', 'minLabel', 'maxLabel', 'item', 'vertical', 'horizontal', 'start', 'end', 'extremes', 'mark', 'label']);
23
+ export const piecewiseColorLegendClasses = generateUtilityClasses('MuiPiecewiseColorLegendClasses', ['root', 'minLabel', 'maxLabel', 'item', 'vertical', 'horizontal', 'start', 'end', 'extremes', 'inlineStart', 'inlineEnd', 'mark', 'label']);
@@ -12,6 +12,7 @@ import { useSvgRef } from "../hooks/useSvgRef.js";
12
12
  import { useSelector } from "../internals/store/useSelector.js";
13
13
  import { useStore } from "../internals/store/useStore.js";
14
14
  import { selectorChartContainerSize, selectorChartPropsSize } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
15
+ import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  const ChartsSurfaceStyles = styled('svg', {
17
18
  name: 'MuiChartsSurface',
@@ -30,7 +31,22 @@ const ChartsSurfaceStyles = styled('svg', {
30
31
  // This prevents default touch actions when using the svg on mobile devices.
31
32
  // For example, prevent page scroll & zoom.
32
33
  touchAction: 'pan-y',
33
- userSelect: 'none'
34
+ userSelect: 'none',
35
+ gridArea: 'chart',
36
+ '&:focus': {
37
+ outline: 'none' // By default don't show focus on the SVG container
38
+ },
39
+ '&:focus-visible': {
40
+ // Show focus outline on the SVG container only when using keyboard navigation
41
+ outline: 'auto',
42
+ '&[data-has-focused-item=true]': {
43
+ // But not if the chart has a focused children item
44
+ outline: 'none'
45
+ }
46
+ },
47
+ '& [data-focused=true]': {
48
+ outline: 'auto'
49
+ }
34
50
  }));
35
51
 
36
52
  /**
@@ -57,6 +73,8 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
57
73
  width: propsWidth,
58
74
  height: propsHeight
59
75
  } = useSelector(store, selectorChartPropsSize);
76
+ const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
77
+ const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
60
78
  const svgRef = useSvgRef();
61
79
  const handleRef = useForkRef(svgRef, ref);
62
80
  const themeProps = useThemeProps({
@@ -77,7 +95,9 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
77
95
  height: propsHeight
78
96
  },
79
97
  viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
80
- className: className
98
+ className: className,
99
+ tabIndex: isKeyboardNavigationEnabled ? 0 : undefined,
100
+ "data-has-focused-item": hasFocusedItem || undefined
81
101
  }, other, {
82
102
  ref: handleRef,
83
103
  children: [title && /*#__PURE__*/_jsx("title", {
@@ -13,6 +13,11 @@ export interface ChartsWrapperProps {
13
13
  * @default 'horizontal'
14
14
  */
15
15
  legendDirection?: Direction;
16
+ /**
17
+ * If `true`, the legend is not rendered.
18
+ * @default false
19
+ */
20
+ hideLegend?: boolean;
16
21
  /**
17
22
  * If `true`, the chart wrapper set `height: 100%`.
18
23
  * @default `false` if the `height` prop is set. And `true` otherwise.
@@ -6,59 +6,103 @@ import { useChartRootRef } from "../hooks/useChartRootRef.js";
6
6
  import { useStore } from "../internals/store/useStore.js";
7
7
  import { useSelector } from "../internals/store/useSelector.js";
8
8
  import { selectorChartPropsSize } from "../internals/plugins/corePlugins/useChartDimensions/index.js";
9
+ import { chartsToolbarClasses } from "../Toolbar/index.js";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
- const getDirection = (direction, position) => {
11
+ const getJustifyItems = position => {
12
+ if (position?.horizontal === 'start') {
13
+ return 'start';
14
+ }
15
+ if (position?.horizontal === 'end') {
16
+ return 'end';
17
+ }
18
+ return 'center';
19
+ };
20
+ const getAlignItems = position => {
21
+ if (position?.vertical === 'top') {
22
+ return 'flex-start';
23
+ }
24
+ if (position?.vertical === 'bottom') {
25
+ return 'flex-end';
26
+ }
27
+ return 'center';
28
+ };
29
+ const getGridTemplateAreas = (hideLegend, direction, position) => {
30
+ if (hideLegend) {
31
+ return `"chart"`;
32
+ }
11
33
  if (direction === 'vertical') {
12
34
  if (position?.horizontal === 'start') {
13
- return 'row';
35
+ return `"legend chart"`;
14
36
  }
15
- return 'row-reverse';
37
+ return `"chart legend"`;
16
38
  }
17
39
  if (position?.vertical === 'bottom') {
18
- return 'column-reverse';
40
+ return `"chart"
41
+ "legend"`;
19
42
  }
20
- return 'column';
43
+ return `"legend"
44
+ "chart"`;
21
45
  };
22
- const getAlign = (direction, position) => {
46
+ const getTemplateColumns = (hideLegend = false, direction = 'horizontal', horizontalPosition = 'end', width = undefined) => {
47
+ const drawingAreaColumn = width ? 'auto' : '1fr';
48
+ if (direction === 'horizontal') {
49
+ return drawingAreaColumn;
50
+ }
51
+ if (hideLegend) {
52
+ return drawingAreaColumn;
53
+ }
54
+ return horizontalPosition === 'start' ? `auto ${drawingAreaColumn}` : `${drawingAreaColumn} auto`;
55
+ };
56
+ const getTemplateRows = (hideLegend = false, direction = 'horizontal', verticalPosition = 'top') => {
57
+ const drawingAreaRow = '1fr';
23
58
  if (direction === 'vertical') {
24
- if (position?.vertical === 'top') {
25
- return 'flex-start';
26
- }
27
- if (position?.vertical === 'bottom') {
28
- return 'flex-end';
29
- }
59
+ return drawingAreaRow;
30
60
  }
31
- if (direction === 'horizontal') {
32
- if (position?.horizontal === 'start') {
33
- return 'flex-start';
34
- }
35
- if (position?.horizontal === 'end') {
36
- return 'flex-end';
37
- }
61
+ if (hideLegend) {
62
+ return drawingAreaRow;
38
63
  }
39
- return 'center';
64
+ return verticalPosition === 'bottom' ? `${drawingAreaRow} auto` : `auto ${drawingAreaRow}`;
40
65
  };
41
66
  const Root = styled('div', {
42
67
  name: 'MuiChartsWrapper',
43
68
  slot: 'Root',
44
- shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'extendVertically'
69
+ shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'extendVertically' && prop !== 'width'
45
70
  })(({
46
- ownerState
47
- }) => ({
48
- display: 'flex',
49
- flexDirection: getDirection(ownerState.legendDirection, ownerState.legendPosition),
50
- flex: 1,
51
- justifyContent: 'center',
52
- alignItems: getAlign(ownerState.legendDirection, ownerState.legendPosition),
53
- variants: [{
54
- props: {
55
- extendVertically: true
71
+ ownerState,
72
+ width
73
+ }) => {
74
+ const gridTemplateColumns = getTemplateColumns(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.horizontal, width);
75
+ const gridTemplateRows = getTemplateRows(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.vertical);
76
+ const gridTemplateAreas = getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition);
77
+ return {
78
+ variants: [{
79
+ props: {
80
+ extendVertically: true
81
+ },
82
+ style: {
83
+ height: '100%'
84
+ }
85
+ }],
86
+ flex: 1,
87
+ display: 'grid',
88
+ gridTemplateColumns,
89
+ gridTemplateRows,
90
+ gridTemplateAreas,
91
+ [`&:has(.${chartsToolbarClasses.root})`]: {
92
+ // Add a row for toolbar if there is one.
93
+ gridTemplateRows: `auto ${gridTemplateRows}`,
94
+ gridTemplateAreas: `"${gridTemplateColumns.split(' ').map(() => 'toolbar').join(' ')}"
95
+ ${gridTemplateAreas}`
56
96
  },
57
- style: {
58
- height: '100%'
59
- }
60
- }]
61
- }));
97
+ [`& .${chartsToolbarClasses.root}`]: {
98
+ gridArea: 'toolbar',
99
+ justifySelf: 'center'
100
+ },
101
+ justifyContent: 'center',
102
+ justifyItems: getJustifyItems(ownerState.legendPosition),
103
+ alignItems: getAlignItems(ownerState.legendPosition)
104
+ };
105
+ });
62
106
 
63
107
  /**
64
108
  * Wrapper for the charts components.
@@ -73,6 +117,7 @@ function ChartsWrapper(props) {
73
117
  const chartRootRef = useChartRootRef();
74
118
  const store = useStore();
75
119
  const {
120
+ width: propsWidth,
76
121
  height: propsHeight
77
122
  } = useSelector(store, selectorChartPropsSize);
78
123
  return /*#__PURE__*/_jsx(Root, {
@@ -80,6 +125,7 @@ function ChartsWrapper(props) {
80
125
  ownerState: props,
81
126
  sx: sx,
82
127
  extendVertically: extendVertically ?? propsHeight === undefined,
128
+ width: propsWidth,
83
129
  children: children
84
130
  });
85
131
  }
@@ -94,6 +140,11 @@ process.env.NODE_ENV !== "production" ? ChartsWrapper.propTypes = {
94
140
  * @default `false` if the `height` prop is set. And `true` otherwise.
95
141
  */
96
142
  extendVertically: PropTypes.bool,
143
+ /**
144
+ * If `true`, the legend is not rendered.
145
+ * @default false
146
+ */
147
+ hideLegend: PropTypes.bool,
97
148
  /**
98
149
  * The direction of the legend.
99
150
  * @default 'horizontal'
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { isBandScale } from "../internals/isBandScale.js";
5
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
6
6
  import { useChartContext } from "../context/ChartProvider/useChartContext.js";
7
7
  import { TICK_LABEL_GAP } from "./utilities.js";
8
8
  import { useTicksGrouped } from "../hooks/useTicksGrouped.js";
@@ -33,7 +33,7 @@ function ChartsGroupedXAxisTicks(inProps) {
33
33
  TickLabel,
34
34
  axisTickLabelProps
35
35
  } = useAxisTicksProps(inProps);
36
- if (!isBandScale(xScale)) {
36
+ if (!isOrdinalScale(xScale)) {
37
37
  throw new Error('MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.');
38
38
  }
39
39
  const {
@@ -10,7 +10,7 @@ import { styled, useTheme, useThemeProps } from '@mui/material/styles';
10
10
  import { ChartsSingleXAxisTicks } from "./ChartsSingleXAxisTicks.js";
11
11
  import { ChartsGroupedXAxisTicks } from "./ChartsGroupedXAxisTicks.js";
12
12
  import { ChartsText } from "../ChartsText/index.js";
13
- import { isBandScale } from "../internals/isBandScale.js";
13
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
14
14
  import { isInfinity } from "../internals/isInfinity.js";
15
15
  import { defaultProps, useUtilityClasses } from "./utilities.js";
16
16
  import { useDrawingArea } from "../hooks/index.js";
@@ -80,8 +80,8 @@ export function ChartsXAxisImpl(_ref) {
80
80
  }
81
81
  const labelHeight = label ? getStringSize(label, axisLabelProps.style).height : 0;
82
82
  const domain = xScale.domain();
83
- const isScaleBand = isBandScale(xScale);
84
- const skipTickRendering = isScaleBand && domain.length === 0 || !isScaleBand && domain.some(isInfinity);
83
+ const isScaleOrdinal = isOrdinalScale(xScale);
84
+ const skipTickRendering = isScaleOrdinal ? domain.length === 0 : domain.some(isInfinity);
85
85
  let children = null;
86
86
  if (!skipTickRendering) {
87
87
  children = 'groups' in axis && Array.isArray(axis.groups) ? /*#__PURE__*/_jsx(ChartsGroupedXAxisTicks, _extends({}, inProps)) : /*#__PURE__*/_jsx(ChartsSingleXAxisTicks, _extends({}, inProps, {
@@ -39,8 +39,12 @@ export function getVisibleLabels(xTicks, {
39
39
  return new Set(xTicks.filter((item, labelIndex) => {
40
40
  const {
41
41
  offset,
42
- labelOffset
42
+ labelOffset,
43
+ formattedValue
43
44
  } = item;
45
+ if (formattedValue === '') {
46
+ return false;
47
+ }
44
48
  const textPosition = offset + labelOffset;
45
49
  if (labelIndex > 0 && direction * textPosition < direction * (previousTextLimit + tickLabelMinGap)) {
46
50
  return false;
@@ -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;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { isBandScale } from "../internals/isBandScale.js";
5
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
6
6
  import { useChartContext } from "../context/ChartProvider/useChartContext.js";
7
7
  import { TICK_LABEL_GAP } from "./utilities.js";
8
8
  import { useTicksGrouped } from "../hooks/useTicksGrouped.js";
@@ -34,7 +34,7 @@ function ChartsGroupedYAxisTicks(inProps) {
34
34
  TickLabel,
35
35
  axisTickLabelProps
36
36
  } = useAxisTicksProps(inProps);
37
- if (!isBandScale(yScale)) {
37
+ if (!isOrdinalScale(yScale)) {
38
38
  throw new Error('MUI X Charts: ChartsGroupedYAxis only supports the `band` and `point` scale types.');
39
39
  }
40
40
  const {
@@ -14,7 +14,7 @@ import { defaultProps, useUtilityClasses } from "./utilities.js";
14
14
  import { isInfinity } from "../internals/isInfinity.js";
15
15
  import { useDrawingArea } from "../hooks/useDrawingArea.js";
16
16
  import { useIsHydrated } from "../hooks/useIsHydrated.js";
17
- import { isBandScale } from "../internals/isBandScale.js";
17
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
18
18
  import { getStringSize } from "../internals/domUtils.js";
19
19
  import { AxisRoot } from "../internals/components/AxisSharedComponents.js";
20
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -100,8 +100,8 @@ export function ChartsYAxisImpl(_ref) {
100
100
  };
101
101
  const axisLabelHeight = label == null ? 0 : getStringSize(label, axisLabelProps.style).height;
102
102
  const domain = yScale.domain();
103
- const isScaleBand = isBandScale(yScale);
104
- const skipTickRendering = isScaleBand && domain.length === 0 || !isScaleBand && domain.some(isInfinity);
103
+ const isScaleOrdinal = isOrdinalScale(yScale);
104
+ const skipTickRendering = isScaleOrdinal ? domain.length === 0 : domain.some(isInfinity);
105
105
  let children = null;
106
106
  if (!skipTickRendering) {
107
107
  children = 'groups' in axis && Array.isArray(axis.groups) ? /*#__PURE__*/_jsx(ChartsGroupedYAxisTicks, _extends({}, inProps)) : /*#__PURE__*/_jsx(ChartsSingleYAxisTicks, _extends({}, inProps, {
@@ -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;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare function FocusedMark(): React.JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { useTheme } from '@mui/material/styles';
5
+ import { useFocusedItem } from "../hooks/useFocusedItem.js";
6
+ import { useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const RADIUS = 6;
9
+ export function FocusedMark() {
10
+ const theme = useTheme();
11
+ const focusedItem = useFocusedItem();
12
+ const lineSeries = useLineSeriesContext();
13
+ const {
14
+ xAxis,
15
+ xAxisIds
16
+ } = useXAxes();
17
+ const {
18
+ yAxis,
19
+ yAxisIds
20
+ } = useYAxes();
21
+ if (focusedItem === null || focusedItem.seriesType !== 'line' || !lineSeries) {
22
+ return null;
23
+ }
24
+ const series = lineSeries?.series[focusedItem.seriesId];
25
+ const xAxisId = series.xAxisId ?? xAxisIds[0];
26
+ const yAxisId = series.yAxisId ?? yAxisIds[0];
27
+ return /*#__PURE__*/_jsx("rect", {
28
+ fill: "none",
29
+ stroke: (theme.vars ?? theme).palette.text.primary,
30
+ strokeWidth: 2,
31
+ x: xAxis[xAxisId].scale(xAxis[xAxisId].data[focusedItem.dataIndex]) - RADIUS,
32
+ y: yAxis[yAxisId].scale(series.stackedData[focusedItem.dataIndex][1]) - RADIUS,
33
+ width: 2 * RADIUS,
34
+ height: 2 * RADIUS,
35
+ rx: 3,
36
+ ry: 3
37
+ });
38
+ }