@mui/x-charts 7.3.1 → 7.4.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 (147) hide show
  1. package/BarChart/BarChart.d.ts +4 -3
  2. package/BarChart/BarChart.js +22 -6
  3. package/BarChart/BarClipPath.d.ts +14 -0
  4. package/BarChart/BarClipPath.js +50 -0
  5. package/BarChart/BarPlot.d.ts +4 -0
  6. package/BarChart/BarPlot.js +108 -36
  7. package/BarChart/getRadius.d.ts +15 -0
  8. package/BarChart/getRadius.js +37 -0
  9. package/BarChart/types.d.ts +25 -0
  10. package/BarChart/types.js +5 -0
  11. package/CHANGELOG.md +141 -5
  12. package/ChartsAxis/axisClasses.d.ts +1 -1
  13. package/ChartsGrid/ChartsGrid.js +22 -11
  14. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
  15. package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
  16. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
  17. package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
  18. package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
  19. package/ChartsOverlay/ChartsOverlay.js +41 -0
  20. package/ChartsOverlay/index.d.ts +3 -0
  21. package/ChartsOverlay/index.js +26 -0
  22. package/ChartsOverlay/package.json +6 -0
  23. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  24. package/ChartsReferenceLine/common.d.ts +1 -1
  25. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  26. package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  27. package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
  28. package/ChartsTooltip/ChartsTooltip.js +2 -2
  29. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  30. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  31. package/ChartsXAxis/ChartsXAxis.js +7 -0
  32. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  33. package/ChartsYAxis/ChartsYAxis.js +7 -0
  34. package/Gauge/Gauge.js +1 -1
  35. package/Gauge/GaugeContainer.js +1 -1
  36. package/Gauge/GaugeProvider.d.ts +2 -2
  37. package/Gauge/GaugeProvider.js +1 -1
  38. package/Gauge/gaugeClasses.d.ts +2 -2
  39. package/Gauge/utils.d.ts +1 -1
  40. package/Gauge/utils.js +4 -4
  41. package/LineChart/AreaElement.d.ts +1 -1
  42. package/LineChart/LineChart.d.ts +4 -3
  43. package/LineChart/LineChart.js +12 -2
  44. package/LineChart/LineElement.d.ts +1 -1
  45. package/LineChart/MarkElement.d.ts +1 -1
  46. package/PieChart/PieArc.d.ts +1 -1
  47. package/PieChart/PieArcLabel.d.ts +1 -1
  48. package/PieChart/PieArcLabel.js +1 -1
  49. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  50. package/PieChart/PieArcLabelPlot.js +3 -3
  51. package/PieChart/PieArcPlot.d.ts +1 -1
  52. package/PieChart/PieArcPlot.js +3 -3
  53. package/PieChart/PieChart.d.ts +4 -3
  54. package/PieChart/PieChart.js +15 -2
  55. package/ScatterChart/ScatterChart.d.ts +4 -3
  56. package/ScatterChart/ScatterChart.js +12 -2
  57. package/context/SeriesContextProvider.js +1 -1
  58. package/esm/BarChart/BarChart.js +22 -6
  59. package/esm/BarChart/BarClipPath.js +42 -0
  60. package/esm/BarChart/BarPlot.js +109 -37
  61. package/esm/BarChart/getRadius.js +30 -0
  62. package/esm/BarChart/types.js +1 -0
  63. package/esm/ChartsGrid/ChartsGrid.js +23 -12
  64. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  65. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  66. package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
  67. package/esm/ChartsOverlay/index.js +3 -0
  68. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  69. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  70. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  71. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  72. package/esm/ChartsXAxis/ChartsXAxis.js +7 -0
  73. package/esm/ChartsYAxis/ChartsYAxis.js +7 -0
  74. package/esm/Gauge/Gauge.js +1 -1
  75. package/esm/Gauge/GaugeContainer.js +1 -1
  76. package/esm/Gauge/GaugeProvider.js +1 -1
  77. package/esm/Gauge/utils.js +4 -4
  78. package/esm/LineChart/LineChart.js +12 -2
  79. package/esm/PieChart/PieArcLabel.js +1 -1
  80. package/esm/PieChart/PieArcLabelPlot.js +3 -3
  81. package/esm/PieChart/PieArcPlot.js +3 -3
  82. package/esm/PieChart/PieChart.js +15 -2
  83. package/esm/ScatterChart/ScatterChart.js +12 -2
  84. package/esm/context/SeriesContextProvider.js +1 -1
  85. package/esm/hooks/useReducedMotion.js +1 -1
  86. package/esm/hooks/useScale.js +1 -1
  87. package/esm/hooks/useTicks.js +4 -0
  88. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  89. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  90. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  91. package/esm/internals/utils.js +1 -1
  92. package/hooks/useReducedMotion.d.ts +1 -1
  93. package/hooks/useReducedMotion.js +1 -1
  94. package/hooks/useScale.d.ts +4 -4
  95. package/hooks/useScale.js +1 -1
  96. package/hooks/useTicks.js +4 -0
  97. package/index.js +1 -1
  98. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  99. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  100. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  101. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
  102. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  103. package/internals/utils.d.ts +1 -1
  104. package/internals/utils.js +1 -1
  105. package/models/axis.d.ts +1 -1
  106. package/models/seriesType/bar.d.ts +1 -1
  107. package/models/seriesType/line.d.ts +1 -1
  108. package/models/seriesType/pie.d.ts +4 -4
  109. package/modern/BarChart/BarChart.js +22 -6
  110. package/modern/BarChart/BarClipPath.js +42 -0
  111. package/modern/BarChart/BarPlot.js +109 -37
  112. package/modern/BarChart/getRadius.js +30 -0
  113. package/modern/BarChart/types.js +1 -0
  114. package/modern/ChartsGrid/ChartsGrid.js +23 -12
  115. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  116. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  117. package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
  118. package/modern/ChartsOverlay/index.js +3 -0
  119. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  120. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  121. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  122. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  123. package/modern/ChartsXAxis/ChartsXAxis.js +7 -0
  124. package/modern/ChartsYAxis/ChartsYAxis.js +7 -0
  125. package/modern/Gauge/Gauge.js +1 -1
  126. package/modern/Gauge/GaugeContainer.js +1 -1
  127. package/modern/Gauge/GaugeProvider.js +1 -1
  128. package/modern/Gauge/utils.js +4 -4
  129. package/modern/LineChart/LineChart.js +12 -2
  130. package/modern/PieChart/PieArcLabel.js +1 -1
  131. package/modern/PieChart/PieArcLabelPlot.js +3 -3
  132. package/modern/PieChart/PieArcPlot.js +3 -3
  133. package/modern/PieChart/PieChart.js +15 -2
  134. package/modern/ScatterChart/ScatterChart.js +12 -2
  135. package/modern/context/SeriesContextProvider.js +1 -1
  136. package/modern/hooks/useReducedMotion.js +1 -1
  137. package/modern/hooks/useScale.js +1 -1
  138. package/modern/hooks/useTicks.js +4 -0
  139. package/modern/index.js +1 -1
  140. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  141. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  142. package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  143. package/modern/internals/utils.js +1 -1
  144. package/package.json +2 -2
  145. package/themeAugmentation/components.d.ts +4 -0
  146. package/themeAugmentation/overrides.d.ts +2 -0
  147. package/themeAugmentation/props.d.ts +2 -0
