@mui/x-charts 7.3.0 → 7.3.2

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 (246) hide show
  1. package/BarChart/BarChart.d.ts +5 -3
  2. package/BarChart/BarChart.js +23 -102
  3. package/BarChart/BarElement.d.ts +63 -62
  4. package/BarChart/BarElement.js +1 -2
  5. package/BarChart/BarPlot.js +9 -9
  6. package/CHANGELOG.md +155 -7
  7. package/ChartContainer/ChartContainer.js +3 -1
  8. package/ChartsAxis/ChartsAxis.js +7 -99
  9. package/ChartsAxis/axisClasses.d.ts +1 -1
  10. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  11. package/ChartsClipPath/ChartsClipPath.js +1 -1
  12. package/ChartsGrid/ChartsGrid.js +1 -1
  13. package/ChartsLegend/ChartsLegend.js +1 -1
  14. package/ChartsLegend/DefaultChartsLegend.js +1 -1
  15. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  16. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
  17. package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
  18. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
  19. package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
  20. package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
  21. package/ChartsOverlay/ChartsOverlay.js +41 -0
  22. package/ChartsOverlay/index.d.ts +3 -0
  23. package/ChartsOverlay/index.js +26 -0
  24. package/ChartsOverlay/package.json +6 -0
  25. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  26. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  27. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  28. package/ChartsReferenceLine/common.d.ts +1 -1
  29. package/ChartsSurface.js +1 -1
  30. package/ChartsText/ChartsText.js +1 -1
  31. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  32. package/ChartsTooltip/ChartsAxisTooltipContent.js +18 -5
  33. package/ChartsTooltip/ChartsItemTooltipContent.js +20 -4
  34. package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
  35. package/ChartsTooltip/ChartsTooltip.js +3 -3
  36. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -7
  37. package/ChartsTooltip/ChartsTooltipTable.js +8 -9
  38. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -6
  39. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -4
  40. package/ChartsTooltip/utils.js +1 -1
  41. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
  42. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  43. package/ChartsXAxis/ChartsXAxis.js +8 -1
  44. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  45. package/ChartsYAxis/ChartsYAxis.js +8 -1
  46. package/Gauge/Gauge.js +2 -2
  47. package/Gauge/GaugeContainer.js +2 -2
  48. package/Gauge/GaugeProvider.d.ts +2 -2
  49. package/Gauge/GaugeProvider.js +2 -2
  50. package/Gauge/GaugeReferenceArc.js +1 -1
  51. package/Gauge/GaugeValueArc.js +1 -1
  52. package/Gauge/GaugeValueText.js +1 -1
  53. package/Gauge/gaugeClasses.d.ts +2 -2
  54. package/Gauge/utils.d.ts +1 -1
  55. package/Gauge/utils.js +4 -4
  56. package/LineChart/AnimatedArea.d.ts +63 -62
  57. package/LineChart/AnimatedArea.js +1 -1
  58. package/LineChart/AnimatedLine.d.ts +63 -62
  59. package/LineChart/AnimatedLine.js +1 -1
  60. package/LineChart/AreaElement.d.ts +1 -1
  61. package/LineChart/AreaElement.js +1 -1
  62. package/LineChart/AreaPlot.js +1 -1
  63. package/LineChart/LineChart.d.ts +5 -3
  64. package/LineChart/LineChart.js +20 -99
  65. package/LineChart/LineElement.d.ts +1 -1
  66. package/LineChart/LineElement.js +1 -1
  67. package/LineChart/LineHighlightElement.js +1 -1
  68. package/LineChart/LineHighlightPlot.js +1 -1
  69. package/LineChart/LinePlot.js +1 -1
  70. package/LineChart/MarkElement.d.ts +1 -1
  71. package/LineChart/MarkElement.js +1 -1
  72. package/LineChart/MarkPlot.js +1 -1
  73. package/PieChart/PieArc.d.ts +2 -1
  74. package/PieChart/PieArc.js +1 -1
  75. package/PieChart/PieArcLabel.d.ts +2 -1
  76. package/PieChart/PieArcLabel.js +2 -2
  77. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  78. package/PieChart/PieArcLabelPlot.js +4 -4
  79. package/PieChart/PieArcPlot.d.ts +1 -1
  80. package/PieChart/PieArcPlot.js +4 -4
  81. package/PieChart/PieChart.d.ts +5 -3
  82. package/PieChart/PieChart.js +23 -99
  83. package/PieChart/PiePlot.js +1 -1
  84. package/PieChart/dataTransform/transition.d.ts +1 -0
  85. package/PieChart/dataTransform/useTransformData.js +1 -1
  86. package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
  87. package/ResponsiveChartContainer/useChartContainerDimensions.js +1 -1
  88. package/ScatterChart/Scatter.js +1 -1
  89. package/ScatterChart/ScatterChart.d.ts +6 -3
  90. package/ScatterChart/ScatterChart.js +74 -125
  91. package/ScatterChart/ScatterPlot.js +9 -2
  92. package/ScatterChart/getColor.d.ts +2 -1
  93. package/ScatterChart/getColor.js +18 -1
  94. package/SparkLineChart/SparkLineChart.js +1 -1
  95. package/context/CartesianContextProvider.d.ts +2 -1
  96. package/context/CartesianContextProvider.js +1 -1
  97. package/context/DrawingProvider.js +1 -1
  98. package/context/HighlightProvider.js +1 -1
  99. package/context/InteractionProvider.js +1 -1
  100. package/context/SeriesContextProvider.js +2 -2
  101. package/context/ZAxisContextProvider.d.ts +33 -0
  102. package/context/ZAxisContextProvider.js +98 -0
  103. package/context/index.d.ts +2 -0
  104. package/context/index.js +8 -1
  105. package/esm/BarChart/BarChart.js +23 -103
  106. package/esm/BarChart/BarElement.js +0 -1
  107. package/esm/BarChart/BarPlot.js +8 -8
  108. package/esm/ChartContainer/ChartContainer.js +3 -2
  109. package/esm/ChartsAxis/ChartsAxis.js +7 -100
  110. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
  111. package/esm/ChartsGrid/ChartsGrid.js +1 -2
  112. package/esm/ChartsLegend/DefaultChartsLegend.js +1 -2
  113. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  114. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  115. package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
  116. package/esm/ChartsOverlay/index.js +3 -0
  117. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  118. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  119. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  120. package/esm/ChartsSurface.js +1 -2
  121. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
  122. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
  123. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  124. package/esm/ChartsTooltip/ChartsTooltipTable.js +8 -8
  125. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
  126. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
  127. package/esm/ChartsXAxis/ChartsXAxis.js +8 -2
  128. package/esm/ChartsYAxis/ChartsYAxis.js +8 -2
  129. package/esm/Gauge/Gauge.js +2 -3
  130. package/esm/Gauge/GaugeContainer.js +1 -1
  131. package/esm/Gauge/GaugeProvider.js +1 -1
  132. package/esm/Gauge/utils.js +4 -4
  133. package/esm/LineChart/AnimatedArea.js +1 -2
  134. package/esm/LineChart/AnimatedLine.js +1 -2
  135. package/esm/LineChart/LineChart.js +20 -100
  136. package/esm/PieChart/PieArcLabel.js +1 -1
  137. package/esm/PieChart/PieArcLabelPlot.js +3 -3
  138. package/esm/PieChart/PieArcPlot.js +3 -3
  139. package/esm/PieChart/PieChart.js +23 -100
  140. package/esm/PieChart/PiePlot.js +1 -2
  141. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  142. package/esm/ScatterChart/ScatterChart.js +74 -126
  143. package/esm/ScatterChart/ScatterPlot.js +8 -1
  144. package/esm/ScatterChart/getColor.js +18 -1
  145. package/esm/SparkLineChart/SparkLineChart.js +1 -2
  146. package/esm/context/SeriesContextProvider.js +1 -1
  147. package/esm/context/ZAxisContextProvider.js +89 -0
  148. package/esm/context/index.js +1 -1
  149. package/esm/hooks/useReducedMotion.js +1 -1
  150. package/esm/hooks/useScale.js +1 -1
  151. package/esm/hooks/useTicks.js +4 -0
  152. package/esm/internals/colorGetter.js +2 -2
  153. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
  154. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  155. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
  156. package/esm/internals/utils.js +1 -1
  157. package/esm/models/z-axis.js +1 -0
  158. package/hooks/useAxisEvents.js +1 -1
  159. package/hooks/useChartDimensions.js +1 -1
  160. package/hooks/useChartId.js +1 -1
  161. package/hooks/useDrawingArea.js +1 -1
  162. package/hooks/useInteractionItemProps.js +1 -1
  163. package/hooks/useMounted.js +1 -1
  164. package/hooks/useReducedMotion.d.ts +1 -1
  165. package/hooks/useReducedMotion.js +1 -1
  166. package/hooks/useScale.d.ts +4 -4
  167. package/hooks/useScale.js +2 -2
  168. package/hooks/useSeries.js +1 -1
  169. package/hooks/useSvgRef.js +1 -1
  170. package/hooks/useTicks.js +5 -1
  171. package/index.js +1 -1
  172. package/internals/colorGetter.d.ts +3 -1
  173. package/internals/colorGetter.js +2 -2
  174. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -6
  175. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  176. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +4 -4
  177. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
  178. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -4
  179. package/internals/defaultizeColor.d.ts +1 -0
  180. package/internals/useAnimatedPath.d.ts +1 -0
  181. package/internals/useAnimatedPath.js +1 -1
  182. package/internals/utils.d.ts +1 -1
  183. package/internals/utils.js +1 -1
  184. package/models/axis.d.ts +1 -1
  185. package/models/colorMapping.d.ts +3 -2
  186. package/models/seriesType/bar.d.ts +1 -1
  187. package/models/seriesType/line.d.ts +1 -1
  188. package/models/seriesType/pie.d.ts +9 -4
  189. package/models/seriesType/scatter.d.ts +5 -0
  190. package/models/z-axis.d.ts +14 -0
  191. package/models/z-axis.js +5 -0
  192. package/modern/BarChart/BarChart.js +23 -103
  193. package/modern/BarChart/BarElement.js +0 -1
  194. package/modern/BarChart/BarPlot.js +8 -8
  195. package/modern/ChartContainer/ChartContainer.js +3 -2
  196. package/modern/ChartsAxis/ChartsAxis.js +7 -100
  197. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
  198. package/modern/ChartsGrid/ChartsGrid.js +1 -2
  199. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -2
  200. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  201. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  202. package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
  203. package/modern/ChartsOverlay/index.js +3 -0
  204. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  205. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  206. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  207. package/modern/ChartsSurface.js +1 -2
  208. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
  209. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
  210. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  211. package/modern/ChartsTooltip/ChartsTooltipTable.js +8 -8
  212. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
  213. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
  214. package/modern/ChartsXAxis/ChartsXAxis.js +8 -2
  215. package/modern/ChartsYAxis/ChartsYAxis.js +8 -2
  216. package/modern/Gauge/Gauge.js +2 -3
  217. package/modern/Gauge/GaugeContainer.js +1 -1
  218. package/modern/Gauge/GaugeProvider.js +1 -1
  219. package/modern/Gauge/utils.js +4 -4
  220. package/modern/LineChart/AnimatedArea.js +1 -2
  221. package/modern/LineChart/AnimatedLine.js +1 -2
  222. package/modern/LineChart/LineChart.js +20 -100
  223. package/modern/PieChart/PieArcLabel.js +1 -1
  224. package/modern/PieChart/PieArcLabelPlot.js +3 -3
  225. package/modern/PieChart/PieArcPlot.js +3 -3
  226. package/modern/PieChart/PieChart.js +23 -100
  227. package/modern/PieChart/PiePlot.js +1 -2
  228. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  229. package/modern/ScatterChart/ScatterChart.js +74 -126
  230. package/modern/ScatterChart/ScatterPlot.js +8 -1
  231. package/modern/ScatterChart/getColor.js +18 -1
  232. package/modern/SparkLineChart/SparkLineChart.js +1 -2
  233. package/modern/context/SeriesContextProvider.js +1 -1
  234. package/modern/context/ZAxisContextProvider.js +89 -0
  235. package/modern/context/index.js +1 -1
  236. package/modern/hooks/useReducedMotion.js +1 -1
  237. package/modern/hooks/useScale.js +1 -1
  238. package/modern/hooks/useTicks.js +4 -0
  239. package/modern/index.js +1 -1
  240. package/modern/internals/colorGetter.js +2 -2
  241. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
  242. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  243. package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
  244. package/modern/internals/utils.js +1 -1
  245. package/modern/models/z-axis.js +1 -0
  246. package/package.json +3 -5
