@mui/x-charts 6.0.0-alpha.15 → 6.0.0-alpha.17

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 (184) hide show
  1. package/BarChart/BarChart.d.ts +13 -2
  2. package/BarChart/BarChart.js +45 -3
  3. package/BarChart/BarElement.d.ts +1318 -3
  4. package/BarChart/BarElement.js +10 -8
  5. package/BarChart/BarPlot.d.ts +17 -1
  6. package/BarChart/BarPlot.js +152 -66
  7. package/BarChart/formatter.js +1 -1
  8. package/CHANGELOG.md +131 -0
  9. package/ChartContainer/index.js +5 -2
  10. package/ChartsAxis/ChartsAxis.js +18 -2
  11. package/ChartsAxis/axisClasses.d.ts +1 -1
  12. package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
  13. package/ChartsClipPath/ChartsClipPath.js +2 -2
  14. package/ChartsLegend/ChartsLegend.d.ts +2 -1
  15. package/ChartsLegend/ChartsLegend.js +12 -8
  16. package/ChartsSurface.js +2 -2
  17. package/ChartsTooltip/ChartsAxisTooltipContent.js +29 -23
  18. package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  19. package/ChartsTooltip/ChartsTooltip.js +2 -2
  20. package/ChartsTooltip/utils.js +2 -2
  21. package/ChartsXAxis/ChartsXAxis.js +123 -35
  22. package/ChartsYAxis/ChartsYAxis.js +38 -16
  23. package/LineChart/AreaElement.d.ts +10 -0
  24. package/LineChart/AreaElement.js +12 -2
  25. package/LineChart/AreaPlot.d.ts +11 -0
  26. package/LineChart/AreaPlot.js +24 -7
  27. package/LineChart/LineChart.d.ts +10 -0
  28. package/LineChart/LineChart.js +36 -2
  29. package/LineChart/LineElement.d.ts +10 -0
  30. package/LineChart/LineElement.js +12 -2
  31. package/LineChart/LineHighlightElement.d.ts +10 -0
  32. package/LineChart/LineHighlightElement.js +12 -2
  33. package/LineChart/LineHighlightPlot.d.ts +10 -0
  34. package/LineChart/LineHighlightPlot.js +14 -3
  35. package/LineChart/LinePlot.d.ts +10 -0
  36. package/LineChart/LinePlot.js +22 -11
  37. package/LineChart/MarkElement.d.ts +10 -0
  38. package/LineChart/MarkElement.js +12 -2
  39. package/LineChart/MarkPlot.d.ts +10 -0
  40. package/LineChart/MarkPlot.js +40 -9
  41. package/LineChart/formatter.js +4 -3
  42. package/PieChart/PieArc.js +2 -2
  43. package/PieChart/PieArcLabel.js +2 -2
  44. package/PieChart/PieChart.d.ts +10 -0
  45. package/PieChart/PieChart.js +37 -2
  46. package/PieChart/PiePlot.d.ts +10 -0
  47. package/PieChart/PiePlot.js +12 -2
  48. package/ResponsiveChartContainer/index.js +4 -4
  49. package/ScatterChart/Scatter.d.ts +10 -0
  50. package/ScatterChart/Scatter.js +12 -2
  51. package/ScatterChart/ScatterChart.d.ts +10 -0
  52. package/ScatterChart/ScatterChart.js +36 -2
  53. package/ScatterChart/ScatterPlot.d.ts +10 -0
  54. package/ScatterChart/ScatterPlot.js +12 -2
  55. package/SparkLineChart/SparkLineChart.d.ts +9 -0
  56. package/SparkLineChart/SparkLineChart.js +16 -2
  57. package/context/CartesianContextProvider.js +10 -2
  58. package/context/DrawingProvider.js +2 -2
  59. package/context/HighlightProvider.js +2 -2
  60. package/context/InteractionProvider.js +2 -2
  61. package/context/SeriesContextProvider.js +2 -2
  62. package/esm/BarChart/BarChart.js +43 -1
  63. package/esm/BarChart/BarElement.js +7 -4
  64. package/esm/BarChart/BarPlot.js +152 -67
  65. package/esm/BarChart/formatter.js +1 -1
  66. package/esm/ChartContainer/index.js +3 -0
  67. package/esm/ChartsAxis/ChartsAxis.js +16 -0
  68. package/esm/ChartsLegend/ChartsLegend.js +10 -6
  69. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +27 -21
  70. package/esm/ChartsXAxis/ChartsXAxis.js +122 -34
  71. package/esm/ChartsYAxis/ChartsYAxis.js +36 -14
  72. package/esm/LineChart/AreaElement.js +10 -0
  73. package/esm/LineChart/AreaPlot.js +24 -6
  74. package/esm/LineChart/LineChart.js +34 -0
  75. package/esm/LineChart/LineElement.js +10 -0
  76. package/esm/LineChart/LineHighlightElement.js +10 -0
  77. package/esm/LineChart/LineHighlightPlot.js +12 -1
  78. package/esm/LineChart/LinePlot.js +23 -14
  79. package/esm/LineChart/MarkElement.js +10 -0
  80. package/esm/LineChart/MarkPlot.js +38 -7
  81. package/esm/LineChart/formatter.js +7 -3
  82. package/esm/PieChart/PieChart.js +35 -0
  83. package/esm/PieChart/PiePlot.js +10 -0
  84. package/esm/ResponsiveChartContainer/index.js +2 -2
  85. package/esm/ScatterChart/Scatter.js +10 -0
  86. package/esm/ScatterChart/ScatterChart.js +34 -0
  87. package/esm/ScatterChart/ScatterPlot.js +10 -0
  88. package/esm/SparkLineChart/SparkLineChart.js +14 -0
  89. package/esm/context/CartesianContextProvider.js +8 -0
  90. package/esm/hooks/useMounted.js +16 -0
  91. package/esm/hooks/useReducedMotion.js +27 -0
  92. package/esm/hooks/useTicks.js +12 -6
  93. package/esm/internals/components/ChartsText.js +19 -13
  94. package/esm/internals/geometry.js +36 -0
  95. package/hooks/useAxisEvents.js +2 -2
  96. package/hooks/useChartDimensions.js +2 -2
  97. package/hooks/useDrawingArea.js +2 -2
  98. package/hooks/useInteractionItemProps.js +2 -2
  99. package/hooks/useMounted.d.ts +1 -0
  100. package/hooks/useMounted.js +25 -0
  101. package/hooks/useReducedMotion.d.ts +8 -0
  102. package/hooks/useReducedMotion.js +33 -0
  103. package/hooks/useScale.d.ts +2 -2
  104. package/hooks/useScale.js +2 -2
  105. package/hooks/useTicks.d.ts +18 -9
  106. package/hooks/useTicks.js +14 -8
  107. package/index.js +1 -1
  108. package/internals/components/ChartsText.d.ts +11 -8
  109. package/internals/components/ChartsText.js +21 -15
  110. package/internals/defaultizeColor.d.ts +2 -2
  111. package/internals/domUtils.d.ts +0 -1
  112. package/internals/geometry.d.ts +9 -0
  113. package/internals/geometry.js +42 -0
  114. package/legacy/BarChart/BarChart.js +43 -1
  115. package/legacy/BarChart/BarElement.js +6 -3
  116. package/legacy/BarChart/BarPlot.js +151 -63
  117. package/legacy/BarChart/formatter.js +1 -1
  118. package/legacy/ChartContainer/index.js +3 -0
  119. package/legacy/ChartsAxis/ChartsAxis.js +16 -0
  120. package/legacy/ChartsLegend/ChartsLegend.js +14 -7
  121. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +5 -1
  122. package/legacy/ChartsXAxis/ChartsXAxis.js +126 -36
  123. package/legacy/ChartsYAxis/ChartsYAxis.js +36 -14
  124. package/legacy/LineChart/AreaElement.js +10 -0
  125. package/legacy/LineChart/AreaPlot.js +27 -7
  126. package/legacy/LineChart/LineChart.js +34 -0
  127. package/legacy/LineChart/LineElement.js +10 -0
  128. package/legacy/LineChart/LineHighlightElement.js +10 -0
  129. package/legacy/LineChart/LineHighlightPlot.js +12 -1
  130. package/legacy/LineChart/LinePlot.js +25 -12
  131. package/legacy/LineChart/MarkElement.js +10 -0
  132. package/legacy/LineChart/MarkPlot.js +37 -7
  133. package/legacy/LineChart/formatter.js +7 -3
  134. package/legacy/PieChart/PieChart.js +35 -0
  135. package/legacy/PieChart/PiePlot.js +10 -0
  136. package/legacy/ResponsiveChartContainer/index.js +2 -2
  137. package/legacy/ScatterChart/Scatter.js +10 -0
  138. package/legacy/ScatterChart/ScatterChart.js +34 -0
  139. package/legacy/ScatterChart/ScatterPlot.js +10 -0
  140. package/legacy/SparkLineChart/SparkLineChart.js +14 -0
  141. package/legacy/context/CartesianContextProvider.js +8 -0
  142. package/legacy/hooks/useMounted.js +21 -0
  143. package/legacy/hooks/useReducedMotion.js +27 -0
  144. package/legacy/hooks/useTicks.js +13 -6
  145. package/legacy/index.js +1 -1
  146. package/legacy/internals/components/ChartsText.js +17 -15
  147. package/legacy/internals/geometry.js +37 -0
  148. package/models/axis.d.ts +19 -2
  149. package/models/seriesType/line.d.ts +3 -3
  150. package/modern/BarChart/BarChart.js +43 -1
  151. package/modern/BarChart/BarElement.js +7 -4
  152. package/modern/BarChart/BarPlot.js +149 -65
  153. package/modern/BarChart/formatter.js +1 -1
  154. package/modern/ChartContainer/index.js +3 -0
  155. package/modern/ChartsAxis/ChartsAxis.js +16 -0
  156. package/modern/ChartsLegend/ChartsLegend.js +10 -6
  157. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +27 -21
  158. package/modern/ChartsXAxis/ChartsXAxis.js +122 -34
  159. package/modern/ChartsYAxis/ChartsYAxis.js +36 -14
  160. package/modern/LineChart/AreaElement.js +10 -0
  161. package/modern/LineChart/AreaPlot.js +22 -5
  162. package/modern/LineChart/LineChart.js +34 -0
  163. package/modern/LineChart/LineElement.js +10 -0
  164. package/modern/LineChart/LineHighlightElement.js +10 -0
  165. package/modern/LineChart/LineHighlightPlot.js +12 -1
  166. package/modern/LineChart/LinePlot.js +20 -9
  167. package/modern/LineChart/MarkElement.js +10 -0
  168. package/modern/LineChart/MarkPlot.js +38 -7
  169. package/modern/LineChart/formatter.js +4 -3
  170. package/modern/PieChart/PieChart.js +35 -0
  171. package/modern/PieChart/PiePlot.js +10 -0
  172. package/modern/ResponsiveChartContainer/index.js +2 -2
  173. package/modern/ScatterChart/Scatter.js +10 -0
  174. package/modern/ScatterChart/ScatterChart.js +34 -0
  175. package/modern/ScatterChart/ScatterPlot.js +10 -0
  176. package/modern/SparkLineChart/SparkLineChart.js +14 -0
  177. package/modern/context/CartesianContextProvider.js +8 -0
  178. package/modern/hooks/useMounted.js +16 -0
  179. package/modern/hooks/useReducedMotion.js +27 -0
  180. package/modern/hooks/useTicks.js +12 -6
  181. package/modern/index.js +1 -1
  182. package/modern/internals/components/ChartsText.js +19 -13
  183. package/modern/internals/geometry.js +36 -0
  184. package/package.json +5 -3
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.BarElement = BarElement;
8
- exports.BarElementPath = void 0;
8
+ exports.barElementClasses = exports.BarElementPath = void 0;
9
9
  exports.getBarElementUtilityClass = getBarElementUtilityClass;
