@mui/x-charts 6.19.1 → 6.19.3

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 (109) hide show
  1. package/BarChart/BarChart.js +1 -0
  2. package/BarChart/BarElement.d.ts +37 -20
  3. package/CHANGELOG.md +84 -0
  4. package/ChartsLegend/ChartsLegend.d.ts +5 -2
  5. package/ChartsLegend/ChartsLegend.js +137 -1
  6. package/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
  7. package/ChartsSurface.d.ts +2 -2
  8. package/ChartsSurface.js +33 -1
  9. package/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
  10. package/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
  11. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  12. package/ChartsTooltip/ChartsTooltipTable.js +2 -0
  13. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
  14. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
  15. package/LineChart/LineChart.d.ts +1 -0
  16. package/LineChart/LineChart.js +2 -0
  17. package/PieChart/PieArcLabelPlot.d.ts +5 -0
  18. package/PieChart/PieArcLabelPlot.js +2 -0
  19. package/PieChart/PieArcPlot.d.ts +5 -0
  20. package/PieChart/PieArcPlot.js +1 -0
  21. package/PieChart/PieChart.d.ts +14 -2
  22. package/PieChart/PieChart.js +3 -2
  23. package/ScatterChart/ScatterChart.js +1 -0
  24. package/SparkLineChart/SparkLineChart.d.ts +15 -1
  25. package/SparkLineChart/SparkLineChart.js +8 -1
  26. package/context/CartesianContextProvider.d.ts +1 -1
  27. package/context/CartesianContextProvider.js +7 -6
  28. package/context/DrawingProvider.d.ts +1 -1
  29. package/context/DrawingProvider.js +8 -7
  30. package/context/HighlightProvider.d.ts +2 -2
  31. package/context/HighlightProvider.js +4 -3
  32. package/context/InteractionProvider.d.ts +2 -2
  33. package/context/InteractionProvider.js +4 -3
  34. package/context/SeriesContextProvider.d.ts +3 -1
  35. package/context/SeriesContextProvider.js +7 -6
  36. package/esm/BarChart/BarChart.js +1 -0
  37. package/esm/ChartsLegend/ChartsLegend.js +139 -2
  38. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
  39. package/esm/ChartsSurface.js +35 -2
  40. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
  41. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
  42. package/esm/ChartsTooltip/ChartsTooltipTable.js +2 -0
  43. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
  44. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
  45. package/esm/LineChart/LineChart.js +2 -0
  46. package/esm/PieChart/PieArcLabelPlot.js +2 -0
  47. package/esm/PieChart/PieArcPlot.js +1 -0
  48. package/esm/PieChart/PieChart.js +3 -2
  49. package/esm/ScatterChart/ScatterChart.js +1 -0
  50. package/esm/SparkLineChart/SparkLineChart.js +8 -1
  51. package/esm/context/CartesianContextProvider.js +7 -6
  52. package/esm/context/DrawingProvider.js +8 -7
  53. package/esm/context/HighlightProvider.js +6 -4
  54. package/esm/context/InteractionProvider.js +6 -4
  55. package/esm/context/SeriesContextProvider.js +9 -7
  56. package/esm/hooks/useDrawingArea.js +7 -3
  57. package/esm/index.js +2 -0
  58. package/hooks/useDrawingArea.d.ts +2 -0
  59. package/hooks/useDrawingArea.js +7 -3
  60. package/index.d.ts +2 -0
  61. package/index.js +23 -1
  62. package/legacy/BarChart/BarChart.js +1 -0
  63. package/legacy/ChartsLegend/ChartsLegend.js +139 -2
  64. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +5 -3
  65. package/legacy/ChartsReferenceLine/common.js +3 -4
  66. package/legacy/ChartsSurface.js +35 -2
  67. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
  68. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
  69. package/legacy/ChartsTooltip/ChartsTooltipTable.js +8 -7
  70. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
  71. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
  72. package/legacy/LineChart/LineChart.js +2 -0
  73. package/legacy/PieChart/PieArcLabelPlot.js +2 -0
  74. package/legacy/PieChart/PieArcPlot.js +1 -0
  75. package/legacy/PieChart/PieChart.js +3 -2
  76. package/legacy/ScatterChart/ScatterChart.js +1 -0
  77. package/legacy/SparkLineChart/SparkLineChart.js +8 -1
  78. package/legacy/context/CartesianContextProvider.js +15 -15
  79. package/legacy/context/DrawingProvider.js +6 -6
  80. package/legacy/context/HighlightProvider.js +4 -3
  81. package/legacy/context/InteractionProvider.js +4 -3
  82. package/legacy/context/SeriesContextProvider.js +8 -7
  83. package/legacy/hooks/useDrawingArea.js +7 -3
  84. package/legacy/index.js +3 -1
  85. package/legacy/internals/components/AxisSharedComponents.js +5 -6
  86. package/models/seriesType/pie.d.ts +1 -0
  87. package/modern/BarChart/BarChart.js +1 -0
  88. package/modern/ChartsLegend/ChartsLegend.js +139 -2
  89. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +7 -3
  90. package/modern/ChartsSurface.js +35 -2
  91. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +2 -54
  92. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -1
  93. package/modern/ChartsTooltip/ChartsTooltipTable.js +2 -0
  94. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -54
  95. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +15 -1
  96. package/modern/LineChart/LineChart.js +2 -0
  97. package/modern/PieChart/PieArcLabelPlot.js +2 -0
  98. package/modern/PieChart/PieArcPlot.js +1 -0
  99. package/modern/PieChart/PieChart.js +3 -2
  100. package/modern/ScatterChart/ScatterChart.js +1 -0
  101. package/modern/SparkLineChart/SparkLineChart.js +8 -1
  102. package/modern/context/CartesianContextProvider.js +7 -6
  103. package/modern/context/DrawingProvider.js +8 -7
  104. package/modern/context/HighlightProvider.js +6 -4
  105. package/modern/context/InteractionProvider.js +6 -4
  106. package/modern/context/SeriesContextProvider.js +9 -7
  107. package/modern/hooks/useDrawingArea.js +7 -3
  108. package/modern/index.js +3 -1
  109. package/package.json +1 -1
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["rotate", "dominantBaseline"],
4
4
  _excluded2 = ["label"];
