@mui/x-charts 7.22.3 → 8.0.0-alpha.1

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 (415) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +15 -0
  2. package/BarChart/AnimatedBarElement.js +21 -0
  3. package/BarChart/BarChart.d.ts +11 -16
  4. package/BarChart/BarChart.js +9 -59
  5. package/BarChart/BarElement.d.ts +6 -1343
  6. package/BarChart/BarElement.js +10 -20
  7. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  8. package/BarChart/BarPlot.js +24 -6
  9. package/BarChart/extremums.js +3 -3
  10. package/BarChart/useBarChartProps.d.ts +2 -4
  11. package/BarChart/useBarChartProps.js +4 -11
  12. package/CHANGELOG.md +348 -12
  13. package/ChartContainer/ChartContainer.d.ts +4 -38
  14. package/ChartContainer/ChartContainer.js +15 -44
  15. package/ChartContainer/ResizableContainer.d.ts +22 -0
  16. package/ChartContainer/ResizableContainer.js +60 -0
  17. package/ChartContainer/useChartContainerProps.d.ts +8 -92
  18. package/ChartContainer/useChartContainerProps.js +29 -59
  19. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  21. package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
  22. package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
  23. package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  24. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
  25. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  26. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
  27. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  28. package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
  29. package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  30. package/ChartsAxisHighlight/index.d.ts +3 -0
  31. package/ChartsAxisHighlight/index.js +4 -1
  32. package/ChartsGrid/ChartsGrid.js +1 -1
  33. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
  34. package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  35. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
  36. package/ChartsGrid/ChartsVerticalGrid.js +3 -3
  37. package/ChartsLegend/ChartsLegend.js +0 -3
  38. package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
  39. package/ChartsLegend/DefaultChartsLegend.js +1 -12
  40. package/ChartsLegend/LegendPerItem.d.ts +3 -3
  41. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
  42. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  43. package/ChartsSurface/ChartsSurface.d.ts +0 -15
  44. package/ChartsSurface/ChartsSurface.js +35 -34
  45. package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
  46. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
  47. package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  48. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
  49. package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  50. package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
  51. package/ChartsTooltip/ChartsTooltip.js +162 -107
  52. package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
  53. package/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  54. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
  55. package/ChartsTooltip/chartsTooltipClasses.js +18 -2
  56. package/ChartsTooltip/index.d.ts +3 -3
  57. package/ChartsTooltip/index.js +2 -3
  58. package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
  59. package/ChartsTooltip/useAxisTooltip.js +21 -21
  60. package/ChartsTooltip/useItemTooltip.d.ts +1 -1
  61. package/ChartsTooltip/useItemTooltip.js +8 -7
  62. package/ChartsTooltip/utils.d.ts +5 -16
  63. package/ChartsTooltip/utils.js +45 -50
  64. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
  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 +60 -61
  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/AreaElement.d.ts +1 -1
  74. package/LineChart/AreaPlot.js +14 -8
  75. package/LineChart/CircleMarkElement.js +6 -5
  76. package/LineChart/LineChart.d.ts +11 -17
  77. package/LineChart/LineChart.js +9 -60
  78. package/LineChart/LineElement.d.ts +1 -1
  79. package/LineChart/LineHighlightPlot.d.ts +1 -1
  80. package/LineChart/LineHighlightPlot.js +8 -11
  81. package/LineChart/LinePlot.js +14 -8
  82. package/LineChart/MarkElement.js +6 -5
  83. package/LineChart/MarkPlot.js +2 -6
  84. package/LineChart/extremums.js +10 -6
  85. package/LineChart/useLineChartProps.d.ts +2 -4
  86. package/LineChart/useLineChartProps.js +4 -11
  87. package/PieChart/PieArc.d.ts +0 -5
  88. package/PieChart/PieArc.js +1 -10
  89. package/PieChart/PieArcPlot.js +0 -5
  90. package/PieChart/PieChart.d.ts +10 -39
  91. package/PieChart/PieChart.js +20 -137
  92. package/PieChart/PiePlot.js +2 -2
  93. package/PieChart/getPieCoordinates.d.ts +2 -2
  94. package/README.md +4 -4
  95. package/ScatterChart/Scatter.js +6 -5
  96. package/ScatterChart/ScatterChart.d.ts +11 -17
  97. package/ScatterChart/ScatterChart.js +11 -60
  98. package/ScatterChart/ScatterPlot.js +3 -6
  99. package/ScatterChart/extremums.js +6 -6
  100. package/ScatterChart/useScatterChartProps.d.ts +2 -4
  101. package/ScatterChart/useScatterChartProps.js +3 -12
  102. package/SparkLineChart/SparkLineChart.d.ts +7 -8
  103. package/SparkLineChart/SparkLineChart.js +6 -33
  104. package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
  105. package/context/ChartDataProvider/ChartDataProvider.d.ts +31 -0
  106. package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
  107. package/context/ChartDataProvider/index.d.ts +1 -0
  108. package/context/ChartDataProvider/index.js +1 -0
  109. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +94 -0
  110. package/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
  111. package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
  112. package/{modern/ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  113. package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
  114. package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +8 -0
  115. package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  116. package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
  117. package/{modern/context/DrawingProvider.js → context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  118. package/context/DrawingAreaProvider/index.d.ts +3 -0
  119. package/context/DrawingAreaProvider/index.js +3 -0
  120. package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
  121. package/context/HighlightedProvider/HighlightedProvider.js +1 -16
  122. package/context/InteractionProvider.d.ts +5 -48
  123. package/context/InteractionProvider.js +8 -64
  124. package/context/InteractionSelectors.d.ts +359 -0
  125. package/context/InteractionSelectors.js +12 -0
  126. package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
  127. package/context/SizeProvider/Size.types.d.ts +30 -0
  128. package/context/SizeProvider/SizeContext.d.ts +4 -0
  129. package/context/SizeProvider/SizeContext.js +13 -0
  130. package/context/SizeProvider/SizeProvider.d.ts +11 -0
  131. package/context/SizeProvider/SizeProvider.js +26 -0
  132. package/context/SizeProvider/index.d.ts +4 -0
  133. package/context/SizeProvider/index.js +4 -0
  134. package/context/SizeProvider/useChartContainerDimensions.d.ts +9 -0
  135. package/{modern/ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
  136. package/context/SizeProvider/useSize.d.ts +5 -0
  137. package/context/SizeProvider/useSize.js +13 -0
  138. package/context/SvgRefProvider/SvgRef.types.d.ts +8 -0
  139. package/context/SvgRefProvider/SvgRef.types.js +1 -0
  140. package/context/SvgRefProvider/SvgRefContext.d.ts +4 -0
  141. package/context/SvgRefProvider/SvgRefContext.js +17 -0
  142. package/context/SvgRefProvider/SvgRefProvider.d.ts +3 -0
  143. package/context/SvgRefProvider/SvgRefProvider.js +24 -0
  144. package/context/SvgRefProvider/index.d.ts +4 -0
  145. package/context/SvgRefProvider/index.js +4 -0
  146. package/context/SvgRefProvider/useSurfaceRef.d.ts +2 -0
  147. package/context/SvgRefProvider/useSurfaceRef.js +14 -0
  148. package/context/ZAxisContextProvider.d.ts +1 -1
  149. package/context/index.d.ts +2 -0
  150. package/context/index.js +2 -1
  151. package/hooks/useAxisEvents.js +32 -19
  152. package/hooks/useChartId.js +2 -2
  153. package/hooks/useDrawingArea.d.ts +2 -2
  154. package/hooks/useDrawingArea.js +2 -2
  155. package/hooks/useInteractionItemProps.js +19 -12
  156. package/hooks/useSvgRef.js +3 -3
  157. package/index.d.ts +1 -2
  158. package/index.js +2 -3
  159. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
  160. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  161. package/internals/computeAxisValue.d.ts +2 -2
  162. package/internals/defaultizeColor.d.ts +1 -8
  163. package/internals/getSymbol.js +19 -3
  164. package/internals/index.d.ts +7 -6
  165. package/internals/index.js +7 -6
  166. package/internals/plugins/models/index.d.ts +35 -0
  167. package/internals/plugins/models/index.js +1 -0
  168. package/internals/plugins/utils/ChartStore.d.ts +12 -0
  169. package/internals/plugins/utils/ChartStore.js +26 -0
  170. package/internals/plugins/utils/ChartsStore.d.ts +12 -0
  171. package/internals/plugins/utils/ChartsStore.js +26 -0
  172. package/internals/plugins/utils/selectors.d.ts +9 -0
  173. package/internals/plugins/utils/selectors.js +37 -0
  174. package/internals/useCharts.d.ts +6 -0
  175. package/internals/useCharts.js +29 -0
  176. package/internals/useSelector.d.ts +4 -0
  177. package/internals/useSelector.js +6 -0
  178. package/internals/useStore.d.ts +2 -0
  179. package/internals/useStore.js +17 -0
  180. package/internals/useStringInterpolator.js +1 -0
  181. package/models/seriesType/bar.d.ts +1 -1
  182. package/models/seriesType/common.d.ts +0 -10
  183. package/models/seriesType/config.d.ts +1 -1
  184. package/models/seriesType/line.d.ts +1 -1
  185. package/models/seriesType/pie.d.ts +1 -1
  186. package/models/seriesType/scatter.d.ts +1 -6
  187. package/modern/BarChart/AnimatedBarElement.js +21 -0
  188. package/modern/BarChart/BarChart.js +9 -59
  189. package/modern/BarChart/BarElement.js +10 -20
  190. package/modern/BarChart/BarPlot.js +24 -6
  191. package/modern/BarChart/extremums.js +3 -3
  192. package/modern/BarChart/useBarChartProps.js +4 -11
  193. package/modern/ChartContainer/ChartContainer.js +15 -44
  194. package/modern/ChartContainer/ResizableContainer.js +60 -0
  195. package/modern/ChartContainer/useChartContainerProps.js +29 -59
  196. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  197. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  198. package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  199. package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  200. package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  201. package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  202. package/modern/ChartsAxisHighlight/index.js +4 -1
  203. package/modern/ChartsGrid/ChartsGrid.js +1 -1
  204. package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  205. package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
  206. package/modern/ChartsLegend/ChartsLegend.js +0 -3
  207. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
  208. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
  209. package/modern/ChartsSurface/ChartsSurface.js +35 -34
  210. package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
  211. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  212. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  213. package/modern/ChartsTooltip/ChartsTooltip.js +162 -107
  214. package/modern/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  215. package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
  216. package/modern/ChartsTooltip/index.js +2 -3
  217. package/modern/ChartsTooltip/useAxisTooltip.js +21 -21
  218. package/modern/ChartsTooltip/useItemTooltip.js +8 -7
  219. package/modern/ChartsTooltip/utils.js +45 -50
  220. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
  221. package/modern/Gauge/Gauge.js +0 -6
  222. package/modern/Gauge/GaugeContainer.js +60 -61
  223. package/modern/LineChart/AnimatedArea.js +9 -18
  224. package/modern/LineChart/AnimatedLine.js +9 -20
  225. package/modern/LineChart/AreaPlot.js +14 -8
  226. package/modern/LineChart/CircleMarkElement.js +6 -5
  227. package/modern/LineChart/LineChart.js +9 -60
  228. package/modern/LineChart/LineHighlightPlot.js +8 -11
  229. package/modern/LineChart/LinePlot.js +14 -8
  230. package/modern/LineChart/MarkElement.js +6 -5
  231. package/modern/LineChart/MarkPlot.js +2 -6
  232. package/modern/LineChart/extremums.js +10 -6
  233. package/modern/LineChart/useLineChartProps.js +4 -11
  234. package/modern/PieChart/PieArc.js +1 -10
  235. package/modern/PieChart/PieArcPlot.js +0 -5
  236. package/modern/PieChart/PieChart.js +20 -137
  237. package/modern/PieChart/PiePlot.js +2 -2
  238. package/modern/ScatterChart/Scatter.js +6 -5
  239. package/modern/ScatterChart/ScatterChart.js +11 -60
  240. package/modern/ScatterChart/ScatterPlot.js +3 -6
  241. package/modern/ScatterChart/extremums.js +6 -6
  242. package/modern/ScatterChart/useScatterChartProps.js +3 -12
  243. package/modern/SparkLineChart/SparkLineChart.js +6 -33
  244. package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
  245. package/modern/context/ChartDataProvider/index.js +1 -0
  246. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
  247. package/{ChartContainer → modern/context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  248. package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  249. package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  250. package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  251. package/modern/context/DrawingAreaProvider/index.js +3 -0
  252. package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
  253. package/modern/context/InteractionProvider.js +8 -64
  254. package/modern/context/InteractionSelectors.js +12 -0
  255. package/modern/context/SizeProvider/Size.types.js +1 -0
  256. package/modern/context/SizeProvider/SizeContext.js +13 -0
  257. package/modern/context/SizeProvider/SizeProvider.js +26 -0
  258. package/modern/context/SizeProvider/index.js +4 -0
  259. package/{ResponsiveChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +15 -7
  260. package/modern/context/SizeProvider/useSize.js +13 -0
  261. package/modern/context/SvgRefProvider/SvgRef.types.js +1 -0
  262. package/modern/context/SvgRefProvider/SvgRefContext.js +17 -0
  263. package/modern/context/SvgRefProvider/SvgRefProvider.js +24 -0
  264. package/modern/context/SvgRefProvider/index.js +4 -0
  265. package/modern/context/SvgRefProvider/useSurfaceRef.js +14 -0
  266. package/modern/context/index.js +2 -1
  267. package/modern/hooks/useAxisEvents.js +32 -19
  268. package/modern/hooks/useChartId.js +2 -2
  269. package/modern/hooks/useDrawingArea.js +2 -2
  270. package/modern/hooks/useInteractionItemProps.js +19 -12
  271. package/modern/hooks/useSvgRef.js +3 -3
  272. package/modern/index.js +2 -3
  273. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  274. package/modern/internals/getSymbol.js +19 -3
  275. package/modern/internals/index.js +7 -6
  276. package/modern/internals/plugins/models/index.js +1 -0
  277. package/modern/internals/plugins/utils/ChartStore.js +26 -0
  278. package/modern/internals/plugins/utils/ChartsStore.js +26 -0
  279. package/modern/internals/plugins/utils/selectors.js +37 -0
  280. package/modern/internals/useCharts.js +29 -0
  281. package/modern/internals/useSelector.js +6 -0
  282. package/modern/internals/useStore.js +17 -0
  283. package/modern/internals/useStringInterpolator.js +1 -0
  284. package/node/BarChart/AnimatedBarElement.js +28 -0
  285. package/node/BarChart/BarChart.js +9 -59
  286. package/node/BarChart/BarElement.js +11 -21
  287. package/node/BarChart/BarPlot.js +22 -4
  288. package/node/BarChart/extremums.js +3 -3
  289. package/node/BarChart/useBarChartProps.js +4 -11
  290. package/node/ChartContainer/ChartContainer.js +14 -43
  291. package/node/ChartContainer/ResizableContainer.js +68 -0
  292. package/node/ChartContainer/useChartContainerProps.js +29 -60
  293. package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
  294. package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
  295. package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
  296. package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
  297. package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
  298. package/node/ChartsAxisHighlight/index.js +33 -0
  299. package/node/ChartsGrid/ChartsGrid.js +2 -2
  300. package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
  301. package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
  302. package/node/ChartsLegend/ChartsLegend.js +0 -3
  303. package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
  304. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
  305. package/node/ChartsSurface/ChartsSurface.js +35 -34
  306. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
  307. package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
  308. package/node/ChartsTooltip/ChartsTooltip.js +161 -106
  309. package/node/ChartsTooltip/ChartsTooltipContainer.js +304 -0
  310. package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
  311. package/node/ChartsTooltip/index.js +19 -28
  312. package/node/ChartsTooltip/useAxisTooltip.js +21 -21
  313. package/node/ChartsTooltip/useItemTooltip.js +8 -7
  314. package/node/ChartsTooltip/utils.js +46 -53
  315. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +51 -40
  316. package/node/Gauge/Gauge.js +0 -6
  317. package/node/Gauge/GaugeContainer.js +60 -61
  318. package/node/LineChart/AnimatedArea.js +9 -19
  319. package/node/LineChart/AnimatedLine.js +9 -21
  320. package/node/LineChart/AreaPlot.js +13 -7
  321. package/node/LineChart/CircleMarkElement.js +6 -5
  322. package/node/LineChart/LineChart.js +9 -60
  323. package/node/LineChart/LineHighlightPlot.js +8 -11
  324. package/node/LineChart/LinePlot.js +13 -7
  325. package/node/LineChart/MarkElement.js +6 -5
  326. package/node/LineChart/MarkPlot.js +2 -6
  327. package/node/LineChart/extremums.js +10 -6
  328. package/node/LineChart/useLineChartProps.js +4 -11
  329. package/node/PieChart/PieArc.js +1 -10
  330. package/node/PieChart/PieArcPlot.js +0 -5
  331. package/node/PieChart/PieChart.js +20 -137
  332. package/node/PieChart/PiePlot.js +2 -2
  333. package/node/ScatterChart/Scatter.js +6 -5
  334. package/node/ScatterChart/ScatterChart.js +11 -60
  335. package/node/ScatterChart/ScatterPlot.js +3 -6
  336. package/node/ScatterChart/extremums.js +6 -6
  337. package/node/ScatterChart/useScatterChartProps.js +3 -12
  338. package/node/SparkLineChart/SparkLineChart.js +6 -33
  339. package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
  340. package/node/context/ChartDataProvider/index.js +16 -0
  341. package/node/context/ChartDataProvider/useChartDataProviderProps.js +72 -0
  342. package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  343. package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
  344. package/node/context/DrawingAreaProvider/DrawingAreaContext.js +22 -0
  345. package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
  346. package/node/context/DrawingAreaProvider/index.js +38 -0
  347. package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
  348. package/node/context/InteractionProvider.js +9 -66
  349. package/node/context/InteractionSelectors.js +18 -0
  350. package/node/context/SizeProvider/Size.types.js +5 -0
  351. package/node/context/SizeProvider/SizeContext.js +20 -0
  352. package/node/context/SizeProvider/SizeProvider.js +29 -0
  353. package/node/context/SizeProvider/index.js +49 -0
  354. package/node/{ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
  355. package/node/context/SizeProvider/useSize.js +20 -0
  356. package/node/context/SvgRefProvider/SvgRef.types.js +5 -0
  357. package/node/context/SvgRefProvider/SvgRefContext.js +23 -0
  358. package/node/context/SvgRefProvider/SvgRefProvider.js +31 -0
  359. package/node/context/SvgRefProvider/index.js +49 -0
  360. package/node/context/SvgRefProvider/useSurfaceRef.js +20 -0
  361. package/node/context/index.js +10 -2
  362. package/node/hooks/useAxisEvents.js +33 -19
  363. package/node/hooks/useChartId.js +2 -2
  364. package/node/hooks/useDrawingArea.js +2 -2
  365. package/node/hooks/useInteractionItemProps.js +20 -13
  366. package/node/hooks/useSvgRef.js +3 -3
  367. package/node/index.js +5 -16
  368. package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  369. package/node/internals/getSymbol.js +19 -3
  370. package/node/internals/index.js +64 -44
  371. package/node/internals/plugins/models/index.js +5 -0
  372. package/node/internals/plugins/utils/ChartStore.js +33 -0
  373. package/node/internals/plugins/utils/ChartsStore.js +33 -0
  374. package/node/internals/plugins/utils/selectors.js +44 -0
  375. package/node/internals/useCharts.js +36 -0
  376. package/node/internals/useSelector.js +13 -0
  377. package/node/internals/useStore.js +24 -0
  378. package/node/internals/useStringInterpolator.js +2 -0
  379. package/package.json +8 -6
  380. package/themeAugmentation/props.d.ts +1 -2
  381. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
  382. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  383. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
  384. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  385. package/ResponsiveChartContainer/ResizableContainer.d.ts +0 -9
  386. package/ResponsiveChartContainer/ResizableContainer.js +0 -26
  387. package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
  388. package/ResponsiveChartContainer/index.d.ts +0 -1
  389. package/ResponsiveChartContainer/index.js +0 -1
  390. package/ResponsiveChartContainer/package.json +0 -6
  391. package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +0 -6
  392. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
  393. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  394. package/internals/SlotComponentPropsFromProps.d.ts +0 -1
  395. package/models/helpers.d.ts +0 -3
  396. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  397. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  398. package/modern/ResponsiveChartContainer/ResizableContainer.js +0 -26
  399. package/modern/ResponsiveChartContainer/index.js +0 -1
  400. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  401. package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
  402. package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
  403. package/node/ResponsiveChartContainer/ResizableContainer.js +0 -32
  404. package/node/ResponsiveChartContainer/index.js +0 -16
  405. package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
  406. /package/{internals/SlotComponentPropsFromProps.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
  407. /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
  408. /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  409. /package/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
  410. /package/{modern/internals/SlotComponentPropsFromProps.js → context/DrawingAreaProvider/DrawingArea.types.js} +0 -0
  411. /package/{modern/models/helpers.js → context/SizeProvider/Size.types.js} +0 -0
  412. /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  413. /package/node/{internals/SlotComponentPropsFromProps.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
  414. /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  415. /package/node/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
@@ -2,17 +2,14 @@
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", "sx", "tooltip", "axisHighlight", "skipAnimation", "legend", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useRtl } from '@mui/system/RtlProvider';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
- import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
11
- import { ChartsAxis } from "../ChartsAxis/ChartsAxis.js";
12
- import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
10
+ import { ChartContainer } from "../ChartContainer/index.js";
13
11
  import { ChartsTooltip } from "../ChartsTooltip/index.js";
14
12
  import { ChartsLegend } from "../ChartsLegend/index.js";
15
- import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
16
13
  import { PiePlot } from "./PiePlot.js";
17
14
  import { ChartsOverlay } from "../ChartsOverlay/index.js";
18
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -45,27 +42,14 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
45
42
  name: 'MuiPieChart'
46
43
  });
47
44
  const {
48
- xAxis,
49
- yAxis,
50
45
  series,
51
46
  width,
52
47
  height,
53
48
  margin: marginProps,
54
49
  colors,
55
50
  sx,
56
- tooltip = {
57
- trigger: 'item'
58
- },
59
- axisHighlight = {
60
- x: 'none',
61
- y: 'none'
62
- },
63
51
  skipAnimation,
64
- legend: legendProps,
65
- topAxis = null,
66
- leftAxis = null,
67
- rightAxis = null,
68
- bottomAxis = null,
52
+ hideLegend,
69
53
  children,
70
54
  slots,
71
55
  slotProps,
@@ -78,14 +62,8 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
78
62
  other = _objectWithoutPropertiesLoose(props, _excluded);
79
63
  const isRtl = useRtl();
80
64
  const margin = _extends({}, isRtl ? defaultRTLMargin : defaultMargin, marginProps);
81
- const legend = _extends({
82
- direction: 'column',
83
- position: {
84
- vertical: 'middle',
85
- horizontal: isRtl ? 'left' : 'right'
86
- }
87
- }, legendProps);
88
- return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({}, other, {
65
+ const Tooltip = slots?.tooltip ?? ChartsTooltip;
66
+ return /*#__PURE__*/_jsxs(ChartContainer, _extends({}, other, {
89
67
  ref: ref,
90
68
  series: series.map(s => _extends({
91
69
  type: 'pie'
@@ -93,27 +71,14 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
93
71
  width: width,
94
72
  height: height,
95
73
  margin: margin,
96
- xAxis: xAxis ?? [{
97
- id: DEFAULT_X_AXIS_KEY,
98
- scaleType: 'point',
99
- data: [...new Array(Math.max(...series.map(s => s.data.length)))].map((_, index) => index)
100
- }],
101
- yAxis: yAxis,
102
74
  colors: colors,
103
75
  sx: sx,
104
- disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
76
+ disableAxisListener: true,
105
77
  highlightedItem: highlightedItem,
106
78
  onHighlightChange: onHighlightChange,
107
79
  className: className,
108
80
  skipAnimation: skipAnimation,
109
- children: [/*#__PURE__*/_jsx(ChartsAxis, {
110
- topAxis: topAxis,
111
- leftAxis: leftAxis,
112
- rightAxis: rightAxis,
113
- bottomAxis: bottomAxis,
114
- slots: slots,
115
- slotProps: slotProps
116
- }), /*#__PURE__*/_jsx(PiePlot, {
81
+ children: [/*#__PURE__*/_jsx(PiePlot, {
117
82
  slots: slots,
118
83
  slotProps: slotProps,
119
84
  onItemClick: onItemClick
@@ -121,13 +86,17 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
121
86
  loading: loading,
122
87
  slots: slots,
123
88
  slotProps: slotProps
124
- }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
125
- slots: slots,
126
- slotProps: slotProps
127
- })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
89
+ }), !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
90
+ direction: "column",
91
+ position: {
92
+ vertical: 'middle',
93
+ horizontal: isRtl ? 'left' : 'right'
94
+ },
128
95
  slots: slots,
129
96
  slotProps: slotProps
130
- })), children]
97
+ }), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({
98
+ trigger: "item"
99
+ }, slotProps?.tooltip)), children]
131
100
  }));
132
101
  });
133
102
  process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
@@ -135,21 +104,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
135
104
  // | These PropTypes are generated from the TypeScript type definitions |
136
105
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
137
106
  // ----------------------------------------------------------------------
138
- /**
139
- * The configuration of axes highlight.
140
- * @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
141
- * @default { x: 'none', y: 'none' }
142
- */
143
- axisHighlight: PropTypes.shape({
144
- x: PropTypes.oneOf(['band', 'line', 'none']),
145
- y: PropTypes.oneOf(['band', 'line', 'none'])
146
- }),
147
- /**
148
- * Indicate which axis to display the bottom of the charts.
149
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
150
- * @default null
151
- */
152
- bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
153
107
  children: PropTypes.node,
154
108
  className: PropTypes.string,
155
109
  /**
@@ -172,6 +126,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
172
126
  * The height of the chart in px. If not defined, it takes the height of the parent element.
173
127
  */
174
128
  height: PropTypes.number,
129
+ /**
130
+ * If `true`, the legend is not rendered.
131
+ */
132
+ hideLegend: PropTypes.bool,
175
133
  /**
176
134
  * The item currently highlighted. Turns highlighting into a controlled prop.
177
135
  */
@@ -179,40 +137,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
179
137
  dataIndex: PropTypes.number,
180
138
  seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
181
139
  }),
182
- /**
183
- * Indicate which axis to display the left of the charts.
184
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
185
- * @default null
186
- */
187
- leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
188
- /**
189
- * The props of the legend.
190
- * @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
191
- * @deprecated Consider using `slotProps.legend` instead.
192
- */
193
- legend: PropTypes.shape({
194
- classes: PropTypes.object,
195
- direction: PropTypes.oneOf(['column', 'row']),
196
- hidden: PropTypes.bool,
197
- itemGap: PropTypes.number,
198
- itemMarkHeight: PropTypes.number,
199
- itemMarkWidth: PropTypes.number,
200
- labelStyle: PropTypes.object,
201
- markGap: PropTypes.number,
202
- onItemClick: PropTypes.func,
203
- padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
204
- bottom: PropTypes.number,
205
- left: PropTypes.number,
206
- right: PropTypes.number,
207
- top: PropTypes.number
208
- })]),
209
- position: PropTypes.shape({
210
- horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
211
- vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
212
- }),
213
- slotProps: PropTypes.object,
214
- slots: PropTypes.object
215
- }),
216
140
  /**
217
141
  * If `true`, a loading overlay is displayed.
218
142
  * @default false
@@ -240,22 +164,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
240
164
  * Callback fired when a pie arc is clicked.
241
165
  */