@@ -9,8 +9,7 @@ import { animated, useSpring } from '@react-spring/web';
9
9
  import { useAnimatedPath } from '../internals/useAnimatedPath';
10
10
  import { cleanId } from '../internals/utils';
11
11
  import { useChartId, useDrawingArea } from '../hooks';
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
13
  export const AreaElementPath = styled(animated.path, {
15
14
  name: 'MuiAreaElement',
16
15
  slot: 'Root',
@@ -10,8 +10,7 @@ import { useAnimatedPath } from '../internals/useAnimatedPath';
10
10
  import { cleanId } from '../internals/utils';
11
11
  import { useChartId } from '../hooks/useChartId';
12
12
  import { useDrawingArea } from '../hooks/useDrawingArea';
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
14
  export const LineElementPath = styled(animated.path, {
16
15
  name: 'MuiLineElement',
17
16
  slot: 'Root',
@@ -15,8 +15,8 @@ import { ChartsClipPath } from '../ChartsClipPath';
15
15
  import { LineHighlightPlot } from './LineHighlightPlot';
16
16
  import { ChartsGrid } from '../ChartsGrid';
17
17
  import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
20
  /**
21
21
  * Demos:
22
22
  *
@@ -56,7 +56,8 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
56
56
  children,
57
57
  slots,
58
58
  slotProps,
59
- skipAnimation
59
+ skipAnimation,
60
+ loading
60
61
  } = props;
61
62
  const id = useId();
62
63
  const clipPathId = `${id}-clip-path`;
@@ -98,6 +99,10 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
98
99
  slotProps: slotProps,
99
100
  onItemClick: onLineClick,
100
101
  skipAnimation: skipAnimation
102
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
103
+ loading: loading,
104
+ slots: slots,
105
+ slotProps: slotProps
101
106
  })]
102
107
  }), /*#__PURE__*/_jsx(ChartsAxis, {
103
108
  topAxis: topAxis,
@@ -117,7 +122,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
117
122
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
118
123
  slots: slots,
119
124
  slotProps: slotProps
120
- })), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
125
+ })), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
121
126
  slots: slots,