10
- exports.lineElementClasses = void 0;
11
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
13
12
  var React = _interopRequireWildcard(require("react"));
@@ -17,16 +16,17 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
17
16
  var _styles = require("@mui/material/styles");
18
17
  var _d3Color = require("d3-color");
19
18
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
19
+ var _web = require("@react-spring/web");
20
20
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
21
21
  var _InteractionProvider = require("../context/InteractionProvider");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps"];
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style"];
24
+ 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); }
25
+ 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 && Object.prototype.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; }
26
26
  function getBarElementUtilityClass(slot) {
27
27
  return (0, _generateUtilityClass.default)('MuiBarElement', slot);
28
28
  }
29
- const lineElementClasses = exports.lineElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root']);
29
+ const barElementClasses = exports.barElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root']);
30
30
  const useUtilityClasses = ownerState => {
31
31
  const {
32
32
  classes,
@@ -37,7 +37,7 @@ const useUtilityClasses = ownerState => {
37
37
  };
38
38
  return (0, _composeClasses.default)(slots, getBarElementUtilityClass, classes);
39
39
  };
40
- const BarElementPath = exports.BarElementPath = (0, _styles.styled)('rect', {
40
+ const BarElementPath = exports.BarElementPath = (0, _styles.styled)(_web.animated.rect, {
41
41
  name: 'MuiBarElement',
42
42
  slot: 'Root',
43
43
  overridesResolver: (_, styles) => styles.root
@@ -58,7 +58,8 @@ function BarElement(props) {
58
58
  color,
59
59
  highlightScope,
60
60
  slots,
61
- slotProps
61
+ slotProps,
62
+ style
62
63
  } = props,
63
64
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
64
65
  const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(highlightScope);
@@ -93,6 +94,7 @@ function BarElement(props) {
93
94
  seriesId: id,
94
95
  dataIndex
95
96
  }), {
97
+ style,
96
98
  className: classes.root
97
99
  }),
98
100
  ownerState
@@ -7,8 +7,24 @@ export interface BarPlotSlotComponentProps {
7
7
  bar?: Partial<BarElementProps>;
8
8
  }
9
9
  export interface BarPlotProps extends Pick<BarElementProps, 'slots' | 'slotProps'> {
10
+ /**
11
+ * If `true`, animations are skiped.
12
+ * @default false
13
+ */
14
+ skipAnimation?: boolean;
10
15
  }
11
- declare function BarPlot(props: BarPlotProps): React.JSX.Element | null;
16
+ /**
17
+ * Demos:
18
+ *
19
+ * - [Bars](https://mui.com/x/react-charts/bars/)
20
+ * - [Bar demonstration](https://mui.com/x/react-charts/bar-demo/)
21
+ * - [Stacking](https://mui.com/x/react-charts/stacking/)
22
+ *
23
+ * API:
24
+ *
25
+ * - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
26
+ */
27
+ declare function BarPlot(props: BarPlotProps): React.JSX.Element;
12
28
  declare namespace BarPlot {
13
29
  var propTypes: any;
14
30
  }
@@ -5,16 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.BarPlot = BarPlot;
8
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var React = _interopRequireWildcard(require("react"));
10
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _web = require("@react-spring/web");
11
13
  var _SeriesContextProvider = require("../context/SeriesContextProvider");
12
14
  var _CartesianContextProvider = require("../context/CartesianContextProvider");
13
15
  var _BarElement = require("./BarElement");
14
16
  var _axis = require("../models/axis");
15
17
  var _jsxRuntime = require("react/jsx-runtime");
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ const _excluded = ["skipAnimation"];
19
+ 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); }
20
+ 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 && Object.prototype.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; }
18
21
  /**
19
22
  * Solution of the equations
20
23
  * W = barWidth * N + offset * (N-1)
@@ -23,7 +26,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
26
  * @param numberOfGroups The number of bars to place in that space.
24
27
  * @param gapRatio The ratio of the gap between bars over the bar width.
25
28
  * @returns The bar width and the offset between bars.
26
- */function getBandSize({
29
+ */
30
+ function getBandSize({
27
31
  bandWidth: W,
28
32
  numberOfGroups: N,
29
33
  gapRatio: r
@@ -41,12 +45,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
41
45
  offset
42
46
  };
43
47
  }
44
- function BarPlot(props) {
45
- const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).bar;
48
+ const useCompletedData = () => {
49
+ const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).bar ?? {
50
+ series: {},
51
+ stackingGroups: [],
52
+ seriesOrder: []
53
+ };
46
54
  const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
47
- if (seriesData === undefined) {
48
- return null;
49
- }
50
55
  const {
51
56
  series,
52
57
  stackingGroups
@@ -59,66 +64,142 @@ function BarPlot(props) {
59
64
  } = axisData;
60
65
  const defaultXAxisId = xAxisIds[0];
61
66
  const defaultYAxisId = yAxisIds[0];
62
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
63
- children: stackingGroups.flatMap(({
64
- ids: groupIds
65
- }, groupIndex) => {
66
- return groupIds.flatMap(seriesId => {
67
- const xAxisKey = series[seriesId].xAxisKey ?? defaultXAxisId;
68
- const yAxisKey = series[seriesId].yAxisKey ?? defaultYAxisId;
69
- const xAxisConfig = xAxis[xAxisKey];
70
- const yAxisConfig = yAxis[yAxisKey];
71
- const verticalLayout = series[seriesId].layout === 'vertical';
72
- let baseScaleConfig;
73
- if (verticalLayout) {
74
- if (!(0, _axis.isBandScaleConfig)(xAxisConfig)) {
75
- throw new Error(`Axis with id "${xAxisKey}" shoud be of type "band" to display the bar series of id "${seriesId}"`);
76
- }
77
- if (xAxis[xAxisKey].data === undefined) {
78
- throw new Error(`Axis with id "${xAxisKey}" shoud have data property`);
79
- }
80
- baseScaleConfig = xAxisConfig;
81
- } else {
82
- if (!(0, _axis.isBandScaleConfig)(yAxisConfig)) {
83
- throw new Error(`Axis with id "${yAxisKey}" shoud be of type "band" to display the bar series of id "${seriesId}"`);
84
- }
85
- if (yAxis[yAxisKey].data === undefined) {
86
- throw new Error(`Axis with id "${xAxisKey}" shoud have data property`);
87
- }
88
- baseScaleConfig = yAxisConfig;
67
+ const data = stackingGroups.flatMap(({
68
+ ids: groupIds
69
+ }, groupIndex) => {
70
+ return groupIds.flatMap(seriesId => {
71
+ const xAxisKey = series[seriesId].xAxisKey ?? defaultXAxisId;
72
+ const yAxisKey = series[seriesId].yAxisKey ?? defaultYAxisId;
73
+ const xAxisConfig = xAxis[xAxisKey];
74
+ const yAxisConfig = yAxis[yAxisKey];
75
+ const verticalLayout = series[seriesId].layout === 'vertical';
76
+ let baseScaleConfig;
77
+ if (verticalLayout) {
78
+ if (!(0, _axis.isBandScaleConfig)(xAxisConfig)) {
79
+ throw new Error(`Axis with id "${xAxisKey}" shoud be of type "band" to display the bar series of id "${seriesId}"`);
80
+ }
81
+ if (xAxis[xAxisKey].data === undefined) {
82
+ throw new Error(`Axis with id "${xAxisKey}" shoud have data property`);
89
83
  }
90
- const xScale = xAxisConfig.scale;
91
- const yScale = yAxisConfig.scale;
92
- const bandWidth = baseScaleConfig.scale.bandwidth();
93
- const {
94
- barWidth,
95
- offset
96
- } = getBandSize({
97
- bandWidth,
98
- numberOfGroups: stackingGroups.length,
99
- gapRatio: baseScaleConfig.barGapRatio
100
- });
101
- const barOffset = groupIndex * (barWidth + offset);
102
- const {
103
- stackedData,
104
- color
105
- } = series[seriesId];
106
- return stackedData.map((values, dataIndex) => {
107
- const baseline = Math.min(...values);
108
- const value = Math.max(...values);
109
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, (0, _extends2.default)({
110
- id: seriesId,
111
- dataIndex: dataIndex,
112
- x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : xScale(baseline),
113
- y: verticalLayout ? yScale(value) : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
114
- height: verticalLayout ? Math.abs(yScale(baseline) - yScale(value)) : barWidth,
115
- width: verticalLayout ? barWidth : Math.abs(xScale(baseline) - xScale(value)),
116
- color: color,
117
- highlightScope: series[seriesId].highlightScope
118
- }, props), `${seriesId}-${dataIndex}`);
119
- });
84
+ baseScaleConfig = xAxisConfig;
85
+ } else {
86
+ if (!(0, _axis.isBandScaleConfig)(yAxisConfig)) {
87
+ throw new Error(`Axis with id "${yAxisKey}" shoud be of type "band" to display the bar series of id "${seriesId}"`);
88
+ }
89
+ if (yAxis[yAxisKey].data === undefined) {
90
+ throw new Error(`Axis with id "${xAxisKey}" shoud have data property`);
91
+ }
92
+ baseScaleConfig = yAxisConfig;
93
+ }
94
+ const xScale = xAxisConfig.scale;
95
+ const yScale = yAxisConfig.scale;
96
+ const bandWidth = baseScaleConfig.scale.bandwidth();
97
+ const {
98
+ barWidth,
99
+ offset
100
+ } = getBandSize({
101
+ bandWidth,
102
+ numberOfGroups: stackingGroups.length,
103
+ gapRatio: baseScaleConfig.barGapRatio
104
+ });
105
+ const barOffset = groupIndex * (barWidth + offset);
106
+ const {
107
+ stackedData,
108
+ color
109
+ } = series[seriesId];
110
+ return stackedData.map((values, dataIndex) => {
111
+ const bottom = Math.min(...values);
112
+ const top = Math.max(...values);
113
+ return {
114
+ bottom,
115
+ top,
116
+ seriesId,
117
+ dataIndex,
118
+ layout: series[seriesId].layout,
119
+ x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : xScale(bottom),
120
+ y: verticalLayout ? yScale(top) : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
121
+ xOrigin: xScale(0),
122
+ yOrigin: yScale(0),
123
+ height: verticalLayout ? Math.abs(yScale(bottom) - yScale(top)) : barWidth,
124
+ width: verticalLayout ? barWidth : Math.abs(xScale(bottom) - xScale(top)),
125
+ color,
126
+ highlightScope: series[seriesId].highlightScope
127
+ };
120
128
  });
121
- })
129
+ });
130
+ });
131
+ return data;
132
+ };
133
+ const getOutStyle = ({
134
+ layout,
135
+ yOrigin,
136
+ x,
137
+ width,
138
+ y,
139
+ xOrigin,
140
+ height
141
+ }) => (0, _extends2.default)({}, layout === 'vertical' ? {
142
+ y: yOrigin,
143
+ x,
144
+ height: 0,
145
+ width
146
+ } : {
147
+ y,
148
+ x: xOrigin,
149
+ height,
150
+ width: 0
151
+ });
152
+ const getInStyle = ({
153
+ x,
154
+ width,
155
+ y,
156
+ height
157
+ }) => ({
158
+ y,
159
+ x,
160
+ height,
161
+ width
162
+ });
163
+
164
+ /**
165
+ * Demos:
166
+ *
167
+ * - [Bars](https://mui.com/x/react-charts/bars/)
168
+ * - [Bar demonstration](https://mui.com/x/react-charts/bar-demo/)
169
+ * - [Stacking](https://mui.com/x/react-charts/stacking/)
170
+ *
171
+ * API:
172
+ *
173
+ * - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
174
+ */
175
+ function BarPlot(props) {
176
+ const completedData = useCompletedData();
177
+ const {
178
+ skipAnimation
179
+ } = props,
180
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
181
+ const transition = (0, _web.useTransition)(completedData, {
182
+ keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
183
+ from: getOutStyle,
184
+ leave: getOutStyle,
185
+ enter: getInStyle,
186
+ update: getInStyle,
187
+ immediate: skipAnimation
188
+ });
189
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
190
+ children: transition((style, {
191
+ seriesId,
192
+ dataIndex,
193
+ color,
194
+ highlightScope
195
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, (0, _extends2.default)({
196
+ id: seriesId,
197
+ dataIndex: dataIndex,
198
+ highlightScope: highlightScope,
199
+ color: color
200
+ }, other, {
201
+ style: style
202
+ })))
122
203
  });
123
204
  }
124
205
  process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
@@ -126,6 +207,11 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
126
207
  // | These PropTypes are generated from the TypeScript type definitions |
127
208
  // | To update them edit the TypeScript types and run "yarn proptypes" |
128
209
  // ----------------------------------------------------------------------
210
+ /**
211
+ * If `true`, animations are skiped.
212
+ * @default false
213
+ */
214
+ skipAnimation: _propTypes.default.bool,
129
215
  /**
130
216
  * The props used for each component slot.
131
217
  * @default {}
@@ -60,7 +60,7 @@ const formatter = (params, dataset) => {
60
60
  return {
61
61
  seriesOrder,
62
62
  stackingGroups,
63
- series: (0, _defaultizeValueFormatter.default)(completedSeries, v => v.toLocaleString())
63
+ series: (0, _defaultizeValueFormatter.default)(completedSeries, v => v?.toLocaleString())
64
64
  };
65
65
  };
66
66
  var _default = exports.default = formatter;
package/CHANGELOG.md CHANGED
@@ -3,6 +3,137 @@
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
+ ## 6.17.0
7
+
8
+ _Oct 27, 2023_
9
+
10
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 The Tree View package is now officially stable!
13
+
14
+ ![tree-view-example](https://github.com/mui/mui-x/assets/550141/77d1fe66-d912-49ba-b38f-b853fb90446a)
15
+
16
+ - ✨ Improve the handling of non-numeric values by Data Grid aggregation
17
+ - 🚀 Support lines with different domains on the line charts
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ ### Data Grid
22
+
23
+ #### `@mui/x-data-grid@6.17.0`
24
+
25
+ - [DataGrid] Allow custom debounce time for row positions calculation (#10708) @cherniavskii
26
+ - [DataGrid] Persist stable row index for focused row (#10674) @cherniavskii
27
+
28
+ #### `@mui/x-data-grid-pro@6.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
29
+
30
+ Same changes as in `@mui/x-data-grid@6.17.0`, plus:
31
+
32
+ - [DataGridPro] Fix `undefined` values passed to `valueFormatter` for tree leaf nodes (#10748) @cherniavskii
33
+
34
+ #### `@mui/x-data-grid-premium@6.17.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
+
36
+ Same changes as in `@mui/x-data-grid-pro@6.17.0`, plus:
37
+
38
+ - [DataGridPremium] Fix `avg` aggregation to ignore non-numeric values (#10787) @cherniavskii
39
+ - [DataGridPremium] Fix `size` aggregation to ignore `undefined` values (#10745) @cherniavskii
40
+ - [DataGridPremium] Fix `sum` aggregation to ignore non-numeric values (#10730) @cherniavskii
41
+ - [DataGridPremium] Fix cell selection throwing index error on second page and beyond (#10784) @MBilalShafi
42
+
43
+ ### Date Pickers
44
+
45
+ #### `@mui/x-date-pickers@6.17.0`
46
+
47
+ - [fields] POC: Use `contentEditable` on `FakeTextField` (#10779) @flaviendelangle
48
+ - [pickers] Fix weekday label localization (#10809) @LukasTy
49
+
50
+ #### `@mui/x-date-pickers-pro@6.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@6.17.0`.
53
+
54
+ ### Charts / `@mui/x-charts@6.0.0-alpha.17`
55
+
56
+ - [charts] Fix text position in Safari (#10815) @lhilgert9
57
+ - [charts] Support lines with different domains (#10801) @alexfauquette
58
+
59
+ ### Tree View / `@mui/x-tree-view@6.17.0`
60
+
61
+ No change
62
+
63
+ ### Docs
64
+
65
+ - [docs] Correct editing related props' description (#10798) @MBilalShafi
66
+ - [docs] Fix RTL data grid demo (#10728) @oliviertassinari
67
+ - [docs] Fix unclosed warning (#10796) @flaviendelangle
68
+ - [docs] Improve performance of `Save and restore the state from external storage` recipe (#10811) @michelengelen
69
+
70
+ - [test] Add missing type on `cleanText` utility function (#10780) @flaviendelangle
71
+
72
+ ## 6.16.3
73
+
74
+ _Oct 20, 2023_
75
+
76
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
77
+
78
+ - 🎁 Add a Data Grid recipe for saving & restoring state
79
+ - 💫 Support animations on the bar chart
80
+ - 🐞 Bugfixes
81
+ - 📚 Documentation improvements
82
+
83
+ ### Data Grid
84
+
85
+ #### `@mui/x-data-grid@6.16.3`
86
+
87
+ - [DataGrid] Allow passing readonly arrays to `columns` and `sortingOrder` props (#10686) @pcorpet
88
+
89
+ #### `@mui/x-data-grid-pro@6.16.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
90
+
91
+ Same changes as in `@mui/x-data-grid@6.16.3`.
92
+
93
+ #### `@mui/x-data-grid-premium@6.16.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
94
+
95
+ Same changes as in `@mui/x-data-grid-pro@6.16.3`.
96
+
97
+ ### Date Pickers
98
+
99
+ #### `@mui/x-date-pickers@6.16.3`
100
+
101
+ - [fields] Correctly respect leading zeroes on seconds section (#10713) @flaviendelangle
102
+ - [fields] Use `onChange` instead of `onKeyPress` for Backspace editing (#10494) @flaviendelangle
103
+ - [pickers] Add reference links to DatePicker components (#10626) @michelengelen
104
+ - [pickers] Add reference links to clock components (#10645) @michelengelen
105
+ - [pickers] Add reference links to misc picker components (#10647) @michelengelen
106
+ - [pickers] Add reference links to toolbar components (#10646) @michelengelen
107
+ - [pickers] POC: Change the props received by the `FakeTextField` component (#10687) @flaviendelangle
108
+
109
+ #### `@mui/x-date-pickers-pro@6.16.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
110
+
111
+ Same changes as in `@mui/x-date-pickers@6.16.3`, plus:
112
+
113
+ - [DateRangePicker] Fix touch based range dragging (#10664) @michelengelen
114
+
115
+ ### Charts / `@mui/x-charts@6.0.0-alpha.16`
116
+
117
+ - [charts] Add reference links to area + bar chart components (#10652) @michelengelen
118
+ - [charts] Add reference links to line chart + sparkline components (#10650) @michelengelen
119
+ - [charts] Add reference links to pie + scatter chart components (#10653) @michelengelen
120
+ - [charts] Render only when `width` and `height` are resolved (#10714) @alexfauquette
121
+ - [charts] Support animation on `BarChart` (#9926) @alexfauquette
122
+ - [charts] Use new text component to avoid tick label overflow on x-axis (#10648) @alexfauquette
123
+
124
+ ### Docs
125
+
126
+ - [docs] Add a recipe for saving and restoring `state` externally (#10722) @michelengelen
127
+ - [docs] Add example about how to add an axis (#10709) @alexfauquette
128
+ - [docs] Customization Playground - fix DesktopDatePicker sx props and styled examples (#10665) @noraleonte
129
+ - [docs] Improve meta description @oliviertassinari
130
+ - [docs] Make overview demo work in codesandbox (#10661) @alexfauquette
131
+
132
+ ### Core
133
+
134
+ - [core] Update React renovate group with `@types` (#10723) @LukasTy
135
+ - [core] Update `styled-components` (#10733) @LukasTy
136
+
6
137
  ## 6.16.2
7
138
 
8
139
  _Oct 12, 2023_
@@ -10,12 +10,13 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
10
10
  var _DrawingProvider = require("../context/DrawingProvider");
11
11
  var _SeriesContextProvider = require("../context/SeriesContextProvider");
12
12
  var _InteractionProvider = require("../context/InteractionProvider");
13
+ var _useReducedMotion = require("../hooks/useReducedMotion");
13
14
  var _ChartsSurface = require("../ChartsSurface");
14
15
  var _CartesianContextProvider = require("../context/CartesianContextProvider");
15
16
  var _HighlightProvider = require("../context/HighlightProvider");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ 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); }
19
+ 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 && Object.prototype.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; }
19
20
  const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
20
21
  const {
21
22
  width,
@@ -34,6 +35,8 @@ const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(fu
34
35
  } = props;
35
36
  const svgRef = React.useRef(null);
36
37
  const handleRef = (0, _useForkRef.default)(ref, svgRef);
38
+ (0, _useReducedMotion.useReducedMotion)(); // a11y reduce motion (see: https://react-spring.dev/docs/utilities/use-reduced-motion)
39
+
37
40
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, {
38
41
  width: width,
39
42
  height: height,
@@ -12,8 +12,8 @@ var _CartesianContextProvider = require("../context/CartesianContextProvider");
12
12
  var _ChartsXAxis = require("../ChartsXAxis");
13
13
  var _ChartsYAxis = require("../ChartsYAxis");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ 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); }
16
+ 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 && Object.prototype.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; }
17
17
  const getAxisId = propsValue => {
18
18
  if (propsValue == null) {
19
19
  return null;
@@ -105,11 +105,15 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
105
105
  fill: _propTypes.default.string,
106
106
  label: _propTypes.default.string,
107
107
  labelFontSize: _propTypes.default.number,
108
+ labelStyle: _propTypes.default.object,
108
109
  position: _propTypes.default.oneOf(['bottom', 'top']),
109
110
  slotProps: _propTypes.default.object,
110
111
  slots: _propTypes.default.object,
111
112
  stroke: _propTypes.default.string,
112
113
  tickFontSize: _propTypes.default.number,
114
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
115
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
116
+ tickLabelStyle: _propTypes.default.object,
113
117
  tickMaxStep: _propTypes.default.number,
114
118
  tickMinStep: _propTypes.default.number,
115
119
  tickNumber: _propTypes.default.number,
@@ -128,11 +132,15 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
128
132
  fill: _propTypes.default.string,
129
133
  label: _propTypes.default.string,
130
134
  labelFontSize: _propTypes.default.number,
135
+ labelStyle: _propTypes.default.object,
131
136
  position: _propTypes.default.oneOf(['left', 'right']),
132
137
  slotProps: _propTypes.default.object,
133
138
  slots: _propTypes.default.object,
134
139
  stroke: _propTypes.default.string,
135
140
  tickFontSize: _propTypes.default.number,
141
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
142
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
143
+ tickLabelStyle: _propTypes.default.object,
136
144
  tickMaxStep: _propTypes.default.number,
137
145
  tickMinStep: _propTypes.default.number,
138
146
  tickNumber: _propTypes.default.number,
@@ -151,11 +159,15 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
151
159
  fill: _propTypes.default.string,
152
160
  label: _propTypes.default.string,
153
161
  labelFontSize: _propTypes.default.number,
162
+ labelStyle: _propTypes.default.object,
154
163
  position: _propTypes.default.oneOf(['left', 'right']),
155
164
  slotProps: _propTypes.default.object,
156
165
  slots: _propTypes.default.object,
157
166
  stroke: _propTypes.default.string,
158
167
  tickFontSize: _propTypes.default.number,
168
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
169
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
170
+ tickLabelStyle: _propTypes.default.object,
159
171
  tickMaxStep: _propTypes.default.number,
160
172
  tickMinStep: _propTypes.default.number,
161
173
  tickNumber: _propTypes.default.number,
@@ -184,11 +196,15 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
184
196
  fill: _propTypes.default.string,
185
197
  label: _propTypes.default.string,
186
198
  labelFontSize: _propTypes.default.number,
199
+ labelStyle: _propTypes.default.object,
187
200
  position: _propTypes.default.oneOf(['bottom', 'top']),
188
201
  slotProps: _propTypes.default.object,
189
202
  slots: _propTypes.default.object,
190
203
  stroke: _propTypes.default.string,
191
204
  tickFontSize: _propTypes.default.number,
205
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
206
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
207
+ tickLabelStyle: _propTypes.default.object,
192
208
  tickMaxStep: _propTypes.default.number,
193
209
  tickMinStep: _propTypes.default.number,
194
210
  tickNumber: _propTypes.default.number,
@@ -9,7 +9,7 @@ export interface ChartsAxisClasses {
9
9
  tick: string;
10
10
  /** Styles applied to ticks label. */
11
11
  tickLabel: string;
12
- /** Styles applied to the axis label. */
12
+ /** Styles applied to the group containing the axis label. */
13
13
  label: string;
14
14
  /** Styles applied to x axes. */
15
15
  directionX: string;
@@ -12,8 +12,8 @@ var _CartesianContextProvider = require("../context/CartesianContextProvider");
12
12
  var _useScale = require("../hooks/useScale");
13
13
  var _isBandScale = require("../internals/isBandScale");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ 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); }
16
+ 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 && Object.prototype.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; }
17
17
  function ChartsAxisHighlight(props) {
18
18
  const {
19
19
  x: xAxisHighlight,