242
166
  onItemClick: PropTypes.func,
243
- /**
244
- * The chart will try to wait for the parent container to resolve its size
245
- * before it renders for the first time.
246
- *
247
- * This can be useful in some scenarios where the chart appear to grow after
248
- * the first render, like when used inside a grid.
249
- *
250
- * @default false
251
- */
252
- resolveSizeBeforeRender: PropTypes.bool,
253
- /**
254
- * Indicate which axis to display the right of the charts.
255
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
256
- * @default null
257
- */
258
- rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
259
167
  /**
260
168
  * The series to display in the pie chart.
261
169
  * An array of [[PieSeriesType]] objects.
@@ -278,31 +186,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
278
186
  slots: PropTypes.object,
279
187
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
280
188
  title: PropTypes.string,
281
- /**
282
- * The configuration of the tooltip.
283
- * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
284
- * @default { trigger: 'item' }
285
- */
286
- tooltip: PropTypes.shape({
287
- axisContent: PropTypes.elementType,
288
- classes: PropTypes.object,
289
- itemContent: PropTypes.elementType,
290
- slotProps: PropTypes.object,
291
- slots: PropTypes.object,
292
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
293
- }),
294
- /**
295
- * Indicate which axis to display the top of the charts.
296
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
297
- * @default null
298
- */
299
- topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
300
- viewBox: PropTypes.shape({
301
- height: PropTypes.number,
302
- width: PropTypes.number,
303
- x: PropTypes.number,
304
- y: PropTypes.number
305
- }),
306
189
  /**
307
190
  * The width of the chart in px. If not defined, it takes the width of the parent element.
308
191
  */
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import { DrawingContext } from "../context/DrawingProvider.js";
5
+ import { DrawingAreaContext } from "../context/DrawingAreaProvider/index.js";
6
6
  import { PieArcPlot } from "./PieArcPlot.js";