@@ -15,6 +15,7 @@ import { ChartsClipPath } from '../ChartsClipPath';
15
15
  import { LineHighlightPlot } from './LineHighlightPlot';
16
16
  import { ChartsGrid } from '../ChartsGrid';
17
17
  import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
18
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
18
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
20
  /**
20
21
  * Demos:
@@ -55,7 +56,8 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
55
56
  children,
56
57
  slots,
57
58
  slotProps,
58
- skipAnimation
59
+ skipAnimation,
60
+ loading
59
61
  } = props;
60
62
  const id = useId();
61
63
  const clipPathId = `${id}-clip-path`;
@@ -97,6 +99,10 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
97
99
  slotProps: slotProps,
98
100
  onItemClick: onLineClick,
99
101
  skipAnimation: skipAnimation
102
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
103
+ loading: loading,
104
+ slots: slots,
105
+ slotProps: slotProps
100
106
  })]
101
107
  }), /*#__PURE__*/_jsx(ChartsAxis, {
102
108
  topAxis: topAxis,
@@ -116,7 +122,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
116
122
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
117
123
  slots: slots,
118
124
  slotProps: slotProps
119
- })), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
125
+ })), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
120
126
  slots: slots,
121
127
  slotProps: slotProps
122
128
  })), /*#__PURE__*/_jsx(ChartsClipPath, {
@@ -197,6 +203,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
197
203
  slotProps: PropTypes.object,
198
204
  slots: PropTypes.object
199
205
  }),
