@mui/x-charts 7.10.0 → 7.11.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 (299) hide show
  1. package/BarChart/BarChart.js +2 -2
  2. package/BarChart/BarElement.d.ts +2 -1
  3. package/BarChart/BarLabel/BarLabelItem.d.ts +2 -1
  4. package/BarChart/BarPlot.js +8 -8
  5. package/BarChart/checkScaleErrors.d.ts +4 -4
  6. package/BarChart/checkScaleErrors.js +11 -11
  7. package/BarChart/extremums.js +4 -1
  8. package/BarChart/formatter.js +2 -2
  9. package/BarChart/useBarChartProps.js +38 -33
  10. package/CHANGELOG.md +169 -0
  11. package/ChartContainer/ChartContainer.d.ts +28 -2
  12. package/ChartContainer/ChartContainer.js +25 -66
  13. package/ChartContainer/useChartContainerHooks.d.ts +1 -1
  14. package/ChartContainer/useChartContainerHooks.js +2 -2
  15. package/ChartContainer/useChartContainerProps.d.ts +86 -0
  16. package/ChartContainer/useChartContainerProps.js +95 -0
  17. package/ChartContainer/useDefaultizeAxis.d.ts +36 -0
  18. package/ChartContainer/useDefaultizeAxis.js +29 -0
  19. package/ChartsAxis/ChartsAxis.js +4 -4
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  21. package/ChartsLegend/ChartsLegend.d.ts +3 -12
  22. package/ChartsLegend/ContinuousColorLegend.d.ts +65 -0
  23. package/ChartsLegend/ContinuousColorLegend.js +398 -0
  24. package/ChartsLegend/DefaultChartsLegend.d.ts +7 -50
  25. package/ChartsLegend/DefaultChartsLegend.js +13 -198
  26. package/ChartsLegend/LegendPerItem.d.ts +61 -0
  27. package/ChartsLegend/LegendPerItem.js +151 -0
  28. package/ChartsLegend/PiecewiseColorLegend.d.ts +26 -0
  29. package/ChartsLegend/PiecewiseColorLegend.js +169 -0
  30. package/ChartsLegend/chartsLegend.types.d.ts +31 -0
  31. package/ChartsLegend/chartsLegend.types.js +5 -0
  32. package/ChartsLegend/index.d.ts +2 -0
  33. package/ChartsLegend/index.js +22 -0
  34. package/ChartsLegend/legend.types.d.ts +62 -0
  35. package/ChartsLegend/legend.types.js +5 -0
  36. package/ChartsLegend/legendItemsPlacement.d.ts +3 -0
  37. package/ChartsLegend/legendItemsPlacement.js +79 -0
  38. package/ChartsLegend/useAxis.d.ts +7 -0
  39. package/ChartsLegend/useAxis.js +47 -0
  40. package/ChartsLegend/utils.d.ts +1 -8
  41. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  42. package/ChartsOverlay/ChartsOverlay.d.ts +3 -2
  43. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  44. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  45. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  46. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  47. package/ChartsSurface.js +3 -1
  48. package/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
  49. package/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
  50. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
  51. package/ChartsXAxis/ChartsXAxis.js +1 -1
  52. package/ChartsYAxis/ChartsYAxis.js +15 -3
  53. package/Gauge/Gauge.d.ts +1 -4
  54. package/Gauge/Gauge.js +9 -6
  55. package/Gauge/GaugeContainer.js +8 -4
  56. package/Gauge/GaugeProvider.js +9 -9
  57. package/LineChart/AnimatedArea.js +2 -2
  58. package/LineChart/AnimatedLine.js +2 -2
  59. package/LineChart/AreaElement.d.ts +2 -1
  60. package/LineChart/AreaPlot.js +10 -6
  61. package/LineChart/LineChart.js +5 -2
  62. package/LineChart/LineElement.d.ts +2 -1
  63. package/LineChart/LineHighlightPlot.d.ts +2 -1
  64. package/LineChart/LineHighlightPlot.js +17 -5
  65. package/LineChart/LinePlot.js +10 -6
  66. package/LineChart/MarkElement.js +2 -2
  67. package/LineChart/MarkPlot.js +13 -25
  68. package/LineChart/extremums.js +4 -1
  69. package/LineChart/formatter.js +2 -2
  70. package/LineChart/useLineChartProps.js +38 -33
  71. package/PieChart/PieArc.js +1 -0
  72. package/PieChart/PieChart.d.ts +1 -4
  73. package/PieChart/PieChart.js +40 -34
  74. package/PieChart/PiePlot.js +6 -6
  75. package/PieChart/getPieCoordinates.js +3 -3
  76. package/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  77. package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +5 -1
  78. package/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
  79. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +20 -0
  80. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +73 -0
  81. package/ScatterChart/Scatter.js +6 -9
  82. package/ScatterChart/ScatterChart.js +4 -1
  83. package/ScatterChart/ScatterPlot.js +6 -3
  84. package/ScatterChart/extremums.js +8 -2
  85. package/ScatterChart/useScatterChartProps.js +35 -30
  86. package/SparkLineChart/SparkLineChart.js +27 -22
  87. package/context/CartesianProvider/CartesianContext.d.ts +1 -1
  88. package/context/CartesianProvider/CartesianProvider.d.ts +2 -3
  89. package/context/CartesianProvider/CartesianProvider.js +18 -7
  90. package/context/CartesianProvider/computeValue.d.ts +32 -9
  91. package/context/CartesianProvider/computeValue.js +20 -16
  92. package/context/CartesianProvider/defaultizeAxis.d.ts +36 -0
  93. package/context/CartesianProvider/defaultizeAxis.js +21 -0
  94. package/context/CartesianProvider/index.d.ts +0 -1
  95. package/context/CartesianProvider/index.js +1 -3
  96. package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
  97. package/context/CartesianProvider/normalizeAxis.js +2 -2
  98. package/context/DrawingProvider.d.ts +12 -0
  99. package/context/DrawingProvider.js +15 -2
  100. package/context/HighlightedProvider/HighlightedProvider.js +2 -2
  101. package/context/SeriesContextProvider.js +1 -1
  102. package/context/ZAxisContextProvider.d.ts +1 -1
  103. package/context/ZAxisContextProvider.js +1 -1
  104. package/esm/BarChart/BarChart.js +2 -2
  105. package/esm/BarChart/BarPlot.js +8 -8
  106. package/esm/BarChart/checkScaleErrors.js +11 -11
  107. package/esm/BarChart/extremums.js +4 -1
  108. package/esm/BarChart/formatter.js +2 -2
  109. package/esm/BarChart/useBarChartProps.js +38 -33
  110. package/esm/ChartContainer/ChartContainer.js +25 -66
  111. package/esm/ChartContainer/useChartContainerHooks.js +2 -2
  112. package/esm/ChartContainer/useChartContainerProps.js +87 -0
  113. package/esm/ChartContainer/useDefaultizeAxis.js +19 -0
  114. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  115. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  116. package/esm/ChartsLegend/ContinuousColorLegend.js +390 -0
  117. package/esm/ChartsLegend/DefaultChartsLegend.js +14 -198
  118. package/esm/ChartsLegend/LegendPerItem.js +141 -0
  119. package/esm/ChartsLegend/PiecewiseColorLegend.js +161 -0
  120. package/esm/ChartsLegend/chartsLegend.types.js +1 -0
  121. package/esm/ChartsLegend/index.js +2 -0
  122. package/esm/ChartsLegend/legend.types.js +1 -0
  123. package/esm/ChartsLegend/legendItemsPlacement.js +72 -0
  124. package/esm/ChartsLegend/useAxis.js +39 -0
  125. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  126. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  127. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  128. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  129. package/esm/ChartsSurface.js +3 -1
  130. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
  131. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
  132. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
  133. package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
  134. package/esm/ChartsYAxis/ChartsYAxis.js +15 -3
  135. package/esm/Gauge/Gauge.js +8 -5
  136. package/esm/Gauge/GaugeContainer.js +8 -4
  137. package/esm/Gauge/GaugeProvider.js +1 -1
  138. package/esm/LineChart/AnimatedArea.js +1 -1
  139. package/esm/LineChart/AnimatedLine.js +1 -1
  140. package/esm/LineChart/AreaPlot.js +10 -6
  141. package/esm/LineChart/LineChart.js +5 -2
  142. package/esm/LineChart/LineHighlightPlot.js +17 -5
  143. package/esm/LineChart/LinePlot.js +10 -6
  144. package/esm/LineChart/MarkElement.js +1 -1
  145. package/esm/LineChart/MarkPlot.js +12 -24
  146. package/esm/LineChart/extremums.js +4 -1
  147. package/esm/LineChart/formatter.js +2 -2
  148. package/esm/LineChart/useLineChartProps.js +38 -33
  149. package/esm/PieChart/PieArc.js +1 -0
  150. package/esm/PieChart/PieChart.js +39 -33
  151. package/esm/PieChart/PiePlot.js +1 -1
  152. package/esm/PieChart/getPieCoordinates.js +1 -1
  153. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  154. package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
  155. package/esm/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
  156. package/esm/ScatterChart/Scatter.js +6 -9
  157. package/esm/ScatterChart/ScatterChart.js +4 -1
  158. package/esm/ScatterChart/ScatterPlot.js +6 -3
  159. package/esm/ScatterChart/extremums.js +8 -2
  160. package/esm/ScatterChart/useScatterChartProps.js +35 -30
  161. package/esm/SparkLineChart/SparkLineChart.js +27 -22
  162. package/esm/context/CartesianProvider/CartesianProvider.js +18 -7
  163. package/esm/context/CartesianProvider/computeValue.js +20 -16
  164. package/esm/context/CartesianProvider/defaultizeAxis.js +13 -0
  165. package/esm/context/CartesianProvider/index.js +1 -3
  166. package/esm/context/CartesianProvider/normalizeAxis.js +2 -2
  167. package/esm/context/DrawingProvider.js +15 -2
  168. package/esm/context/HighlightedProvider/HighlightedProvider.js +2 -2
  169. package/esm/context/SeriesContextProvider.js +1 -1
  170. package/esm/context/ZAxisContextProvider.js +1 -1
  171. package/esm/hooks/useAxisEvents.js +14 -17
  172. package/esm/hooks/useDrawingArea.js +5 -3
  173. package/esm/hooks/useReducedMotion.js +4 -2
  174. package/esm/internals/SlotComponentPropsFromProps.js +1 -0
  175. package/esm/internals/cleanId.js +6 -0
  176. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  177. package/esm/internals/geometry.js +1 -1
  178. package/esm/internals/{utils.js → getPercentageValue.js} +1 -13
  179. package/esm/internals/getSymbol.js +5 -0
  180. package/esm/internals/index.js +3 -1
  181. package/esm/internals/isDefined.js +3 -0
  182. package/esm/internals/notNull.js +3 -0
  183. package/esm/internals/ts-generic.js +1 -0
  184. package/esm/internals/warning.js +19 -11
  185. package/hooks/useAxisEvents.js +14 -17
  186. package/hooks/useDrawingArea.js +5 -3
  187. package/hooks/useReducedMotion.js +4 -2
  188. package/index.js +1 -1
  189. package/internals/SlotComponentPropsFromProps.d.ts +1 -0
  190. package/internals/SlotComponentPropsFromProps.js +5 -0
  191. package/internals/cleanId.d.ts +4 -0
  192. package/internals/cleanId.js +12 -0
  193. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +6 -0
  194. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  195. package/internals/defaultizeColor.d.ts +7 -0
  196. package/internals/geometry.js +1 -1
  197. package/internals/getPercentageValue.d.ts +7 -0
  198. package/internals/{utils.js → getPercentageValue.js} +1 -15
  199. package/internals/getSymbol.d.ts +2 -0
  200. package/internals/getSymbol.js +11 -0
  201. package/internals/index.d.ts +3 -1
  202. package/internals/index.js +25 -5
  203. package/internals/isDefined.d.ts +1 -0
  204. package/internals/isDefined.js +9 -0
  205. package/internals/notNull.d.ts +1 -0
  206. package/internals/notNull.js +9 -0
  207. package/internals/ts-generic.d.ts +5 -0
  208. package/internals/ts-generic.js +5 -0
  209. package/internals/warning.d.ts +2 -1
  210. package/internals/warning.js +21 -12
  211. package/models/axis.d.ts +5 -2
  212. package/models/helpers.d.ts +1 -0
  213. package/models/seriesType/common.d.ts +10 -0
  214. package/models/seriesType/config.d.ts +2 -16
  215. package/models/seriesType/scatter.d.ts +5 -0
  216. package/modern/BarChart/BarChart.js +2 -2
  217. package/modern/BarChart/BarPlot.js +8 -8
  218. package/modern/BarChart/checkScaleErrors.js +11 -11
  219. package/modern/BarChart/extremums.js +4 -1
  220. package/modern/BarChart/formatter.js +2 -2
  221. package/modern/BarChart/useBarChartProps.js +38 -33
  222. package/modern/ChartContainer/ChartContainer.js +25 -66
  223. package/modern/ChartContainer/useChartContainerHooks.js +2 -2
  224. package/modern/ChartContainer/useChartContainerProps.js +87 -0
  225. package/modern/ChartContainer/useDefaultizeAxis.js +19 -0
  226. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  227. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  228. package/modern/ChartsLegend/ContinuousColorLegend.js +390 -0
  229. package/modern/ChartsLegend/DefaultChartsLegend.js +14 -198
  230. package/modern/ChartsLegend/LegendPerItem.js +141 -0
  231. package/modern/ChartsLegend/PiecewiseColorLegend.js +161 -0
  232. package/modern/ChartsLegend/chartsLegend.types.js +1 -0
  233. package/modern/ChartsLegend/index.js +2 -0
  234. package/modern/ChartsLegend/legend.types.js +1 -0
  235. package/modern/ChartsLegend/legendItemsPlacement.js +72 -0
  236. package/modern/ChartsLegend/useAxis.js +39 -0
  237. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  238. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  239. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  240. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  241. package/modern/ChartsSurface.js +3 -1
  242. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
  243. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
  244. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
  245. package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
  246. package/modern/ChartsYAxis/ChartsYAxis.js +15 -3
  247. package/modern/Gauge/Gauge.js +8 -5
  248. package/modern/Gauge/GaugeContainer.js +8 -4
  249. package/modern/Gauge/GaugeProvider.js +1 -1
  250. package/modern/LineChart/AnimatedArea.js +1 -1
  251. package/modern/LineChart/AnimatedLine.js +1 -1
  252. package/modern/LineChart/AreaPlot.js +10 -6
  253. package/modern/LineChart/LineChart.js +5 -2
  254. package/modern/LineChart/LineHighlightPlot.js +17 -5
  255. package/modern/LineChart/LinePlot.js +10 -6
  256. package/modern/LineChart/MarkElement.js +1 -1
  257. package/modern/LineChart/MarkPlot.js +12 -24
  258. package/modern/LineChart/extremums.js +4 -1
  259. package/modern/LineChart/formatter.js +2 -2
  260. package/modern/LineChart/useLineChartProps.js +38 -33
  261. package/modern/PieChart/PieArc.js +1 -0
  262. package/modern/PieChart/PieChart.js +39 -33
  263. package/modern/PieChart/PiePlot.js +1 -1
  264. package/modern/PieChart/getPieCoordinates.js +1 -1
  265. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  266. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
  267. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
  268. package/modern/ScatterChart/Scatter.js +6 -9
  269. package/modern/ScatterChart/ScatterChart.js +4 -1
  270. package/modern/ScatterChart/ScatterPlot.js +6 -3
  271. package/modern/ScatterChart/extremums.js +8 -2
  272. package/modern/ScatterChart/useScatterChartProps.js +35 -30
  273. package/modern/SparkLineChart/SparkLineChart.js +27 -22
  274. package/modern/context/CartesianProvider/CartesianProvider.js +18 -7
  275. package/modern/context/CartesianProvider/computeValue.js +20 -16
  276. package/modern/context/CartesianProvider/defaultizeAxis.js +13 -0
  277. package/modern/context/CartesianProvider/index.js +1 -3
  278. package/modern/context/CartesianProvider/normalizeAxis.js +2 -2
  279. package/modern/context/DrawingProvider.js +15 -2
  280. package/modern/context/HighlightedProvider/HighlightedProvider.js +2 -2
  281. package/modern/context/SeriesContextProvider.js +1 -1
  282. package/modern/context/ZAxisContextProvider.js +1 -1
  283. package/modern/hooks/useAxisEvents.js +14 -17
  284. package/modern/hooks/useDrawingArea.js +5 -3
  285. package/modern/hooks/useReducedMotion.js +4 -2
  286. package/modern/index.js +1 -1
  287. package/modern/internals/SlotComponentPropsFromProps.js +1 -0
  288. package/modern/internals/cleanId.js +6 -0
  289. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  290. package/modern/internals/geometry.js +1 -1
  291. package/modern/internals/{utils.js → getPercentageValue.js} +1 -13
  292. package/modern/internals/getSymbol.js +5 -0
  293. package/modern/internals/index.js +3 -1
  294. package/modern/internals/isDefined.js +3 -0
  295. package/modern/internals/notNull.js +3 -0
  296. package/modern/internals/ts-generic.js +1 -0
  297. package/modern/internals/warning.js +19 -11
  298. package/package.json +4 -4
  299. package/internals/utils.d.ts +0 -18