7
7
  import { PieArcLabelPlot } from "./PieArcLabelPlot.js";
8
8
  import { getPercentageValue } from "../internals/getPercentageValue.js";
@@ -33,7 +33,7 @@ function PiePlot(props) {
33
33
  top,
34
34
  width,
35
35
  height
36
- } = React.useContext(DrawingContext);
36
+ } = React.useContext(DrawingAreaContext);
37
37
  const skipAnimation = useSkipAnimation(inSkipAnimation);
38
38
  if (seriesData === undefined) {
39
39
  return null;
@@ -5,9 +5,11 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { getValueToPositionMapper } from "../hooks/useScale.js";
7
7
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
8
- import { InteractionContext } from "../context/InteractionProvider.js";
8
+ import { useStore } from "../internals/useStore.js";
9
+ import { useSelector } from "../internals/useSelector.js";
9
10
  import { useHighlighted } from "../context/index.js";
10
11
  import { useDrawingArea } from "../hooks/useDrawingArea.js";
12
+ import { selectorChartsInteractionIsVoronoiEnabled } from "../context/InteractionSelectors.js";
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
  /**
13
15
  * Demos:
@@ -30,10 +32,9 @@ function Scatter(props) {
30
32
  onItemClick
31
33
  } = props;
32
34
  const drawingArea = useDrawingArea();
33
- const {
34
- useVoronoiInteraction
35
- } = React.useContext(InteractionContext);
36
- const skipInteractionHandlers = useVoronoiInteraction || series.disableHover;
35
+ const store = useStore();
36
+ const isVoronoiEnabled = useSelector(store, selectorChartsInteractionIsVoronoiEnabled);
37
+ const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
37
38
  const getInteractionItemProps = useInteractionItemProps(skipInteractionHandlers);
38
39
  const {
39
40
  isFaded,
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useThemeProps } from '@mui/material/styles';
7
7
  import { ScatterPlot } from "./ScatterPlot.js";
8
- import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
8
+ import { ChartContainer } from "../ChartContainer/index.js";
9
9
  import { ChartsAxis } from "../ChartsAxis/index.js";
10
10
  import { ChartsTooltip } from "../ChartsTooltip/index.js";
11
11
  import { ChartsLegend } from "../ChartsLegend/index.js";
@@ -41,17 +41,19 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(inProps
41
41
  overlayProps,
42
42
  legendProps,
43
43
  axisHighlightProps,
44
- tooltipProps,
45
44
  children
46
45
  } = useScatterChartProps(props);
47
- return /*#__PURE__*/_jsx(ResponsiveChartContainer, _extends({
46
+ const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
47
+ return /*#__PURE__*/_jsx(ChartContainer, _extends({
48
48
  ref: ref
49
49
  }, chartContainerProps, {
50
50
  children: /*#__PURE__*/_jsxs(ZAxisContextProvider, _extends({}, zAxisProps, {
51
51
  children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
52
52
  "data-drawing-container": true,
53
53
  children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
54
- }), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), children]
54
+ }), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
55
+ trigger: "item"
56
+ }, props.slotProps?.tooltip)), children]
55
57
  }))
