@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
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSelector = void 0;
7
+ var _withSelector = require("use-sync-external-store/with-selector");
8
+ const defaultCompare = Object.is;
9
+ const useSelector = (store, selector, args = undefined, equals = defaultCompare) => {
10
+ const selectorWithArgs = state => selector(state, args);
11
+ return (0, _withSelector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, selectorWithArgs, equals);
12
+ };
13
+ exports.useSelector = useSelector;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useStore = useStore;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _InteractionProvider = require("../context/InteractionProvider");
10
+ function useStore(skipError) {
11
+ const charts = React.useContext(_InteractionProvider.ChartsContext);
12
+ if (skipError) {
13
+ // TODO: Remove once store is used by all charts.
14
+ // This line is only for `useAxisEvents` which is in the surface of the Gauge.
15
+ // But the Gauge don't have store yet because it does not need the interaction provider.
16
+ // Will be fixed when every thing move to the store since every component will have access to it.
17
+ // @ts-ignore
18
+ return charts?.store;
19
+ }
20
+ if (!charts) {
21
+ throw new Error(['MUI X: Could not find the charts context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
22
+ }
23
+ return charts.store;
24
+ }
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.useStringInterpolator = void 0;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
10
+ /* eslint-disable react-compiler/react-compiler */
11
+
10
12
  function usePrevious(value) {
11
13
  const ref = React.useRef({
12
14
  currentPath: value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.22.3",
3
+ "version": "8.0.0-alpha.1",
4
4
  "description": "The community edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -29,22 +29,24 @@
29
29
  "directory": "packages/x-charts"
30
30
  },
31
31
  "dependencies": {
32
- "@babel/runtime": "^7.25.7",
32
+ "@babel/runtime": "^7.26.0",
33
33
  "@mui/utils": "^5.16.6 || ^6.0.0",
34
34
  "@react-spring/rafz": "^9.7.5",
35
35
  "@react-spring/web": "^9.7.5",
36
36
  "clsx": "^2.1.1",
37
37
  "prop-types": "^15.8.1",
38
- "@mui/x-charts-vendor": "7.20.0",
39
- "@mui/x-internals": "7.21.0"
38
+ "reselect": "^5.1.1",
39
+ "use-sync-external-store": "^1.0.0",
40
+ "@mui/x-charts-vendor": "8.0.0-alpha.1",
41
+ "@mui/x-internals": "8.0.0-alpha.1"
40
42
  },
41
43
  "peerDependencies": {
42
44
  "@emotion/react": "^11.9.0",
43
45
  "@emotion/styled": "^11.8.1",
44
46
  "@mui/material": "^5.15.14 || ^6.0.0",
45
47
  "@mui/system": "^5.15.14 || ^6.0.0",
46
- "react": "^17.0.0 || ^18.0.0",
47
- "react-dom": "^17.0.0 || ^18.0.0"
48
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
48
50
  },
49
51
  "peerDependenciesMeta": {
50
52
  "@emotion/react": {
@@ -8,14 +8,13 @@ import { LineChartProps } from '../LineChart/LineChart';
8
8
  import { ScatterChartProps } from '../ScatterChart/ScatterChart';
9
9
  import { PieChartProps } from '../PieChart/PieChart';
10
10
  import { ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
11
- import { ChartSeriesType } from '../models/seriesType/config';
12
11
 
13
12
  export interface ChartsComponentsPropsList {
14
13
  MuiChartsXAxis: ChartsXAxisProps;
15
14
  MuiChartsYAxis: ChartsYAxisProps;
16
15
  MuiChartsGrid: ChartsGridProps;
17
16
  MuiChartsLegend: ChartsLegendProps;
18
- MuiChartsTooltip: ChartsTooltipProps<ChartSeriesType>;
17
+ MuiChartsTooltip: ChartsTooltipProps;
19
18
  MuiChartsSurface: ChartsSurfaceProps;
20
19
 
21
20
  // BarChart components
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import type { ChartsAxisContentProps } from './ChartsAxisTooltipContent';
3
- declare function DefaultChartsAxisTooltipContent(props: ChartsAxisContentProps): React.JSX.Element | null;
4
- declare namespace DefaultChartsAxisTooltipContent {
5
- var propTypes: any;
6
- }
7
- export { DefaultChartsAxisTooltipContent };
@@ -1,123 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PropTypes from 'prop-types';
5
- import clsx from 'clsx';
6
- import Typography from '@mui/material/Typography';
7
- import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from "./ChartsTooltipTable.js";
8
- import { utcFormatter } from "./utils.js";
9
- import { getLabel } from "../internals/getLabel.js";
10
- import { isCartesianSeries } from "../internals/isCartesian.js";
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- function DefaultChartsAxisTooltipContent(props) {
13
- const {
14
- series,
15
- axis,
16
- dataIndex,
17
- axisValue,
18
- sx,
19
- classes
20
- } = props;
21
- if (dataIndex == null) {
22
- return null;
23
- }
24
- const axisFormatter = axis.valueFormatter ?? (v => axis.scaleType === 'utc' ? utcFormatter(v) : v.toLocaleString());
25
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
26
- sx: sx,
27
- className: classes.paper,
28
- children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
29
- className: classes.table,
30
- children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
31
- children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
32
- children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
33
- colSpan: 3,
34
- children: /*#__PURE__*/_jsx(Typography, {
35
- children: axisFormatter(axisValue, {
36
- location: 'tooltip'
37
- })
38
- })
39
- })
40
- })
41
- }), /*#__PURE__*/_jsx("tbody", {
42
- children: series.filter(isCartesianSeries).map(({
43
- id,
44
- label,
45
- valueFormatter,
46
- data,
47
- getColor
48
- }) => {
49
- // @ts-ignore
50
- const formattedValue = valueFormatter(data[dataIndex] ?? null, {
51
- dataIndex
52
- });
53
- if (formattedValue == null) {
54
- return null;
55
- }
56
- const formattedLabel = getLabel(label, 'tooltip');
57
- const color = getColor(dataIndex);
58
- return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
59
- className: classes.row,
60
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
61
- className: clsx(classes.markCell, classes.cell),
62
- children: color && /*#__PURE__*/_jsx(ChartsTooltipMark, {
63
- color: color,
64
- className: classes.mark
65
- })
66
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
67
- className: clsx(classes.labelCell, classes.cell),
68
- children: formattedLabel ? /*#__PURE__*/_jsx(Typography, {
69
- children: formattedLabel
70
- }) : null
71
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
72
- className: clsx(classes.valueCell, classes.cell),
73
- children: /*#__PURE__*/_jsx(Typography, {
74
- children: formattedValue
75
- })
76
- })]
77
- }, id);
78
- })
79
- })]
80
- })
81
- });
82
- }
83
- process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propTypes = {
84
- // ----------------------------- Warning --------------------------------
85
- // | These PropTypes are generated from the TypeScript type definitions |
86
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
87
- // ----------------------------------------------------------------------
88
- /**
89
- * The properties of the triggered axis.
90
- */
91
- axis: PropTypes.object.isRequired,
92
- /**
93
- * Data identifying the triggered axis.
94
- */
95
- axisData: PropTypes.shape({
96
- x: PropTypes.shape({
97
- index: PropTypes.number,
98
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
99
- }),
100
- y: PropTypes.shape({
101
- index: PropTypes.number,
102
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
103
- })
104
- }).isRequired,
105
- /**
106
- * The value associated to the current mouse position.
107
- */
108
- axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
109
- /**
110
- * Override or extend the styles applied to the component.
111
- */
112
- classes: PropTypes.object.isRequired,
113
- /**
114
- * The index of the data item triggered.
115
- */
116
- dataIndex: PropTypes.number,
117
- /**
118
- * The series linked to the triggered axis.
119
- */
120
- series: PropTypes.arrayOf(PropTypes.object).isRequired,
121
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
122
- } : void 0;
123
- export { DefaultChartsAxisTooltipContent };
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { ChartSeriesType } from '../models/seriesType/config';
3
- import type { ChartsItemContentProps } from './ChartsItemTooltipContent';
4
- declare function DefaultChartsItemTooltipContent<T extends ChartSeriesType = ChartSeriesType>(props: ChartsItemContentProps<T>): React.JSX.Element | null;
5
- declare namespace DefaultChartsItemTooltipContent {
6
- var propTypes: any;
7
- }
8
- export { DefaultChartsItemTooltipContent };
@@ -1,92 +0,0 @@
1
- 'use client';
2
-
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
- import clsx from 'clsx';
7
- import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from "./ChartsTooltipTable.js";
8
- import { getLabel } from "../internals/getLabel.js";
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- function DefaultChartsItemTooltipContent(props) {
11
- const {
12
- series,
13
- itemData,
14
- sx,
15
- classes,
16
- getColor
17
- } = props;
18
- if (itemData.dataIndex === undefined || !series.data[itemData.dataIndex]) {
19
- return null;
20
- }
21
- const {
22
- displayedLabel,
23
- color
24
- } = series.type === 'pie' ? {
25
- color: getColor(itemData.dataIndex),
26
- displayedLabel: getLabel(series.data[itemData.dataIndex].label, 'tooltip')
27
- } : {
28
- color: getColor(itemData.dataIndex),
29
- displayedLabel: getLabel(series.label, 'tooltip')
30
- };
31
- const value = series.type === 'pie' ? _extends({}, series.data[itemData.dataIndex], {
32
- label: getLabel(series.data[itemData.dataIndex].label, 'tooltip')
33
- }) : series.data[itemData.dataIndex];
34
- const formattedValue = series.valueFormatter?.(value, {
35
- dataIndex: itemData.dataIndex
36
- });
37
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
38
- sx: sx,
39
- className: classes.paper,
40
- children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
41
- className: classes.table,
42
- children: /*#__PURE__*/_jsx("tbody", {
43
- children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
44
- className: classes.row,
45
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
46
- className: clsx(classes.markCell, classes.cell),
47
- children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
48
- color: color,
49
- className: classes.mark
50
- })
51
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
52
- className: clsx(classes.labelCell, classes.cell),
53
- children: displayedLabel
54
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
55
- className: clsx(classes.valueCell, classes.cell),
56
- children: formattedValue
57
- })]
58
- })
59
- })
60
- })
61
- });
62
- }
63
- process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propTypes = {
64
- // ----------------------------- Warning --------------------------------
65
- // | These PropTypes are generated from the TypeScript type definitions |
66
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
67
- // ----------------------------------------------------------------------
68
- /**
69
- * Override or extend the styles applied to the component.
70
- */
71
- classes: PropTypes.object.isRequired,
72
- /**
73
- * Get the color of the item with index `dataIndex`.
74
- * @param {number} dataIndex The data index of the item.
75
- * @returns {string} The color to display.
76
- */
77
- getColor: PropTypes.func.isRequired,
78
- /**
79
- * The data used to identify the triggered item.
80
- */
81
- itemData: PropTypes.shape({
82
- dataIndex: PropTypes.number,
83
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
84
- type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
85
- }).isRequired,
86
- /**
87
- * The series linked to the triggered axis.
88
- */
89
- series: PropTypes.object.isRequired,
90
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
91
- } : void 0;
92
- export { DefaultChartsItemTooltipContent };
@@ -1,9 +0,0 @@
1
- import type { ResponsiveChartContainerProps } from './ResponsiveChartContainer';
2
- /**
3
- * Wrapping div that take the shape of its parent.
4
- *
5
- * @ignore - do not document.
6
- */
7
- export declare const ResizableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
8
- ownerState: Pick<ResponsiveChartContainerProps, "width" | "height">;
9
- }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
@@ -1,26 +0,0 @@
1
- import { styled } from '@mui/material/styles';
2
- /**
3
- * Wrapping div that take the shape of its parent.
4
- *
5
- * @ignore - do not document.
6
- */
7
- export const ResizableContainer = styled('div', {
8
- name: 'MuiResponsiveChart',
9
- slot: 'Container'
10
- })(({
11
- ownerState
12
- }) => ({
13
- width: ownerState.width ?? '100%',
14
- height: ownerState.height ?? '100%',
15
- display: 'flex',
16
- position: 'relative',
17
- flexGrow: 1,
18
- flexDirection: 'column',
19
- alignItems: 'center',
20
- justifyContent: 'center',
21
- overflow: 'hidden',
22
- '&>svg': {
23
- width: '100%',
24
- height: '100%'
25
- }
26
- }));
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- import { ChartContainerProps } from '../ChartContainer';
3
- export interface ResponsiveChartContainerProps extends Omit<ChartContainerProps, 'width' | 'height'> {
4
- /**
5
- * The width of the chart in px. If not defined, it takes the width of the parent element.
6
- */
7
- width?: number;
8
- /**
9
- * The height of the chart in px. If not defined, it takes the height of the parent element.
10
- */
11
- height?: number;
12
- /**
13
- * The chart will try to wait for the parent container to resolve its size
14
- * before it renders for the first time.
15
- *
16
- * This can be useful in some scenarios where the chart appear to grow after
17
- * the first render, like when used inside a grid.
18
- *
19
- * @default false
20
- */
21
- resolveSizeBeforeRender?: boolean;
22
- }
23
- declare const ResponsiveChartContainer: React.ForwardRefExoticComponent<ResponsiveChartContainerProps & React.RefAttributes<unknown>>;
24
- export { ResponsiveChartContainer };
@@ -1 +0,0 @@
1
- export * from './ResponsiveChartContainer';
@@ -1 +0,0 @@
1
- export * from "./ResponsiveChartContainer.js";
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../node/ResponsiveChartContainer/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- export declare const useChartContainerDimensions: (inWidth?: number, inHeight?: number, resolveSizeBeforeRender?: boolean) => {
3
- containerRef: React.MutableRefObject<null>;
4
- width: number;
5
- height: number;
6
- };
@@ -1,19 +0,0 @@
1
- import type { ResponsiveChartContainerProps } from './ResponsiveChartContainer';
2
- export declare const useResponsiveChartContainerProps: (props: ResponsiveChartContainerProps, ref: React.ForwardedRef<unknown>) => {
3
- hasIntrinsicSize: number;
4
- chartContainerProps: Omit<import("..").ChartsSurfaceProps & Omit<import("../internals").SeriesProviderProps, "seriesFormatters"> & Omit<import("../internals").DrawingProviderProps, "svgRef"> & Pick<import("../internals").CartesianProviderProps, "dataset"> & import("..").ZAxisContextProviderProps & import("..").HighlightedProviderProps & import("../internals").PluginProviderProps & import("../internals").AnimationProviderProps, "children"> & {
5
- xAxis?: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsXAxisProps>, "id">[];
6
- yAxis?: import("../internals").MakeOptional<import("..").AxisConfig<import("..").ScaleName, any, import("..").ChartsYAxisProps>, "id">[];
7
- children?: React.ReactNode;
8
- } & {
9
- ref: React.ForwardedRef<unknown>;
10
- };
11
- resizableChartContainerProps: {
12
- ownerState: {
13
- width: number | undefined;
14
- height: number | undefined;
15
- };
16
- ref: import("react").MutableRefObject<null>;
17
- className?: string | undefined;
18
- };
19
- };
@@ -1,70 +0,0 @@
1
- 'use client';
2
-
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["width", "height", "resolveSizeBeforeRender", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "viewBox", "xAxis", "yAxis", "zAxis", "skipAnimation"];
6
- import { useChartContainerDimensions } from "./useChartContainerDimensions.js";
7
- export const useResponsiveChartContainerProps = (props, ref) => {
8
- const {
9
- width,
10
- height,
11
- resolveSizeBeforeRender,
12
- margin,
13
- children,
14
- series,
15
- colors,
16
- dataset,
17
- desc,
18
- disableAxisListener,
19
- highlightedItem,
20
- onHighlightChange,
21
- plugins,
22
- sx,
23
- title,
24
- viewBox,
25
- xAxis,
26
- yAxis,
27
- zAxis,
28
- skipAnimation
29
- } = props,
30
- other = _objectWithoutPropertiesLoose(props, _excluded);
31
- const {
32
- containerRef,
33
- width: dWidth,
34
- height: dHeight
35
- } = useChartContainerDimensions(width, height, resolveSizeBeforeRender);
36
- const resizableChartContainerProps = _extends({}, other, {
37
- ownerState: {
38
- width,
39
- height
40
- },
41
- ref: containerRef
42
- });
43
- const chartContainerProps = {
44
- margin,
45
- children,
46
- series,
47
- colors,
48
- dataset,
49
- desc,
50
- disableAxisListener,
51
- highlightedItem,
52
- onHighlightChange,
53
- plugins,
54
- sx,
55
- title,
56
- viewBox,
57
- xAxis,
58
- yAxis,
59
- zAxis,
60
- skipAnimation,
61
- width: dWidth,
62
- height: dHeight,
63
- ref
64
- };
65
- return {
66
- hasIntrinsicSize: dWidth && dHeight,
67
- chartContainerProps,
68
- resizableChartContainerProps
69
- };
70
- };
@@ -1 +0,0 @@
1
- export type SlotComponentPropsFromProps<TProps extends {}, TOverrides extends {}, TOwnerState extends {}> = (Partial<TProps> & TOverrides) | ((ownerState: TOwnerState) => Partial<TProps> & TOverrides);
@@ -1,3 +0,0 @@
1
- export type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
- export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
3
- export type DefaultizedProps<P extends {}, RequiredProps extends keyof P, AdditionalProps extends {} = {}> = Omit<P, RequiredProps | keyof AdditionalProps> & Required<Pick<P, RequiredProps>> & AdditionalProps;
@@ -1,123 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PropTypes from 'prop-types';
5
- import clsx from 'clsx';
6
- import Typography from '@mui/material/Typography';
7
- import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from "./ChartsTooltipTable.js";
8
- import { utcFormatter } from "./utils.js";
9
- import { getLabel } from "../internals/getLabel.js";
10
- import { isCartesianSeries } from "../internals/isCartesian.js";
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- function DefaultChartsAxisTooltipContent(props) {
13
- const {
14
- series,
15
- axis,
16
- dataIndex,
17
- axisValue,
18
- sx,
19
- classes
20
- } = props;
21
- if (dataIndex == null) {
22
- return null;
23
- }
24
- const axisFormatter = axis.valueFormatter ?? (v => axis.scaleType === 'utc' ? utcFormatter(v) : v.toLocaleString());
25
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
26
- sx: sx,
27
- className: classes.paper,
28
- children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
29
- className: classes.table,
30
- children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
31
- children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
32
- children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
33
- colSpan: 3,
34
- children: /*#__PURE__*/_jsx(Typography, {
35
- children: axisFormatter(axisValue, {
36
- location: 'tooltip'
37
- })
38
- })
39
- })
40
- })
41
- }), /*#__PURE__*/_jsx("tbody", {
42
- children: series.filter(isCartesianSeries).map(({
43
- id,
44
- label,
45
- valueFormatter,
46
- data,
47
- getColor
48
- }) => {
49
- // @ts-ignore
50
- const formattedValue = valueFormatter(data[dataIndex] ?? null, {
51
- dataIndex
52
- });
53
- if (formattedValue == null) {
54
- return null;
55
- }
56
- const formattedLabel = getLabel(label, 'tooltip');
57
- const color = getColor(dataIndex);
58
- return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
59
- className: classes.row,
60
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
61
- className: clsx(classes.markCell, classes.cell),
62
- children: color && /*#__PURE__*/_jsx(ChartsTooltipMark, {
63
- color: color,
64
- className: classes.mark
65
- })
66
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
67
- className: clsx(classes.labelCell, classes.cell),
68
- children: formattedLabel ? /*#__PURE__*/_jsx(Typography, {
69
- children: formattedLabel
70
- }) : null
71
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
72
- className: clsx(classes.valueCell, classes.cell),
73
- children: /*#__PURE__*/_jsx(Typography, {
74
- children: formattedValue
75
- })
76
- })]
77
- }, id);
78
- })
79
- })]
80
- })
81
- });
82
- }
83
- process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propTypes = {
84
- // ----------------------------- Warning --------------------------------
85
- // | These PropTypes are generated from the TypeScript type definitions |
86
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
87
- // ----------------------------------------------------------------------
88
- /**
89
- * The properties of the triggered axis.
90
- */
91
- axis: PropTypes.object.isRequired,
92
- /**
93
- * Data identifying the triggered axis.
94
- */
95
- axisData: PropTypes.shape({
96
- x: PropTypes.shape({
97
- index: PropTypes.number,
98
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
99
- }),
100
- y: PropTypes.shape({
101
- index: PropTypes.number,
102
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
103
- })
104
- }).isRequired,
105
- /**
106
- * The value associated to the current mouse position.
107
- */
108
- axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
109
- /**
110
- * Override or extend the styles applied to the component.
111
- */
112
- classes: PropTypes.object.isRequired,
113
- /**
114
- * The index of the data item triggered.
115
- */
116
- dataIndex: PropTypes.number,
117
- /**
118
- * The series linked to the triggered axis.
119
- */
120
- series: PropTypes.arrayOf(PropTypes.object).isRequired,
121
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
122
- } : void 0;
123
- export { DefaultChartsAxisTooltipContent };