@mui/x-charts 8.0.0-alpha.0 → 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 (335) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +15 -0
  2. package/BarChart/AnimatedBarElement.js +21 -0
  3. package/BarChart/BarChart.d.ts +4 -9
  4. package/BarChart/BarChart.js +3 -31
  5. package/BarChart/BarElement.d.ts +5 -1342
  6. package/BarChart/BarElement.js +10 -20
  7. package/BarChart/BarPlot.js +12 -2
  8. package/BarChart/useBarChartProps.d.ts +0 -2
  9. package/BarChart/useBarChartProps.js +2 -8
  10. package/CHANGELOG.md +429 -5
  11. package/ChartContainer/ChartContainer.d.ts +2 -19
  12. package/ChartContainer/ChartContainer.js +10 -20
  13. package/ChartContainer/ResizableContainer.d.ts +17 -4
  14. package/ChartContainer/ResizableContainer.js +36 -2
  15. package/ChartContainer/useChartContainerProps.d.ts +6 -7
  16. package/ChartContainer/useChartContainerProps.js +14 -28
  17. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
  18. package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  19. package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  21. package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
  22. package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  23. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
  24. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  25. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
  26. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  27. package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
  28. package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  29. package/ChartsAxisHighlight/index.d.ts +3 -0
  30. package/ChartsAxisHighlight/index.js +4 -1
  31. package/ChartsGrid/ChartsGrid.js +1 -1
  32. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
  33. package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  34. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
  35. package/ChartsGrid/ChartsVerticalGrid.js +3 -3
  36. package/ChartsLegend/LegendPerItem.d.ts +2 -2
  37. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  38. package/ChartsSurface/ChartsSurface.d.ts +0 -15
  39. package/ChartsSurface/ChartsSurface.js +35 -34
  40. package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
  41. package/ChartsTooltip/ChartTooltip.types.js +1 -0
  42. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
  43. package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  44. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
  45. package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  46. package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
  47. package/ChartsTooltip/ChartsTooltip.js +161 -145
  48. package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
  49. package/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  50. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
  51. package/ChartsTooltip/chartsTooltipClasses.js +18 -2
  52. package/ChartsTooltip/index.d.ts +3 -3
  53. package/ChartsTooltip/index.js +2 -3
  54. package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
  55. package/ChartsTooltip/useAxisTooltip.js +19 -19
  56. package/ChartsTooltip/useItemTooltip.d.ts +1 -1
  57. package/ChartsTooltip/useItemTooltip.js +5 -4
  58. package/ChartsTooltip/utils.d.ts +0 -3
  59. package/ChartsTooltip/utils.js +0 -8
  60. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
  61. package/Gauge/Gauge.d.ts +1 -1
  62. package/Gauge/Gauge.js +0 -6
  63. package/Gauge/GaugeContainer.d.ts +3 -3
  64. package/Gauge/GaugeContainer.js +60 -61
  65. package/LineChart/AnimatedArea.d.ts +0 -1333
  66. package/LineChart/AnimatedArea.js +9 -18
  67. package/LineChart/AnimatedLine.d.ts +0 -1333
  68. package/LineChart/AnimatedLine.js +9 -20
  69. package/LineChart/AreaPlot.js +12 -2
  70. package/LineChart/CircleMarkElement.js +6 -5
  71. package/LineChart/LineChart.d.ts +4 -10
  72. package/LineChart/LineChart.js +3 -32
  73. package/LineChart/LineHighlightPlot.js +6 -5
  74. package/LineChart/LinePlot.js +12 -2
  75. package/LineChart/MarkElement.js +6 -5
  76. package/LineChart/useLineChartProps.d.ts +0 -2
  77. package/LineChart/useLineChartProps.js +2 -8
  78. package/PieChart/PieChart.d.ts +3 -9
  79. package/PieChart/PieChart.js +5 -37
  80. package/PieChart/PiePlot.js +2 -2
  81. package/PieChart/getPieCoordinates.d.ts +2 -2
  82. package/README.md +2 -2
  83. package/ScatterChart/Scatter.js +6 -5
  84. package/ScatterChart/ScatterChart.d.ts +4 -10
  85. package/ScatterChart/ScatterChart.js +5 -32
  86. package/ScatterChart/useScatterChartProps.d.ts +0 -2
  87. package/ScatterChart/useScatterChartProps.js +1 -9
  88. package/SparkLineChart/SparkLineChart.d.ts +3 -4
  89. package/SparkLineChart/SparkLineChart.js +4 -31
  90. package/context/ChartDataProvider/ChartDataProvider.d.ts +9 -19
  91. package/context/ChartDataProvider/ChartDataProvider.js +30 -43
  92. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +7 -10
  93. package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  94. package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
  95. package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  96. package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +8 -0
  97. package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  98. package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
  99. package/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  100. package/context/DrawingAreaProvider/index.d.ts +3 -0
  101. package/context/DrawingAreaProvider/index.js +3 -0
  102. package/context/InteractionProvider.d.ts +5 -48
  103. package/context/InteractionProvider.js +8 -64
  104. package/context/InteractionSelectors.d.ts +359 -0
  105. package/context/InteractionSelectors.js +12 -0
  106. package/context/SizeProvider/Size.types.d.ts +30 -0
  107. package/context/SizeProvider/Size.types.js +1 -0
  108. package/context/SizeProvider/SizeContext.d.ts +4 -0
  109. package/context/SizeProvider/SizeContext.js +13 -0
  110. package/context/SizeProvider/SizeProvider.d.ts +11 -0
  111. package/context/SizeProvider/SizeProvider.js +26 -0
  112. package/context/SizeProvider/index.d.ts +4 -0
  113. package/context/SizeProvider/index.js +4 -0
  114. package/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.d.ts +4 -1
  115. package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
  116. package/context/SizeProvider/useSize.d.ts +5 -0
  117. package/context/SizeProvider/useSize.js +13 -0
  118. package/context/SvgRefProvider/SvgRef.types.d.ts +8 -0
  119. package/context/SvgRefProvider/SvgRef.types.js +1 -0
  120. package/context/SvgRefProvider/SvgRefContext.d.ts +4 -0
  121. package/context/SvgRefProvider/SvgRefContext.js +17 -0
  122. package/context/SvgRefProvider/SvgRefProvider.d.ts +3 -0
  123. package/context/SvgRefProvider/SvgRefProvider.js +24 -0
  124. package/context/SvgRefProvider/index.d.ts +4 -0
  125. package/context/SvgRefProvider/index.js +4 -0
  126. package/context/SvgRefProvider/useSurfaceRef.d.ts +2 -0
  127. package/context/SvgRefProvider/useSurfaceRef.js +14 -0
  128. package/context/index.d.ts +2 -0
  129. package/context/index.js +2 -1
  130. package/hooks/useAxisEvents.js +32 -19
  131. package/hooks/useChartId.js +2 -2
  132. package/hooks/useDrawingArea.d.ts +2 -2
  133. package/hooks/useDrawingArea.js +2 -2
  134. package/hooks/useInteractionItemProps.js +19 -12
  135. package/hooks/useSvgRef.js +3 -3
  136. package/index.js +1 -1
  137. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
  138. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  139. package/internals/computeAxisValue.d.ts +2 -2
  140. package/internals/index.d.ts +3 -2
  141. package/internals/index.js +3 -2
  142. package/internals/plugins/models/index.d.ts +35 -0
  143. package/internals/plugins/models/index.js +1 -0
  144. package/internals/plugins/utils/ChartStore.d.ts +12 -0
  145. package/internals/plugins/utils/ChartStore.js +26 -0
  146. package/internals/plugins/utils/ChartsStore.d.ts +12 -0
  147. package/internals/plugins/utils/ChartsStore.js +26 -0
  148. package/internals/plugins/utils/selectors.d.ts +9 -0
  149. package/internals/plugins/utils/selectors.js +37 -0
  150. package/internals/useCharts.d.ts +6 -0
  151. package/internals/useCharts.js +29 -0
  152. package/internals/useSelector.d.ts +4 -0
  153. package/internals/useSelector.js +6 -0
  154. package/internals/useStore.d.ts +2 -0
  155. package/internals/useStore.js +17 -0
  156. package/modern/BarChart/AnimatedBarElement.js +21 -0
  157. package/modern/BarChart/BarChart.js +3 -31
  158. package/modern/BarChart/BarElement.js +10 -20
  159. package/modern/BarChart/BarPlot.js +12 -2
  160. package/modern/BarChart/useBarChartProps.js +2 -8
  161. package/modern/ChartContainer/ChartContainer.js +10 -20
  162. package/modern/ChartContainer/ResizableContainer.js +36 -2
  163. package/modern/ChartContainer/useChartContainerProps.js +14 -28
  164. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  165. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  166. package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  167. package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  168. package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  169. package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  170. package/modern/ChartsAxisHighlight/index.js +4 -1
  171. package/modern/ChartsGrid/ChartsGrid.js +1 -1
  172. package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  173. package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
  174. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  175. package/modern/ChartsSurface/ChartsSurface.js +35 -34
  176. package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
  177. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  178. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  179. package/modern/ChartsTooltip/ChartsTooltip.js +161 -145
  180. package/modern/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  181. package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
  182. package/modern/ChartsTooltip/index.js +2 -3
  183. package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
  184. package/modern/ChartsTooltip/useItemTooltip.js +5 -4
  185. package/modern/ChartsTooltip/utils.js +0 -8
  186. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
  187. package/modern/Gauge/Gauge.js +0 -6
  188. package/modern/Gauge/GaugeContainer.js +60 -61
  189. package/modern/LineChart/AnimatedArea.js +9 -18
  190. package/modern/LineChart/AnimatedLine.js +9 -20
  191. package/modern/LineChart/AreaPlot.js +12 -2
  192. package/modern/LineChart/CircleMarkElement.js +6 -5
  193. package/modern/LineChart/LineChart.js +3 -32
  194. package/modern/LineChart/LineHighlightPlot.js +6 -5
  195. package/modern/LineChart/LinePlot.js +12 -2
  196. package/modern/LineChart/MarkElement.js +6 -5
  197. package/modern/LineChart/useLineChartProps.js +2 -8
  198. package/modern/PieChart/PieChart.js +5 -37
  199. package/modern/PieChart/PiePlot.js +2 -2
  200. package/modern/ScatterChart/Scatter.js +6 -5
  201. package/modern/ScatterChart/ScatterChart.js +5 -32
  202. package/modern/ScatterChart/useScatterChartProps.js +1 -9
  203. package/modern/SparkLineChart/SparkLineChart.js +4 -31
  204. package/modern/context/ChartDataProvider/ChartDataProvider.js +30 -43
  205. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  206. package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  207. package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  208. package/modern/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  209. package/modern/context/DrawingAreaProvider/index.js +3 -0
  210. package/modern/context/InteractionProvider.js +8 -64
  211. package/modern/context/InteractionSelectors.js +12 -0
  212. package/modern/context/SizeProvider/Size.types.js +1 -0
  213. package/modern/context/SizeProvider/SizeContext.js +13 -0
  214. package/modern/context/SizeProvider/SizeProvider.js +26 -0
  215. package/modern/context/SizeProvider/index.js +4 -0
  216. package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +11 -5
  217. package/modern/context/SizeProvider/useSize.js +13 -0
  218. package/modern/context/SvgRefProvider/SvgRef.types.js +1 -0
  219. package/modern/context/SvgRefProvider/SvgRefContext.js +17 -0
  220. package/modern/context/SvgRefProvider/SvgRefProvider.js +24 -0
  221. package/modern/context/SvgRefProvider/index.js +4 -0
  222. package/modern/context/SvgRefProvider/useSurfaceRef.js +14 -0
  223. package/modern/context/index.js +2 -1
  224. package/modern/hooks/useAxisEvents.js +32 -19
  225. package/modern/hooks/useChartId.js +2 -2
  226. package/modern/hooks/useDrawingArea.js +2 -2
  227. package/modern/hooks/useInteractionItemProps.js +19 -12
  228. package/modern/hooks/useSvgRef.js +3 -3
  229. package/modern/index.js +1 -1
  230. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  231. package/modern/internals/index.js +3 -2
  232. package/modern/internals/plugins/models/index.js +1 -0
  233. package/modern/internals/plugins/utils/ChartStore.js +26 -0
  234. package/modern/internals/plugins/utils/ChartsStore.js +26 -0
  235. package/modern/internals/plugins/utils/selectors.js +37 -0
  236. package/modern/internals/useCharts.js +29 -0
  237. package/modern/internals/useSelector.js +6 -0
  238. package/modern/internals/useStore.js +17 -0
  239. package/node/BarChart/AnimatedBarElement.js +28 -0
  240. package/node/BarChart/BarChart.js +3 -31
  241. package/node/BarChart/BarElement.js +11 -21
  242. package/node/BarChart/BarPlot.js +11 -1
  243. package/node/BarChart/useBarChartProps.js +2 -8
  244. package/node/ChartContainer/ChartContainer.js +10 -20
  245. package/node/ChartContainer/ResizableContainer.js +39 -3
  246. package/node/ChartContainer/useChartContainerProps.js +14 -28
  247. package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
  248. package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
  249. package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
  250. package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
  251. package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
  252. package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
  253. package/node/ChartsAxisHighlight/index.js +33 -0
  254. package/node/ChartsGrid/ChartsGrid.js +2 -2
  255. package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
  256. package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
  257. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  258. package/node/ChartsSurface/ChartsSurface.js +35 -34
  259. package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
  260. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
  261. package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
  262. package/node/ChartsTooltip/ChartsTooltip.js +160 -144
  263. package/node/ChartsTooltip/ChartsTooltipContainer.js +304 -0
  264. package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
  265. package/node/ChartsTooltip/index.js +19 -28
  266. package/node/ChartsTooltip/useAxisTooltip.js +19 -19
  267. package/node/ChartsTooltip/useItemTooltip.js +5 -4
  268. package/node/ChartsTooltip/utils.js +0 -9
  269. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +48 -35
  270. package/node/Gauge/Gauge.js +0 -6
  271. package/node/Gauge/GaugeContainer.js +60 -61
  272. package/node/LineChart/AnimatedArea.js +9 -19
  273. package/node/LineChart/AnimatedLine.js +9 -21
  274. package/node/LineChart/AreaPlot.js +11 -1
  275. package/node/LineChart/CircleMarkElement.js +6 -5
  276. package/node/LineChart/LineChart.js +3 -32
  277. package/node/LineChart/LineHighlightPlot.js +6 -5
  278. package/node/LineChart/LinePlot.js +11 -1
  279. package/node/LineChart/MarkElement.js +6 -5
  280. package/node/LineChart/useLineChartProps.js +2 -8
  281. package/node/PieChart/PieChart.js +5 -37
  282. package/node/PieChart/PiePlot.js +2 -2
  283. package/node/ScatterChart/Scatter.js +6 -5
  284. package/node/ScatterChart/ScatterChart.js +5 -32
  285. package/node/ScatterChart/useScatterChartProps.js +1 -9
  286. package/node/SparkLineChart/SparkLineChart.js +4 -31
  287. package/node/context/ChartDataProvider/ChartDataProvider.js +30 -43
  288. package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
  289. package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
  290. package/node/context/DrawingAreaProvider/DrawingAreaContext.js +22 -0
  291. package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
  292. package/node/context/DrawingAreaProvider/index.js +38 -0
  293. package/node/context/InteractionProvider.js +9 -66
  294. package/node/context/InteractionSelectors.js +18 -0
  295. package/node/context/SizeProvider/Size.types.js +5 -0
  296. package/node/context/SizeProvider/SizeContext.js +20 -0
  297. package/node/context/SizeProvider/SizeProvider.js +29 -0
  298. package/node/context/SizeProvider/index.js +49 -0
  299. package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
  300. package/node/context/SizeProvider/useSize.js +20 -0
  301. package/node/context/SvgRefProvider/SvgRef.types.js +5 -0
  302. package/node/context/SvgRefProvider/SvgRefContext.js +23 -0
  303. package/node/context/SvgRefProvider/SvgRefProvider.js +31 -0
  304. package/node/context/SvgRefProvider/index.js +49 -0
  305. package/node/context/SvgRefProvider/useSurfaceRef.js +20 -0
  306. package/node/context/index.js +10 -2
  307. package/node/hooks/useAxisEvents.js +33 -19
  308. package/node/hooks/useChartId.js +2 -2
  309. package/node/hooks/useDrawingArea.js +2 -2
  310. package/node/hooks/useInteractionItemProps.js +20 -13
  311. package/node/hooks/useSvgRef.js +3 -3
  312. package/node/index.js +1 -1
  313. package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  314. package/node/internals/index.js +28 -16
  315. package/node/internals/plugins/models/index.js +5 -0
  316. package/node/internals/plugins/utils/ChartStore.js +33 -0
  317. package/node/internals/plugins/utils/ChartsStore.js +33 -0
  318. package/node/internals/plugins/utils/selectors.js +44 -0
  319. package/node/internals/useCharts.js +36 -0
  320. package/node/internals/useSelector.js +13 -0
  321. package/node/internals/useStore.js +24 -0
  322. package/package.json +7 -5
  323. package/themeAugmentation/props.d.ts +1 -2
  324. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
  325. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  326. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
  327. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  328. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  329. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  330. package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
  331. package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
  332. /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
  333. /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  334. /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  335. /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