122
127
  slotProps: slotProps
123
128
  })), /*#__PURE__*/_jsx(ChartsClipPath, {
@@ -144,30 +149,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
144
149
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
145
150
  * @default xAxisIds[0] The id of the first provided axis
146
151
  */
147
- bottomAxis: PropTypes.oneOfType([PropTypes.shape({
148
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
149
- classes: PropTypes.object,
150
- disableLine: PropTypes.bool,
151
- disableTicks: PropTypes.bool,
152
- fill: PropTypes.string,
153
- label: PropTypes.string,
154
- labelFontSize: PropTypes.number,
155
- labelStyle: PropTypes.object,
156
- position: PropTypes.oneOf(['bottom', 'top']),
157
- slotProps: PropTypes.object,
158
- slots: PropTypes.object,
159
- stroke: PropTypes.string,
160
- tickFontSize: PropTypes.number,
161
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
162
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
163
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
164
- tickLabelStyle: PropTypes.object,
165
- tickMaxStep: PropTypes.number,
166
- tickMinStep: PropTypes.number,
167
- tickNumber: PropTypes.number,
168
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
169
- tickSize: PropTypes.number
170
- }), PropTypes.string]),
152
+ bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
171
153
  children: PropTypes.node,
172
154
  className: PropTypes.string,
173
155
  /**
@@ -206,30 +188,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
206
188
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
207
189
  * @default yAxisIds[0] The id of the first provided axis
208
190
  */
209
- leftAxis: PropTypes.oneOfType([PropTypes.shape({
210
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
211
- classes: PropTypes.object,
212
- disableLine: PropTypes.bool,
213
- disableTicks: PropTypes.bool,
214
- fill: PropTypes.string,
215
- label: PropTypes.string,
216
- labelFontSize: PropTypes.number,
217
- labelStyle: PropTypes.object,
218
- position: PropTypes.oneOf(['left', 'right']),
219
- slotProps: PropTypes.object,
220
- slots: PropTypes.object,
221
- stroke: PropTypes.string,
222
- tickFontSize: PropTypes.number,
223
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
224
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
225
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
226
- tickLabelStyle: PropTypes.object,
227
- tickMaxStep: PropTypes.number,
228
- tickMinStep: PropTypes.number,
229
- tickNumber: PropTypes.number,
230
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
231
- tickSize: PropTypes.number
232
- }), PropTypes.string]),
191
+ leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
233
192
  /**
234
193
  * @deprecated Consider using `slotProps.legend` instead.
235
194
  */
@@ -244,6 +203,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
244
203
  slotProps: PropTypes.object,
245
204
  slots: PropTypes.object
246
205
  }),