@@ -52,8 +52,8 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
52
52
  ref: ref
53
53
  }, chartContainerProps, {
54
54
  children: [props.onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, (0, _extends2.default)({}, axisClickHandlerProps)), props.grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
55
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps))]
56
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltipProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
55
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
56
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltipProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
57
57
  }));
58
58
  });
59
59
  process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { AnimatedProps } from '@react-spring/web';
3
+ import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
3
4
  import { SeriesId } from '../models/seriesType/common';
4
5
  export interface BarElementClasses {
5
6
  /** Styles applied to the root element. */
@@ -1365,7 +1366,7 @@ export interface BarElementSlots {
1365
1366
  bar?: React.ElementType<BarProps>;
1366
1367
  }
1367
1368
  export interface BarElementSlotProps {
1368
- bar?: Partial<BarProps>;
1369
+ bar?: SlotComponentPropsFromProps<BarProps, {}, BarElementOwnerState>;
1369
1370
  }
1370
1371
  export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.SVGProps<SVGRectElement>, 'ref' | 'id'> & {
1371
1372
  /**
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { SlotComponentPropsFromProps } from '../../internals/SlotComponentPropsFromProps';
2
3
  import { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
3
4
  import { BarLabelProps } from './BarLabel';
4
5
  export interface BarLabelSlots {
@@ -9,7 +10,7 @@ export interface BarLabelSlots {
9
10
  barLabel?: React.JSXElementConstructor<BarLabelProps>;
10
11
  }
11
12
  export interface BarLabelSlotProps {
12
- barLabel?: Partial<BarLabelProps>;
13
+ barLabel?: SlotComponentPropsFromProps<BarLabelProps, {}, BarLabelOwnerState>;
13
14
  }
14
15
  export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighlighted'> & Pick<BarLabelProps, 'style'> & {
15
16
  /**
@@ -74,16 +74,16 @@ const useAggregatedData = () => {
74
74
  ids: groupIds
75
75
  }, groupIndex) => {
76
76
  return groupIds.flatMap(seriesId => {
77
- const xAxisKey = series[seriesId].xAxisKey ?? defaultXAxisId;
78
- const yAxisKey = series[seriesId].yAxisKey ?? defaultYAxisId;
79
- const xAxisConfig = xAxis[xAxisKey];
80
- const yAxisConfig = yAxis[yAxisKey];
77
+ const xAxisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey ?? defaultXAxisId;
78
+ const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey ?? defaultYAxisId;
79
+ const xAxisConfig = xAxis[xAxisId];
80
+ const yAxisConfig = yAxis[yAxisId];
81
81
  const verticalLayout = series[seriesId].layout === 'vertical';
82
- (0, _checkScaleErrors.checkScaleErrors)(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis);
82
+ (0, _checkScaleErrors.checkScaleErrors)(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis);
83
83
  const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
84
84
  const xScale = xAxisConfig.scale;
85
85
  const yScale = yAxisConfig.scale;
86
- const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisKey], yAxis[yAxisKey]);
86
+ const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
87
87
  const bandWidth = baseScaleConfig.scale.bandwidth();
88
88
  const {
89
89
  barWidth,
@@ -106,8 +106,8 @@ const useAggregatedData = () => {
106
106
  seriesId,
107
107
  dataIndex,
108
108
  layout: series[seriesId].layout,
109
- x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : minValueCoord,
110
- y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
109
+ x: verticalLayout ? xScale(xAxis[xAxisId].data?.[dataIndex]) + barOffset : minValueCoord,
110
+ y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisId].data?.[dataIndex]) + barOffset,
111
111
  xOrigin: xScale(0),
112
112
  yOrigin: yScale(0),
113
113
  height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
@@ -1,7 +1,7 @@
1
1
  import { AxisDefaultized, AxisId } from '../models/axis';
2
2
  import { SeriesId } from '../models/seriesType/common';
3
- export declare function checkScaleErrors(verticalLayout: boolean, seriesId: SeriesId, xAxisKey: AxisId, xAxis: {
4
- [axisKey: AxisId]: AxisDefaultized;
5
- }, yAxisKey: AxisId, yAxis: {
6
- [axisKey: AxisId]: AxisDefaultized;
3
+ export declare function checkScaleErrors(verticalLayout: boolean, seriesId: SeriesId, xAxisId: AxisId, xAxis: {
4
+ [axisId: AxisId]: AxisDefaultized;
5
+ }, yAxisId: AxisId, yAxis: {
6
+ [axisId: AxisId]: AxisDefaultized;
7
7
  }): void;
@@ -6,28 +6,28 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.checkScaleErrors = checkScaleErrors;
7
7
  var _constants = require("../constants");
8
8
  var _axis = require("../models/axis");
9
- const getAxisMessage = (axisDirection, axisKey) => {
9
+ const getAxisMessage = (axisDirection, axisId) => {
10
10
  const axisName = `${axisDirection}-axis`;
11
- const axisKeyName = `${axisDirection}Axis`;
11
+ const axisIdName = `${axisDirection}Axis`;
12
12
  const axisDefaultKey = axisDirection === 'x' ? _constants.DEFAULT_X_AXIS_KEY : _constants.DEFAULT_Y_AXIS_KEY;
13
- return axisKey === axisDefaultKey ? `The first \`${axisKeyName}\`` : `The ${axisName} with id "${axisKey}"`;
13
+ return axisId === axisDefaultKey ? `The first \`${axisIdName}\`` : `The ${axisName} with id "${axisId}"`;
14
14
  };
15
- function checkScaleErrors(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis) {
16
- const xAxisConfig = xAxis[xAxisKey];
17
- const yAxisConfig = yAxis[yAxisKey];
15
+ function checkScaleErrors(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis) {
16
+ const xAxisConfig = xAxis[xAxisId];
17
+ const yAxisConfig = yAxis[yAxisId];
18
18
  const discreteAxisConfig = verticalLayout ? xAxisConfig : yAxisConfig;
19
19
  const continuousAxisConfig = verticalLayout ? yAxisConfig : xAxisConfig;
20
- const discreteAxisKey = verticalLayout ? xAxisKey : yAxisKey;
21
- const continuousAxisKey = verticalLayout ? yAxisKey : xAxisKey;
20
+ const discreteAxisId = verticalLayout ? xAxisId : yAxisId;
21
+ const continuousAxisId = verticalLayout ? yAxisId : xAxisId;
22
22
  const discreteAxisDirection = verticalLayout ? 'x' : 'y';
23
23
  const continuousAxisDirection = verticalLayout ? 'y' : 'x';
24
24
  if (!(0, _axis.isBandScaleConfig)(discreteAxisConfig)) {
25
- throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should be of type "band" to display the bar series of id "${seriesId}".`);
25
+ throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should be of type "band" to display the bar series of id "${seriesId}".`);
26
26
  }
27
27
  if (discreteAxisConfig.data === undefined) {
28
- throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should have data property.`);
28
+ throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should have data property.`);
29
29
  }
30
30
  if ((0, _axis.isBandScaleConfig)(continuousAxisConfig) || (0, _axis.isPointScaleConfig)(continuousAxisConfig)) {
31
- throw new Error(`MUI X Charts: ${getAxisMessage(continuousAxisDirection, continuousAxisKey)} should be a continuous type to display the bar series of id "${seriesId}".`);
31
+ throw new Error(`MUI X: ${getAxisMessage(continuousAxisDirection, continuousAxisId)} should be a continuous type to display the bar series of id "${seriesId}".`);
32
32
  }
33
33
  }
@@ -18,7 +18,10 @@ const getValueExtremum = params => {
18
18
  axis,
19
19
  isDefaultAxis
20
20
  } = params;
21
- return Object.keys(series).filter(seriesId => series[seriesId].yAxisKey === axis.id || isDefaultAxis && series[seriesId].yAxisKey === undefined).reduce((acc, seriesId) => {
21
+ return Object.keys(series).filter(seriesId => {
22
+ const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
23
+ return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
24
+ }).reduce((acc, seriesId) => {
22
25
  const [seriesMin, seriesMax] = series[seriesId].stackedData?.reduce((seriesAcc, values) => [Math.min(...values, ...(seriesAcc[0] === null ? [] : [seriesAcc[0]])), Math.max(...values, ...(seriesAcc[1] === null ? [] : [seriesAcc[1]]))], series[seriesId].stackedData[0]) ?? [null, null];
23
26
  return [acc[0] === null ? seriesMin : Math.min(seriesMin, acc[0]), acc[1] === null ? seriesMax : Math.max(seriesMax, acc[1])];
24
27
  }, [null, null]);
@@ -32,7 +32,7 @@ const formatter = (params, dataset) => {
32
32
  }
33
33
  });
34
34
  } else if (dataset === undefined) {
35
- throw new Error([`MUI X Charts: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
35
+ throw new Error([`MUI X: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
36
36
  }
37
37
  });
38
38
  const completedSeries = {};
@@ -59,7 +59,7 @@ const formatter = (params, dataset) => {
59
59
  if (typeof value !== 'number') {
60
60
  if (process.env.NODE_ENV !== 'production' && !warnOnce && value !== null) {
61
61
  warnOnce = true;
62
- console.error([`MUI-X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
62
+ console.error([`MUI X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.'].join('\n'));
63
63
  }
64
64
  return 0;
65
65
  }
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.useBarChartProps = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
10
  var _useId = _interopRequireDefault(require("@mui/utils/useId"));
10
11
  var _constants = require("../constants");
12
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className"];
11
13
  /**
12
14
  * A helper function that extracts BarChartProps from the input props
13
15
  * and returns an object with props for the children components of BarChart.
@@ -17,36 +19,38 @@ var _constants = require("../constants");
17
19
  */
18
20
  const useBarChartProps = props => {
19
21
  const {
20
- xAxis,
21
- yAxis,
22
- series,
23
- width,
24
- height,
25
- margin,
26
- colors,
27
- dataset,
28
- sx,
29
- tooltip,
30
- onAxisClick,
31
- axisHighlight,
32
- legend,
33
- grid,
34
- topAxis,
35
- leftAxis,
36
- rightAxis,
37
- bottomAxis,
38
- children,
39
- slots,
40
- slotProps,
41
- skipAnimation,
42
- loading,
43
- layout,
44
- onItemClick,
45
- highlightedItem,
46
- onHighlightChange,
47
- borderRadius,
48
- barLabel
49
- } = props;
22
+ xAxis,
23
+ yAxis,
24
+ series,
25
+ width,
26
+ height,
27
+ margin,
28
+ colors,
29
+ dataset,
30
+ sx,
31
+ tooltip,
32
+ onAxisClick,
33
+ axisHighlight,
34
+ legend,
35
+ grid,
36
+ topAxis,
37
+ leftAxis,
38
+ rightAxis,
39
+ bottomAxis,
40
+ children,
41
+ slots,
42
+ slotProps,
43
+ skipAnimation,
44
+ loading,
45
+ layout,
46
+ onItemClick,
47
+ highlightedItem,
48
+ onHighlightChange,
49
+ borderRadius,
50
+ barLabel,
51
+ className
52
+ } = props,
53
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
50
54
  const id = (0, _useId.default)();
51
55
  const clipPathId = `${id}-clip-path`;
52
56
  const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
@@ -56,7 +60,7 @@ const useBarChartProps = props => {
56
60
  length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
57
61
  }, (_, index) => index)
58
62
  };