@@ -0,0 +1,12 @@
1
+ import type { ChartState } from '../models';
2
+ type Listener<T> = (value: T) => void;
3
+ export type StoreUpdater = (prevState: ChartState) => ChartState;
4
+ export declare class ChartsStore {
5
+ value: ChartState;
6
+ private listeners;
7
+ constructor(value: ChartState);
8
+ subscribe: (fn: Listener<ChartState>) => () => void;
9
+ getSnapshot: () => ChartState;
10
+ update: (updater: StoreUpdater) => void;
11
+ }
12
+ export {};
@@ -0,0 +1,26 @@
1
+ // For now this is fixed. Will need to support generic if we add plugins
2
+
3
+ export class ChartsStore {
4
+ constructor(value) {
5
+ this.value = void 0;
6
+ this.listeners = void 0;
7
+ this.subscribe = fn => {
8
+ this.listeners.add(fn);
9
+ return () => {
10
+ this.listeners.delete(fn);
11
+ };
12
+ };
13
+ this.getSnapshot = () => {
14
+ return this.value;
15
+ };
16
+ this.update = updater => {
17
+ const newState = updater(this.value);
18
+ if (newState !== this.value) {
19
+ this.value = newState;
20
+ this.listeners.forEach(l => l(newState));
21
+ }
22
+ };
23
+ this.value = value;
24
+ this.listeners = new Set();
25
+ }
26
+ }
@@ -0,0 +1,9 @@
1
+ import { CreateSelectorFunction } from 'reselect';
2
+ import { ChartState } from '../models';
3
+ export type ChartsRootSelector = (state: ChartState) => ChartState[keyof ChartState];
4
+ export type ChartsSelector<TState, TArgs, TResult> = (state: TState, args: TArgs) => TResult;
5
+ /**
6
+ * Method wrapping reselect's createSelector to provide caching for chart instances.
7
+ *
8
+ */
9
+ export declare const createSelector: CreateSelectorFunction;
@@ -0,0 +1,37 @@
1
+ import { lruMemoize, createSelectorCreator } from 'reselect';
2
+ const reselectCreateSelector = createSelectorCreator({
3
+ memoize: lruMemoize,
4
+ memoizeOptions: {
5
+ maxSize: 1,
6
+ equalityCheck: Object.is
7
+ }
8
+ });
9
+ const cache = new WeakMap();
10
+ /**
11
+ * Method wrapping reselect's createSelector to provide caching for chart instances.
12
+ *
13
+ */
14
+ export const createSelector = (...createSelectorArgs) => {
15
+ const selector = (state, selectorArgs) => {
16
+ const cacheKey = state.cacheKey;
17
+
18
+ // If there is no cache for the current chart instance, create one.
19
+ let cacheForCurrentChartInstance = cache.get(cacheKey);
20
+ if (!cacheForCurrentChartInstance) {
21
+ cacheForCurrentChartInstance = new Map();
22
+ cache.set(cacheKey, cacheForCurrentChartInstance);
23
+ }
24
+
25
+ // If there is a cached selector, execute it.
26
+ const cachedSelector = cacheForCurrentChartInstance.get(createSelectorArgs);
27
+ if (cachedSelector) {
28
+ return cachedSelector(state, selectorArgs);
29
+ }
30
+
31
+ // Otherwise, create a new selector and cache it and execute it.
32
+ const fn = reselectCreateSelector(...createSelectorArgs);
33
+ cacheForCurrentChartInstance.set(createSelectorArgs, fn);
34
+ return fn(state, selectorArgs);
35
+ };
36
+ return selector;
37
+ };
@@ -0,0 +1,6 @@
1
+ import { ChartStore } from './plugins/utils/ChartStore';
2
+ export declare function useCharts(): {
3
+ contextValue: {
4
+ store: ChartStore;
5
+ };
6
+ };
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { ChartStore } from "./plugins/utils/ChartStore.js";
3
+ let globalId = 0;
4
+ export function useCharts() {
5
+ const storeRef = React.useRef(null);
6
+ if (storeRef.current == null) {
7
+ // eslint-disable-next-line react-compiler/react-compiler
8
+ globalId += 1;
9
+ const initialState = {
10
+ interaction: {
11
+ item: null,
12
+ axis: {
13
+ x: null,
14
+ y: null
15
+ }
16
+ },
17
+ cacheKey: {
18
+ id: globalId
19
+ }
20
+ };
21
+ storeRef.current = new ChartStore(initialState);
22
+ }
23
+ const contextValue = React.useMemo(() => ({
24
+ store: storeRef.current
25
+ }), []);
26
+ return {
27
+ contextValue
28
+ };
29
+ }
@@ -0,0 +1,4 @@
1
+ import { ChartState } from './plugins/models';
2
+ import { ChartsSelector } from './plugins/utils/selectors';
3
+ import { ChartStore } from './plugins/utils/ChartStore';
4
+ export declare const useSelector: <TArgs, TValue>(store: ChartStore, selector: ChartsSelector<ChartState, TArgs, TValue>, args?: TArgs, equals?: (a: TValue, b: TValue) => boolean) => TValue;
@@ -0,0 +1,6 @@
1
+ import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector';
2
+ const defaultCompare = Object.is;
3
+ export const useSelector = (store, selector, args = undefined, equals = defaultCompare) => {
4
+ const selectorWithArgs = state => selector(state, args);
5
+ return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, selectorWithArgs, equals);
6
+ };
@@ -0,0 +1,2 @@
1
+ import { ChartStore } from './plugins/utils/ChartStore';
2
+ export declare function useStore(skipError?: boolean): ChartStore;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { ChartsContext } from "../context/InteractionProvider.js";
3
+ export function useStore(skipError) {
4
+ const charts = React.useContext(ChartsContext);
5
+ if (skipError) {
6
+ // TODO: Remove once store is used by all charts.
7
+ // This line is only for `useAxisEvents` which is in the surface of the Gauge.
8
+ // But the Gauge don't have store yet because it does not need the interaction provider.
9
+ // Will be fixed when every thing move to the store since every component will have access to it.
10
+ // @ts-ignore
11
+ return charts?.store;
12
+ }
13
+ if (!charts) {
14
+ 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'));
15
+ }
16
+ return charts.store;
17
+ }
@@ -0,0 +1,21 @@
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 = ["ownerState"];
6
+ import * as React from 'react';
7
+ import { animated } from '@react-spring/web';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ /**
10
+ * @ignore - internal component.
11
+ */
12
+ export function AnimatedBarElement(props) {
13
+ const {
14
+ ownerState
15
+ } = props,
16
+ other = _objectWithoutPropertiesLoose(props, _excluded);
17
+ return /*#__PURE__*/_jsx(animated.rect, _extends({}, other, {
18
+ filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
19
+ opacity: ownerState.isFaded ? 0.3 : 1
20
+ }));
21
+ }
@@ -43,15 +43,15 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
43
43
  chartsAxisProps,