206
+ /**
207
+ * If `true`, a loading overlay is displayed.
208
+ */
209
+ loading: PropTypes.bool,
200
210
  /**
201
211
  * The margin between the SVG and the drawing area.
202
212
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -39,7 +39,7 @@ const PieArcLabelRoot = styled(animated.text, {
39
39
  }));
40
40
  /**
41
41
  * Helper to compute label position.
42
- * It's not an inline function because we need it in inerpolation.
42
+ * It's not an inline function because we need it in interpolation.
43
43
  */
44
44
  const getLabelPosition = (formattedArcLabel, variable) => (startAngle, endAngle, padAngle, arcLabelRadius, cornerRadius) => {
45
45
  if (!formattedArcLabel) {
@@ -129,7 +129,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
129
129
  value: PropTypes.number.isRequired
130
130
  })).isRequired,
131
131
  /**
132
- * Override the arc attibutes when it is faded.
132
+ * Override the arc attributes when it is faded.
133
133
  * @default { additionalRadius: -5 }
134
134
  */
135
135
  faded: PropTypes.shape({
@@ -142,7 +142,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
142
142
  paddingAngle: PropTypes.number
143
143
  }),
144
144
  /**
145
- * Override the arc attibutes when it is highlighted.
145
+ * Override the arc attributes when it is highlighted.
146
146
  */
147
147
  highlighted: PropTypes.shape({
148
148
  additionalRadius: PropTypes.number,
@@ -159,7 +159,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
159
159
  }),
160
160
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
161
161
  /**
162
- * The radius between circle center and the begining of the arc.
162
+ * The radius between circle center and the beginning of the arc.
163
163
  * @default 0
164
164
  */
165
165
  innerRadius: PropTypes.number,
@@ -109,7 +109,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
109
109
  value: PropTypes.number.isRequired
110
110
  })).isRequired,
111
111
  /**
112
- * Override the arc attibutes when it is faded.
112
+ * Override the arc attributes when it is faded.
113
113
  * @default { additionalRadius: -5 }
114
114
  */
115
115
  faded: PropTypes.shape({
@@ -122,7 +122,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
122
122
  paddingAngle: PropTypes.number
123
123
  }),
124
124
  /**
125
- * Override the arc attibutes when it is highlighted.
125
+ * Override the arc attributes when it is highlighted.
126
126
  */
127
127
  highlighted: PropTypes.shape({
128
128
  additionalRadius: PropTypes.number,
@@ -139,7 +139,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
139
139
  }),
140
140
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
141
141
  /**
142
- * The radius between circle center and the begining of the arc.
142
+ * The radius between circle center and the beginning of the arc.
143
143
  * @default 0
144
144
  */
145
145
  innerRadius: PropTypes.number,
@@ -9,6 +9,7 @@ import { ChartsLegend } from '../ChartsLegend';
9
9
  import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
10
10
  import { PiePlot } from './PiePlot';
11
11
  import { useIsRTL } from '../internals/useIsRTL';
12
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  const defaultMargin = {
14
15
  top: 5,
@@ -59,7 +60,8 @@ function PieChart(props) {
59
60
  children,
60
61
  slots,
61
62
  slotProps,
62
- onItemClick
63
+ onItemClick,
64
+ loading
63
65
  } = props;
64
66
  const isRTL = useIsRTL();
65
67
  const margin = _extends({}, isRTL ? defaultRTLMargin : defaultMargin, marginProps);
@@ -98,10 +100,17 @@ function PieChart(props) {
98
100
  slotProps: slotProps,
99
101
  onItemClick: onItemClick,
100
102
  skipAnimation: skipAnimation
103
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
104
+ loading: loading,
105
+ slots: slots,
106
+ slotProps: slotProps
101
107
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
102
108
  slots: slots,
103
109
  slotProps: slotProps
104
- })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), children]
110
+ })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
111
+ slots: slots,
112
+ slotProps: slotProps
113
+ })), children]
105
114
  });
106
115
  }
107
116
  process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