206
+ /**
207
+ * If `true`, a loading overlay is displayed.
208
+ */
209
+ loading: PropTypes.bool,
247
210
  /**
248
211
  * The margin between the SVG and the drawing area.
249
212
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -280,32 +243,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
280
243
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
281
244
  * @default null
282
245
  */
283
- rightAxis: PropTypes.oneOfType([PropTypes.shape({
284
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
285
- classes: PropTypes.object,
286
- disableLine: PropTypes.bool,
287
- disableTicks: PropTypes.bool,
288
- fill: PropTypes.string,
289
- label: PropTypes.string,
290
- labelFontSize: PropTypes.number,
291
- labelStyle: PropTypes.object,
292
- position: PropTypes.oneOf(['left', 'right']),
293
- slotProps: PropTypes.object,
294
- slots: PropTypes.object,
295
- stroke: PropTypes.string,
296
- tickFontSize: PropTypes.number,
297
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
298
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
299
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
300
- tickLabelStyle: PropTypes.object,
301
- tickMaxStep: PropTypes.number,
302
- tickMinStep: PropTypes.number,
303
- tickNumber: PropTypes.number,
304
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
305
- tickSize: PropTypes.number
306
- }), PropTypes.string]),
246
+ rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
307
247
  /**
308
248
  * The series to display in the line chart.
249
+ * An array of [[LineSeriesType]] objects.
309
250
  */