5
5
  import * as React from 'react';
6
+ import PropTypes from 'prop-types';
6
7
  import { useSlotProps } from '@mui/base/utils';
7
8
  import { NoSsr } from '@mui/base/NoSsr';
8
9
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
@@ -234,7 +235,108 @@ function DefaultChartsLegend(props) {
234
235
  })
235
236
  });
236
237
  }
237
- export function ChartsLegend(inProps) {
238
+ process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
239
+ // ----------------------------- Warning --------------------------------
240
+ // | These PropTypes are generated from the TypeScript type definitions |
241
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
242
+ // ----------------------------------------------------------------------
243
+ /**
244
+ * Override or extend the styles applied to the component.
245
+ */
246
+ classes: PropTypes.object.isRequired,
247
+ /**
248
+ * The direction of the legend layout.
249
+ * The default depends on the chart.
250
+ */
251
+ direction: PropTypes.oneOf(['column', 'row']).isRequired,
252
+ drawingArea: PropTypes.shape({
253
+ bottom: PropTypes.number.isRequired,
254
+ height: PropTypes.number.isRequired,
255
+ left: PropTypes.number.isRequired,
256
+ right: PropTypes.number.isRequired,
257
+ top: PropTypes.number.isRequired,
258
+ width: PropTypes.number.isRequired
259
+ }).isRequired,
260
+ /**
261
+ * Set to true to hide the legend.
262
+ * @default false
263
+ */
264
+ hidden: PropTypes.bool,
265
+ /**
266
+ * Space between two legend items (in px).
267
+ * @default 10
268
+ */
269
+ itemGap: PropTypes.number,
270
+ /**
271
+ * Height of the item mark (in px).
272
+ * @default 20
273
+ */
274
+ itemMarkHeight: PropTypes.number,
275
+ /**
276
+ * Width of the item mark (in px).
277
+ * @default 20
278
+ */
279
+ itemMarkWidth: PropTypes.number,
280
+ /**
281
+ * Style applied to legend labels.
282
+ * @default theme.typography.subtitle1
283
+ */
284
+ labelStyle: PropTypes.object,
285
+ /**
286
+ * Space between the mark and the label (in px).
287
+ * @default 5
288
+ */
289
+ markGap: PropTypes.number,
290
+ /**
291
+ * Legend padding (in px).
292
+ * Can either be a single number, or an object with top, left, bottom, right properties.
293
+ * @default 0
294
+ */
295
+ padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
296
+ bottom: PropTypes.number,
297
+ left: PropTypes.number,
298
+ right: PropTypes.number,
299
+ top: PropTypes.number
300
+ })]),
301
+ position: PropTypes.shape({
302
+ horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
303
+ vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
304
+ }).isRequired,
305
+ series: PropTypes.shape({
306
+ bar: PropTypes.shape({
307
+ series: PropTypes.object.isRequired,
308
+ seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
309
+ stackingGroups: PropTypes.arrayOf(PropTypes.shape({
310
+ ids: PropTypes.arrayOf(PropTypes.string).isRequired,
311
+ stackingOffset: PropTypes.func.isRequired,
312
+ stackingOrder: PropTypes.func.isRequired
313
+ })).isRequired
314
+ }),
315
+ line: PropTypes.shape({
316
+ series: PropTypes.object.isRequired,
317
+ seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
318
+ stackingGroups: PropTypes.arrayOf(PropTypes.shape({
319
+ ids: PropTypes.arrayOf(PropTypes.string).isRequired,
320
+ stackingOffset: PropTypes.func.isRequired,
321
+ stackingOrder: PropTypes.func.isRequired
322
+ })).isRequired
323
+ }),
324
+ pie: PropTypes.shape({
325
+ series: PropTypes.object.isRequired,
326
+ seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
327
+ }),
328
+ scatter: PropTypes.shape({
329
+ series: PropTypes.object.isRequired,
330
+ seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
331
+ })
332
+ }).isRequired,
333
+ seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({
334
+ color: PropTypes.string.isRequired,
335
+ id: PropTypes.string.isRequired,
336
+ label: PropTypes.string.isRequired
337
+ })).isRequired
338
+ } : void 0;
339
+ function ChartsLegend(inProps) {
238
340
  var _slots$legend;
239
341
  const props = useThemeProps({
240
342
  props: _extends({}, defaultProps, inProps),
@@ -270,4 +372,39 @@ export function ChartsLegend(inProps) {
270
372
  ownerState: {}
271
373
  });
272
374
  return /*#__PURE__*/_jsx(ChartLegendRender, _extends({}, chartLegendRenderProps));
273
- }
375
+ }
376
+ process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
377
+ // ----------------------------- Warning --------------------------------
378
+ // | These PropTypes are generated from the TypeScript type definitions |
379
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
380
+ // ----------------------------------------------------------------------
381
+ /**
382
+ * Override or extend the styles applied to the component.
383
+ */
384
+ classes: PropTypes.object,
385
+ /**
386
+ * The direction of the legend layout.
387
+ * The default depends on the chart.
388
+ */
389
+ direction: PropTypes.oneOf(['column', 'row']),
390
+ /**
391
+ * Set to true to hide the legend.
392
+ * @default false
393
+ */
394
+ hidden: PropTypes.bool,
395
+ position: PropTypes.shape({
396
+ horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
397
+ vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
398
+ }),
399
+ /**
400
+ * The props used for each component slot.
401
+ * @default {}
402
+ */
403
+ slotProps: PropTypes.object,
404
+ /**
405
+ * Overridable component slots.
406
+ * @default {}
407
+ */
408
+ slots: PropTypes.object
409
+ } : void 0;
410
+ export { ChartsLegend };
@@ -5,13 +5,17 @@ import { ChartsXReferenceLine } from './ChartsXReferenceLine';
5
5
  import { ChartsYReferenceLine } from './ChartsYReferenceLine';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  function ChartsReferenceLine(props) {
8
- if (props.x !== undefined && props.y !== undefined) {
8
+ const {
9
+ x,
10
+ y
11
+ } = props;
12
+ if (x !== undefined && y !== undefined) {
9
13
  throw new Error('MUI-X-Charts: The ChartsReferenceLine can not have both `x` and `y` props set.');
10
14
  }
11
- if (props.x === undefined && props.y === undefined) {
15
+ if (x === undefined && y === undefined) {
12
16
  throw new Error('MUI-X-Charts: The ChartsReferenceLine should have a value in `x` or `y` prop.');
13
17
  }
14
- if (props.x !== undefined) {
18
+ if (x !== undefined) {
15
19
  return /*#__PURE__*/_jsx(ChartsXReferenceLine, _extends({}, props));
16
20
  }
17
21
  return /*#__PURE__*/_jsx(ChartsYReferenceLine, _extends({}, props));
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className"];
4
4
  import { styled } from '@mui/material/styles';
5
+ import PropTypes from 'prop-types';
5
6
  import * as React from 'react';
6
7
  import { useAxisEvents } from './hooks/useAxisEvents';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -10,7 +11,7 @@ const ChartChartsSurfaceStyles = styled('svg', {
10
11
  name: 'MuiChartsSurface',
11
12
  slot: 'Root'
12
13
  })(() => ({}));
13
- export const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
14
+ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
14
15
  const {
15
16
  children,
16
17
  width,
@@ -38,4 +39,36 @@ export const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurfac
38
39
  children: props.desc
39
40
  }), children]
40
41
  }));