59
- const chartContainerProps = {
63
+ const chartContainerProps = (0, _extends2.default)({}, rest, {
60
64
  series: series.map(s => (0, _extends2.default)({
61
65
  type: 'bar'
62
66
  }, s, {
@@ -76,8 +80,9 @@ const useBarChartProps = props => {
76
80
  sx,
77
81
  highlightedItem,
78
82
  onHighlightChange,
79
- disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick
80
- };
83
+ disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
84
+ className
85
+ });
81
86
  const barPlotProps = {
82
87
  onItemClick,
83
88
  slots,
package/CHANGELOG.md CHANGED
@@ -3,6 +3,175 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.11.1
7
+
8
+ _Jul 25, 2024_
9
+
10
+ We'd like to offer a big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🔎 Allow `Zoom` to be controllable for charts (#13858) @JCQuintas
13
+ - 🌍 Add Icelandic (is-IS) and Norwegian Nynorsk (nn-NO) locales on the Data Grid
14
+ - 🌍 Improve Norwegian Bokmål (nb-NO) and German (de-DE) locales on the Data Grid
15
+ - 🌍 Add Norwegian Nynorsk (nn-NO) locale on the Date and Time Pickers
16
+ - 🐞 Bugfixes
17
+ - 📚 Documentation improvements
18
+
19
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
20
+
21
+ ### Data Grid
22
+
23
+ #### `@mui/x-data-grid@7.11.1`
24
+
25
+ - [DataGrid] Remove dead code in internal `GridPreferencesPanel` (#13934) @k-rajat19
26
+ - [DataGrid] Do not miss to escape formulas in CSV export (#13888) @arminmeh
27
+ - [l10n] Add Icelandic (is-IS) locale (#13283) @magnimarels
28
+ - [l10n] Add Norwegian nynorsk (nn-NO) locale and improve Norwegian bokmål (nb-NO) locale (#13588) @AnderzL7
29
+ - [l10n] Improve German (de-DE) locale (#13910) @lhilgert9
30
+
31
+ #### `@mui/x-data-grid-pro@7.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
32
+
33
+ Same changes as in `@mui/x-data-grid@7.11.1`.
34
+
35
+ #### `@mui/x-data-grid-premium@7.11.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
36
+
37
+ Same changes as in `@mui/x-data-grid-pro@7.11.1`, plus:
38
+
39
+ - [DataGridPremium] Pass the `api` object to events (#13893) @pcorpet
40
+ - [DataGridPremium] Fix paste to selected cells (#13967) @romgrk
41
+
42
+ ### Date and Time Pickers
43
+
44
+ #### `@mui/x-date-pickers@7.11.1`
45
+
46
+ - [fields] Prevent keyboard editing when disabled (#13900) @arthurbalduini
47
+ - [l10n] Add Norwegian Nynorsk (nn-NO) locale (#13946) @AnderzL7
48
+
49
+ #### `@mui/x-date-pickers-pro@7.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-date-pickers@7.11.1`.
52
+
53
+ ### Charts
54
+
55
+ #### `@mui/x-charts@7.11.1`
56
+
57
+ - [charts] Add `ownerState` function to `slotProps` typing when available (#13965) @alexfauquette
58
+ - [charts] Allow `Zoom` to be controllable (#13858) @JCQuintas
59
+ - [charts] Deprecate `xAxisKey` /`zAxisKey` in favor of `xAxisId`/`zAxisId` (#13940) @alexfauquette
60
+ - [charts] Hide empty arcs in the PieChart (#13897) @alexfauquette
61
+ - [charts] Limit the trigger of exit charts (#13682) @alexfauquette
62
+
63
+ ### Tree View
64
+
65
+ #### `@mui/x-tree-view@7.11.1`
66
+
67
+ - [TreeView] Allow the plugins to enrich the props passed to the item slots (#13953) @flaviendelangle
68
+
69
+ ### Docs
70
+
71
+ - [docs] Bump pnpm priority as a package manager (#13894) @oliviertassinari
72
+ - [docs] Explicitly mark charts pro as not released (#13905) @alexfauquette
73
+ - [docs] Fix dot consistency a11y table @oliviertassinari
74
+ - [docs] Fix some typos in charts docs (#13906) @cratiu222
75
+ - [docs] Fix spelling (#13902) @nnsW3
76
+ - [docs] Improve error message when moving between plans (#13874) @oliviertassinari
77
+ - [docs] Update `SparkLineChart` reference not being correctly capitalised (#13960) @duckboy81
78
+ - [docs] Fix scroll demos disorientation (#13909) @oliviertassinari
79
+
80
+ ### Core
81
+
82
+ - [core] Add `@mui/material-nextjs` to `MUI Core` renovate group (#13966) @LukasTy
83
+ - [core] Remove warning message in production (#13911) @oliviertassinari
84
+ - [code-infra] Reuse `useReactVersion` script from the monorepo (#13710) @cherniavskii
85
+ - [infra] Adds order id validation action (#13957) @michelengelen
86
+ - [infra] Fix order id validator action (#13971) @michelengelen
87
+ - [infra] Fix regex in order id validation (#13976) @michelengelen
88
+ - [infra] Issue template improvement (#13954) @michelengelen
89
+
90
+ ## 7.11.0
91
+
92
+ _Jul 18, 2024_
93
+
94
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
95
+
96
+ - 🎨 Add [color legend](https://mui.com/x/react-charts/legend/#color-legend) for charts (#13700) @alexfauquette
97
+ - 🌍 Improve Korean (ko-KR) locale on the Date and Time Pickers
98
+ - 🌍 Improve Russian (ru-RU) locale on the Date and Time Pickers and Data Grid
99
+ - 🐞 Bugfixes
100
+ - 📚 Documentation improvements
101
+
102
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
103
+
104
+ ### Data Grid
105
+
106
+ #### `@mui/x-data-grid@7.11.0`
107
+
108
+ - [DataGrid] Expose `gridEditRowsStateSelector` (#13877) @romgrk
109
+ - [DataGrid] Fix `columnResizeStop` event not emitted when column is not resized (#13307) @mateuseap
110
+ - [DataGrid] Fix delete filter inconsistent behavior (#13353) @oukunan
111
+ - [DataGrid] Enable flip on preferences panel (#13803) @romgrk
112
+ - [DataGrid] Support `date` and `datetime-local` input types in `GridFilterInputMultipleValue` type (#13411) @karudedios
113
+ - [l10n] Improve Russian (ru-RU) locale (#13735) @diro-atk
114
+
115
+ #### `@mui/x-data-grid-pro@7.11.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
116
+
117
+ Same changes as in `@mui/x-data-grid@7.11.0`.
118
+
119
+ #### `@mui/x-data-grid-premium@7.11.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
120
+
121
+ Same changes as in `@mui/x-data-grid-pro@7.11.0`.
122
+
123
+ ### Date and Time Pickers
124
+
125
+ #### `@mui/x-date-pickers@7.11.0`
126
+
127
+ - [l10n] Improve Korean (ko-KR) locale (#13651) @100pearlcent
128
+ - [l10n] Improve Russian (ru-RU) locale (#13871) @Inv1x
129
+ - [pickers] Add more conformance tests improving API docs precision (#13800) @LukasTy
130
+ - [TimePicker] Add `Mui-selected` class to `TimeClock` meridiem buttons (#13848) @LukasTy
131
+
132
+ #### `@mui/x-date-pickers-pro@7.11.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
133
+
134
+ Same changes as in `@mui/x-date-pickers@7.11.0`, plus:
135
+
136
+ - [DateRangePicker] Fix `name` prop propagation regression (#13821) @LukasTy
137
+
138
+ ### Charts
139
+
140
+ #### `@mui/x-charts@7.11.0`
141
+
142
+ - [charts] Create color legend (#13700) @alexfauquette
143
+ - [charts] Defaultize axis on top level `useChartContainerProps` (#13817) @JCQuintas
144
+ - [charts] Fix charts not passing `className` to root element (#13647) @JCQuintas
145
+ - [charts] Generate API documentation for pro components (#13822) @alexfauquette
146
+ - [charts] Improve zoomed highlight behaviour (unreleased) (#13868) @JCQuintas
147
+ - [charts] Allow zoom on Y axis and add zoom options to configure zooming behaviour (unreleased) (#13726) @JCQuintas
148
+ - [charts] Disable animations while zooming (unreleased) (#13807) @JCQuintas
149
+
150
+ ### Tree View
151
+
152
+ #### `@mui/x-tree-view@7.11.0`
153
+
154
+ - [TreeView] Extract some logic outside of the `useTreeView` hook (#13845) @flaviendelangle
155
+
156
+ ### Docs
157
+
158
+ - [docs] Add warning about `process.env.NODE_ENV` in production (#13869) @cherniavskii
159
+ - [docs] Allow controlling the demo form from the example (#13796) @JCQuintas
160
+ - [docs] Clarify Pickers clearable behavior not working on mobile (#13786) @lnhrdt
161
+ - [docs] Improve the documentation of the picker's `onChange` and `onAccept` props (#13543) @flaviendelangle
162
+ - [docs] Replace company name with project name @oliviertassinari
163
+ - [docs] Sort Pickers & Charts API slots alphabetically (#13843) @LukasTy
164
+
165
+ ### Core
166
+
167
+ - [core] Add MUI Internal `renovate` group (#13846) @LukasTy
168
+ - [core] Link GitHub issue for `import/prefer-default-export` rule @oliviertassinari
169
+ - [core] Normalize `...other` and test imports in charts (#13844) @JCQuintas
170
+ - [core] Normalize rest / other to match the most common used @oliviertassinari
171
+ - [code-infra] Follow `next` tag for `@mui/docs` package bumps (#13813) @LukasTy
172
+ - [code-infra] Use specific version for `@mui/docs` dependency (#13760) @LukasTy
173
+ - [internals] Move `EventManager` to `@mui/x-internals` package (#13815) @flaviendelangle
174
+
6
175
  ## 7.10.0
7
176
 
8
177
  _Jul 11, 2024_
@@ -6,7 +6,21 @@ import { CartesianContextProviderProps } from '../context/CartesianProvider';
6
6
  import { HighlightedProviderProps, ZAxisContextProviderProps } from '../context';
7
7
  import { ChartsPluginType } from '../models/plugin';
8
8
  import { ChartSeriesType } from '../models/seriesType/config';
9
- export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, 'seriesFormatters'> & Omit<DrawingProviderProps, 'svgRef'> & Omit<CartesianContextProviderProps, 'xExtremumGetters' | 'yExtremumGetters'> & ZAxisContextProviderProps & HighlightedProviderProps, 'children'> & {
9
+ import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
10
+ import { MakeOptional } from '../models/helpers';
11
+ export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, 'seriesFormatters'> & Omit<DrawingProviderProps, 'svgRef'> & Pick<CartesianContextProviderProps, 'dataset'> & ZAxisContextProviderProps & HighlightedProviderProps, 'children'> & {
12
+ /**
13
+ * The configuration of the x-axes.
14
+ * If not provided, a default axis config is used.
15
+ * An array of [[AxisConfig]] objects.
16
+ */
17
+ xAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsXAxisProps>, 'id'>[];
18
+ /**
19
+ * The configuration of the y-axes.
20
+ * If not provided, a default axis config is used.
21
+ * An array of [[AxisConfig]] objects.
22
+ */
23
+ yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, 'id'>[];
10
24
  children?: React.ReactNode;
11
25
  /**
12
26
  * An array of plugins defining how to preprocess data.
@@ -14,7 +28,19 @@ export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextPr
14
28
  */
15
29
  plugins?: ChartsPluginType<ChartSeriesType>[];
16
30
  };
17
- declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> & Omit<CartesianContextProviderProps, "xExtremumGetters" | "yExtremumGetters"> & ZAxisContextProviderProps & HighlightedProviderProps, "children"> & {
31
+ declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> & Pick<CartesianContextProviderProps, "dataset"> & ZAxisContextProviderProps & HighlightedProviderProps, "children"> & {
32
+ /**
33
+ * The configuration of the x-axes.
34
+ * If not provided, a default axis config is used.
35
+ * An array of [[AxisConfig]] objects.
36
+ */
37
+ xAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsXAxisProps>, "id">[];
38
+ /**
39
+ * The configuration of the y-axes.
40
+ * If not provided, a default axis config is used.
41
+ * An array of [[AxisConfig]] objects.
42
+ */
43
+ yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, "id">[];
18
44
  children?: React.ReactNode;
19
45
  /**
20
46
  * An array of plugins defining how to preprocess data.
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ChartContainer = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var React = _interopRequireWildcard(require("react"));
9
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
11
  var _DrawingProvider = require("../context/DrawingProvider");
@@ -15,80 +16,38 @@ var _ChartsSurface = require("../ChartsSurface");
15
16
  var _CartesianProvider = require("../context/CartesianProvider");
16
17
  var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
17
18
  var _context = require("../context");
18
- var _useChartContainerHooks = require("./useChartContainerHooks");
19
+ var _useChartContainerProps = require("./useChartContainerProps");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
23
  const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
23
24
  const {
24
- width,
25
- height,
26
- series,
27
- margin,
28
- xAxis,
29
- yAxis,
30
- zAxis,
31
- colors,
32
- dataset,
33
- sx,
34
- title,
35
- desc,
36
- disableAxisListener,
37
- highlightedItem,
38
- onHighlightChange,
39
- plugins,
40
- children
41
- } = props;
42
- const {
43
- svgRef,
44
- handleRef,
45
- xExtremumGetters,
46
- yExtremumGetters,
47
- seriesFormatters,
48
- colorProcessors
49
- } = (0, _useChartContainerHooks.useChartContainerHooks)(ref, plugins);
50
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, {
51
- width: width,
52
- height: height,
53
- margin: margin,
54
- svgRef: svgRef,
55
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorProvider.ColorProvider, {
56
- colorProcessors: colorProcessors,
57
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, {
58
- series: series,
59
- colors: colors,
60
- dataset: dataset,
61
- seriesFormatters: seriesFormatters,
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianProvider.CartesianContextProvider, {
63
- xAxis: xAxis,
64
- yAxis: yAxis,
65
- dataset: dataset,
66
- xExtremumGetters: xExtremumGetters,
67
- yExtremumGetters: yExtremumGetters,
68
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, {
69
- zAxis: zAxis,
70
- dataset: dataset,
25
+ children,
26
+ drawingProviderProps,
27
+ colorProviderProps,
28
+ seriesContextProps,
29
+ cartesianContextProps,
30
+ zAxisContextProps,
31
+ highlightedProviderProps,
32
+ chartsSurfaceProps
33
+ } = (0, _useChartContainerProps.useChartContainerProps)(props, ref);
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, (0, _extends2.default)({}, drawingProviderProps, {
35
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorProvider.ColorProvider, (0, _extends2.default)({}, colorProviderProps, {
36
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, (0, _extends2.default)({}, seriesContextProps, {
37
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianProvider.CartesianContextProvider, (0, _extends2.default)({}, cartesianContextProps, {
38
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, (0, _extends2.default)({}, zAxisContextProps, {
71
39
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InteractionProvider.InteractionProvider, {
72
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, {
73
- highlightedItem: highlightedItem,
74
- onHighlightChange: onHighlightChange,
75
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, {
76
- width: width,
77
- height: height,
78
- ref: handleRef,
79
- sx: sx,
80
- title: title,
81
- desc: desc,
82
- disableAxisListener: disableAxisListener,
40
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, (0, _extends2.default)({}, highlightedProviderProps, {
41
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
83
42
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxesGradients.ChartsAxesGradients, {}), children]
84
- })
85
- })
43
+ }))
44
+ }))
86
45
  })
87
- })
88
- })
89
- })
90
- })
91
- });
46
+ }))
47
+ }))
48
+ }))
49
+ }))
50
+ }));
92
51
  });
93
52
  process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
94
53
  // ----------------------------- Warning --------------------------------
@@ -3,7 +3,7 @@ import { ChartsPluginType } from '../models';
3
3
  import { ChartSeriesType } from '../models/seriesType/config';
4
4
  export declare const useChartContainerHooks: (ref: React.ForwardedRef<unknown> | null, plugins?: ChartsPluginType<ChartSeriesType>[]) => {
5
5
  svgRef: React.RefObject<SVGSVGElement>;
6
- handleRef: ((instance: unknown) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
6
+ chartSurfaceRef: ((instance: unknown) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
7
7
  xExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
8
8
  yExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
9
9
  seriesFormatters: import("../internals").SeriesFormatterConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
@@ -13,7 +13,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
13
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
14
  const useChartContainerHooks = (ref, plugins) => {
15
15
  const svgRef = React.useRef(null);
16
- const handleRef = (0, _useForkRef.default)(ref, svgRef);
16
+ const chartSurfaceRef = (0, _useForkRef.default)(ref, svgRef);
17
17
  const {
18
18
  xExtremumGetters,
19
19
  yExtremumGetters,
@@ -24,7 +24,7 @@ const useChartContainerHooks = (ref, plugins) => {
24
24
 
25
25
  return {
26
26
  svgRef,
27
- handleRef,
27
+ chartSurfaceRef,
28
28
  xExtremumGetters,
29
29
  yExtremumGetters,
30
30
  seriesFormatters,