56
58
  }));
57
59
  });
@@ -62,7 +64,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
62
64
  // ----------------------------------------------------------------------
63
65
  /**
64
66
  * The configuration of axes highlight.
65
- * @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
67
+ * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
66
68
  * @default { x: 'none', y: 'none' }
67
69
  */
68
70
  axisHighlight: PropTypes.shape({
@@ -109,6 +111,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
109
111
  * The height of the chart in px. If not defined, it takes the height of the parent element.
110
112
  */
111
113
  height: PropTypes.number,
114
+ /**
115
+ * If `true`, the legend is not rendered.
116
+ */
117
+ hideLegend: PropTypes.bool,
112
118
  /**
113
119
  * The item currently highlighted. Turns highlighting into a controlled prop.
114
120
  */
@@ -122,32 +128,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
122
128
  * @default yAxisIds[0] The id of the first provided axis
123
129
  */
124
130
  leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
125
- /**
126
- * @deprecated Consider using `slotProps.legend` instead.
127
- */
128
- legend: PropTypes.shape({
129
- classes: PropTypes.object,
130
- direction: PropTypes.oneOf(['column', 'row']),
131
- hidden: PropTypes.bool,
132
- itemGap: PropTypes.number,
133
- itemMarkHeight: PropTypes.number,
134
- itemMarkWidth: PropTypes.number,
135
- labelStyle: PropTypes.object,
136
- markGap: PropTypes.number,
137
- onItemClick: PropTypes.func,
138
- padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
139
- bottom: PropTypes.number,
140
- left: PropTypes.number,
141
- right: PropTypes.number,
142
- top: PropTypes.number
143
- })]),
144
- position: PropTypes.shape({
145
- horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
146
- vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
147
- }),
148
- slotProps: PropTypes.object,
149
- slots: PropTypes.object
150
- }),
151
131
  /**
152
132
  * If `true`, a loading overlay is displayed.
153
133
  * @default false
@@ -177,16 +157,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
177
157
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
178
158
  */