41
- });
42
+ });
43
+ process.env.NODE_ENV !== "production" ? ChartsSurface.propTypes = {
44
+ // ----------------------------- Warning --------------------------------
45
+ // | These PropTypes are generated from the TypeScript type definitions |
46
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
47
+ // ----------------------------------------------------------------------
48
+ children: PropTypes.node,
49
+ className: PropTypes.string,
50
+ desc: PropTypes.string,
51
+ /**
52
+ * If `true`, the charts will not listen to the mouse move event.
53
+ * It might break interactive features, but will improve performance.
54
+ * @default false
55
+ */
56
+ disableAxisListener: PropTypes.bool,
57
+ /**
58
+ * The height of the chart in px.
59
+ */
60
+ height: PropTypes.number.isRequired,
61
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
62
+ title: PropTypes.string,
63
+ viewBox: PropTypes.shape({
64
+ height: PropTypes.number,
65
+ width: PropTypes.number,
66
+ x: PropTypes.number,
67
+ y: PropTypes.number
68
+ }),
69
+ /**
70
+ * The width of the chart in px.
71
+ */
72
+ width: PropTypes.number.isRequired
73
+ } : void 0;
74
+ export { ChartsSurface };
@@ -76,37 +76,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
76
76
  classes: PropTypes.object.isRequired,