44
44
  axisHighlightProps,
45
45
  legendProps,
46
- tooltipProps,
47
46
  children
48
47
  } = useBarChartProps(props);
48
+ const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
49
49
  return /*#__PURE__*/_jsxs(ChartContainer, _extends({
50
50
  ref: ref
51
51
  }, chartContainerProps, {
52
52
  children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
53
53
  children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
54
- })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
54
+ })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
55
55
  }));
56
56
  });
57
57
  process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
@@ -63,7 +63,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
63
63
  * The configuration of axes highlight.
64
64
  * Default is set to 'band' in the bar direction.
65
65
  * Depends on `layout` prop.
66
- * @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
66
+ * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
67
67
  */
68
68
  axisHighlight: PropTypes.shape({
69
69
  x: PropTypes.oneOf(['band', 'line', 'none']),
@@ -174,16 +174,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
174
174
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
175
175
  */
176
176
  onItemClick: PropTypes.func,
177
- /**
178
- * The chart will try to wait for the parent container to resolve its size
179
- * before it renders for the first time.
180
- *
181
- * This can be useful in some scenarios where the chart appear to grow after
182
- * the first render, like when used inside a grid.
183
- *
184
- * @default false
185
- */
186
- resolveSizeBeforeRender: PropTypes.bool,
187
177
  /**
188
178
  * Indicate which axis to display the right of the charts.
189
179
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
@@ -212,30 +202,12 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
212
202
  slots: PropTypes.object,
213
203
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
214
204
  title: PropTypes.string,
215
- /**
216
- * The configuration of the tooltip.
217
- * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
218
- */
219
- tooltip: PropTypes.shape({
220
- axisContent: PropTypes.elementType,
221
- classes: PropTypes.object,
222
- itemContent: PropTypes.elementType,
223
- slotProps: PropTypes.object,
224
- slots: PropTypes.object,
225
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
226
- }),
227
205
  /**
228
206
  * Indicate which axis to display the top of the charts.
229
207
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
230
208
  * @default null
231
209
  */
232
210
  topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
233
- viewBox: PropTypes.shape({
234
- height: PropTypes.number,
235
- width: PropTypes.number,
236
- x: PropTypes.number,
237
- y: PropTypes.number
238
- }),
239
211
  /**
240
212
  * The width of the chart in px. If not defined, it takes the width of the parent element.
241
213
  */
@@ -8,39 +8,27 @@ import PropTypes from 'prop-types';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import useSlotProps from '@mui/utils/useSlotProps';
10
10
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
11
- import { styled } from '@mui/material/styles';
12
11
  import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
13
- import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
14
- import { animated } from '@react-spring/web';
15
12
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
16
13
  import { useItemHighlighted } from "../context/index.js";
14
+ import { AnimatedBarElement } from "./AnimatedBarElement.js";
17
15
  import { jsx as _jsx } from "react/jsx-runtime";
18
16
  export function getBarElementUtilityClass(slot) {
19
17
  return generateUtilityClass('MuiBarElement', slot);
20
18
  }
21
- export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root']);
19
+ export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root', 'highlighted', 'faded']);
22
20
  const useUtilityClasses = ownerState => {
23
21
  const {
24
22
  classes,
25
- id
23
+ id,
24
+ isHighlighted,
25
+ isFaded
26
26
  } = ownerState;
27
27
  const slots = {
28
- root: ['root', `series-${id}`]
28
+ root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
29
29
  };
30
30
  return composeClasses(slots, getBarElementUtilityClass, classes);
31
31
  };
32
- export const BarElementPath = styled(animated.rect, {
33
- name: 'MuiBarElement',
34
- slot: 'Root',
35
- overridesResolver: (_, styles) => styles.root
36
- })(({
37
- ownerState
38
- }) => ({
39
- stroke: 'none',
40
- fill: ownerState.isHighlighted ? d3Color(ownerState.color).brighter(0.5).formatHex() : ownerState.color,
41
- transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
42
- opacity: ownerState.isFaded && 0.3 || 1
43
- }));
44
32
  function BarElement(props) {
45
33
  const {
46
34
  id,
@@ -70,7 +58,7 @@ function BarElement(props) {
70
58
  isHighlighted
71
59
  };
72
60
  const classes = useUtilityClasses(ownerState);
73
- const Bar = slots?.bar ?? BarElementPath;
61
+ const Bar = slots?.bar ?? AnimatedBarElement;
74
62
  const barProps = useSlotProps({
75
63
  elementType: Bar,
76
64
  externalSlotProps: slotProps?.bar,
@@ -82,7 +70,9 @@ function BarElement(props) {
82
70
  }), {
83
71
  style,
84
72
  onClick,
85
- cursor: onClick ? 'pointer' : 'unset'
73
+ cursor: onClick ? 'pointer' : 'unset',
74
+ stroke: 'none',
75
+ fill: color
86
76
  }),
87
77
  className: classes.root,
88
78
  ownerState
@@ -6,8 +6,9 @@ const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useTransition } from '@react-spring/web';
9
+ import { styled } from '@mui/material/styles';
9
10
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
10
- import { BarElement } from "./BarElement.js";
11
+ import { BarElement, barElementClasses } from "./BarElement.js";
11
12
  import getColor from "./getColor.js";
12
13
  import { useChartId, useDrawingArea } from "../hooks/index.js";
13
14
  import { BarClipPath } from "./BarClipPath.js";
@@ -179,6 +180,15 @@ const enterStyle = ({
179
180
  height,
180
181
  width
181
182
  });
183
+ const BarPlotRoot = styled('g', {
184
+ name: 'MuiBarPlot',
185
+ slot: 'Root',
186
+ overridesResolver: (_, styles) => styles.root
187
+ })({
188
+ [`& .${barElementClasses.root}`]: {
189
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
190
+ }
191
+ });
182
192
 
183
193
  /**
184
194
  * Demos:
@@ -221,7 +231,7 @@ function BarPlot(props) {
221
231
  update: enterStyle,
222
232
  immediate: skipAnimation
223
233
  });
224
- return /*#__PURE__*/_jsxs(React.Fragment, {
234
+ return /*#__PURE__*/_jsxs(BarPlotRoot, {
225
235
  children: [!withoutBorderRadius && maskTransition((style, {
226
236
  id,
227
237
  hasPositive,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAxisClick", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
6
6
  import useId from '@mui/utils/useId';
7
7
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
8
8
  /**
@@ -23,7 +23,6 @@ export const useBarChartProps = props => {
23
23
  colors,
24
24
  dataset,
25
25
  sx,
26
- tooltip,
27
26
  onAxisClick,
28
27
  axisHighlight,
29
28
  grid,
@@ -74,7 +73,7 @@ export const useBarChartProps = props => {
74
73
  sx,
75
74
  highlightedItem,
76
75
  onHighlightChange,
77
- disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
76
+ disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
78
77
  className,
79
78
  skipAnimation
80
79
  });
@@ -120,10 +119,6 @@ export const useBarChartProps = props => {
120
119
  slots,
121
120
  slotProps
122
121
  };
123
- const tooltipProps = _extends({}, tooltip, {
124
- slots,
125
- slotProps
126
- });
127
122
  return {
128
123
  chartContainerProps,
129
124
  barPlotProps,
@@ -135,7 +130,6 @@ export const useBarChartProps = props => {
135
130
  chartsAxisProps,
136
131
  axisHighlightProps,
137
132
  legendProps,
138
- tooltipProps,
139
133
  children
140
134
  };
141
135
  };
@@ -6,15 +6,21 @@ import PropTypes from 'prop-types';
6
6
  import { ChartDataProvider } from "../context/ChartDataProvider/index.js";
7
7
  import { ResizableContainer } from "./ResizableContainer.js";
8
8
  import { useChartContainerProps } from "./useChartContainerProps.js";
9
+ import { ChartsSurface } from "../ChartsSurface/index.js";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
11
12
  const {
12
- hasIntrinsicSize,
13
13
  chartDataProviderProps,
14
- resizableChartContainerProps
14
+ children,
15
+ resizableContainerProps,
16
+ chartsSurfaceProps
15
17
  } = useChartContainerProps(props, ref);
16
- return /*#__PURE__*/_jsx(ResizableContainer, _extends({}, resizableChartContainerProps, {
17
- children: hasIntrinsicSize ? /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps)) : null
18
+ return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
19
+ children: /*#__PURE__*/_jsx(ResizableContainer, _extends({}, resizableContainerProps, {
20
+ children: /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
21
+ children: children
22
+ }))
23
+ }))
18
24
  }));
19
25
  });
20
26
  process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
@@ -74,16 +80,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
74
80
  * If not provided, the container supports line, bar, scatter and pie charts.
75
81
  */
76
82
  plugins: PropTypes.arrayOf(PropTypes.object),
77
- /**
78
- * The chart will try to wait for the parent container to resolve its size
79
- * before it renders for the first time.
80
- *
81
- * This can be useful in some scenarios where the chart appear to grow after
82
- * the first render, like when used inside a grid.
83
- *
84
- * @default false
85
- */
86
- resolveSizeBeforeRender: PropTypes.bool,
87
83
  /**
88
84
  * The array of series to display.
89
85
  * Each type of series has its own specificity.
@@ -97,12 +93,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
97
93
  skipAnimation: PropTypes.bool,
98
94
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
99
95
  title: PropTypes.string,
100
- viewBox: PropTypes.shape({
101
- height: PropTypes.number,
102
- width: PropTypes.number,
103
- x: PropTypes.number,
104
- y: PropTypes.number
105
- }),
106
96
  /**
107
97
  * The width of the chart in px. If not defined, it takes the width of the parent element.
108
98
  */
@@ -1,10 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
1
4
  import { styled } from '@mui/material/styles';
5
+ import { useSize } from "../context/SizeProvider/index.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
2
7
  /**
3
8
  * Wrapping div that take the shape of its parent.
4
9
  *
5
10
  * @ignore - do not document.
6
11
  */
7
- export const ResizableContainer = styled('div', {
12
+ export const ResizableContainerRoot = styled('div', {
8
13
  name: 'MuiResponsiveChart',
9
14
  slot: 'Container'
10
15
  })(({
@@ -23,4 +28,33 @@ export const ResizableContainer = styled('div', {
23
28
  width: '100%',
24
29
  height: '100%'
25
30
  }
26
- }));
31
+ }));
32
+
33
+ /**
34
+ * Wrapping div that take the shape of its parent.
35
+ *
36
+ * @ignore - do not document.
37
+ */
38
+ function ResizableContainer(props) {
39
+ const {
40
+ inHeight,
41
+ inWidth,
42
+ containerRef
43
+ } = useSize();
44
+ return /*#__PURE__*/_jsx(ResizableContainerRoot, _extends({}, props, {
45
+ ownerState: {
46
+ width: inWidth,
47
+ height: inHeight
48
+ },
49
+ ref: containerRef,
50
+ children: props.children
51
+ }));
52
+ }
53
+ process.env.NODE_ENV !== "production" ? ResizableContainer.propTypes = {
54
+ // ----------------------------- Warning --------------------------------
55
+ // | These PropTypes are generated from the TypeScript type definitions |
56
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
57
+ // ----------------------------------------------------------------------
58
+ children: PropTypes.node
59
+ } : void 0;
60
+ export { ResizableContainer };
@@ -1,14 +1,11 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  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";
4
+ const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "xAxis", "yAxis", "zAxis", "skipAnimation"];
7
5
  export const useChartContainerProps = (props, ref) => {
8
6
  const {
9
7
  width,
10
8
  height,
11
- resolveSizeBeforeRender,
12
9
  margin,
13
10
  children,
14
11
  series,
@@ -21,50 +18,39 @@ export const useChartContainerProps = (props, ref) => {
21
18
  plugins,
22
19
  sx,
23
20
  title,
24
- viewBox,
25
21
  xAxis,
26
22
  yAxis,
27
23
  zAxis,
28
24
  skipAnimation
29
25
  } = props,
30
26
  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
- });
27
+ const resizableContainerProps = other;
28
+ const chartsSurfaceProps = {
29
+ title,
30
+ desc,
31
+ sx,
32
+ disableAxisListener,
33
+ ref
34
+ };
43
35
  const chartDataProviderProps = {
44
36
  margin,
45
- children,
46
37
  series,
47
38
  colors,
48
39
  dataset,
49
- desc,
50
- disableAxisListener,
51
40
  highlightedItem,
52
41
  onHighlightChange,
53
42
  plugins,
54
- sx,
55
- title,
56
- viewBox,
57
43
  xAxis,
58
44
  yAxis,
59
45
  zAxis,
60
46
  skipAnimation,
61
- width: dWidth,
62
- height: dHeight,
63
- ref
47
+ width,
48
+ height
64
49
  };
65
50
  return {
66
- hasIntrinsicSize: Boolean(dWidth && dHeight),
67
51
  chartDataProviderProps,
68
- resizableChartContainerProps
52
+ resizableContainerProps,
53
+ chartsSurfaceProps,
54
+ children
69
55
  };
70
56
  };