@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
@@ -14,12 +14,12 @@ import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
14
14
  import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from "./LineHighlightPlot.js";
15
15
  import { ChartsGridProps } from "../ChartsGrid/index.js";
16
16
  import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/index.js";
17
- import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
17
+ import { LineChartPluginSignatures } from "./LineChart.plugins.js";
18
18
  import { ChartsToolbarSlots, ChartsToolbarSlotProps } from "../Toolbar/index.js";
19
19
  export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
20
20
  export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
21
21
  export type LineSeries = MakeOptional<LineSeriesType, 'type'>;
22
- export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
22
+ export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
23
23
  /**
24
24
  * The series to display in the line chart.
25
25
  * An array of [[LineSeries]] objects.
@@ -20,6 +20,7 @@ import { useChartContainerProps } from "../ChartContainer/useChartContainerProps
20
20
  import { ChartDataProvider } from "../ChartDataProvider/index.js";
21
21
  import { ChartsSurface } from "../ChartsSurface/index.js";
22
22
  import { ChartsWrapper } from "../ChartsWrapper/index.js";
23
+ import { FocusedMark } from "./FocusedMark.js";
23
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
25
  /**
25
26
  * Demos:
@@ -63,7 +64,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(inProps, ref)
63
64
  children: [props.showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
64
65
  children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
65
66
  children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
66
- })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
67
+ })), /*#__PURE__*/_jsx(FocusedMark, {}), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
67
68
  "data-drawing-container": true,
68
69
  children: /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps))
69
70
  }), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
@@ -111,6 +112,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
111
112
  * If `true`, render the line highlight item.
112
113
  */
113
114
  disableLineItemHighlight: PropTypes.bool,
115
+ enableKeyboardNavigation: PropTypes.bool,
114
116
  /**
115
117
  * Options to enable features planned for the next major.
116
118
  */
@@ -2,6 +2,7 @@ import { UseChartZAxisSignature } from "../internals/plugins/featurePlugins/useC
2
2
  import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
3
3
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
4
4
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
5
+ import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
5
6
  import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
6
- export type LineChartPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature];
7
- export declare const LINE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<LineChartPluginsSignatures>;
7
+ export type LineChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
8
+ export declare const LINE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<LineChartPluginSignatures>;
@@ -2,4 +2,5 @@ import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis
2
2
  import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
3
3
  import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
4
4
  import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
5
- export const LINE_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight];
5
+ import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
6
+ export const LINE_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
@@ -9,5 +9,6 @@ export * from "./LineElement.js";
9
9
  export * from "./AnimatedLine.js";
10
10
  export * from "./MarkElement.js";
11
11
  export * from "./LineHighlightElement.js";
12
+ export * from "./LineChart.plugins.js";
12
13
  export type { MarkElementClasses, MarkElementClassKey } from "./markElementClasses.js";
13
14
  export { getMarkElementUtilityClass, markElementClasses } from "./markElementClasses.js";
@@ -9,4 +9,5 @@ export * from "./LineElement.js";
9
9
  export * from "./AnimatedLine.js";
10
10
  export * from "./MarkElement.js";
11
11
  export * from "./LineHighlightElement.js";
12
+ export * from "./LineChart.plugins.js";
12
13
  export { getMarkElementUtilityClass, markElementClasses } from "./markElementClasses.js";
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { area as d3Area } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { useChartGradientIdBuilder } from "../hooks/useChartGradientId.js";
4
- import { isBandScale } from "../internals/isBandScale.js";
4
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
5
5
  import { getCurveFactory } from "../internals/getCurve.js";