@@ -168,6 +177,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
168
177
  slotProps: PropTypes.object,
169
178
  slots: PropTypes.object
170
179
  }),
180
+ /**
181
+ * If `true`, a loading overlay is displayed.
182
+ */
183
+ loading: PropTypes.bool,
171
184
  /**
172
185
  * The margin between the SVG and the drawing area.
173
186
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -6,6 +6,7 @@ import { ResponsiveChartContainer } from '../ResponsiveChartContainer';
6
6
  import { ChartsAxis } from '../ChartsAxis';
7
7
  import { ChartsTooltip } from '../ChartsTooltip';
8
8
  import { ChartsLegend } from '../ChartsLegend';
9
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
9
10
  import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
10
11
  import { ChartsVoronoiHandler } from '../ChartsVoronoiHandler/ChartsVoronoiHandler';
11
12
  import { ChartsGrid } from '../ChartsGrid';
@@ -45,7 +46,8 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
45
46
  onItemClick,
46
47
  children,
47
48
  slots,
48
- slotProps
49
+ slotProps,
50
+ loading
49
51
  } = props;
50
52
  return /*#__PURE__*/_jsx(ResponsiveChartContainer, {
51
53
  ref: ref,
@@ -78,13 +80,17 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
78
80
  slots: slots,
79
81
  slotProps: slotProps,
80
82
  onItemClick: disableVoronoi ? onItemClick : undefined
83
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
84
+ loading: loading,
85
+ slots: slots,
86
+ slotProps: slotProps
81
87
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
82
88
  slots: slots,
83
89
  slotProps: slotProps
84
90
  })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({
85
91
  x: "none",
86
92
  y: "none"
87
- }, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({
93
+ }, axisHighlight)), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({
88
94
  trigger: "item"
89
95
  }, tooltip)), children]
90
96
  })
@@ -164,6 +170,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
164
170
  slotProps: PropTypes.object,
165
171
  slots: PropTypes.object
166
172
  }),
173
+ /**
174
+ * If `true`, a loading overlay is displayed.
175
+ */
176
+ loading: PropTypes.bool,
167
177
  /**
168
178
  * The margin between the SVG and the drawing area.
169
179
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -50,7 +50,7 @@ const formatSeries = (series, colors, dataset) => {
50
50
  seriesGroups[type].seriesOrder.push(id);
51
51
  });
52
52
  const formattedSeries = {};
53
- // Apply formater on a type group
53
+ // Apply formatter on a type group
54
54
  Object.keys(seriesTypeFormatter).forEach(type => {
55
55
  if (seriesGroups[type] !== undefined) {
56
56
  formattedSeries[type] = seriesTypeFormatter[type]?.(seriesGroups[type], dataset) ?? seriesGroups[type];
@@ -5,7 +5,7 @@ import { useIsomorphicLayoutEffect, Globals } from '@react-spring/web';
5
5
  * set skipAnimations to the value of the user's
6
6
  * `prefers-reduced-motion` query.
7
7
  *
8
- * The return value, post-effect, is the value of their prefered setting
8
+ * The return value, post-effect, is the value of their preferred setting
9
9
  */
10
10
  export const useReducedMotion = () => {
11
11
  // Taken from: https://github.com/pmndrs/react-spring/blob/02ec877bbfab0df46da0e4a47d5f68d3e731206a/packages/shared/src/hooks/useReducedMotion.ts#L13
@@ -3,7 +3,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
3
3
  import { isBandScale } from '../internals/isBandScale';
4
4
  /**
5
5
  * For a given scale return a function that map value to their position.
6
- * Usefull when dealing with specific scale such as band.
6
+ * Useful when dealing with specific scale such as band.
7
7
  * @param scale The scale to use
8
8
  * @returns (value: any) => number
9
9
  */
@@ -59,6 +59,10 @@ export function useTicks(options) {
59
59
  labelOffset: 0
60
60
  }));
61
61
  }
62
+ if (scale.domain().length === 0 || scale.domain()[0] === scale.domain()[1]) {
63
+ // The axis should not be visible, so ticks should also be hidden.
64
+ return [];
65
+ }
62
66
  const ticks = typeof tickInterval === 'object' ? tickInterval : scale.ticks(tickNumber);