179
159
  onItemClick: PropTypes.func,
180
- /**
181
- * The chart will try to wait for the parent container to resolve its size
182
- * before it renders for the first time.
183
- *
184
- * This can be useful in some scenarios where the chart appear to grow after
185
- * the first render, like when used inside a grid.
186
- *
187
- * @default false
188
- */
189
- resolveSizeBeforeRender: PropTypes.bool,
190
160
  /**
191
161
  * Indicate which axis to display the right of the charts.
192
162
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
@@ -215,31 +185,12 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
215
185
  slots: PropTypes.object,
216
186
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
217
187
  title: PropTypes.string,
218
- /**
219
- * The configuration of the tooltip.
220
- * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
221
- * @default { trigger: 'item' }
222
- */
223
- tooltip: PropTypes.shape({
224
- axisContent: PropTypes.elementType,
225
- classes: PropTypes.object,
226
- itemContent: PropTypes.elementType,
227
- slotProps: PropTypes.object,
228
- slots: PropTypes.object,
229
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
230
- }),
231
188
  /**
232
189
  * Indicate which axis to display the top of the charts.
233
190
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
234
191
  * @default null
235
192
  */
236
193
  topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
237
- viewBox: PropTypes.shape({
238
- height: PropTypes.number,
239
- width: PropTypes.number,
240
- x: PropTypes.number,
241
- y: PropTypes.number
242
- }),
243
194
  /**
244
195
  * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
245
196
  * If `undefined`, the radius is assumed to be infinite.
@@ -52,18 +52,15 @@ function ScatterPlot(props) {
52
52
  children: seriesOrder.map(seriesId => {
53
53
  const {
54
54
  id,
55
- xAxisKey,
56
- yAxisKey,
57
- zAxisKey,
58
55
  xAxisId,
59
56
  yAxisId,
60
57
  zAxisId,
61
58
  markerSize,
62
59
  color
63
60
  } = series[seriesId];
64
- const colorGetter = getColor(series[seriesId], xAxis[xAxisId ?? xAxisKey ?? defaultXAxisId], yAxis[yAxisId ?? yAxisKey ?? defaultYAxisId], zAxis[zAxisId ?? zAxisKey ?? defaultZAxisId]);
65
- const xScale = xAxis[xAxisId ?? xAxisKey ?? defaultXAxisId].scale;
66
- const yScale = yAxis[yAxisId ?? yAxisKey ?? defaultYAxisId].scale;
61
+ const colorGetter = getColor(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
62
+ const xScale = xAxis[xAxisId ?? defaultXAxisId].scale;
63
+ const yScale = yAxis[yAxisId ?? defaultYAxisId].scale;
67
64
  return /*#__PURE__*/_jsx(ScatterItems, _extends({
68
65
  xScale: xScale,
69
66
  yScale: yScale,
@@ -9,14 +9,14 @@ export const getExtremumX = params => {
9
9
  getFilters
10
10
  } = params;
11
11
  return Object.keys(series).filter(seriesId => {
12
- const axisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey;
12
+ const axisId = series[seriesId].xAxisId;
13
13
  return axisId === axis.id || axisId === undefined && isDefaultAxis;
14
14
  }).reduce((acc, seriesId) => {
15
15
  const filter = getFilters?.({
16
16
  currentAxisId: axis.id,
17
17
  isDefaultAxis,
18
- seriesXAxisId: series[seriesId].xAxisId ?? series[seriesId].xAxisKey,
19
- seriesYAxisId: series[seriesId].yAxisId ?? series[seriesId].yAxisKey
18
+ seriesXAxisId: series[seriesId].xAxisId,
19
+ seriesYAxisId: series[seriesId].yAxisId
20
20
  });
21
21
  const seriesMinMax = series[seriesId].data?.reduce((accSeries, d, dataIndex) => {
22
22
  if (filter && !filter(d, dataIndex)) {
@@ -35,14 +35,14 @@ export const getExtremumY = params => {
35
35
  getFilters
36
36
  } = params;
37
37
  return Object.keys(series).filter(seriesId => {
38
- const axisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
38
+ const axisId = series[seriesId].yAxisId;
39
39
  return axisId === axis.id || axisId === undefined && isDefaultAxis;
40
40
  }).reduce((acc, seriesId) => {
41
41
  const filter = getFilters?.({
42
42
  currentAxisId: axis.id,
43
43
  isDefaultAxis,
44
- seriesXAxisId: series[seriesId].xAxisId ?? series[seriesId].xAxisKey,
45
- seriesYAxisId: series[seriesId].yAxisId ?? series[seriesId].yAxisKey
44
+ seriesXAxisId: series[seriesId].xAxisId,
45
+ seriesYAxisId: series[seriesId].yAxisId
46
46
  });
47
47
  const seriesMinMax = series[seriesId].data?.reduce((accSeries, d, dataIndex) => {
48
48
  if (filter && !filter(d, dataIndex)) {
@@ -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", "zAxis", "series", "tooltip", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "legend", "width", "height", "margin", "colors", "sx", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
5
+ const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
6
6
  /**
7
7
  * A helper function that extracts ScatterChartProps from the input props
8
8
  * and returns an object with props for the children components of ScatterChart.
@@ -16,11 +16,9 @@ export const useScatterChartProps = props => {
16
16
  yAxis,
17
17
  zAxis,
18
18
  series,
19
- tooltip,
20
19
  axisHighlight,
21
20
  voronoiMaxRadius,
22
21
  disableVoronoi,
23
- legend,
24
22
  width,
25
23
  height,
26
24
  margin,
@@ -85,20 +83,14 @@ export const useScatterChartProps = props => {
85
83
  slots,
86
84
  slotProps
87
85
  };
88
- const legendProps = _extends({}, legend, {
86
+ const legendProps = {
89
87
  slots,
90
88
  slotProps
91
- });
89
+ };
92
90
  const axisHighlightProps = _extends({
93
91
  y: 'none',
94
92
  x: 'none'
95
93
  }, axisHighlight);
96
- const tooltipProps = _extends({
97
- trigger: 'item'
98
- }, tooltip, {
99
- slots,
100
- slotProps
101
- });
102
94
  return {
103
95
  chartContainerProps,
104
96
  zAxisProps,
@@ -109,7 +101,6 @@ export const useScatterChartProps = props => {
109
101
  overlayProps,
110
102
  legendProps,
111
103
  axisHighlightProps,
112
- tooltipProps,
113
104
  children
114
105
  };
115
106
  };
@@ -2,12 +2,12 @@
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", "width", "height", "margin", "colors", "sx", "showTooltip", "tooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
5
+ const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "colors", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { BarPlot } from "../BarChart/index.js";
9
9
  import { LinePlot, AreaPlot, LineHighlightPlot } from "../LineChart/index.js";
10
- import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
10
+ import { ChartContainer } from "../ChartContainer/index.js";
11
11
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
12
12
  import { ChartsTooltip } from "../ChartsTooltip/index.js";
13
13
  import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
@@ -38,7 +38,6 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
38
38
  colors,
39
39
  sx,
40
40
  showTooltip,
41
- tooltip,
42
41
  showHighlight,
43
42
  axisHighlight: inAxisHighlight,
44
43
  children,
@@ -58,7 +57,8 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
58
57
  x: 'none'
59
58
  };
60
59
  const axisHighlight = _extends({}, defaultXHighlight, inAxisHighlight);
61
- return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({}, other, {
60
+ const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
61
+ return /*#__PURE__*/_jsxs(ChartContainer, _extends({}, other, {
62
62
  ref: ref,
63
63
  series: [_extends({
64
64
  type: plotType,
@@ -86,7 +86,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
86
86
  }, yAxis)],
87
87
  colors: colors,
88
88
  sx: sx,
89
- disableAxisListener: (!showTooltip || tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
89
+ disableAxisListener: (!showTooltip || slotProps?.tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
90
90
  children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
91
91
  skipAnimation: true,
92
92
  slots: slots,
@@ -107,10 +107,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
107
107
  slots: slots,
108
108
  slotProps: slotProps
109
109
  })]
110
- }), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), showTooltip && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
111
- slotProps: slotProps,
112
- slots: slots
113
- })), children]
110
+ }), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), showTooltip && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), children]
114
111
  }));
