@mui/x-charts 7.9.0 → 7.11.0

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 (222) hide show
  1. package/BarChart/BarChart.js +2 -2
  2. package/BarChart/formatter.js +1 -1
  3. package/BarChart/useBarChartProps.js +38 -33
  4. package/CHANGELOG.md +159 -0
  5. package/ChartContainer/ChartContainer.d.ts +28 -2
  6. package/ChartContainer/ChartContainer.js +25 -66
  7. package/ChartContainer/useChartContainerHooks.d.ts +1 -1
  8. package/ChartContainer/useChartContainerHooks.js +2 -2
  9. package/ChartContainer/useChartContainerProps.d.ts +86 -0
  10. package/ChartContainer/useChartContainerProps.js +95 -0
  11. package/ChartContainer/useDefaultizeAxis.d.ts +36 -0
  12. package/ChartContainer/useDefaultizeAxis.js +29 -0
  13. package/ChartsLegend/ChartsLegend.d.ts +3 -12
  14. package/ChartsLegend/ContinuousColorLegend.d.ts +65 -0
  15. package/ChartsLegend/ContinuousColorLegend.js +398 -0
  16. package/ChartsLegend/DefaultChartsLegend.d.ts +7 -50
  17. package/ChartsLegend/DefaultChartsLegend.js +13 -198
  18. package/ChartsLegend/LegendPerItem.d.ts +61 -0
  19. package/ChartsLegend/LegendPerItem.js +151 -0
  20. package/ChartsLegend/PiecewiseColorLegend.d.ts +26 -0
  21. package/ChartsLegend/PiecewiseColorLegend.js +169 -0
  22. package/ChartsLegend/chartsLegend.types.d.ts +31 -0
  23. package/ChartsLegend/chartsLegend.types.js +5 -0
  24. package/ChartsLegend/index.d.ts +2 -0
  25. package/ChartsLegend/index.js +22 -0
  26. package/ChartsLegend/legend.types.d.ts +62 -0
  27. package/ChartsLegend/legend.types.js +5 -0
  28. package/ChartsLegend/legendItemsPlacement.d.ts +3 -0
  29. package/ChartsLegend/legendItemsPlacement.js +79 -0
  30. package/ChartsLegend/useAxis.d.ts +7 -0
  31. package/ChartsLegend/useAxis.js +47 -0
  32. package/ChartsLegend/utils.d.ts +1 -8
  33. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  34. package/ChartsSurface.js +3 -1
  35. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +26 -18
  36. package/ChartsXAxis/ChartsXAxis.js +1 -1
  37. package/ChartsYAxis/ChartsYAxis.js +15 -3
  38. package/Gauge/Gauge.d.ts +1 -4
  39. package/Gauge/Gauge.js +9 -6
  40. package/Gauge/GaugeContainer.js +8 -4
  41. package/Gauge/GaugeProvider.js +9 -9
  42. package/LineChart/AnimatedArea.js +2 -2
  43. package/LineChart/AnimatedLine.js +2 -2
  44. package/LineChart/AreaPlot.js +7 -1
  45. package/LineChart/LineChart.js +2 -2
  46. package/LineChart/LineHighlightPlot.js +8 -0
  47. package/LineChart/MarkElement.js +2 -2
  48. package/LineChart/MarkPlot.js +4 -20
  49. package/LineChart/extremums.js +1 -1
  50. package/LineChart/formatter.js +1 -1
  51. package/LineChart/useLineChartProps.js +38 -33
  52. package/PieChart/PieChart.d.ts +1 -4
  53. package/PieChart/PieChart.js +40 -34
  54. package/PieChart/PiePlot.js +6 -6
  55. package/PieChart/getPieCoordinates.js +3 -3
  56. package/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  57. package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +5 -1
  58. package/ResponsiveChartContainer/useChartContainerDimensions.js +6 -2
  59. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +20 -0
  60. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +73 -0
  61. package/ScatterChart/Scatter.js +6 -9
  62. package/ScatterChart/useScatterChartProps.js +35 -30
  63. package/SparkLineChart/SparkLineChart.js +27 -22
  64. package/context/CartesianProvider/CartesianProvider.d.ts +2 -3
  65. package/context/CartesianProvider/CartesianProvider.js +18 -7
  66. package/context/CartesianProvider/computeValue.d.ts +32 -9
  67. package/context/CartesianProvider/computeValue.js +20 -16
  68. package/context/CartesianProvider/defaultizeAxis.d.ts +36 -0
  69. package/context/CartesianProvider/defaultizeAxis.js +21 -0
  70. package/context/CartesianProvider/index.d.ts +0 -1
  71. package/context/CartesianProvider/index.js +1 -3
  72. package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
  73. package/context/CartesianProvider/normalizeAxis.js +1 -1
  74. package/context/DrawingProvider.d.ts +11 -0
  75. package/context/DrawingProvider.js +9 -2
  76. package/context/HighlightedProvider/HighlightedProvider.js +2 -2
  77. package/esm/BarChart/BarChart.js +2 -2
  78. package/esm/BarChart/formatter.js +1 -1
  79. package/esm/BarChart/useBarChartProps.js +38 -33
  80. package/esm/ChartContainer/ChartContainer.js +25 -66
  81. package/esm/ChartContainer/useChartContainerHooks.js +2 -2
  82. package/esm/ChartContainer/useChartContainerProps.js +87 -0
  83. package/esm/ChartContainer/useDefaultizeAxis.js +19 -0
  84. package/esm/ChartsLegend/ContinuousColorLegend.js +390 -0
  85. package/esm/ChartsLegend/DefaultChartsLegend.js +14 -198
  86. package/esm/ChartsLegend/LegendPerItem.js +141 -0
  87. package/esm/ChartsLegend/PiecewiseColorLegend.js +161 -0
  88. package/esm/ChartsLegend/chartsLegend.types.js +1 -0
  89. package/esm/ChartsLegend/index.js +2 -0
  90. package/esm/ChartsLegend/legend.types.js +1 -0
  91. package/esm/ChartsLegend/legendItemsPlacement.js +72 -0
  92. package/esm/ChartsLegend/useAxis.js +39 -0
  93. package/esm/ChartsSurface.js +3 -1
  94. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +26 -18
  95. package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
  96. package/esm/ChartsYAxis/ChartsYAxis.js +15 -3
  97. package/esm/Gauge/Gauge.js +8 -5
  98. package/esm/Gauge/GaugeContainer.js +8 -4
  99. package/esm/Gauge/GaugeProvider.js +1 -1
  100. package/esm/LineChart/AnimatedArea.js +1 -1
  101. package/esm/LineChart/AnimatedLine.js +1 -1
  102. package/esm/LineChart/AreaPlot.js +7 -1
  103. package/esm/LineChart/LineChart.js +2 -2
  104. package/esm/LineChart/LineHighlightPlot.js +8 -0
  105. package/esm/LineChart/MarkElement.js +1 -1
  106. package/esm/LineChart/MarkPlot.js +3 -19
  107. package/esm/LineChart/extremums.js +1 -1
  108. package/esm/LineChart/formatter.js +1 -1
  109. package/esm/LineChart/useLineChartProps.js +38 -33
  110. package/esm/PieChart/PieChart.js +39 -33
  111. package/esm/PieChart/PiePlot.js +1 -1
  112. package/esm/PieChart/getPieCoordinates.js +1 -1
  113. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  114. package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +6 -2
  115. package/esm/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
  116. package/esm/ScatterChart/Scatter.js +6 -9
  117. package/esm/ScatterChart/useScatterChartProps.js +35 -30
  118. package/esm/SparkLineChart/SparkLineChart.js +27 -22
  119. package/esm/context/CartesianProvider/CartesianProvider.js +18 -7
  120. package/esm/context/CartesianProvider/computeValue.js +20 -16
  121. package/esm/context/CartesianProvider/defaultizeAxis.js +13 -0
  122. package/esm/context/CartesianProvider/index.js +1 -3
  123. package/esm/context/CartesianProvider/normalizeAxis.js +1 -1
  124. package/esm/context/DrawingProvider.js +9 -2
  125. package/esm/context/HighlightedProvider/HighlightedProvider.js +2 -2
  126. package/esm/hooks/useAxisEvents.js +3 -10
  127. package/esm/hooks/useDrawingArea.js +5 -3
  128. package/esm/hooks/useReducedMotion.js +4 -2
  129. package/esm/internals/cleanId.js +6 -0
  130. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  131. package/esm/internals/{utils.js → getPercentageValue.js} +1 -13
  132. package/esm/internals/getSymbol.js +5 -0
  133. package/esm/internals/index.js +3 -1
  134. package/esm/internals/isDefined.js +3 -0
  135. package/esm/internals/notNull.js +3 -0
  136. package/esm/internals/ts-generic.js +1 -0
  137. package/hooks/useAxisEvents.js +3 -10
  138. package/hooks/useDrawingArea.js +5 -3
  139. package/hooks/useReducedMotion.js +4 -2
  140. package/index.js +1 -1
  141. package/internals/cleanId.d.ts +4 -0
  142. package/internals/cleanId.js +12 -0
  143. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +6 -0
  144. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  145. package/internals/getPercentageValue.d.ts +7 -0
  146. package/internals/{utils.js → getPercentageValue.js} +1 -15
  147. package/internals/getSymbol.d.ts +2 -0
  148. package/internals/getSymbol.js +11 -0
  149. package/internals/index.d.ts +3 -1
  150. package/internals/index.js +25 -5
  151. package/internals/isDefined.d.ts +1 -0
  152. package/internals/isDefined.js +9 -0
  153. package/internals/notNull.d.ts +1 -0
  154. package/internals/notNull.js +9 -0
  155. package/internals/ts-generic.d.ts +5 -0
  156. package/internals/ts-generic.js +5 -0
  157. package/models/axis.d.ts +5 -2
  158. package/models/helpers.d.ts +1 -0
  159. package/models/seriesType/config.d.ts +2 -16
  160. package/modern/BarChart/BarChart.js +2 -2
  161. package/modern/BarChart/formatter.js +1 -1
  162. package/modern/BarChart/useBarChartProps.js +38 -33
  163. package/modern/ChartContainer/ChartContainer.js +25 -66
  164. package/modern/ChartContainer/useChartContainerHooks.js +2 -2
  165. package/modern/ChartContainer/useChartContainerProps.js +87 -0
  166. package/modern/ChartContainer/useDefaultizeAxis.js +19 -0
  167. package/modern/ChartsLegend/ContinuousColorLegend.js +390 -0
  168. package/modern/ChartsLegend/DefaultChartsLegend.js +14 -198
  169. package/modern/ChartsLegend/LegendPerItem.js +141 -0
  170. package/modern/ChartsLegend/PiecewiseColorLegend.js +161 -0
  171. package/modern/ChartsLegend/chartsLegend.types.js +1 -0
  172. package/modern/ChartsLegend/index.js +2 -0
  173. package/modern/ChartsLegend/legend.types.js +1 -0
  174. package/modern/ChartsLegend/legendItemsPlacement.js +72 -0
  175. package/modern/ChartsLegend/useAxis.js +39 -0
  176. package/modern/ChartsSurface.js +3 -1
  177. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +26 -18
  178. package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
  179. package/modern/ChartsYAxis/ChartsYAxis.js +15 -3
  180. package/modern/Gauge/Gauge.js +8 -5
  181. package/modern/Gauge/GaugeContainer.js +8 -4
  182. package/modern/Gauge/GaugeProvider.js +1 -1
  183. package/modern/LineChart/AnimatedArea.js +1 -1
  184. package/modern/LineChart/AnimatedLine.js +1 -1
  185. package/modern/LineChart/AreaPlot.js +7 -1
  186. package/modern/LineChart/LineChart.js +2 -2
  187. package/modern/LineChart/LineHighlightPlot.js +8 -0
  188. package/modern/LineChart/MarkElement.js +1 -1
  189. package/modern/LineChart/MarkPlot.js +3 -19
  190. package/modern/LineChart/extremums.js +1 -1
  191. package/modern/LineChart/formatter.js +1 -1
  192. package/modern/LineChart/useLineChartProps.js +38 -33
  193. package/modern/PieChart/PieChart.js +39 -33
  194. package/modern/PieChart/PiePlot.js +1 -1
  195. package/modern/PieChart/getPieCoordinates.js +1 -1
  196. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
  197. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +6 -2
  198. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
  199. package/modern/ScatterChart/Scatter.js +6 -9
  200. package/modern/ScatterChart/useScatterChartProps.js +35 -30
  201. package/modern/SparkLineChart/SparkLineChart.js +27 -22
  202. package/modern/context/CartesianProvider/CartesianProvider.js +18 -7
  203. package/modern/context/CartesianProvider/computeValue.js +20 -16
  204. package/modern/context/CartesianProvider/defaultizeAxis.js +13 -0
  205. package/modern/context/CartesianProvider/index.js +1 -3
  206. package/modern/context/CartesianProvider/normalizeAxis.js +1 -1
  207. package/modern/context/DrawingProvider.js +9 -2
  208. package/modern/context/HighlightedProvider/HighlightedProvider.js +2 -2
  209. package/modern/hooks/useAxisEvents.js +3 -10
  210. package/modern/hooks/useDrawingArea.js +5 -3
  211. package/modern/hooks/useReducedMotion.js +4 -2
  212. package/modern/index.js +1 -1
  213. package/modern/internals/cleanId.js +6 -0
  214. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
  215. package/modern/internals/{utils.js → getPercentageValue.js} +1 -13
  216. package/modern/internals/getSymbol.js +5 -0
  217. package/modern/internals/index.js +3 -1
  218. package/modern/internals/isDefined.js +3 -0
  219. package/modern/internals/notNull.js +3 -0
  220. package/modern/internals/ts-generic.js +1 -0
  221. package/package.json +4 -4
  222. 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 = {
@@ -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.']);
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,165 @@
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.0
7
+
8
+ _Jul 18, 2024_
9
+
10
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎨 Add [color legend](https://mui.com/x/react-charts/legend/#color-legend) for charts (#13700) @alexfauquette
13
+ - 🌍 Improve Korean (ko-KR) locale on the Date and Time Pickers
14
+ - 🌍 Improve Russian (ru-RU) locale on the Date and Time Pickers and Data Grid
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@7.11.0`
23
+
24
+ - [DataGrid] Expose `gridEditRowsStateSelector` (#13877) @romgrk
25
+ - [DataGrid] Fix `columnResizeStop` event not emitted when column is not resized (#13307) @mateuseap
26
+ - [DataGrid] Fix delete filter inconsistent behavior (#13353) @oukunan
27
+ - [DataGrid] Enable flip on preferences panel (#13803) @romgrk
28
+ - [DataGrid] Support `date` and `datetime-local` input types in `GridFilterInputMultipleValue` type (#13411) @karudedios
29
+ - [l10n] Improve Russian (ru-RU) locale (#13735) @diro-atk
30
+
31
+ #### `@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')
32
+
33
+ Same changes as in `@mui/x-data-grid@7.11.0`.
34
+
35
+ #### `@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')
36
+
37
+ Same changes as in `@mui/x-data-grid-pro@7.11.0`.
38
+
39
+ ### Date and Time Pickers
40
+
41
+ #### `@mui/x-date-pickers@7.11.0`
42
+
43
+ - [l10n] Improve Korean (ko-KR) locale (#13651) @100pearlcent
44
+ - [l10n] Improve Russian (ru-RU) locale (#13871) @Inv1x
45
+ - [pickers] Add more conformance tests improving API docs precision (#13800) @LukasTy
46
+ - [TimePicker] Add `Mui-selected` class to `TimeClock` meridiem buttons (#13848) @LukasTy
47
+
48
+ #### `@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')
49
+
50
+ Same changes as in `@mui/x-date-pickers@7.11.0`, plus:
51
+
52
+ - [DateRangePicker] Fix `name` prop propagation regression (#13821) @LukasTy
53
+
54
+ ### Charts
55
+
56
+ #### `@mui/x-charts@7.11.0`
57
+
58
+ - [charts] Create color legend (#13700) @alexfauquette
59
+ - [charts] Defaultize axis on top level `useChartContainerProps` (#13817) @JCQuintas
60
+ - [charts] Fix charts not passing `className` to root element (#13647) @JCQuintas
61
+ - [charts] Generate API documentation for pro components (#13822) @alexfauquette
62
+ - [charts] Improve zoomed highlight behaviour (unreleased) (#13868) @JCQuintas
63
+ - [charts] Allow zoom on Y axis and add zoom options to configure zooming behaviour (unreleased) (#13726) @JCQuintas
64
+ - [charts] Disable animations while zooming (unreleased) (#13807) @JCQuintas
65
+
66
+ ### Tree View
67
+
68
+ #### `@mui/x-tree-view@7.11.0`
69
+
70
+ - [TreeView] Extract some logic outside of the `useTreeView` hook (#13845) @flaviendelangle
71
+
72
+ ### Docs
73
+
74
+ - [docs] Add warning about `process.env.NODE_ENV` in production (#13869) @cherniavskii
75
+ - [docs] Allow controlling the demo form from the example (#13796) @JCQuintas
76
+ - [docs] Clarify Pickers clearable behavior not working on mobile (#13786) @lnhrdt
77
+ - [docs] Improve the documentation of the picker's `onChange` and `onAccept` props (#13543) @flaviendelangle
78
+ - [docs] Replace company name with project name @oliviertassinari
79
+ - [docs] Sort Pickers & Charts API slots alphabetically (#13843) @LukasTy
80
+
81
+ ### Core
82
+
83
+ - [core] Add MUI Internal `renovate` group (#13846) @LukasTy
84
+ - [core] Link GitHub issue for `import/prefer-default-export` rule @oliviertassinari
85
+ - [core] Normalize `...other` and test imports in charts (#13844) @JCQuintas
86
+ - [core] Normalize rest / other to match the most common used @oliviertassinari
87
+ - [code-infra] Follow `next` tag for `@mui/docs` package bumps (#13813) @LukasTy
88
+ - [code-infra] Use specific version for `@mui/docs` dependency (#13760) @LukasTy
89
+ - [internals] Move `EventManager` to `@mui/x-internals` package (#13815) @flaviendelangle
90
+
91
+ ## 7.10.0
92
+
93
+ _Jul 11, 2024_
94
+
95
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
96
+
97
+ - 🎁 Add selectors to support showing child row count in footer in the Data Grid
98
+ - ✨ New APIs for retrieving current item tree and item's children IDs in the Tree View
99
+ - 🌍 Improve Spanish (es-ES) locale on the Data Grid
100
+ - 🐞 Bugfixes
101
+ - 📚 Documentation improvements
102
+
103
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
104
+
105
+ ### Data Grid
106
+
107
+ #### `@mui/x-data-grid@7.10.0`
108
+
109
+ - [DataGrid] Add selectors to support showing child row count in footer (#13725) @KenanYusuf
110
+ - [DataGrid] Fix incorrect panels position when using a toolbar (#13474) @oukunan
111
+ - [DataGrid] Set default variant to `'standard'` in `GridFilterInputMultipleValue` (#13129) @tarunrajput
112
+ - [DataGrid] Use `readonly` on more array props (#13331) @pcorpet
113
+ - [l10n] Improve Spanish (es-ES) locale (#13772) @joserealdev
114
+
115
+ #### `@mui/x-data-grid-pro@7.10.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.10.0`, plus:
118
+
119
+ - [DataGridPro] Keep bottom pinned row at the bottom (#13313) @romgrk
120
+
121
+ #### `@mui/x-data-grid-premium@7.10.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
122
+
123
+ Same changes as in `@mui/x-data-grid-pro@7.10.0`.
124
+
125
+ ### Date and Time Pickers
126
+
127
+ #### `@mui/x-date-pickers@7.10.0`
128
+
129
+ - [fields] Prevent infinite recursion when ensuring selection (#13779) @LukasTy
130
+ - [fields] Unify fields behavior regardless of the `readOnly` flag (#13688) @LukasTy
131
+
132
+ #### `@mui/x-date-pickers-pro@7.10.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.10.0`, plus:
135
+
136
+ - [DateRangePicker] Fix `calendarHeader` slot props propagation (#13780) @LukasTy
137
+ - [DateTimeRangePicker] Resolve `format` from given `views` (#13743) @LukasTy
138
+
139
+ ### Charts
140
+
141
+ #### `@mui/x-charts@7.10.0`
142
+
143
+ - [charts] Fix displaying area of a `LineChart` when using the `log` scale (#13791) @alexfauquette
144
+ - [charts] Use correct click handler prop on pie chart `OnSeriesItemClick` documentation (#13761) @tonyhallett
145
+
146
+ ### Tree View
147
+
148
+ #### `@mui/x-tree-view@7.10.0`
149
+
150
+ - [TreeView] Add `getItemTree` and `getItemOrderedChildrenIds` methods to the public API (#13804) @flaviendelangle
151
+ - [TreeView] Add utility function to check if an optional plugin is present (#13788) @flaviendelangle
152
+
153
+ ### Docs
154
+
155
+ - [docs] Add missing default `loading` prop value (#13604) @oliviertassinari
156
+ - [docs] Add the `DateTimeRangePicker` to the "Commonly used components" demo (#13775) @flaviendelangle
157
+ - [docs] Fix Pickers customization playground overflow (#13742) @LukasTy
158
+ - [docs] Move Pickers dialog guidelines to accessibility page (#13778) @arthurbalduini
159
+
160
+ ### Core
161
+
162
+ - [core] Sort `DATA_GRID_PROPS_DEFAULT_VALUES` alphabetically (#13783) @oliviertassinari
163
+ - [test] Fix split infinitive use in tests @oliviertassinari
164
+
6
165
  ## 7.9.0
7
166
 
8
167
  _Jul 5, 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,
@@ -0,0 +1,86 @@
1
+ import type { DrawingProviderProps } from '../context/DrawingProvider';
2
+ import type { ColorProviderProps } from '../context/ColorProvider';
3
+ import type { CartesianContextProviderProps } from '../context/CartesianProvider';
4
+ import type { SeriesContextProviderProps } from '../context/SeriesContextProvider';
5
+ import type { ZAxisContextProviderProps } from '../context/ZAxisContextProvider';
6
+ import type { ChartContainerProps } from './ChartContainer';
7
+ import { HighlightedProviderProps } from '../context';
8
+ import { ChartsSurfaceProps } from '../ChartsSurface';
9
+ export declare const useChartContainerProps: (props: ChartContainerProps, ref: React.ForwardedRef<unknown>) => {
10
+ children: import("react").ReactNode;
11
+ drawingProviderProps: Omit<DrawingProviderProps, "children">;
12
+ colorProviderProps: Omit<ColorProviderProps, "children">;
13
+ seriesContextProps: Omit<SeriesContextProviderProps, "children">;
14
+ cartesianContextProps: Omit<CartesianContextProviderProps, "children">;
15
+ zAxisContextProps: Omit<ZAxisContextProviderProps, "children">;
16
+ highlightedProviderProps: Omit<HighlightedProviderProps, "children">;
17
+ chartsSurfaceProps: ChartsSurfaceProps & {
18
+ ref: any;
19
+ };
20
+ xAxis: {
21
+ reverse?: boolean;
22
+ fill?: string;
23
+ stroke?: string;
24
+ data?: any[] | undefined;
25
+ label?: string;
26
+ max?: number | Date;
27
+ min?: number | Date;
28
+ classes?: Partial<import("..").ChartsAxisClasses>;
29
+ slots?: Partial<import("../internals").ChartsAxisSlots>;
30
+ slotProps?: Partial<import("../internals").ChartsAxisSlotProps>;
31
+ dataKey?: string;
32
+ valueFormatter?: ((value: any, context: import("../internals").AxisValueFormatterContext) => string) | undefined;
33
+ colorMap?: import("../models/colorMapping").ContinuousColorConfig<number | Date> | import("../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
34
+ tickMaxStep?: number;
35
+ tickMinStep?: number;
36
+ tickNumber?: number;
37
+ tickPlacement?: "start" | "end" | "middle" | "extremities";
38
+ tickLabelPlacement?: "middle" | "tick";
39
+ scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
40
+ axisId?: import("../internals").AxisId;
41
+ disableLine?: boolean;
42
+ disableTicks?: boolean;
43
+ tickFontSize?: number;
44
+ tickLabelStyle?: import("..").ChartsTextProps["style"];
45
+ labelStyle?: import("..").ChartsTextProps["style"];
46
+ tickLabelInterval?: "auto" | ((value: any, index: number) => boolean);
47
+ labelFontSize?: number;
48
+ tickSize?: number;
49
+ tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[];
50
+ hideTooltip?: boolean;
51
+ id: import("../internals").AxisId;
52
+ }[];
53
+ yAxis: {
54
+ reverse?: boolean;
55
+ fill?: string;
56
+ stroke?: string;
57
+ data?: any[] | undefined;
58
+ label?: string;
59
+ max?: number | Date;
60
+ min?: number | Date;
61
+ classes?: Partial<import("..").ChartsAxisClasses>;
62
+ slots?: Partial<import("../internals").ChartsAxisSlots>;
63
+ slotProps?: Partial<import("../internals").ChartsAxisSlotProps>;
64
+ dataKey?: string;
65
+ valueFormatter?: ((value: any, context: import("../internals").AxisValueFormatterContext) => string) | undefined;
66
+ colorMap?: import("../models/colorMapping").ContinuousColorConfig<number | Date> | import("../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
67
+ tickMaxStep?: number;
68
+ tickMinStep?: number;
69
+ tickNumber?: number;
70
+ tickPlacement?: "start" | "end" | "middle" | "extremities";
71
+ tickLabelPlacement?: "middle" | "tick";
72
+ scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
73
+ axisId?: import("../internals").AxisId;
74
+ disableLine?: boolean;
75
+ disableTicks?: boolean;
76
+ tickFontSize?: number;
77
+ tickLabelStyle?: import("..").ChartsTextProps["style"];
78
+ labelStyle?: import("..").ChartsTextProps["style"];
79
+ tickLabelInterval?: "auto" | ((value: any, index: number) => boolean);
80
+ labelFontSize?: number;
81
+ tickSize?: number;
82
+ tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[];
83
+ hideTooltip?: boolean;
84
+ id: import("../internals").AxisId;
85
+ }[];
86
+ };
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useChartContainerProps = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var _useChartContainerHooks = require("./useChartContainerHooks");
11
+ var _useDefaultizeAxis = require("./useDefaultizeAxis");
12
+ const _excluded = ["width", "height", "series", "margin", "xAxis", "yAxis", "zAxis", "colors", "dataset", "sx", "title", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "children"];
13
+ const useChartContainerProps = (props, ref) => {
14
+ const {
15
+ width,
16
+ height,
17
+ series,
18
+ margin,
19
+ xAxis,
20
+ yAxis,
21
+ zAxis,
22
+ colors,
23
+ dataset,
24
+ sx,
25
+ title,
26
+ desc,
27
+ disableAxisListener,
28
+ highlightedItem,
29
+ onHighlightChange,
30
+ plugins,
31
+ children
32
+ } = props,
33
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
34
+ const {
35
+ svgRef,
36
+ chartSurfaceRef,
37
+ xExtremumGetters,
38
+ yExtremumGetters,
39
+ seriesFormatters,
40
+ colorProcessors
41
+ } = (0, _useChartContainerHooks.useChartContainerHooks)(ref, plugins);
42
+ const [defaultizedXAxis, defaultizedYAxis] = (0, _useDefaultizeAxis.useDefaultizeAxis)(xAxis, yAxis);
43
+ const drawingProviderProps = {
44
+ width,
45
+ height,
46
+ margin,
47
+ svgRef
48
+ };
49
+ const colorProviderProps = {
50
+ colorProcessors
51
+ };
52
+ const seriesContextProps = {
53
+ series,
54
+ colors,
55
+ dataset,
56
+ seriesFormatters
57
+ };
58
+ const cartesianContextProps = {
59
+ xAxis: defaultizedXAxis,
60
+ yAxis: defaultizedYAxis,
61
+ dataset,
62
+ xExtremumGetters,
63
+ yExtremumGetters
64
+ };
65
+ const zAxisContextProps = {
66
+ zAxis,
67
+ dataset
68
+ };
69
+ const highlightedProviderProps = {
70
+ highlightedItem,
71
+ onHighlightChange
72
+ };
73
+ const chartsSurfaceProps = (0, _extends2.default)({}, other, {
74
+ width,
75
+ height,
76
+ ref: chartSurfaceRef,
77
+ sx,
78
+ title,
79
+ desc,
80
+ disableAxisListener
81
+ });
82
+ return {
83
+ children,
84
+ drawingProviderProps,
85
+ colorProviderProps,
86
+ seriesContextProps,
87
+ cartesianContextProps,
88
+ zAxisContextProps,
89
+ highlightedProviderProps,
90
+ chartsSurfaceProps,
91
+ xAxis: defaultizedXAxis,
92
+ yAxis: defaultizedYAxis
93
+ };
94
+ };
95
+ exports.useChartContainerProps = useChartContainerProps;