63
67
  return ticks.map(value => ({
64
68
  value,
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.3.1
2
+ * @mui/x-charts v7.4.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -9,7 +9,7 @@ export function useChartGradient() {
9
9
  const {
10
10
  chartId
11
11
  } = React.useContext(DrawingContext);
12
- return React.useCallback((axisId, direction) => `${chartId}-graient-${direction}-${axisId}`, [chartId]);
12
+ return React.useCallback((axisId, direction) => `${chartId}-gradient-${direction}-${axisId}`, [chartId]);
13
13
  }
14
14
  export function ChartsAxesGradients() {
15
15
  const {
@@ -40,7 +40,7 @@ export function ChartsAxesGradients() {
40
40
  } = yAxis[axisId];
41
41
  if (colorMap?.type === 'piecewise') {
42
42
  return /*#__PURE__*/_jsx(ChartsPiecewiseGradient, {
43
- isReveresed: !reverse,
43
+ isReversed: !reverse,
44
44
  scale: scale,
45
45
  colorMap: colorMap,
46
46
  size: svgHeight,
@@ -50,7 +50,7 @@ export function ChartsAxesGradients() {
50
50
  }
51
51
  if (colorMap?.type === 'continuous') {
52
52
  return /*#__PURE__*/_jsx(ChartsContinuousGradient, {
53
- isReveresed: !reverse,
53
+ isReversed: !reverse,
54
54
  scale: scale,
55
55
  colorScale: colorScale,
56
56
  colorMap: colorMap,
@@ -70,7 +70,7 @@ export function ChartsAxesGradients() {
70
70
  } = xAxis[axisId];
71
71
  if (colorMap?.type === 'piecewise') {
72
72
  return /*#__PURE__*/_jsx(ChartsPiecewiseGradient, {
73
- isReveresed: reverse,
73
+ isReversed: reverse,
74
74
  scale: scale,
75
75
  colorMap: colorMap,
76
76
  size: svgWidth,
@@ -80,7 +80,7 @@ export function ChartsAxesGradients() {
80
80
  }
81
81
  if (colorMap?.type === 'continuous') {
82
82
  return /*#__PURE__*/_jsx(ChartsContinuousGradient, {
83
- isReveresed: reverse,
83
+ isReversed: reverse,
84
84
  scale: scale,
85
85
  colorScale: colorScale,
86
86
  colorMap: colorMap,
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  const PX_PRECISION = 10;
5
5
  export default function ChartsContinuousGradient(props) {
6
6
  const {
7
- isReveresed,
7
+ isReversed,
8
8
  gradientId,
9
9
  size,
10
10
  direction,
@@ -26,7 +26,7 @@ export default function ChartsContinuousGradient(props) {
26
26
  x2: "0",
27
27
  y1: "0",
28
28
  y2: "0",
29
- [`${direction}${isReveresed ? 1 : 2}`]: `${size}px`,
29
+ [`${direction}${isReversed ? 1 : 2}`]: `${size}px`,
30
30
  gradientUnits: "userSpaceOnUse" // Use the SVG coordinate instead of the component ones.
31
31
  ,
32
32
  children: Array.from({
@@ -40,7 +40,7 @@ export default function ChartsContinuousGradient(props) {
40
40
  if (x === undefined) {
41
41
  return null;
42
42
  }
43
- const offset = isReveresed ? 1 - x / size : x / size;
43
+ const offset = isReversed ? 1 - x / size : x / size;
44
44
  const color = colorScale(value);
45
45
  if (color === null) {
46
46
  return null;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  export default function ChartsPiecewiseGradient(props) {
4
4
  const {
5
- isReveresed,
5
+ isReversed,
6
6
  gradientId,
7
7
  size,
8
8
  direction,
@@ -15,7 +15,7 @@ export default function ChartsPiecewiseGradient(props) {
15
15
  x2: "0",
16
16
  y1: "0",
17
17
  y2: "0",
18
- [`${direction}${isReveresed ? 1 : 2}`]: `${size}px`,
18
+ [`${direction}${isReversed ? 1 : 2}`]: `${size}px`,
19
19
  gradientUnits: "userSpaceOnUse" // Use the SVG coordinate instead of the component ones.
20
20
  ,
21
21
  children: colorMap.thresholds.map((threshold, index) => {
@@ -23,7 +23,7 @@ export default function ChartsPiecewiseGradient(props) {
23
23
  if (x === undefined) {
24
24
  return null;
25
25
  }
26
- const offset = isReveresed ? 1 - x / size : x / size;
26
+ const offset = isReversed ? 1 - x / size : x / size;
27
27
  return /*#__PURE__*/_jsxs(React.Fragment, {
28
28
  children: [/*#__PURE__*/_jsx("stop", {
29
29
  offset: offset,
@@ -4,7 +4,7 @@ export function getSymbol(shape) {
4
4
  return symbolNames.indexOf(shape) || 0;
5
5
  }
6
6
  /**
7
- * Transform mouse event position to corrdinates inside the SVG.
7
+ * Transform mouse event position to coordinates inside the SVG.
8
8
  * @param svg The SVG element
9
9
  * @param event The mouseEvent to transform
10
10
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.3.1",
3
+ "version": "7.4.0",
4
4
  "description": "The community edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -35,7 +35,7 @@
35
35
  "@mui/utils": "^5.15.14",
36
36
  "@react-spring/rafz": "^9.7.3",
37
37
  "@react-spring/web": "^9.7.3",
38
- "clsx": "^2.1.0",
38
+ "clsx": "^2.1.1",
39
39
  "d3-color": "^3.1.0",
40
40
  "d3-delaunay": "^6.0.4",
41
41
  "d3-interpolate": "^3.0.1",
@@ -18,6 +18,10 @@ export interface ChartsComponents {
18
18
  MuiChartsClipPath?: {
19
19
  defaultProps?: ComponentsProps['MuiChartsClipPath'];
20
20
  };
21
+ MuiChartsGrid?: {
22
+ defaultProps?: ComponentsProps['MuiChartsGrid'];
23
+ styleOverrides?: ComponentsOverrides['MuiChartsGrid'];
24
+ };
21
25
  MuiChartsLegend?: {
22
26
  defaultProps?: ComponentsProps['MuiChartsLegend'];
23
27
  styleOverrides?: ComponentsOverrides['MuiChartsLegend'];
@@ -1,6 +1,7 @@
1
1
  import { BarElementClassKey } from '../BarChart/BarElement';
2
2
  import { ChartsAxisClassKey } from '../ChartsAxis';
3
3
  import { ChartsAxisHighlightClassKey } from '../ChartsAxisHighlight';
4
+ import { ChartsGridClassKey } from '../ChartsGrid';
4
5
  import { ChartsLegendClassKey } from '../ChartsLegend';
5
6
  import { ChartsTooltipClassKey } from '../ChartsTooltip';
6
7
  import { AreaElementClassKey, LineElementClassKey, MarkElementClassKey } from '../LineChart';
@@ -9,6 +10,7 @@ import { AreaElementClassKey, LineElementClassKey, MarkElementClassKey } from '.
9
10
  export interface PickersComponentNameToClassKey {
10
11
  MuiChartsAxis: ChartsAxisClassKey;
11
12
  MuiChartsAxisHighlight: ChartsAxisHighlightClassKey;
13
+ MuiChartsGrid: ChartsGridClassKey;
12
14
  MuiChartsLegend: ChartsLegendClassKey;
13
15
  MuiChartsTooltip: ChartsTooltipClassKey;
14
16
 
@@ -3,6 +3,7 @@ import { BarElementProps } from '../BarChart/BarElement';
3
3
  import { ChartsAxisProps } from '../ChartsAxis';
4
4
  import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
5
5
  import { ChartsClipPathProps } from '../ChartsClipPath';
6
+ import { ChartsGridProps } from '../ChartsGrid';
6
7
  import { ChartsLegendProps } from '../ChartsLegend';
7
8
  import { ChartsSurfaceProps } from '../ChartsSurface';
8
9
  import { ChartsTooltipProps } from '../ChartsTooltip';
@@ -18,6 +19,7 @@ export interface ChartsComponentsPropsList {
18
19
  MuiChartsYAxis: ChartsYAxisProps;
19
20
  MuiChartsAxisHighlight: ChartsAxisHighlightProps;
20
21
  MuiChartsClipPath: ChartsClipPathProps;
22
+ MuiChartsGrid: ChartsGridProps;
21
23
  MuiChartsLegend: ChartsLegendProps;
22
24
  MuiChartsTooltip: ChartsTooltipProps;
23
25
  MuiChartsSurface: ChartsSurfaceProps;