6
6
  import { getValueToPositionMapper, useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.js";
7
7
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -52,7 +52,7 @@ export function useAreaPlotData(xAxes, yAxes) {
52
52
  throw new Error(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
53
53
  }
54
54
  }
55
- const shouldExpand = curve?.includes('step') && !strictStepCurve && isBandScale(xScale);
55
+ const shouldExpand = curve?.includes('step') && !strictStepCurve && isOrdinalScale(xScale);
56
56
  const formattedData = xData?.flatMap((x, index) => {
57
57
  const nullData = data[index] == null;
58
58
  if (shouldExpand) {
@@ -12,7 +12,7 @@ import { LineHighlightPlotProps } from "./LineHighlightPlot.js";
12
12
  import { LinePlotProps } from "./LinePlot.js";
13
13
  import { MarkPlotProps } from "./MarkPlot.js";
14
14
  import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
15
- import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
15
+ import { LineChartPluginSignatures } from "./LineChart.plugins.js";
16
16
  /**
17
17
  * A helper function that extracts LineChartProps from the input props
18
18
  * and returns an object with props for the children components of LineChart.
@@ -22,7 +22,7 @@ import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
22
22
  */
23
23
  export declare const useLineChartProps: (props: LineChartProps) => {
24
24
  chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
25
- chartContainerProps: ChartContainerProps<"line", LineChartPluginsSignatures>;
25
+ chartContainerProps: ChartContainerProps<"line", LineChartPluginSignatures>;
26
26
  gridProps: ChartsGridProps;
27
27
  clipPathProps: ChartsClipPathProps;
28
28
  clipPathGroupProps: {
@@ -119,7 +119,8 @@ export const useLineChartProps = props => {
119
119
  const chartsWrapperProps = {
120
120
  sx,
121
121
  legendPosition: props.slotProps?.legend?.position,
122
- legendDirection: props.slotProps?.legend?.direction
122
+ legendDirection: props.slotProps?.legend?.direction,
123
+ hideLegend: props.hideLegend ?? false
123
124
  };
124
125
  return {
125
126
  chartsWrapperProps,
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { warnOnce } from '@mui/x-internals/warning';
3
3
  import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
4
4
  import { useChartGradientIdBuilder } from "../hooks/useChartGradientId.js";
5
- import { isBandScale } from "../internals/isBandScale.js";
5
+ import { isOrdinalScale } from "../internals/scaleGuards.js";
6
6
  import { getCurveFactory } from "../internals/getCurve.js";
7
7
  import { getValueToPositionMapper, useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.js";
8
8
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -50,7 +50,7 @@ export function useLinePlotData(xAxes, yAxes) {
50
50
  warnOnce(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`, 'error');
51
51
  }
52
52
  }
53
- const shouldExpand = curve?.includes('step') && !strictStepCurve && isBandScale(xScale);
53
+ const shouldExpand = curve?.includes('step') && !strictStepCurve && isOrdinalScale(xScale);
54
54
  const formattedData = xData?.flatMap((x, index) => {
55
55
  const nullData = data[index] == null;
56
56
  if (shouldExpand) {
@@ -20,6 +20,7 @@ interface PieArcOwnerState {
20
20
  color: string;
21
21
  isFaded: boolean;
22
22
  isHighlighted: boolean;
23
+ isFocused: boolean;
23
24
  classes?: Partial<PieArcClasses>;
24
25
  }
25
26
  export declare function getPieArcUtilityClass(slot: string): string;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
5
+ const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "isFocused", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import composeClasses from '@mui/utils/composeClasses';
@@ -51,6 +51,7 @@ const PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
51
51
  id,
52
52
  isFaded,
53
53
  isHighlighted,
54
+ isFocused,
54
55
  onClick,
55
56
  cornerRadius,
56
57
  startAngle,
@@ -67,7 +68,8 @@ const PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
67
68
  classes: innerClasses,
68
69
  color,
69
70
  isFaded,
70
- isHighlighted
71
+ isHighlighted,
72
+ isFocused
71
73
  };
72
74
  const classes = useUtilityClasses(ownerState);
73
75
  const interactionProps = useInteractionItemProps({
@@ -96,7 +98,8 @@ const PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
96
98
  strokeWidth: 1,
97
99
  strokeLinejoin: "round",
98
100
  "data-highlighted": ownerState.isHighlighted || undefined,
99
- "data-faded": ownerState.isFaded || undefined
101
+ "data-faded": ownerState.isFaded || undefined,
102
+ "data-focused": isFocused || undefined
100
103
  }, other, interactionProps, animatedProps));
101
104
  });
102
105
  if (process.env.NODE_ENV !== "production") PieArc.displayName = "PieArc";
@@ -112,6 +115,7 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
112
115
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
113
116
  innerRadius: PropTypes.number.isRequired,
114
117
  isFaded: PropTypes.bool.isRequired,
118
+ isFocused: PropTypes.bool.isRequired,
115
119
  isHighlighted: PropTypes.bool.isRequired,
116
120
  outerRadius: PropTypes.number.isRequired,
117
121
  paddingAngle: PropTypes.number.isRequired,
@@ -54,6 +54,7 @@ function PieArcPlot(props) {
54
54
  dataIndex: index,
55
55
  isFaded: item.isFaded,
56
56
  isHighlighted: item.isHighlighted,
57
+ isFocused: item.isFocused,
57
58
  onClick: onItemClick && (event => {
58
59
  onItemClick(event, {
59
60
  type: 'pie',
@@ -78,6 +78,7 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
78
78
  legendPosition: props.slotProps?.legend?.position,
79
79
  legendDirection: props.slotProps?.legend?.direction ?? 'vertical',
80
80
  sx: sx,
81
+ hideLegend: hideLegend ?? false,
81
82
  children: [showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
82
83
  direction: props.slotProps?.legend?.direction ?? 'vertical',
83
84
  slots: slots,
@@ -119,6 +120,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
119
120
  */
120
121
  dataset: PropTypes.arrayOf(PropTypes.object),
121
122
  desc: PropTypes.string,
123
+ enableKeyboardNavigation: PropTypes.bool,
122
124
  /**
123
125
  * The height of the chart in px. If not defined, it takes the height of the parent element.
124
126
  */
@@ -1,5 +1,6 @@
1
1
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
2
2
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
3
+ import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
3
4
  import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
4
- export type PieChartPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature];
5
+ export type PieChartPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
5
6
  export declare const PIE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<PieChartPluginSignatures>;
@@ -1,3 +1,4 @@
1
1
  import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
2
2
  import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
3
- export const PIE_CHART_PLUGINS = [useChartInteraction, useChartHighlight];
3
+ import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
4
+ export const PIE_CHART_PLUGINS = [useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
@@ -12,5 +12,6 @@ export interface ValueWithHighlight extends DefaultizedPieValueType, AnimatedObj
12
12
  dataIndex: number;
13
13
  isFaded: boolean;
14
14
  isHighlighted: boolean;
15
+ isFocused: boolean;
15
16
  }
16
17
  export declare function useTransformData(series: Pick<DefaultizedPieSeriesType, 'cornerRadius' | 'paddingAngle' | 'id' | 'highlighted' | 'faded' | 'data'> & ComputedPieRadius): ValueWithHighlight[];
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import { useItemHighlightedGetter } from "../../hooks/useItemHighlightedGetter.js";
6
+ import { useIsItemFocusedGetter } from "../../hooks/useIsItemFocusedGetter.js";
6
7
  import { deg2rad } from "../../internals/angleConversion.js";
7
8
  export function useTransformData(series) {
8
9
  const {
@@ -20,6 +21,7 @@ export function useTransformData(series) {
20
21
  isFaded: isItemFaded,
21
22
  isHighlighted: isItemHighlighted
22
23
  } = useItemHighlightedGetter();
24
+ const isItemFocused = useIsItemFocusedGetter();
23
25
  const dataWithHighlight = React.useMemo(() => data.map((item, itemIndex) => {
24
26
  const currentItem = {
25
27
  seriesId,
@@ -27,6 +29,11 @@ export function useTransformData(series) {
27
29
  };
28
30
  const isHighlighted = isItemHighlighted(currentItem);
29
31
  const isFaded = !isHighlighted && isItemFaded(currentItem);
32
+ const isFocused = isItemFocused({
33
+ seriesType: 'pie',
34
+ seriesId,
35
+ dataIndex: itemIndex
36
+ });
30
37
  const attributesOverride = _extends({
31
38
  additionalRadius: 0
32
39
  }, isFaded && faded || isHighlighted && highlighted || {});
@@ -39,12 +46,13 @@ export function useTransformData(series) {
39
46
  dataIndex: itemIndex,
40
47
  isFaded,
41
48
  isHighlighted,
49
+ isFocused,
42
50
  paddingAngle,
43
51
  innerRadius,
44
52
  outerRadius,
45
53
  cornerRadius,
46
54
  arcLabelRadius
47
55
  });
48
- }), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, seriesId]);
56
+ }), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, isItemFocused, seriesId]);
49
57
  return dataWithHighlight;
50
58
  }
@@ -5,5 +5,6 @@ export * from "./PieArcLabelPlot.js";
5
5
  export * from "./PieArc.js";
6
6
  export * from "./PieArcLabel.js";
7
7
  export * from "./getPieCoordinates.js";
8
+ export * from "./PieChart.plugins.js";
8
9
  export { pieClasses } from "./pieClasses.js";
9
10
  export type { PieClasses, PieClassKey } from "./pieClasses.js";
@@ -5,4 +5,5 @@ export * from "./PieArcLabelPlot.js";
5
5
  export * from "./PieArc.js";
6
6
  export * from "./PieArcLabel.js";
7
7
  export * from "./getPieCoordinates.js";
8
+ export * from "./PieChart.plugins.js";
8
9
  export { pieClasses } from "./pieClasses.js";
@@ -3,7 +3,7 @@ import { useRadiusAxes } from "../../hooks/useAxis.js";
3
3
  import { useRotationScale } from "../../hooks/useScale.js";
4
4
  import { useChartContext } from "../../context/ChartProvider/useChartContext.js";
5
5
  import { selectorChartPolarCenter } from "../../internals/plugins/featurePlugins/useChartPolarAxis/index.js";
6
- import { isBandScale } from "../../internals/isBandScale.js";
6
+ import { isOrdinalScale } from "../../internals/scaleGuards.js";
7
7
  import { degToRad } from "../../internals/degToRad.js";
8
8
  import { clampAngle } from "../../internals/clampAngle.js";
9
9
  import { useSelector } from "../../internals/store/useSelector.js";
@@ -42,7 +42,7 @@ export function useRadarAxis(params) {
42
42
  }, (_, index) => (index + 1) / divisions);
43
43
  const radiusScale = radiusAxis[metric].scale;
44
44
  const R = radiusScale.range()[1];
45
- if (isBandScale(radiusScale)) {
45
+ if (isOrdinalScale(radiusScale)) {
46
46
  if (process.env.NODE_ENV !== 'production') {
47
47
  console.error('MUI X Charts: Radar chart does not support ordinal axes');
48
48
  }
@@ -2,4 +2,4 @@ import { UseChartPolarAxisSignature } from "../internals/plugins/featurePlugins/
2
2
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
3
3
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
4
4
  export declare const RADAR_PLUGINS: readonly [import("../internals/index.js").ChartPlugin<UseChartPolarAxisSignature<any>>, import("../internals/index.js").ChartPlugin<UseChartInteractionSignature>, import("../internals/index.js").ChartPlugin<UseChartHighlightSignature>];
5
- export type RadarChartPluginsSignatures = [UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature];
5
+ export type RadarChartPluginSignatures = [UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature];
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { MakeOptional } from '@mui/x-internals/types';
3
- import { RadarChartPluginsSignatures } from "../RadarChart.plugins.js";
3
+ import { RadarChartPluginSignatures } from "../RadarChart.plugins.js";
4
4
  import { RadarSeriesType } from "../../models/seriesType/radar.js";
5
5
  import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
6
6
  import { RadarConfig } from "./radar.types.js";
7
7
  import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
8
8
  export type RadarSeries = MakeOptional<RadarSeriesType, 'type'>;
9
- export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
9
+ export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
10
10
  /**
11
11
  * The series to display in the bar chart.
12
12
  * An array of [[RadarSeries]] objects.
@@ -22,5 +22,5 @@ export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSi
22
22
  */
23
23
  highlight?: 'axis' | 'series' | 'none';
24
24
  };
25
- declare function RadarDataProvider<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures>(props: RadarDataProviderProps<TSignatures>): React.JSX.Element;
25
+ declare function RadarDataProvider<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginSignatures>(props: RadarDataProviderProps<TSignatures>): React.JSX.Element;
26
26
  export { RadarDataProvider };
@@ -15,4 +15,5 @@ export * from "./RadarGrid/index.js";
15
15
  export * from "./RadarAxis/index.js";
16
16
  export * from "./RadarAxisHighlight/index.js";
17
17
  export * from "./RadarMetricLabels/index.js";
18
- export * from "./RadarSeriesPlot/index.js";
18
+ export * from "./RadarSeriesPlot/index.js";
19
+ export * from "./RadarChart.plugins.js";
@@ -16,4 +16,5 @@ export * from "./RadarGrid/index.js";
16
16
  export * from "./RadarAxis/index.js";
17
17
  export * from "./RadarAxisHighlight/index.js";
18
18
  export * from "./RadarMetricLabels/index.js";
19
- export * from "./RadarSeriesPlot/index.js";
19
+ export * from "./RadarSeriesPlot/index.js";
20
+ export * from "./RadarChart.plugins.js";
@@ -5,7 +5,7 @@ import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
5
5
  import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
6
6
  import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
7
7
  import { RadarGridProps } from "./RadarGrid/index.js";
8
- import { RadarChartPluginsSignatures } from "./RadarChart.plugins.js";
8
+ import { RadarChartPluginSignatures } from "./RadarChart.plugins.js";
9
9
  import { RadarSeriesAreaProps, RadarSeriesMarksProps } from "./RadarSeriesPlot/index.js";
10
10
  /**
11
11
  * A helper function that extracts RadarChartProps from the input props
@@ -18,7 +18,7 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
18
18
  highlight: "none" | "series" | "axis";
19
19
  chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
20
20
  chartsSurfaceProps: ChartsSurfaceProps;
21
- radarDataProviderProps: RadarDataProviderProps<RadarChartPluginsSignatures>;
21
+ radarDataProviderProps: RadarDataProviderProps<RadarChartPluginSignatures>;
22
22
  radarGrid: RadarGridProps;
23
23
  radarSeriesAreaProps: RadarSeriesAreaProps;
24
24
  radarSeriesMarksProps: RadarSeriesMarksProps;
@@ -59,7 +59,8 @@ export const useRadarChartProps = props => {
59
59
  slotProps
60
60
  };
61
61
  const chartsWrapperProps = {
62
- sx
62
+ sx,
63
+ hideLegend: props.hideLegend ?? false
63
64
  };
64
65
  const radarGrid = {
65
66
  divisions,
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import { DefaultizedScatterSeriesType } from "../models/seriesType/scatter.js";
3
+ import { D3Scale } from "../models/axis.js";
4
+ import { ScatterClasses } from "./scatterClasses.js";
5
+ import { ColorGetter } from "../internals/plugins/models/seriesConfig/index.js";
6
+ export interface BatchScatterProps {
7
+ series: DefaultizedScatterSeriesType;
8
+ xScale: D3Scale;
9
+ yScale: D3Scale;
10
+ color: string;
11
+ colorGetter?: ColorGetter<'scatter'>;
12
+ classes?: Partial<ScatterClasses>;
13
+ }
14
+ export interface BatchScatterPathsProps {
15
+ series: DefaultizedScatterSeriesType;
16
+ xScale: D3Scale;
17
+ yScale: D3Scale;
18
+ color: string;
19
+ colorGetter?: ColorGetter<'scatter'>;
20
+ markerSize: number;
21
+ }
22
+ /**
23
+ * @internal
24
+ * A batch version of the Scatter component that uses SVG paths to render points.
25
+ * This component is optimized for performance and is suitable for rendering large datasets, but has limitations. Some of the limitations include:
26
+ * - Limited CSS styling;
27
+ * - Overriding the `marker` slot is not supported;
28
+ * - Highlight style must not contain opacity.
29
+ *
30
+ * You can read about all the limitations [here](https://mui.com/x/react-charts/scatter/#performance).
31
+ */
32
+ export declare function BatchScatter(props: BatchScatterProps): React.JSX.Element;
@@ -0,0 +1,165 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useUtilityClasses } from "./scatterClasses.js";
6
+ import { useChartContext } from "../context/ChartProvider/index.js";
7
+ import { getValueToPositionMapper } from "../hooks/useScale.js";
8
+ import { useSelector } from "../internals/store/useSelector.js";
9
+ import { selectorChartIsSeriesFaded, selectorChartIsSeriesHighlighted, selectorChartSeriesUnfadedItem, selectorChartSeriesHighlightedItem } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const MAX_POINTS_PER_PATH = 1000;
12
+ /* In an SVG arc, if the arc starts and ends at the same point, it is not rendered, so we add a tiny
13
+ * value to one of the coordinates to ensure that the arc is rendered. */
14
+ const ALMOST_ZERO = 0.01;
15
+ function appendAtKey(map, key, value) {
16
+ let bucket = map.get(key);
17
+ if (!bucket) {
18
+ bucket = [value];
19
+ map.set(key, bucket);
20
+ } else {
21
+ bucket.push(value);
22
+ }
23
+ return bucket;
24
+ }
25
+ function createPath(x, y, markerSize) {
26
+ return `M${x - markerSize} ${y} a${markerSize} ${markerSize} 0 1 1 0 ${ALMOST_ZERO}`;
27
+ }
28
+ function useCreatePaths(seriesData, markerSize, xScale, yScale, color, colorGetter) {
29
+ const {
30
+ instance
31
+ } = useChartContext();
32
+ const getXPosition = getValueToPositionMapper(xScale);
33
+ const getYPosition = getValueToPositionMapper(yScale);
34
+ const paths = new Map();
35
+ const temporaryPaths = new Map();
36
+ for (let i = 0; i < seriesData.length; i += 1) {
37
+ const scatterPoint = seriesData[i];
38
+ const x = getXPosition(scatterPoint.x);
39
+ const y = getYPosition(scatterPoint.y);
40
+ if (!instance.isPointInside(x, y)) {
41
+ continue;
42
+ }
43
+ const path = createPath(x, y, markerSize);
44
+ const fill = colorGetter ? colorGetter(i) : color;
45
+ const tempPath = appendAtKey(temporaryPaths, fill, path);
46
+ if (tempPath.length >= MAX_POINTS_PER_PATH) {
47
+ appendAtKey(paths, fill, tempPath.join(''));
48
+ temporaryPaths.delete(fill);
49
+ }
50
+ }
51
+ for (const [fill, tempPath] of temporaryPaths.entries()) {
52
+ if (tempPath.length > 0) {
53
+ appendAtKey(paths, fill, tempPath.join(''));
54
+ }
55
+ }
56
+ return paths;
57
+ }
58
+ function BatchScatterPaths(props) {
59
+ const {
60
+ series,
61
+ xScale,
62
+ yScale,
63
+ color,
64
+ colorGetter,
65
+ markerSize
66
+ } = props;
67
+ const paths = useCreatePaths(series.data, markerSize, xScale, yScale, color, colorGetter);
68
+ const children = [];
69
+ let i = 0;
70
+ for (const [fill, dArray] of paths.entries()) {
71
+ for (const d of dArray) {
72
+ children.push(/*#__PURE__*/_jsx("path", {
73
+ fill: fill,
74
+ d: d
75
+ }, i));
76
+ i += 1;
77
+ }
78
+ }
79
+ return /*#__PURE__*/_jsx(React.Fragment, {
80
+ children: children
81
+ });
82
+ }
83
+ const MemoBatchScatterPaths = /*#__PURE__*/React.memo(BatchScatterPaths);
84
+ if (process.env.NODE_ENV !== "production") MemoBatchScatterPaths.displayName = "MemoBatchScatterPaths";
85
+ const Group = styled('g')({
86
+ '&[data-faded="true"]': {
87
+ opacity: 0.3
88
+ },
89
+ '& path': {
90
+ /* The browser must do hit testing to know which element a pointer is interacting with.
91
+ * With many data points, we create many paths causing significant time to be spent in the hit test phase.
92
+ * To fix this issue, we disable pointer events for the descendant paths.
93
+ *
94
+ * Ideally, users should be able to override this in case they need pointer events to be enabled,
95
+ * but it can affect performance negatively, especially with many data points. */
96
+ pointerEvents: 'none'
97
+ }
98
+ });
99
+
100
+ /**
101
+ * @internal
102
+ * A batch version of the Scatter component that uses SVG paths to render points.
103
+ * This component is optimized for performance and is suitable for rendering large datasets, but has limitations. Some of the limitations include:
104
+ * - Limited CSS styling;
105
+ * - Overriding the `marker` slot is not supported;
106
+ * - Highlight style must not contain opacity.
107
+ *
108
+ * You can read about all the limitations [here](https://mui.com/x/react-charts/scatter/#performance).
109
+ */
110
+ export function BatchScatter(props) {
111
+ const {
112
+ series,
113
+ xScale,
114
+ yScale,
115
+ color,
116
+ colorGetter,
117
+ classes: inClasses
118
+ } = props;
119
+ const {
120
+ store
121
+ } = useChartContext();
122
+ const isSeriesHighlighted = useSelector(store, selectorChartIsSeriesHighlighted, [series.id]);
123
+ const isSeriesFaded = useSelector(store, selectorChartIsSeriesFaded, [series.id]);
124
+ const seriesHighlightedItem = useSelector(store, selectorChartSeriesHighlightedItem, [series.id]);
125
+ const seriesUnfadedItem = useSelector(store, selectorChartSeriesUnfadedItem, [series.id]);
126
+ const highlightedModifier = 1.2;
127
+ const markerSize = series.markerSize * (isSeriesHighlighted ? highlightedModifier : 1);
128
+ const classes = useUtilityClasses(inClasses);
129
+ const siblings = [];
130
+ if (seriesHighlightedItem != null) {
131
+ const datum = series.data[seriesHighlightedItem];
132
+ const getXPosition = getValueToPositionMapper(xScale);
133
+ const getYPosition = getValueToPositionMapper(yScale);
134
+ siblings.push(/*#__PURE__*/_jsx("path", {
135
+ fill: colorGetter ? colorGetter(seriesHighlightedItem) : color,
136
+ "data-highlighted": true,
137
+ d: createPath(getXPosition(datum.x), getYPosition(datum.y), markerSize * highlightedModifier)
138
+ }, `highlighted-${series.id}`));
139
+ }
140
+ if (seriesUnfadedItem != null) {
141
+ const datum = series.data[seriesUnfadedItem];
142
+ const getXPosition = getValueToPositionMapper(xScale);
143
+ const getYPosition = getValueToPositionMapper(yScale);
144
+ siblings.push(/*#__PURE__*/_jsx("path", {
145
+ fill: colorGetter ? colorGetter(seriesUnfadedItem) : color,
146
+ d: createPath(getXPosition(datum.x), getYPosition(datum.y), markerSize)
147
+ }, `unfaded-${series.id}`));
148
+ }
149
+ return /*#__PURE__*/_jsxs(React.Fragment, {
150
+ children: [/*#__PURE__*/_jsx(Group, {
151
+ className: classes.root,
152
+ "data-series": series.id,
153
+ "data-faded": isSeriesFaded || undefined,
154
+ "data-highlighted": isSeriesHighlighted || undefined,
155
+ children: /*#__PURE__*/_jsx(MemoBatchScatterPaths, {
156
+ series: series,
157
+ xScale: xScale,
158
+ yScale: yScale,
159
+ color: color,
160
+ colorGetter: colorGetter,
161
+ markerSize: markerSize
162
+ })
163
+ }), siblings]
164
+ });
165
+ }