115
112
  });
116
113
  process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
@@ -193,16 +190,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
193
190
  * @default 'line'
194
191
  */
195
192
  plotType: PropTypes.oneOf(['bar', 'line']),
196
- /**
197
- * The chart will try to wait for the parent container to resolve its size
198
- * before it renders for the first time.
199
- *
200
- * This can be useful in some scenarios where the chart appear to grow after
201
- * the first render, like when used inside a grid.
202
- *
203
- * @default false
204
- */
205
- resolveSizeBeforeRender: PropTypes.bool,
206
193
  /**
207
194
  * Set to `true` to highlight the value.
208
195
  * With line, it shows a point.
@@ -232,14 +219,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
232
219
  slots: PropTypes.object,
233
220
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
234
221
  title: PropTypes.string,
235
- tooltip: PropTypes.shape({
236
- axisContent: PropTypes.elementType,
237
- classes: PropTypes.object,
238
- itemContent: PropTypes.elementType,
239
- slotProps: PropTypes.object,
240
- slots: PropTypes.object,
241
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
242
- }),
243
222
  /**
244
223
  * Formatter used by the tooltip.
245
224
  * @param {number} value The value to format.
@@ -247,12 +226,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
247
226
  * @default (value: number | null) => (value === null ? '' : value.toString())
248
227
  */
249
228
  valueFormatter: PropTypes.func,
250
- viewBox: PropTypes.shape({
251
- height: PropTypes.number,
252
- width: PropTypes.number,
253
- x: PropTypes.number,
254
- y: PropTypes.number
255
- }),
256
229
  /**
257
230
  * The width of the chart in px. If not defined, it takes the width of the parent element.
258
231
  */