310
251
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
311
252
  /**
@@ -343,30 +284,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
343
284
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
344
285
  * @default null
345
286
  */
346
- topAxis: PropTypes.oneOfType([PropTypes.shape({
347
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
348
- classes: PropTypes.object,
349
- disableLine: PropTypes.bool,
350
- disableTicks: PropTypes.bool,
351
- fill: PropTypes.string,
352
- label: PropTypes.string,
353
- labelFontSize: PropTypes.number,
354
- labelStyle: PropTypes.object,
355
- position: PropTypes.oneOf(['bottom', 'top']),
356
- slotProps: PropTypes.object,
357
- slots: PropTypes.object,
358
- stroke: PropTypes.string,
359
- tickFontSize: PropTypes.number,
360
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
361
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
362
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
363
- tickLabelStyle: PropTypes.object,
364
- tickMaxStep: PropTypes.number,
365
- tickMinStep: PropTypes.number,
366
- tickNumber: PropTypes.number,
367
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
368
- tickSize: PropTypes.number
369
- }), PropTypes.string]),
287
+ topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
370
288
  viewBox: PropTypes.shape({
371
289
  height: PropTypes.number,
372
290
  width: PropTypes.number,
@@ -380,6 +298,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
380
298
  /**
381
299
  * The configuration of the x-axes.
382
300
  * If not provided, a default axis config is used.
301
+ * An array of [[AxisConfig]] objects.
383
302
  */
384
303
  xAxis: PropTypes.arrayOf(PropTypes.shape({
385
304
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -432,6 +351,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
432
351
  /**
433
352
  * The configuration of the y-axes.
434
353
  * If not provided, a default axis config is used.
354
+ * An array of [[AxisConfig]] objects.
435
355
  */
436
356
  yAxis: PropTypes.arrayOf(PropTypes.shape({
437
357
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -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,8 +9,8 @@ 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 { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const defaultMargin = {
15
15
  top: 5,
16
16
  bottom: 5,
@@ -60,7 +60,8 @@ function PieChart(props) {
60
60
  children,
61
61
  slots,
62
62
  slotProps,
63
- onItemClick
63
+ onItemClick,
64
+ loading
64
65
  } = props;
65
66
  const isRTL = useIsRTL();
66
67
  const margin = _extends({}, isRTL ? defaultRTLMargin : defaultMargin, marginProps);
@@ -99,10 +100,17 @@ function PieChart(props) {
99
100
  slotProps: slotProps,
100
101
  onItemClick: onItemClick,
101
102
  skipAnimation: skipAnimation
103
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
104
+ loading: loading,
105
+ slots: slots,
106
+ slotProps: slotProps
102
107
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
103
108
  slots: slots,
104
109
  slotProps: slotProps
105
- })), /*#__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]
106
114
  });
107
115
  }
108
116
  process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
@@ -124,30 +132,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
124
132
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
125
133
  * @default null
126
134
  */
127
- bottomAxis: PropTypes.oneOfType([PropTypes.shape({
128
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
129
- classes: PropTypes.object,
130
- disableLine: PropTypes.bool,
131
- disableTicks: PropTypes.bool,
132
- fill: PropTypes.string,
133
- label: PropTypes.string,
134
- labelFontSize: PropTypes.number,
135
- labelStyle: PropTypes.object,
136
- position: PropTypes.oneOf(['bottom', 'top']),
137
- slotProps: PropTypes.object,
138
- slots: PropTypes.object,
139
- stroke: PropTypes.string,
140
- tickFontSize: PropTypes.number,
141
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
142
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
143
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
144
- tickLabelStyle: PropTypes.object,
145
- tickMaxStep: PropTypes.number,
146
- tickMinStep: PropTypes.number,
147
- tickNumber: PropTypes.number,
148
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
149
- tickSize: PropTypes.number
150
- }), PropTypes.string]),
135
+ bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
151
136
  children: PropTypes.node,
152
137
  className: PropTypes.string,
153
138
  /**
@@ -175,30 +160,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
175
160
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
176
161
  * @default null
177
162
  */
178
- leftAxis: PropTypes.oneOfType([PropTypes.shape({
179
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
180
- classes: PropTypes.object,
181
- disableLine: PropTypes.bool,
182
- disableTicks: PropTypes.bool,
183
- fill: PropTypes.string,
184
- label: PropTypes.string,
185
- labelFontSize: PropTypes.number,
186
- labelStyle: PropTypes.object,
187
- position: PropTypes.oneOf(['left', 'right']),
188
- slotProps: PropTypes.object,
189
- slots: PropTypes.object,
190
- stroke: PropTypes.string,
191
- tickFontSize: PropTypes.number,
192
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
193
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
194
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
195
- tickLabelStyle: PropTypes.object,
196
- tickMaxStep: PropTypes.number,
197
- tickMinStep: PropTypes.number,
198
- tickNumber: PropTypes.number,
199
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
200
- tickSize: PropTypes.number
201
- }), PropTypes.string]),
163
+ leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
202
164
  /**
203
165
  * The props of the legend.
204
166
  * @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
@@ -215,6 +177,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
215
177
  slotProps: PropTypes.object,
216
178
  slots: PropTypes.object
217
179
  }),
180
+ /**
181
+ * If `true`, a loading overlay is displayed.
182
+ */
183
+ loading: PropTypes.bool,
218
184
  /**
219
185
  * The margin between the SVG and the drawing area.
220
186
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -236,32 +202,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
236
202
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
237
203
  * @default null
238
204
  */
239
- rightAxis: PropTypes.oneOfType([PropTypes.shape({
240
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
241
- classes: PropTypes.object,
242
- disableLine: PropTypes.bool,
243
- disableTicks: PropTypes.bool,
244
- fill: PropTypes.string,
245
- label: PropTypes.string,
246
- labelFontSize: PropTypes.number,
247
- labelStyle: PropTypes.object,
248
- position: PropTypes.oneOf(['left', 'right']),
249
- slotProps: PropTypes.object,
250
- slots: PropTypes.object,
251
- stroke: PropTypes.string,
252
- tickFontSize: PropTypes.number,
253
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
254
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
255
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
256
- tickLabelStyle: PropTypes.object,
257
- tickMaxStep: PropTypes.number,
258
- tickMinStep: PropTypes.number,
259
- tickNumber: PropTypes.number,
260
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
261
- tickSize: PropTypes.number
262
- }), PropTypes.string]),
205
+ rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
263
206
  /**
264
207
  * The series to display in the pie chart.
208
+ * An array of [[PieSeriesType]] objects.
265
209
  */
266
210
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
267
211
  /**
@@ -299,30 +243,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
299
243
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
300
244
  * @default null
301
245
  */
302
- topAxis: PropTypes.oneOfType([PropTypes.shape({
303
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
304
- classes: PropTypes.object,
305
- disableLine: PropTypes.bool,
306
- disableTicks: PropTypes.bool,
307
- fill: PropTypes.string,
308
- label: PropTypes.string,
309
- labelFontSize: PropTypes.number,
310
- labelStyle: PropTypes.object,
311
- position: PropTypes.oneOf(['bottom', 'top']),
312
- slotProps: PropTypes.object,
313
- slots: PropTypes.object,
314
- stroke: PropTypes.string,
315
- tickFontSize: PropTypes.number,
316
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
317
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
318
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
319
- tickLabelStyle: PropTypes.object,
320
- tickMaxStep: PropTypes.number,
321
- tickMinStep: PropTypes.number,
322
- tickNumber: PropTypes.number,
323
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
324
- tickSize: PropTypes.number
325
- }), PropTypes.string]),
246
+ topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
326
247
  viewBox: PropTypes.shape({
327
248
  height: PropTypes.number,
328
249
  width: PropTypes.number,
@@ -336,6 +257,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
336
257
  /**
337
258
  * The configuration of the x-axes.
338
259
  * If not provided, a default axis config is used.
260
+ * An array of [[AxisConfig]] objects.
339
261
  */
340
262
  xAxis: PropTypes.arrayOf(PropTypes.shape({
341
263
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -388,6 +310,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
388
310
  /**
389
311
  * The configuration of the y-axes.
390
312
  * If not provided, a default axis config is used.
313
+ * An array of [[AxisConfig]] objects.
391
314
  */
392
315
  yAxis: PropTypes.arrayOf(PropTypes.shape({
393
316
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -6,8 +6,7 @@ import { PieArcPlot } from './PieArcPlot';
6
6
  import { PieArcLabelPlot } from './PieArcLabelPlot';
7
7
  import { getPercentageValue } from '../internals/utils';
8
8
  import { getPieCoordinates } from './getPieCoordinates';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
10
  /**
12
11
  * Demos:
13
12
  *
@@ -107,6 +107,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
107
107
  /**
108
108
  * The configuration of the x-axes.
109
109
  * If not provided, a default axis config is used.
110
+ * An array of [[AxisConfig]] objects.
110
111
  */
111
112
  xAxis: PropTypes.arrayOf(PropTypes.shape({
112
113
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -159,6 +160,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
159
160
  /**
160
161
  * The configuration of the y-axes.
161
162
  * If not provided, a default axis config is used.
163
+ * An array of [[AxisConfig]] objects.
162
164
  */
163
165
  yAxis: PropTypes.arrayOf(PropTypes.shape({
164
166
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),