77
77
  content: PropTypes.elementType,
78
78
  contentProps: PropTypes.shape({
79
- axis: PropTypes.shape({
80
- axisId: PropTypes.string,
81
- classes: PropTypes.object,
82
- data: PropTypes.array,
83
- dataKey: PropTypes.string,
84
- disableLine: PropTypes.bool,
85
- disableTicks: PropTypes.bool,
86
- fill: PropTypes.string,
87
- hideTooltip: PropTypes.bool,
88
- id: PropTypes.string.isRequired,
89
- label: PropTypes.string,
90
- labelFontSize: PropTypes.number,
91
- labelStyle: PropTypes.object,
92
- max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
93
- min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
94
- position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
95
- scale: PropTypes.func.isRequired,
96
- scaleType: PropTypes.oneOf(['time']).isRequired,
97
- slotProps: PropTypes.object,
98
- slots: PropTypes.object,
99
- stroke: PropTypes.string,
100
- tickFontSize: PropTypes.number,
101
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
102
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
103
- tickLabelStyle: PropTypes.object,
104
- tickMaxStep: PropTypes.number,
105
- tickMinStep: PropTypes.number,
106
- tickNumber: PropTypes.number.isRequired,
107
- tickSize: PropTypes.number,
108
- valueFormatter: PropTypes.func
109
- }),
79
+ axis: PropTypes.object,
110
80
  axisData: PropTypes.shape({
111
81
  x: PropTypes.shape({
112
82
  index: PropTypes.number,
@@ -120,29 +90,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
120
90
  axisValue: PropTypes.any,
121
91
  classes: PropTypes.object,
122
92
  dataIndex: PropTypes.number,
123
- series: PropTypes.arrayOf(PropTypes.shape({
124
- area: PropTypes.bool,
125
- color: PropTypes.string.isRequired,
126
- connectNulls: PropTypes.bool,
127
- curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
128
- data: PropTypes.arrayOf(PropTypes.number).isRequired,
129
- dataKey: PropTypes.string,
130
- disableHighlight: PropTypes.bool,
131
- highlightScope: PropTypes.shape({
132
- faded: PropTypes.oneOf(['global', 'none', 'series']),
133
- highlighted: PropTypes.oneOf(['item', 'none', 'series'])
134
- }),
135
- id: PropTypes.string.isRequired,
136
- label: PropTypes.string,
137
- showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
138
- stack: PropTypes.string,
139
- stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
140
- stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
141
- type: PropTypes.oneOf(['line']).isRequired,
142
- valueFormatter: PropTypes.func.isRequired,
143
- xAxisKey: PropTypes.string,
144
- yAxisKey: PropTypes.string
145
- })),
93
+ series: PropTypes.arrayOf(PropTypes.object),
146
94
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
147
95
  }),
148
96
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
@@ -44,7 +44,21 @@ process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
44
44
  }),
45
45
  series: PropTypes.shape({
46
46
  color: PropTypes.string,
47
- data: PropTypes.arrayOf(PropTypes.number).isRequired,
47
+ data: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.shape({
48
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
49
+ x: PropTypes.number.isRequired,
50
+ y: PropTypes.number.isRequired
51
+ })), PropTypes.arrayOf(PropTypes.shape({
52
+ color: PropTypes.string.isRequired,
53
+ endAngle: PropTypes.number.isRequired,
54
+ formattedValue: PropTypes.string.isRequired,
55
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
56
+ index: PropTypes.number.isRequired,
57
+ label: PropTypes.string,
58
+ padAngle: PropTypes.number.isRequired,
59
+ startAngle: PropTypes.number.isRequired,
60
+ value: PropTypes.number.isRequired
61
+ }))]).isRequired,
48
62
  highlightScope: PropTypes.shape({
49
63
  faded: PropTypes.oneOf(['global', 'none', 'series']),
50
64
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
@@ -59,6 +59,8 @@ export const ChartsTooltipCell = styled('td', {
59
59
  paddingRight: theme.spacing(2)
60
60
  }
61
61
  }));
62
+
63
+ // eslint-disable-next-line material-ui/no-styled-box
62
64
  export const ChartsTooltipMark = styled(Box, {
63
65
  name: 'MuiChartsTooltip',
64
66
  slot: 'Mark'
@@ -81,37 +81,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
81
81
  /**
82
82
  * The properties of the triggered axis.
83
83
  */
84
- axis: PropTypes.shape({
85
- axisId: PropTypes.string,
86
- classes: PropTypes.object,
87
- data: PropTypes.array,
88
- dataKey: PropTypes.string,
89
- disableLine: PropTypes.bool,
90
- disableTicks: PropTypes.bool,
91
- fill: PropTypes.string,
92
- hideTooltip: PropTypes.bool,
93
- id: PropTypes.string.isRequired,
94
- label: PropTypes.string,
95
- labelFontSize: PropTypes.number,
96
- labelStyle: PropTypes.object,
97
- max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
98
- min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
99
- position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
100
- scale: PropTypes.func.isRequired,
101
- scaleType: PropTypes.oneOf(['time']).isRequired,
102
- slotProps: PropTypes.object,
103
- slots: PropTypes.object,
104
- stroke: PropTypes.string,
105
- tickFontSize: PropTypes.number,
106
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
107
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
108
- tickLabelStyle: PropTypes.object,
109
- tickMaxStep: PropTypes.number,
110
- tickMinStep: PropTypes.number,
111
- tickNumber: PropTypes.number.isRequired,
112
- tickSize: PropTypes.number,
113
- valueFormatter: PropTypes.func
114
- }).isRequired,
84
+ axis: PropTypes.object.isRequired,
115
85
  /**
116
86
  * Data identifying the triggered axis.
117
87
  */
@@ -140,29 +110,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
140
110
  /**
141
111
  * The series linked to the triggered axis.
142
112
  */
143
- series: PropTypes.arrayOf(PropTypes.shape({
144
- area: PropTypes.bool,
145
- color: PropTypes.string.isRequired,
146
- connectNulls: PropTypes.bool,
147
- curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
148
- data: PropTypes.arrayOf(PropTypes.number).isRequired,
149
- dataKey: PropTypes.string,
150
- disableHighlight: PropTypes.bool,
151
- highlightScope: PropTypes.shape({
152
- faded: PropTypes.oneOf(['global', 'none', 'series']),
153
- highlighted: PropTypes.oneOf(['item', 'none', 'series'])
154
- }),
155
- id: PropTypes.string.isRequired,
156
- label: PropTypes.string,
157
- showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
158
- stack: PropTypes.string,
159
- stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
160
- stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
161
- type: PropTypes.oneOf(['line']).isRequired,
162
- valueFormatter: PropTypes.func.isRequired,
163
- xAxisKey: PropTypes.string,
164
- yAxisKey: PropTypes.string
165
- })).isRequired,
113
+ series: PropTypes.arrayOf(PropTypes.object).isRequired,
166
114
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
167
115
  } : void 0;
168
116
  export { DefaultChartsAxisTooltipContent };
@@ -78,7 +78,21 @@ process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propType
78
78
  */
79
79
  series: PropTypes.shape({
80
80
  color: PropTypes.string,
81
- data: PropTypes.arrayOf(PropTypes.number).isRequired,
81
+ data: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.number), PropTypes.arrayOf(PropTypes.shape({
82
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
83
+ x: PropTypes.number.isRequired,
84
+ y: PropTypes.number.isRequired
85
+ })), PropTypes.arrayOf(PropTypes.shape({
86
+ color: PropTypes.string.isRequired,
87
+ endAngle: PropTypes.number.isRequired,
88
+ formattedValue: PropTypes.string.isRequired,
89
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
90
+ index: PropTypes.number.isRequired,
91
+ label: PropTypes.string,
92
+ padAngle: PropTypes.number.isRequired,
93
+ startAngle: PropTypes.number.isRequired,
94
+ value: PropTypes.number.isRequired
95
+ }))]).isRequired,
82
96
  highlightScope: PropTypes.shape({
83
97
  faded: PropTypes.oneOf(['global', 'none', 'series']),
84
98
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
@@ -120,6 +120,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
120
120
  * - 'none': display nothing.
121
121
  * - 'line': display a line at the current mouse position.
122
122
  * - 'band': display a band at the current mouse position. Only available with band scale.
123
+ * @default { x: 'line' }
123
124
  */
124
125
  axisHighlight: PropTypes.shape({
125
126
  x: PropTypes.oneOf(['band', 'line', 'none']),
@@ -156,6 +157,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
156
157
  className: PropTypes.string,
157
158
  /**
158
159
  * Color palette used to colorize multiple series.
160
+ * @default blueberryTwilightPalette
159
161
  */
160
162
  colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
161
163
  /**
@@ -106,6 +106,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
106
106
  arcLabel: PropTypes.oneOfType([PropTypes.oneOf(['formattedValue', 'label', 'value']), PropTypes.func]),
107
107
  /**
108
108
  * The minimal angle required to display the arc label.
109
+ * @default 0
109
110
  */
110
111
  arcLabelMinAngle: PropTypes.number,
111
112
  /**
@@ -131,6 +132,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
131
132
  })).isRequired,
132
133
  /**
133
134
  * Override the arc attibutes when it is faded.
135
+ * @default { additionalRadius: -5 }
134
136
  */
135
137
  faded: PropTypes.shape({
136
138
  additionalRadius: PropTypes.number,
@@ -111,6 +111,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
111
111
  })).isRequired,
112
112
  /**
113
113
  * Override the arc attibutes when it is faded.
114
+ * @default { additionalRadius: -5 }
114
115
  */
115
116
  faded: PropTypes.shape({
116
117
  additionalRadius: PropTypes.number,
@@ -108,7 +108,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
108
108
  /**
109
109
  * Indicate which axis to display the bottom of the charts.
110
110
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
111
- * @default xAxisIds[0] The id of the first provided axis
111
+ * @default null
112
112
  */
113
113
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
114
114
  axisId: PropTypes.string,
@@ -136,6 +136,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
136
136
  className: PropTypes.string,
137
137
  /**
138
138
  * Color palette used to colorize multiple series.
139
+ * @default blueberryTwilightPalette
139
140
  */
140
141
  colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
141
142
  /**
@@ -157,7 +158,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
157
158
  /**
158
159
  * Indicate which axis to display the left of the charts.
159
160
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
160
- * @default yAxisIds[0] The id of the first provided axis
161
+ * @default null
161
162
  */
162
163
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
163
164
  axisId: PropTypes.string,
@@ -113,6 +113,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
113
113
  className: PropTypes.string,
114
114
  /**
115
115
  * Color palette used to colorize multiple series.
116
+ * @default blueberryTwilightPalette
116
117
  */
117
118
  colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
118
119
  /**
@@ -119,6 +119,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
119
119
  className: PropTypes.string,
120
120
  /**
121
121
  * Color palette used to colorize multiple series.
122
+ * @default blueberryTwilightPalette
122
123
  */
123
124
  colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
124
125
  /**
@@ -149,7 +150,12 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
149
150
  * The margin between the SVG and the drawing area.
150
151
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
151
152
  * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
152
- * @default object Depends on the charts type.
153
+ * @default {
154
+ * top: 5,
155
+ * bottom: 5,
156
+ * left: 5,
157
+ * right: 5,
158
+ * }
153
159
  */
154
160
  margin: PropTypes.shape({
155
161
  bottom: PropTypes.number,
@@ -198,6 +204,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
198
204
  * Formatter used by the tooltip.
199
205
  * @param {number} value The value to format.
200
206
  * @returns {string} the formatted value.
207
+ * @default (v: number) => v.toString()
201
208
  */
202
209
  valueFormatter: PropTypes.func,
203
210
  viewBox: PropTypes.shape({
@@ -38,12 +38,13 @@ export const CartesianContext = /*#__PURE__*/React.createContext({
38
38
  *
39
39
  * - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/)
40
40
  */
41
- function CartesianContextProvider({
42
- xAxis: inXAxis,
43
- yAxis: inYAxis,
44
- dataset,
45
- children
46
- }) {
41
+ function CartesianContextProvider(props) {
42
+ const {
43
+ xAxis: inXAxis,
44
+ yAxis: inYAxis,
45
+ dataset,
46
+ children
47
+ } = props;
47
48
  const formattedSeries = React.useContext(SeriesContext);
48
49
  const drawingArea = React.useContext(DrawingContext);
49
50
  const xAxis = React.useMemo(() => inXAxis == null ? void 0 : inXAxis.map(axisConfig => {
@@ -23,13 +23,14 @@ export const SVGContext = /*#__PURE__*/React.createContext({
23
23
  *
24
24
  * - [DrawingProvider API](https://mui.com/x/api/charts/drawing-provider/)
25
25
  */
26
- function DrawingProvider({
27
- width,
28
- height,
29
- margin,
30
- svgRef,
31
- children
32
- }) {
26
+ function DrawingProvider(props) {
27
+ const {
28
+ width,
29
+ height,
30
+ margin,
31
+ svgRef,
32
+ children
33
+ } = props;
33
34
  const drawingArea = useChartDimensions(width, height, margin);
34
35
  return /*#__PURE__*/_jsx(SVGContext.Provider, {
35
36
  value: svgRef,
@@ -29,9 +29,10 @@ const dataReducer = (prevState, action) => {
29
29
  return prevState;
30
30
  }
31
31
  };
32
- export function HighlightProvider({
33
- children
34
- }) {
32
+ function HighlightProvider(props) {
33
+ const {
34
+ children
35
+ } = props;
35
36
  const [data, dispatch] = React.useReducer(dataReducer, {
36
37
  item: null,
37
38
  scope: defaultScope
@@ -43,4 +44,5 @@ export function HighlightProvider({
43
44
  value: value,
44
45
  children: children
45
46
  });
46
- }
47
+ }
48
+ export { HighlightProvider };
@@ -31,9 +31,10 @@ const dataReducer = (prevState, action) => {
31
31
  return prevState;
32
32
  }
33
33
  };
34
- export function InteractionProvider({
35
- children
36
- }) {
34
+ function InteractionProvider(props) {
35
+ const {
36
+ children
37
+ } = props;
37
38
  const [data, dispatch] = React.useReducer(dataReducer, {
38
39
  item: null,
39
40
  axis: {
@@ -48,4 +49,5 @@ export function InteractionProvider({
48
49
  value: value,
49
50
  children: children
50
51
  });
51
- }
52
+ }
53
+ export { InteractionProvider };
@@ -57,16 +57,18 @@ const formatSeries = (series, colors, dataset) => {
57
57
  });
58
58
  return formattedSeries;
59
59
  };
60
- export function SeriesContextProvider({
61
- series,
62
- dataset,
63
- colors = blueberryTwilightPalette,
64
- children
65
- }) {
60
+ function SeriesContextProvider(props) {
61
+ const {
62
+ series,
63
+ dataset,
64
+ colors = blueberryTwilightPalette,
65
+ children
66
+ } = props;
66
67
  const theme = useTheme();
67
68
  const formattedSeries = React.useMemo(() => formatSeries(series, typeof colors === 'function' ? colors(theme.palette.mode) : colors, dataset), [series, colors, theme.palette.mode, dataset]);
68
69
  return /*#__PURE__*/_jsx(SeriesContext.Provider, {
69
70
  value: formattedSeries,
70
71
  children: children
71
72
  });
72
- }
73
+ }
74
+ export { SeriesContextProvider };