@mui/x-charts 8.0.0-alpha.0 → 8.0.0-alpha.2

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 (417) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +15 -0
  2. package/BarChart/AnimatedBarElement.js +21 -0
  3. package/BarChart/BarChart.d.ts +4 -9
  4. package/BarChart/BarChart.js +3 -35
  5. package/BarChart/BarElement.d.ts +5 -1342
  6. package/BarChart/BarElement.js +10 -20
  7. package/BarChart/BarLabel/BarLabel.d.ts +298 -298
  8. package/BarChart/BarPlot.js +12 -2
  9. package/BarChart/useBarChartProps.d.ts +0 -2
  10. package/BarChart/useBarChartProps.js +2 -8
  11. package/CHANGELOG.md +651 -6
  12. package/ChartContainer/ChartContainer.d.ts +26 -19
  13. package/ChartContainer/ChartContainer.js +31 -25
  14. package/ChartContainer/useChartContainerProps.d.ts +5 -7
  15. package/ChartContainer/useChartContainerProps.js +12 -27
  16. package/ChartsAxis/axisClasses.js +2 -1
  17. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
  18. package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  19. package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  21. package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
  22. package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  23. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
  24. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  25. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
  26. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  27. package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
  28. package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  29. package/ChartsAxisHighlight/index.d.ts +3 -0
  30. package/ChartsAxisHighlight/index.js +4 -1
  31. package/ChartsGrid/ChartsGrid.js +1 -1
  32. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
  33. package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  34. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
  35. package/ChartsGrid/ChartsVerticalGrid.js +3 -3
  36. package/ChartsLegend/LegendPerItem.d.ts +2 -2
  37. package/ChartsLegend/chartsLegendClasses.js +2 -1
  38. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  39. package/ChartsSurface/ChartsSurface.d.ts +14 -15
  40. package/ChartsSurface/ChartsSurface.js +68 -35
  41. package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
  42. package/ChartsTooltip/ChartTooltip.types.js +1 -0
  43. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
  44. package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  45. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
  46. package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  47. package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
  48. package/ChartsTooltip/ChartsTooltip.js +143 -145
  49. package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
  50. package/ChartsTooltip/ChartsTooltipContainer.js +280 -0
  51. package/ChartsTooltip/ChartsTooltipTable.js +1 -1
  52. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
  53. package/ChartsTooltip/chartsTooltipClasses.js +18 -2
  54. package/ChartsTooltip/index.d.ts +3 -3
  55. package/ChartsTooltip/index.js +2 -3
  56. package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
  57. package/ChartsTooltip/useAxisTooltip.js +19 -19
  58. package/ChartsTooltip/useItemTooltip.d.ts +2 -3
  59. package/ChartsTooltip/useItemTooltip.js +5 -4
  60. package/ChartsTooltip/utils.d.ts +0 -3
  61. package/ChartsTooltip/utils.js +0 -8
  62. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
  63. package/ChartsXAxis/ChartsXAxis.js +3 -17
  64. package/ChartsYAxis/ChartsYAxis.js +2 -17
  65. package/Gauge/Gauge.d.ts +1 -1
  66. package/Gauge/Gauge.js +0 -6
  67. package/Gauge/GaugeContainer.d.ts +3 -3
  68. package/Gauge/GaugeContainer.js +42 -76
  69. package/LineChart/AnimatedArea.d.ts +0 -1333
  70. package/LineChart/AnimatedArea.js +9 -18
  71. package/LineChart/AnimatedLine.d.ts +0 -1333
  72. package/LineChart/AnimatedLine.js +9 -20
  73. package/LineChart/AreaPlot.js +12 -2
  74. package/LineChart/CircleMarkElement.js +6 -5
  75. package/LineChart/LineChart.d.ts +4 -10
  76. package/LineChart/LineChart.js +3 -36
  77. package/LineChart/LineHighlightPlot.js +6 -5
  78. package/LineChart/LinePlot.js +12 -2
  79. package/LineChart/MarkElement.js +6 -5
  80. package/LineChart/useLineChartProps.d.ts +0 -2
  81. package/LineChart/useLineChartProps.js +2 -8
  82. package/PieChart/PieChart.d.ts +3 -9
  83. package/PieChart/PieChart.js +5 -41
  84. package/PieChart/PiePlot.js +2 -2
  85. package/PieChart/getPieCoordinates.d.ts +2 -2
  86. package/README.md +2 -2
  87. package/ScatterChart/Scatter.js +6 -5
  88. package/ScatterChart/ScatterChart.d.ts +4 -10
  89. package/ScatterChart/ScatterChart.js +5 -36
  90. package/ScatterChart/useScatterChartProps.d.ts +0 -2
  91. package/ScatterChart/useScatterChartProps.js +1 -9
  92. package/SparkLineChart/SparkLineChart.d.ts +3 -4
  93. package/SparkLineChart/SparkLineChart.js +4 -35
  94. package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
  95. package/context/ChartDataProvider/ChartDataProvider.d.ts +36 -19
  96. package/context/ChartDataProvider/ChartDataProvider.js +55 -48
  97. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +25 -32
  98. package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  99. package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -11
  100. package/context/ChartProvider/ChartContext.d.ts +6 -0
  101. package/context/ChartProvider/ChartContext.js +8 -0
  102. package/context/ChartProvider/ChartProvider.d.ts +4 -0
  103. package/context/ChartProvider/ChartProvider.js +19 -0
  104. package/context/ChartProvider/ChartProvider.types.d.ts +24 -0
  105. package/context/ChartProvider/ChartProvider.types.js +1 -0
  106. package/context/ChartProvider/index.d.ts +3 -0
  107. package/context/ChartProvider/index.js +3 -0
  108. package/context/ChartProvider/useChartContext.d.ts +3 -0
  109. package/context/ChartProvider/useChartContext.js +11 -0
  110. package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
  111. package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  112. package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +3 -0
  113. package/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
  114. package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
  115. package/{modern/context/DrawingProvider.js → context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  116. package/context/DrawingAreaProvider/index.d.ts +3 -0
  117. package/context/DrawingAreaProvider/index.js +3 -0
  118. package/context/InteractionSelectors.d.ts +382 -0
  119. package/context/InteractionSelectors.js +12 -0
  120. package/context/SizeProvider/Size.types.d.ts +30 -0
  121. package/context/SizeProvider/Size.types.js +1 -0
  122. package/context/SizeProvider/SizeContext.d.ts +4 -0
  123. package/context/SizeProvider/SizeContext.js +15 -0
  124. package/context/SizeProvider/SizeProvider.d.ts +11 -0
  125. package/context/SizeProvider/SizeProvider.js +26 -0
  126. package/context/SizeProvider/index.d.ts +4 -0
  127. package/context/SizeProvider/index.js +4 -0
  128. package/context/SizeProvider/useChartContainerDimensions.d.ts +9 -0
  129. package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
  130. package/context/SizeProvider/useSize.d.ts +5 -0
  131. package/context/SizeProvider/useSize.js +13 -0
  132. package/context/index.d.ts +2 -0
  133. package/context/index.js +2 -1
  134. package/hooks/useAxisEvents.js +32 -19
  135. package/hooks/useChartId.js +5 -6
  136. package/hooks/useDrawingArea.d.ts +2 -2
  137. package/hooks/useDrawingArea.js +2 -2
  138. package/hooks/useInteractionItemProps.js +22 -13
  139. package/hooks/useSvgRef.d.ts +1 -1
  140. package/hooks/useSvgRef.js +4 -8
  141. package/index.js +1 -1
  142. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
  143. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
  144. package/internals/computeAxisValue.d.ts +2 -2
  145. package/internals/defaultizeColor.d.ts +1 -1
  146. package/internals/index.d.ts +3 -4
  147. package/internals/index.js +3 -4
  148. package/internals/plugins/allPlugins.d.ts +1 -0
  149. package/internals/plugins/allPlugins.js +3 -0
  150. package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
  151. package/internals/plugins/corePlugins/corePlugins.js +7 -0
  152. package/internals/plugins/corePlugins/index.d.ts +2 -0
  153. package/internals/plugins/corePlugins/index.js +1 -0
  154. package/internals/plugins/corePlugins/useChartId/index.d.ts +2 -0
  155. package/internals/plugins/corePlugins/useChartId/index.js +1 -0
  156. package/internals/plugins/corePlugins/useChartId/useChartId.d.ts +3 -0
  157. package/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
  158. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +36 -0
  159. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
  160. package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +20 -0
  161. package/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
  162. package/internals/plugins/corePlugins/useChartId/useChartId.utils.d.ts +1 -0
  163. package/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
  164. package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +3 -0
  165. package/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
  166. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.d.ts +3 -0
  167. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
  168. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +376 -0
  169. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
  170. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +57 -0
  171. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
  172. package/internals/plugins/models/chart.d.ts +14 -0
  173. package/internals/plugins/models/chart.js +1 -0
  174. package/internals/plugins/models/helpers.d.ts +7 -0
  175. package/internals/plugins/models/helpers.js +1 -0
  176. package/internals/plugins/models/index.d.ts +3 -0
  177. package/internals/plugins/models/index.js +3 -0
  178. package/internals/plugins/models/plugin.d.ts +75 -0
  179. package/internals/plugins/models/plugin.js +1 -0
  180. package/internals/plugins/utils/ChartStore.d.ts +13 -0
  181. package/internals/plugins/utils/ChartStore.js +24 -0
  182. package/internals/plugins/utils/selectors.d.ts +9 -0
  183. package/internals/plugins/utils/selectors.js +37 -0
  184. package/internals/store/useCharts.d.ts +14 -0
  185. package/internals/store/useCharts.js +72 -0
  186. package/internals/store/useCharts.types.d.ts +5 -0
  187. package/internals/store/useCharts.types.js +1 -0
  188. package/internals/store/useSelector.d.ts +4 -0
  189. package/internals/store/useSelector.js +6 -0
  190. package/internals/store/useStore.d.ts +3 -0
  191. package/internals/store/useStore.js +17 -0
  192. package/models/axis.d.ts +1 -13
  193. package/modern/BarChart/AnimatedBarElement.js +21 -0
  194. package/modern/BarChart/BarChart.js +3 -35
  195. package/modern/BarChart/BarElement.js +10 -20
  196. package/modern/BarChart/BarPlot.js +12 -2
  197. package/modern/BarChart/useBarChartProps.js +2 -8
  198. package/modern/ChartContainer/ChartContainer.js +31 -25
  199. package/modern/ChartContainer/useChartContainerProps.js +12 -27
  200. package/modern/ChartsAxis/axisClasses.js +2 -1
  201. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  202. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  203. package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  204. package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  205. package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  206. package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  207. package/modern/ChartsAxisHighlight/index.js +4 -1
  208. package/modern/ChartsGrid/ChartsGrid.js +1 -1
  209. package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  210. package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
  211. package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
  212. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  213. package/modern/ChartsSurface/ChartsSurface.js +68 -35
  214. package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
  215. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  216. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  217. package/modern/ChartsTooltip/ChartsTooltip.js +143 -145
  218. package/modern/ChartsTooltip/ChartsTooltipContainer.js +280 -0
  219. package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
  220. package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
  221. package/modern/ChartsTooltip/index.js +2 -3
  222. package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
  223. package/modern/ChartsTooltip/useItemTooltip.js +5 -4
  224. package/modern/ChartsTooltip/utils.js +0 -8
  225. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
  226. package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
  227. package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
  228. package/modern/Gauge/Gauge.js +0 -6
  229. package/modern/Gauge/GaugeContainer.js +42 -76
  230. package/modern/LineChart/AnimatedArea.js +9 -18
  231. package/modern/LineChart/AnimatedLine.js +9 -20
  232. package/modern/LineChart/AreaPlot.js +12 -2
  233. package/modern/LineChart/CircleMarkElement.js +6 -5
  234. package/modern/LineChart/LineChart.js +3 -36
  235. package/modern/LineChart/LineHighlightPlot.js +6 -5
  236. package/modern/LineChart/LinePlot.js +12 -2
  237. package/modern/LineChart/MarkElement.js +6 -5
  238. package/modern/LineChart/useLineChartProps.js +2 -8
  239. package/modern/PieChart/PieChart.js +5 -41
  240. package/modern/PieChart/PiePlot.js +2 -2
  241. package/modern/ScatterChart/Scatter.js +6 -5
  242. package/modern/ScatterChart/ScatterChart.js +5 -36
  243. package/modern/ScatterChart/useScatterChartProps.js +1 -9
  244. package/modern/SparkLineChart/SparkLineChart.js +4 -35
  245. package/modern/context/ChartDataProvider/ChartDataProvider.js +55 -48
  246. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  247. package/modern/context/ChartProvider/ChartContext.js +8 -0
  248. package/modern/context/ChartProvider/ChartProvider.js +19 -0
  249. package/modern/context/ChartProvider/ChartProvider.types.js +1 -0
  250. package/modern/context/ChartProvider/index.js +3 -0
  251. package/modern/context/ChartProvider/useChartContext.js +11 -0
  252. package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  253. package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
  254. package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  255. package/modern/context/DrawingAreaProvider/index.js +3 -0
  256. package/modern/context/InteractionSelectors.js +12 -0
  257. package/modern/context/SizeProvider/Size.types.js +1 -0
  258. package/modern/context/SizeProvider/SizeContext.js +15 -0
  259. package/modern/context/SizeProvider/SizeProvider.js +26 -0
  260. package/modern/context/SizeProvider/index.js +4 -0
  261. package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +16 -6
  262. package/modern/context/SizeProvider/useSize.js +13 -0
  263. package/modern/context/index.js +2 -1
  264. package/modern/hooks/useAxisEvents.js +32 -19
  265. package/modern/hooks/useChartId.js +5 -6
  266. package/modern/hooks/useDrawingArea.js +2 -2
  267. package/modern/hooks/useInteractionItemProps.js +22 -13
  268. package/modern/hooks/useSvgRef.js +4 -8
  269. package/modern/index.js +1 -1
  270. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
  271. package/modern/internals/index.js +3 -4
  272. package/modern/internals/plugins/allPlugins.js +3 -0
  273. package/modern/internals/plugins/corePlugins/corePlugins.js +7 -0
  274. package/modern/internals/plugins/corePlugins/index.js +1 -0
  275. package/modern/internals/plugins/corePlugins/useChartId/index.js +1 -0
  276. package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
  277. package/modern/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
  278. package/modern/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
  279. package/modern/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
  280. package/modern/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
  281. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
  282. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
  283. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
  284. package/modern/internals/plugins/models/chart.js +1 -0
  285. package/modern/internals/plugins/models/helpers.js +1 -0
  286. package/modern/internals/plugins/models/index.js +3 -0
  287. package/modern/internals/plugins/models/plugin.js +1 -0
  288. package/modern/internals/plugins/utils/ChartStore.js +24 -0
  289. package/modern/internals/plugins/utils/selectors.js +37 -0
  290. package/modern/internals/store/useCharts.js +72 -0
  291. package/modern/internals/store/useCharts.types.js +1 -0
  292. package/modern/internals/store/useSelector.js +6 -0
  293. package/modern/internals/store/useStore.js +17 -0
  294. package/node/BarChart/AnimatedBarElement.js +28 -0
  295. package/node/BarChart/BarChart.js +3 -35
  296. package/node/BarChart/BarElement.js +11 -21
  297. package/node/BarChart/BarPlot.js +11 -1
  298. package/node/BarChart/useBarChartProps.js +2 -8
  299. package/node/ChartContainer/ChartContainer.js +31 -25
  300. package/node/ChartContainer/useChartContainerProps.js +12 -27
  301. package/node/ChartsAxis/axisClasses.js +5 -3
  302. package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
  303. package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
  304. package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
  305. package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
  306. package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
  307. package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
  308. package/node/ChartsAxisHighlight/index.js +33 -0
  309. package/node/ChartsGrid/ChartsGrid.js +2 -2
  310. package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
  311. package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
  312. package/node/ChartsLegend/chartsLegendClasses.js +5 -3
  313. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  314. package/node/ChartsSurface/ChartsSurface.js +68 -35
  315. package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
  316. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
  317. package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
  318. package/node/ChartsTooltip/ChartsTooltip.js +142 -144
  319. package/node/ChartsTooltip/ChartsTooltipContainer.js +286 -0
  320. package/node/ChartsTooltip/ChartsTooltipTable.js +2 -2
  321. package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
  322. package/node/ChartsTooltip/index.js +19 -28
  323. package/node/ChartsTooltip/useAxisTooltip.js +19 -19
  324. package/node/ChartsTooltip/useItemTooltip.js +5 -4
  325. package/node/ChartsTooltip/utils.js +0 -9
  326. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -37
  327. package/node/ChartsXAxis/ChartsXAxis.js +3 -17
  328. package/node/ChartsYAxis/ChartsYAxis.js +2 -17
  329. package/node/Gauge/Gauge.js +0 -6
  330. package/node/Gauge/GaugeContainer.js +42 -76
  331. package/node/LineChart/AnimatedArea.js +9 -19
  332. package/node/LineChart/AnimatedLine.js +9 -21
  333. package/node/LineChart/AreaPlot.js +11 -1
  334. package/node/LineChart/CircleMarkElement.js +6 -5
  335. package/node/LineChart/LineChart.js +3 -36
  336. package/node/LineChart/LineHighlightPlot.js +6 -5
  337. package/node/LineChart/LinePlot.js +11 -1
  338. package/node/LineChart/MarkElement.js +6 -5
  339. package/node/LineChart/useLineChartProps.js +2 -8
  340. package/node/PieChart/PieChart.js +5 -41
  341. package/node/PieChart/PiePlot.js +2 -2
  342. package/node/ScatterChart/Scatter.js +6 -5
  343. package/node/ScatterChart/ScatterChart.js +5 -36
  344. package/node/ScatterChart/useScatterChartProps.js +1 -9
  345. package/node/SparkLineChart/SparkLineChart.js +4 -35
  346. package/node/context/ChartDataProvider/ChartDataProvider.js +55 -48
  347. package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
  348. package/node/context/ChartProvider/ChartContext.js +15 -0
  349. package/node/context/ChartProvider/ChartProvider.js +24 -0
  350. package/node/context/ChartProvider/ChartProvider.types.js +5 -0
  351. package/node/context/ChartProvider/index.js +38 -0
  352. package/node/context/ChartProvider/useChartContext.js +18 -0
  353. package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
  354. package/node/context/DrawingAreaProvider/DrawingAreaContext.js +21 -0
  355. package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
  356. package/node/context/DrawingAreaProvider/index.js +38 -0
  357. package/node/context/InteractionSelectors.js +18 -0
  358. package/node/context/SizeProvider/Size.types.js +5 -0
  359. package/node/context/SizeProvider/SizeContext.js +22 -0
  360. package/node/context/SizeProvider/SizeProvider.js +29 -0
  361. package/node/context/SizeProvider/index.js +49 -0
  362. package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
  363. package/node/context/SizeProvider/useSize.js +20 -0
  364. package/node/context/index.js +10 -2
  365. package/node/hooks/useAxisEvents.js +33 -19
  366. package/node/hooks/useChartId.js +5 -7
  367. package/node/hooks/useDrawingArea.js +2 -2
  368. package/node/hooks/useInteractionItemProps.js +23 -14
  369. package/node/hooks/useSvgRef.js +4 -9
  370. package/node/index.js +1 -1
  371. package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +8 -6
  372. package/node/internals/index.js +28 -40
  373. package/node/internals/plugins/allPlugins.js +10 -0
  374. package/node/internals/plugins/corePlugins/corePlugins.js +12 -0
  375. package/node/internals/plugins/corePlugins/index.js +12 -0
  376. package/node/internals/plugins/corePlugins/useChartId/index.js +12 -0
  377. package/node/internals/plugins/corePlugins/useChartId/useChartId.js +41 -0
  378. package/node/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +15 -0
  379. package/node/internals/plugins/corePlugins/useChartId/useChartId.types.js +5 -0
  380. package/node/internals/plugins/corePlugins/useChartId/useChartId.utils.js +12 -0
  381. package/node/internals/plugins/featurePlugins/useChartInteraction/index.js +27 -0
  382. package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +81 -0
  383. package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +16 -0
  384. package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +5 -0
  385. package/node/internals/plugins/models/chart.js +5 -0
  386. package/node/internals/plugins/models/helpers.js +5 -0
  387. package/node/internals/plugins/models/index.js +38 -0
  388. package/node/internals/plugins/models/plugin.js +5 -0
  389. package/node/internals/plugins/utils/ChartStore.js +31 -0
  390. package/node/internals/plugins/utils/selectors.js +44 -0
  391. package/node/internals/store/useCharts.js +80 -0
  392. package/node/internals/store/useCharts.types.js +5 -0
  393. package/node/internals/store/useSelector.js +13 -0
  394. package/node/internals/store/useStore.js +23 -0
  395. package/package.json +7 -5
  396. package/themeAugmentation/props.d.ts +1 -2
  397. package/ChartContainer/ResizableContainer.d.ts +0 -9
  398. package/ChartContainer/ResizableContainer.js +0 -26
  399. package/ChartContainer/useChartContainerDimensions.d.ts +0 -6
  400. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
  401. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  402. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
  403. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  404. package/context/InteractionProvider.d.ts +0 -50
  405. package/context/InteractionProvider.js +0 -78
  406. package/modern/ChartContainer/ResizableContainer.js +0 -26
  407. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  408. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  409. package/modern/context/InteractionProvider.js +0 -78
  410. package/node/ChartContainer/ResizableContainer.js +0 -32
  411. package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
  412. package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
  413. package/node/context/InteractionProvider.js +0 -85
  414. /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
  415. /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  416. /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  417. /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
@@ -42,8 +42,6 @@ const defaultProps = {
42
42
  position: 'left',
43
43
  disableLine: false,
44
44
  disableTicks: false,
45
- tickFontSize: 12,
46
- labelFontSize: 14,
47
45
  tickSize: 6
48
46
  };
49
47
 
@@ -76,9 +74,7 @@ function ChartsYAxis(inProps) {
76
74
  position,
77
75
  disableLine,
78
76
  disableTicks,
79
- tickFontSize,
80
77
  label,
81
- labelFontSize,
82
78
  labelStyle,
83
79
  tickLabelStyle,
84
80
  tickSize: tickSizeProp,
@@ -113,6 +109,7 @@ function ChartsYAxis(inProps) {
113
109
  tickInterval
114
110
  });
115
111
  const positionSign = position === 'right' ? 1 : -1;
112
+ const tickFontSize = typeof tickLabelStyle?.fontSize === 'number' ? tickLabelStyle.fontSize : 12;
116
113
  const labelRefPoint = {
117
114
  x: positionSign * (tickFontSize + tickSize + 10),
118
115
  y: top + height / 2
@@ -140,7 +137,7 @@ function ChartsYAxis(inProps) {
140
137
  externalSlotProps: slotProps?.axisLabel,
141
138
  additionalProps: {
142
139
  style: _extends({
143
- fontSize: labelFontSize,
140
+ fontSize: 14,
144
141
  angle: positionSign * 90,
145
142
  textAnchor: 'middle',
146
143
  dominantBaseline: 'auto'
@@ -243,12 +240,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
243
240
  * The label of the axis.
244
241
  */
245
242
  label: PropTypes.string,
246
- /**
247
- * The font size of the axis label.
248
- * @default 14
249
- * @deprecated Consider using `labelStyle.fontSize` instead.
250
- */
251
- labelFontSize: PropTypes.number,
252
243
  /**
253
244
  * The style applied to the axis label.
254
245
  */
@@ -273,12 +264,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
273
264
  */
274
265
  stroke: PropTypes.string,
275
266
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
276
- /**
277
- * The font size of the axis ticks text.
278
- * @default 12
279
- * @deprecated Consider using `tickLabelStyle.fontSize` instead.
280
- */
281
- tickFontSize: PropTypes.number,
282
267
  /**
283
268
  * Defines which ticks are displayed.
284
269
  * Its value can be:
@@ -137,12 +137,6 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
137
137
  * @default 0
138
138
  */
139
139
  valueMin: PropTypes.number,
140
- viewBox: PropTypes.shape({
141
- height: PropTypes.number,
142
- width: PropTypes.number,
143
- x: PropTypes.number,
144
- y: PropTypes.number
145
- }),
146
140
  /**
147
141
  * The width of the chart in px. If not defined, it takes the width of the parent element.
148
142
  */
@@ -6,32 +6,15 @@ const _excluded = ["width", "height", "margin", "title", "desc", "value", "value
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { styled } from '@mui/material/styles';
9
- import useForkRef from '@mui/utils/useForkRef';
10
- import { useChartContainerDimensions } from "../ChartContainer/useChartContainerDimensions.js";
11
9
  import { ChartsSurface } from "../ChartsSurface/index.js";
12
- import { DrawingProvider } from "../context/DrawingProvider.js";
10
+ import { DrawingAreaProvider } from "../context/DrawingAreaProvider/index.js";
13
11
  import { GaugeProvider } from "./GaugeProvider.js";
12
+ import { SizeProvider } from "../context/SizeProvider/index.js";
13
+ import { ChartProvider } from "../context/ChartProvider/index.js";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
- const ResizableContainer = styled('div', {
16
- name: 'MuiGauge',
17
- slot: 'Container'
18
- })(({
19
- ownerState,
15
+ const GStyled = styled('g')(({
20
16
  theme
21
17
  }) => ({
22
- width: ownerState.width ?? '100%',
23
- height: ownerState.height ?? '100%',
24
- display: 'flex',
25
- position: 'relative',
26
- flexGrow: 1,
27
- flexDirection: 'column',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- overflow: 'hidden',
31
- '&>svg': {
32
- width: '100%',
33
- height: '100%'
34
- },
35
18
  '& text': {
36
19
  fill: (theme.vars || theme).palette.text.primary
37
20
  }
@@ -56,58 +39,47 @@ const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(pro
56
39
  children
57
40
  } = props,
58
41
  other = _objectWithoutPropertiesLoose(props, _excluded);
59
- const {
60
- containerRef,
61
- width,
62
- height
63
- } = useChartContainerDimensions(inWidth, inHeight);
64
- const svgRef = React.useRef(null);
65
- const chartSurfaceRef = useForkRef(ref, svgRef);
66
- return /*#__PURE__*/_jsx(ResizableContainer, _extends({
67
- ref: containerRef,
68
- ownerState: {
42
+ return /*#__PURE__*/_jsx(ChartProvider, {
43
+ children: /*#__PURE__*/_jsx(SizeProvider, {
69
44
  width: inWidth,
70
- height: inHeight
71
- },
72
- role: "meter",
73
- "aria-valuenow": value === null ? undefined : value,
74
- "aria-valuemin": valueMin,
75
- "aria-valuemax": valueMax
76
- }, other, {
77
- children: width && height ? /*#__PURE__*/_jsx(DrawingProvider, {
78
- width: width,
79
- height: height,
80
- margin: _extends({
81
- left: 10,
82
- right: 10,
83
- top: 10,
84
- bottom: 10
85
- }, margin),
86
- svgRef: svgRef,
87
- children: /*#__PURE__*/_jsx(GaugeProvider, {
88
- value: value,
89
- valueMin: valueMin,
90
- valueMax: valueMax,
91
- startAngle: startAngle,
92
- endAngle: endAngle,
93
- outerRadius: outerRadius,
94
- innerRadius: innerRadius,
95
- cornerRadius: cornerRadius,
96
- cx: cx,
97
- cy: cy,
98
- children: /*#__PURE__*/_jsx(ChartsSurface, {
99
- width: width,
100
- height: height,
101
- ref: chartSurfaceRef,
102
- title: title,
103
- desc: desc,
104
- disableAxisListener: true,
105
- "aria-hidden": "true",
106
- children: children
45
+ height: inHeight,
46
+ children: /*#__PURE__*/_jsx(DrawingAreaProvider, {
47
+ margin: _extends({
48
+ left: 10,
49
+ right: 10,
50
+ top: 10,
51
+ bottom: 10
52
+ }, margin),
53
+ children: /*#__PURE__*/_jsx(GaugeProvider, {
54
+ value: value,
55
+ valueMin: valueMin,
56
+ valueMax: valueMax,
57
+ startAngle: startAngle,
58
+ endAngle: endAngle,
59
+ outerRadius: outerRadius,
60
+ innerRadius: innerRadius,
61
+ cornerRadius: cornerRadius,
62
+ cx: cx,
63
+ cy: cy,
64
+ children: /*#__PURE__*/_jsx(ChartsSurface, _extends({
65
+ title: title,
66
+ desc: desc,
67
+ disableAxisListener: true,
68
+ role: "meter",
69
+ "aria-valuenow": value === null ? undefined : value,
70
+ "aria-valuemin": valueMin,
71
+ "aria-valuemax": valueMax
72
+ }, other, {
73
+ ref: ref,
74
+ children: /*#__PURE__*/_jsx(GStyled, {
75
+ "aria-hidden": "true",
76
+ children: children
77
+ })
78
+ }))
107
79
  })
108
80
  })
109
- }) : null
110
- }));
81
+ })
82
+ });
111
83
  });
112
84
  process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
113
85
  // ----------------------------- Warning --------------------------------
@@ -198,12 +170,6 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
198
170
  * @default 0
199
171
  */
200
172
  valueMin: PropTypes.number,
201
- viewBox: PropTypes.shape({
202
- height: PropTypes.number,
203
- width: PropTypes.number,
204
- x: PropTypes.number,
205
- y: PropTypes.number
206
- }),
207
173
  /**
208
174
  * The width of the chart in px. If not defined, it takes the width of the parent element.
209
175
  */
@@ -5,24 +5,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["d", "skipAnimation", "ownerState"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { styled } from '@mui/material/styles';
9
8
  import { animated, useTransition } from '@react-spring/web';
10
- import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
11
9
  import { useStringInterpolator } from "../internals/useStringInterpolator.js";
12
10
  import { AppearingMask } from "./AppearingMask.js";
13
11
  import { jsx as _jsx } from "react/jsx-runtime";
14
- export const AreaElementPath = styled(animated.path, {
15
- name: 'MuiAreaElement',
16
- slot: 'Root',
17
- overridesResolver: (_, styles) => styles.root
18
- })(({
19
- ownerState
20
- }) => ({
21
- stroke: 'none',
22
- fill: ownerState.gradientId && `url(#${ownerState.gradientId})` || ownerState.isHighlighted && d3Color(ownerState.color).brighter(1).formatHex() || d3Color(ownerState.color).brighter(0.5).formatHex(),
23
- transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
24
- opacity: ownerState.isFaded ? 0.3 : 1
25
- }));
26
12
  /**
27
13
  * Demos:
28
14
  *
@@ -57,10 +43,15 @@ function AnimatedArea(props) {
57
43
  return /*#__PURE__*/_jsx(AppearingMask, {
58
44
  skipAnimation: skipAnimation,
59
45
  id: `${ownerState.id}-area-clip`,
60
- children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(AreaElementPath, _extends({}, other, {
61
- ownerState: ownerState,
62
- d: style.value.to(interpolator)
63
- })))
46
+ children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(animated.path, _extends({
47
+ d: style.value.to(interpolator),
48
+ fill: ownerState.gradientId ? `url(#${ownerState.gradientId})` : ownerState.color,
49
+ filter:
50
+ // eslint-disable-next-line no-nested-ternary
51
+ ownerState.isHighlighted ? 'brightness(140%)' : ownerState.gradientId ? undefined : 'brightness(120%)',
52
+ opacity: ownerState.isFaded ? 0.3 : 1,
53
+ stroke: "none"
54
+ }, other)))
64
55
  });
65
56
  }
66
57
  process.env.NODE_ENV !== "production" ? AnimatedArea.propTypes = {
@@ -6,25 +6,9 @@ const _excluded = ["d", "skipAnimation", "ownerState"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { animated, useTransition } from '@react-spring/web';
9
- import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
10
- import { styled } from '@mui/material/styles';
11
9
  import { useStringInterpolator } from "../internals/useStringInterpolator.js";
12
10
  import { AppearingMask } from "./AppearingMask.js";
13
11
  import { jsx as _jsx } from "react/jsx-runtime";
14
- export const LineElementPath = styled(animated.path, {
15
- name: 'MuiLineElement',
16
- slot: 'Root',
17
- overridesResolver: (_, styles) => styles.root
18
- })(({
19
- ownerState
20
- }) => ({
21
- strokeWidth: 2,
22
- strokeLinejoin: 'round',
23
- fill: 'none',
24
- stroke: ownerState.gradientId && `url(#${ownerState.gradientId})` || ownerState.isHighlighted && d3Color(ownerState.color).brighter(0.5).formatHex() || ownerState.color,
25
- transition: 'opacity 0.2s ease-in, stroke 0.2s ease-in',
26
- opacity: ownerState.isFaded ? 0.3 : 1
27
- }));
28
12
  /**
29
13
  * Demos:
30
14
  *
@@ -59,10 +43,15 @@ function AnimatedLine(props) {
59
43
  return /*#__PURE__*/_jsx(AppearingMask, {
60
44
  skipAnimation: skipAnimation,
61
45
  id: `${ownerState.id}-line-clip`,
62
- children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(LineElementPath, _extends({}, other, {
63
- ownerState: ownerState,
64
- d: style.value.to(interpolator)
65
- })))
46
+ children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(animated.path, _extends({
47
+ d: style.value.to(interpolator),
48
+ stroke: ownerState.gradientId ? `url(#${ownerState.gradientId})` : ownerState.color,
49
+ strokeWidth: 2,
50
+ strokeLinejoin: "round",
51
+ fill: "none",
52
+ filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
53
+ opacity: ownerState.isFaded ? 0.3 : 1
54
+ }, other)))
66
55
  });
67
56
  }
68
57
  process.env.NODE_ENV !== "production" ? AnimatedLine.propTypes = {
@@ -5,9 +5,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import { styled } from '@mui/material/styles';
8
9
  import { area as d3Area } from '@mui/x-charts-vendor/d3-shape';
9
10
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
10
- import { AreaElement } from "./AreaElement.js";
11
+ import { AreaElement, areaElementClasses } from "./AreaElement.js";
11
12
  import { getValueToPositionMapper } from "../hooks/useScale.js";
12
13
  import getCurveFactory from "../internals/getCurve.js";
13
14
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -15,6 +16,15 @@ import { useChartGradient } from "../internals/components/ChartsAxesGradients/in
15
16
  import { useLineSeries } from "../hooks/useSeries.js";
16
17
  import { useSkipAnimation } from "../context/AnimationProvider/index.js";
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ const AreaPlotRoot = styled('g', {
20
+ name: 'MuiAreaPlot',
21
+ slot: 'Root',
22
+ overridesResolver: (_, styles) => styles.root
23
+ })({
24
+ [`& .${areaElementClasses.root}`]: {
25
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
26
+ }
27
+ });
18
28
  const useAggregatedData = () => {
19
29
  const seriesData = useLineSeries();
20
30
  const axisData = useCartesianContext();
@@ -117,7 +127,7 @@ function AreaPlot(props) {
117
127
  const skipAnimation = useSkipAnimation(inSkipAnimation);
118
128
  const getGradientId = useChartGradient();
119
129
  const completedData = useAggregatedData();
120
- return /*#__PURE__*/_jsx("g", _extends({}, other, {
130
+ return /*#__PURE__*/_jsx(AreaPlotRoot, _extends({}, other, {
121
131
  children: completedData.map(({
122
132
  d,
123
133
  seriesId,
@@ -8,10 +8,12 @@ import PropTypes from 'prop-types';
8
8
  import { useTheme } from '@mui/material/styles';
9
9
  import { warnOnce } from '@mui/x-internals/warning';
10
10
  import { animated, useSpring } from '@react-spring/web';
11
- import { InteractionContext } from "../context/InteractionProvider.js";
12
11
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
13
12
  import { useItemHighlighted } from "../context/index.js";
14
13
  import { useUtilityClasses } from "./markElementClasses.js";
14
+ import { useSelector } from "../internals/store/useSelector.js";
15
+ import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
16
+ import { useStore } from "../internals/store/useStore.js";
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
16
18
  /**
17
19
  * The line mark element that only render circle for performance improvement.
@@ -49,9 +51,8 @@ function CircleMarkElement(props) {
49
51
  } = useItemHighlighted({
50
52
  seriesId: id
51
53
  });
52
- const {
53
- axis
54
- } = React.useContext(InteractionContext);
54
+ const store = useStore();
55
+ const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
55
56
  const position = useSpring({
56
57
  to: {
57
58
  x,
@@ -62,7 +63,7 @@ function CircleMarkElement(props) {
62
63
  const ownerState = {
63
64
  id,
64
65
  classes: innerClasses,
65
- isHighlighted: axis.x?.index === dataIndex || isHighlighted,
66
+ isHighlighted: xAxisIdentifier?.index === dataIndex || isHighlighted,
66
67
  isFaded,
67
68
  color
68
69
  };
@@ -48,9 +48,9 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(inProps, ref)
48
48
  axisHighlightProps,
49
49
  lineHighlightPlotProps,
50
50
  legendProps,
51
- tooltipProps,
52
51
  children
53
52
  } = useLineChartProps(props);
53
+ const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
54
54
  return /*#__PURE__*/_jsxs(ChartContainer, _extends({
55
55
  ref: ref
56
56
  }, chartContainerProps, {
@@ -59,7 +59,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(inProps, ref)
59
59
  })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
60
60
  "data-drawing-container": true,
61
61
  children: /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps))
62
- }), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
62
+ }), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
63
63
  }));
64
64
  });
65
65
  process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
@@ -69,7 +69,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
69
69
  // ----------------------------------------------------------------------
70
70
  /**
71
71
  * The configuration of axes highlight.
72
- * @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
72
+ * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
73
73
  * @default { x: 'line' }
74
74
  */
75
75
  axisHighlight: PropTypes.shape({
@@ -178,16 +178,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
178
178
  * Callback fired when a mark element is clicked.
179
179
  */
180
180
  onMarkClick: PropTypes.func,
181
- /**
182
- * The chart will try to wait for the parent container to resolve its size
183
- * before it renders for the first time.
184
- *
185
- * This can be useful in some scenarios where the chart appear to grow after
186
- * the first render, like when used inside a grid.
187
- *
188
- * @default false
189
- */
190
- resolveSizeBeforeRender: PropTypes.bool,
191
181
  /**
192
182
  * Indicate which axis to display the right of the charts.
193
183
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
@@ -216,31 +206,12 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
216
206
  slots: PropTypes.object,
217
207
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
218
208
  title: PropTypes.string,
219
- /**
220
- * The configuration of the tooltip.
221
- * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
222
- * @default { trigger: 'item' }
223
- */
224
- tooltip: PropTypes.shape({
225
- axisContent: PropTypes.elementType,
226
- classes: PropTypes.object,
227
- itemContent: PropTypes.elementType,
228
- slotProps: PropTypes.object,
229
- slots: PropTypes.object,
230
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
231
- }),
232
209
  /**
233
210
  * Indicate which axis to display the top of the charts.
234
211
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
235
212
  * @default null
236
213
  */
237
214
  topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
238
- viewBox: PropTypes.shape({
239
- height: PropTypes.number,
240
- width: PropTypes.number,
241
- x: PropTypes.number,
242
- y: PropTypes.number
243
- }),
244
215
  /**
245
216
  * The width of the chart in px. If not defined, it takes the width of the parent element.
246
217
  */
@@ -276,7 +247,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
276
247
  hideTooltip: PropTypes.bool,
277
248
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
278
249
  label: PropTypes.string,
279
- labelFontSize: PropTypes.number,
280
250
  labelStyle: PropTypes.object,
281
251
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
282
252
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -287,7 +257,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
287
257
  slots: PropTypes.object,
288
258
  stroke: PropTypes.string,
289
259
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
290
- tickFontSize: PropTypes.number,
291
260
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
292
261
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
293
262
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -330,7 +299,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
330
299
  hideTooltip: PropTypes.bool,
331
300
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
332
301
  label: PropTypes.string,
333
- labelFontSize: PropTypes.number,
334
302
  labelStyle: PropTypes.object,
335
303
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
336
304
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -341,7 +309,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
341
309
  slots: PropTypes.object,
342
310
  stroke: PropTypes.string,
343
311
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
344
- tickFontSize: PropTypes.number,
345
312
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
346
313
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
347
314
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -5,14 +5,16 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["slots", "slotProps"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import { useStore } from "../internals/store/useStore.js";
9
+ import { useSelector } from "../internals/store/useSelector.js";
8
10
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
9
11
  import { LineHighlightElement } from "./LineHighlightElement.js";
10
12
  import { getValueToPositionMapper } from "../hooks/useScale.js";
11
- import { InteractionContext } from "../context/InteractionProvider.js";
12
13
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
13
14
  import getColor from "./getColor.js";
14
15
  import { useLineSeries } from "../hooks/useSeries.js";
15
16
  import { useDrawingArea } from "../hooks/useDrawingArea.js";
17
+ import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  /**
18
20
  * Demos:
@@ -33,10 +35,9 @@ function LineHighlightPlot(props) {
33
35
  const seriesData = useLineSeries();
34
36
  const axisData = useCartesianContext();
35
37
  const drawingArea = useDrawingArea();
36
- const {
37
- axis
38
- } = React.useContext(InteractionContext);
39
- const highlightedIndex = axis.x?.index;
38
+ const store = useStore();
39
+ const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
40
+ const highlightedIndex = xAxisIdentifier?.index;
40
41
  if (highlightedIndex === undefined) {
41
42
  return null;
42
43
  }
@@ -5,9 +5,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import { styled } from '@mui/material/styles';
8
9
  import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
9
10
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
10
- import { LineElement } from "./LineElement.js";
11
+ import { LineElement, lineElementClasses } from "./LineElement.js";
11
12
  import { getValueToPositionMapper } from "../hooks/useScale.js";
12
13
  import getCurveFactory from "../internals/getCurve.js";
13
14
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -15,6 +16,15 @@ import { useChartGradient } from "../internals/components/ChartsAxesGradients/in
15
16
  import { useLineSeries } from "../hooks/useSeries.js";
16
17
  import { useSkipAnimation } from "../context/AnimationProvider/index.js";
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ const LinePlotRoot = styled('g', {
20
+ name: 'MuiAreaPlot',
21
+ slot: 'Root',
22
+ overridesResolver: (_, styles) => styles.root
23
+ })({
24
+ [`& .${lineElementClasses.root}`]: {
25
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
26
+ }
27
+ });
18
28
  const useAggregatedData = () => {
19
29
  const seriesData = useLineSeries();
20
30
  const axisData = useCartesianContext();
@@ -98,7 +108,7 @@ function LinePlot(props) {
98
108
  const skipAnimation = useSkipAnimation(inSkipAnimation);
99
109
  const getGradientId = useChartGradient();
100
110
  const completedData = useAggregatedData();
101
- return /*#__PURE__*/_jsx("g", _extends({}, other, {
111
+ return /*#__PURE__*/_jsx(LinePlotRoot, _extends({}, other, {
102
112
  children: completedData.map(({
103
113
  d,
104
114
  seriesId,
@@ -9,10 +9,12 @@ import { styled } from '@mui/material/styles';
9
9
  import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
10
10
  import { animated, to, useSpring } from '@react-spring/web';
11
11
  import { getSymbol } from "../internals/getSymbol.js";
12
- import { InteractionContext } from "../context/InteractionProvider.js";
13
12
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
14
13
  import { useItemHighlighted } from "../context/index.js";
15
14
  import { useUtilityClasses } from "./markElementClasses.js";
15
+ import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
16
+ import { useSelector } from "../internals/store/useSelector.js";
17
+ import { useStore } from "../internals/store/useStore.js";
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  const MarkElementPath = styled(animated.path, {
18
20
  name: 'MuiMarkElement',
@@ -56,9 +58,8 @@ function MarkElement(props) {
56
58
  } = useItemHighlighted({
57
59
  seriesId: id
58
60
  });
59
- const {
60
- axis
61
- } = React.useContext(InteractionContext);
61
+ const store = useStore();
62
+ const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
62
63
  const position = useSpring({
63
64
  to: {
64
65
  x,
@@ -69,7 +70,7 @@ function MarkElement(props) {
69
70
  const ownerState = {
70
71
  id,
71
72
  classes: innerClasses,
72
- isHighlighted: axis.x?.index === dataIndex || isHighlighted,
73
+ isHighlighted: xAxisIdentifier?.index === dataIndex || isHighlighted,
73
74
  isFaded,
74
75
  color
75
76
  };
@@ -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 = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className", "experimentalMarkRendering"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className", "experimentalMarkRendering"];
6
6
  import useId from '@mui/utils/useId';
7
7
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
8
8
  /**
@@ -23,7 +23,6 @@ export const useLineChartProps = props => {
23
23
  colors,
24
24
  dataset,
25
25
  sx,
26
- tooltip,
27
26
  onAxisClick,
28
27
  onAreaClick,
29
28
  onLineClick,
@@ -69,7 +68,7 @@ export const useLineChartProps = props => {
69
68
  sx,
70
69
  highlightedItem,
71
70
  onHighlightChange,
72
- disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
71
+ disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
73
72
  className,
74
73
  skipAnimation
75
74
  });
@@ -127,10 +126,6 @@ export const useLineChartProps = props => {
127
126
  slots,
128
127
  slotProps
129
128
  };
130
- const tooltipProps = _extends({}, tooltip, {
131
- slots,
132
- slotProps
133
- });
134
129
  return {
135
130
  chartContainerProps,
136
131
  axisClickHandlerProps,
@@ -145,7 +140,6 @@ export const useLineChartProps = props => {
145
140
  axisHighlightProps,
146
141
  lineHighlightPlotProps,
147
142
  legendProps,
148
- tooltipProps,
149
143
  children
150
144
  };
151
145
  };