@mui/x-charts 6.19.3 → 6.19.5

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 (128) hide show
  1. package/BarChart/BarChart.js +11 -9
  2. package/BarChart/BarElement.d.ts +6 -3
  3. package/BarChart/BarElement.js +1 -0
  4. package/BarChart/BarPlot.js +9 -10
  5. package/CHANGELOG.md +117 -0
  6. package/ChartsAxis/ChartsAxis.js +4 -4
  7. package/ChartsLegend/ChartsLegend.js +0 -101
  8. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  9. package/ChartsReferenceLine/common.d.ts +2 -1
  10. package/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
  11. package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  12. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  13. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
  14. package/ChartsXAxis/ChartsXAxis.js +13 -9
  15. package/ChartsYAxis/ChartsYAxis.js +1 -1
  16. package/LineChart/AreaElement.d.ts +7 -4
  17. package/LineChart/AreaElement.js +1 -0
  18. package/LineChart/LineChart.js +11 -9
  19. package/LineChart/LineElement.d.ts +7 -4
  20. package/LineChart/LineElement.js +1 -0
  21. package/LineChart/LineHighlightElement.d.ts +3 -2
  22. package/LineChart/LineHighlightElement.js +2 -1
  23. package/LineChart/MarkElement.d.ts +3 -2
  24. package/LineChart/MarkElement.js +1 -0
  25. package/PieChart/PieArc.d.ts +3 -2
  26. package/PieChart/PieArc.js +1 -0
  27. package/PieChart/PieArcLabel.d.ts +3 -2
  28. package/PieChart/PieArcLabel.js +1 -0
  29. package/PieChart/PieArcLabelPlot.js +1 -1
  30. package/PieChart/PieArcPlot.js +1 -1
  31. package/PieChart/PieChart.js +11 -9
  32. package/ScatterChart/Scatter.js +1 -1
  33. package/ScatterChart/ScatterChart.js +11 -9
  34. package/SparkLineChart/SparkLineChart.d.ts +7 -1
  35. package/SparkLineChart/SparkLineChart.js +14 -5
  36. package/context/CartesianContextProvider.js +8 -6
  37. package/context/InteractionProvider.d.ts +2 -2
  38. package/esm/BarChart/BarChart.js +11 -9
  39. package/esm/BarChart/BarElement.js +1 -0
  40. package/esm/BarChart/BarPlot.js +8 -10
  41. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  42. package/esm/ChartsLegend/ChartsLegend.js +0 -101
  43. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  44. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
  45. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  46. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  47. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
  48. package/esm/ChartsXAxis/ChartsXAxis.js +13 -9
  49. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  50. package/esm/LineChart/AreaElement.js +1 -0
  51. package/esm/LineChart/LineChart.js +11 -9
  52. package/esm/LineChart/LineElement.js +1 -0
  53. package/esm/LineChart/LineHighlightElement.js +2 -1
  54. package/esm/LineChart/MarkElement.js +1 -0
  55. package/esm/PieChart/PieArc.js +1 -0
  56. package/esm/PieChart/PieArcLabel.js +1 -0
  57. package/esm/PieChart/PieArcLabelPlot.js +1 -1
  58. package/esm/PieChart/PieArcPlot.js +1 -1
  59. package/esm/PieChart/PieChart.js +11 -9
  60. package/esm/ScatterChart/Scatter.js +1 -1
  61. package/esm/ScatterChart/ScatterChart.js +11 -9
  62. package/esm/SparkLineChart/SparkLineChart.js +14 -5
  63. package/esm/context/CartesianContextProvider.js +8 -6
  64. package/index.js +1 -1
  65. package/internals/defaultizeColor.d.ts +15 -15
  66. package/internals/defaultizeValueFormatter.d.ts +4 -7
  67. package/internals/stackSeries.d.ts +4 -7
  68. package/legacy/BarChart/BarChart.js +11 -9
  69. package/legacy/BarChart/BarElement.js +1 -0
  70. package/legacy/BarChart/BarPlot.js +10 -10
  71. package/legacy/ChartsAxis/ChartsAxis.js +4 -4
  72. package/legacy/ChartsLegend/ChartsLegend.js +0 -101
  73. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  74. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
  75. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  76. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  77. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
  78. package/legacy/ChartsXAxis/ChartsXAxis.js +12 -8
  79. package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
  80. package/legacy/LineChart/AreaElement.js +1 -0
  81. package/legacy/LineChart/LineChart.js +11 -9
  82. package/legacy/LineChart/LineElement.js +1 -0
  83. package/legacy/LineChart/LineHighlightElement.js +2 -1
  84. package/legacy/LineChart/MarkElement.js +1 -0
  85. package/legacy/PieChart/PieArc.js +1 -0
  86. package/legacy/PieChart/PieArcLabel.js +1 -0
  87. package/legacy/PieChart/PieArcLabelPlot.js +1 -1
  88. package/legacy/PieChart/PieArcPlot.js +1 -1
  89. package/legacy/PieChart/PieChart.js +11 -9
  90. package/legacy/ScatterChart/Scatter.js +1 -1
  91. package/legacy/ScatterChart/ScatterChart.js +11 -9
  92. package/legacy/SparkLineChart/SparkLineChart.js +16 -6
  93. package/legacy/context/CartesianContextProvider.js +8 -6
  94. package/legacy/index.js +1 -1
  95. package/models/axis.d.ts +7 -2
  96. package/models/seriesType/common.d.ts +2 -1
  97. package/models/seriesType/config.d.ts +7 -12
  98. package/models/seriesType/line.d.ts +2 -2
  99. package/models/seriesType/pie.d.ts +7 -3
  100. package/models/seriesType/scatter.d.ts +5 -2
  101. package/modern/BarChart/BarChart.js +11 -9
  102. package/modern/BarChart/BarElement.js +1 -0
  103. package/modern/BarChart/BarPlot.js +8 -10
  104. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  105. package/modern/ChartsLegend/ChartsLegend.js +0 -101
  106. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  107. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
  108. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  109. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
  110. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -2
  111. package/modern/ChartsXAxis/ChartsXAxis.js +13 -9
  112. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  113. package/modern/LineChart/AreaElement.js +1 -0
  114. package/modern/LineChart/LineChart.js +11 -9
  115. package/modern/LineChart/LineElement.js +1 -0
  116. package/modern/LineChart/LineHighlightElement.js +2 -1
  117. package/modern/LineChart/MarkElement.js +1 -0
  118. package/modern/PieChart/PieArc.js +1 -0
  119. package/modern/PieChart/PieArcLabel.js +1 -0
  120. package/modern/PieChart/PieArcLabelPlot.js +1 -1
  121. package/modern/PieChart/PieArcPlot.js +1 -1
  122. package/modern/PieChart/PieChart.js +11 -9
  123. package/modern/ScatterChart/Scatter.js +1 -1
  124. package/modern/ScatterChart/ScatterChart.js +11 -9
  125. package/modern/SparkLineChart/SparkLineChart.js +14 -5
  126. package/modern/context/CartesianContextProvider.js +8 -6
  127. package/modern/index.js +1 -1
  128. package/package.json +1 -1
@@ -132,7 +132,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
132
132
  * @default xAxisIds[0] The id of the first provided axis
133
133
  */
134
134
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
135
- axisId: PropTypes.string,
135
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
136
136
  classes: PropTypes.object,
137
137
  disableLine: PropTypes.bool,
138
138
  disableTicks: PropTypes.bool,
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
186
186
  * @default yAxisIds[0] The id of the first provided axis
187
187
  */
188
188
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
189
- axisId: PropTypes.string,
189
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
190
190
  classes: PropTypes.object,
191
191
  disableLine: PropTypes.bool,
192
192
  disableTicks: PropTypes.bool,
@@ -239,7 +239,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
239
239
  * @default null
240
240
  */
241
241
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
242
- axisId: PropTypes.string,
242
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
243
243
  classes: PropTypes.object,
244
244
  disableLine: PropTypes.bool,
245
245
  disableTicks: PropTypes.bool,
@@ -272,7 +272,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
272
272
  faded: PropTypes.oneOf(['global', 'none', 'series']),
273
273
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
274
274
  }),
275
- id: PropTypes.string,
275
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
276
276
  label: PropTypes.string,
277
277
  showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
278
278
  stack: PropTypes.string,
@@ -309,7 +309,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
309
309
  * @default null
310
310
  */
311
311
  topAxis: PropTypes.oneOfType([PropTypes.shape({
312
- axisId: PropTypes.string,
312
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
313
313
  classes: PropTypes.object,
314
314
  disableLine: PropTypes.bool,
315
315
  disableTicks: PropTypes.bool,
@@ -346,7 +346,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
346
346
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
347
347
  */
348
348
  xAxis: PropTypes.arrayOf(PropTypes.shape({
349
- axisId: PropTypes.string,
349
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
350
350
  classes: PropTypes.object,
351
351
  data: PropTypes.array,
352
352
  dataKey: PropTypes.string,
@@ -354,13 +354,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
354
354
  disableTicks: PropTypes.bool,
355
355
  fill: PropTypes.string,
356
356
  hideTooltip: PropTypes.bool,
357
- id: PropTypes.string,
357
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
358
358
  label: PropTypes.string,
359
359
  labelFontSize: PropTypes.number,
360
360
  labelStyle: PropTypes.object,
361
361
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
362
362
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
363
363
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
364
+ reverse: PropTypes.bool,
364
365
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
365
366
  slotProps: PropTypes.object,
366
367
  slots: PropTypes.object,
@@ -380,7 +381,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
380
381
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
381
382
  */
382
383
  yAxis: PropTypes.arrayOf(PropTypes.shape({
383
- axisId: PropTypes.string,
384
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
384
385
  classes: PropTypes.object,
385
386
  data: PropTypes.array,
386
387
  dataKey: PropTypes.string,
@@ -388,13 +389,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
388
389
  disableTicks: PropTypes.bool,
389
390
  fill: PropTypes.string,
390
391
  hideTooltip: PropTypes.bool,
391
- id: PropTypes.string,
392
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
392
393
  label: PropTypes.string,
393
394
  labelFontSize: PropTypes.number,
394
395
  labelStyle: PropTypes.object,
395
396
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
396
397
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
397
398
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
399
+ reverse: PropTypes.bool,
398
400
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
399
401
  slotProps: PropTypes.object,
400
402
  slots: PropTypes.object,
@@ -122,6 +122,7 @@ process.env.NODE_ENV !== "production" ? LineElement.propTypes = {
122
122
  faded: PropTypes.oneOf(['global', 'none', 'series']),
123
123
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
124
124
  }),
125
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
125
126
  /**
126
127
  * The props used for each component slot.
127
128
  * @default {}
@@ -73,6 +73,7 @@ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
73
73
  // | These PropTypes are generated from the TypeScript type definitions |
74
74
  // | To update them edit the TypeScript types and run "yarn proptypes" |
75
75
  // ----------------------------------------------------------------------
76
- classes: PropTypes.object
76
+ classes: PropTypes.object,
77
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
77
78
  } : void 0;
78
79
  export { LineHighlightElement };
@@ -129,6 +129,7 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
129
129
  faded: PropTypes.oneOf(['global', 'none', 'series']),
130
130
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
131
131
  }),
132
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
132
133
  /**
133
134
  * The shape of the marker.
134
135
  */
@@ -95,6 +95,7 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
95
95
  faded: PropTypes.oneOf(['global', 'none', 'series']),
96
96
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
97
97
  }),
98
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
98
99
  isFaded: PropTypes.bool.isRequired,
99
100
  isHighlighted: PropTypes.bool.isRequired
100
101
  } : void 0;
@@ -98,6 +98,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
98
98
  // ----------------------------------------------------------------------
99
99
  classes: PropTypes.object,
100
100
  formattedArcLabel: PropTypes.string,
101
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
101
102
  isFaded: PropTypes.bool.isRequired,
102
103
  isHighlighted: PropTypes.bool.isRequired
103
104
  } : void 0;
@@ -159,7 +159,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
159
159
  faded: PropTypes.oneOf(['global', 'none', 'series']),
160
160
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
161
161
  }),
162
- id: PropTypes.string.isRequired,
162
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
163
163
  /**
164
164
  * The radius between circle center and the begining of the arc.
165
165
  * @default 0
@@ -138,7 +138,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
138
138
  faded: PropTypes.oneOf(['global', 'none', 'series']),
139
139
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
140
140
  }),
141
- id: PropTypes.string.isRequired,
141
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
142
142
  /**
143
143
  * The radius between circle center and the begining of the arc.
144
144
  * @default 0
@@ -111,7 +111,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
111
111
  * @default null
112
112
  */
113
113
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
114
- axisId: PropTypes.string,
114
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
115
115
  classes: PropTypes.object,
116
116
  disableLine: PropTypes.bool,
117
117
  disableTicks: PropTypes.bool,
@@ -161,7 +161,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
161
161
  * @default null
162
162
  */
163
163
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
164
- axisId: PropTypes.string,
164
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
165
165
  classes: PropTypes.object,
166
166
  disableLine: PropTypes.bool,
167
167
  disableTicks: PropTypes.bool,
@@ -215,7 +215,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
215
215
  * @default null
216
216
  */
217
217
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
218
- axisId: PropTypes.string,
218
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
219
219
  classes: PropTypes.object,
220
220
  disableLine: PropTypes.bool,
221
221
  disableTicks: PropTypes.bool,
@@ -273,7 +273,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
273
273
  faded: PropTypes.oneOf(['global', 'none', 'series']),
274
274
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
275
275
  }),
276
- id: PropTypes.string,
276
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
277
277
  innerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
278
278
  outerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
279
279
  paddingAngle: PropTypes.number,
@@ -309,7 +309,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
309
309
  * @default null
310
310
  */
311
311
  topAxis: PropTypes.oneOfType([PropTypes.shape({
312
- axisId: PropTypes.string,
312
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
313
313
  classes: PropTypes.object,
314
314
  disableLine: PropTypes.bool,
315
315
  disableTicks: PropTypes.bool,
@@ -346,7 +346,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
346
346
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
347
347
  */
348
348
  xAxis: PropTypes.arrayOf(PropTypes.shape({
349
- axisId: PropTypes.string,
349
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
350
350
  classes: PropTypes.object,
351
351
  data: PropTypes.array,
352
352
  dataKey: PropTypes.string,
@@ -354,13 +354,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
354
354
  disableTicks: PropTypes.bool,
355
355
  fill: PropTypes.string,
356
356
  hideTooltip: PropTypes.bool,
357
- id: PropTypes.string,
357
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
358
358
  label: PropTypes.string,
359
359
  labelFontSize: PropTypes.number,
360
360
  labelStyle: PropTypes.object,
361
361
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
362
362
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
363
363
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
364
+ reverse: PropTypes.bool,
364
365
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
365
366
  slotProps: PropTypes.object,
366
367
  slots: PropTypes.object,
@@ -380,7 +381,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
380
381
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
381
382
  */
382
383
  yAxis: PropTypes.arrayOf(PropTypes.shape({
383
- axisId: PropTypes.string,
384
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
384
385
  classes: PropTypes.object,
385
386
  data: PropTypes.array,
386
387
  dataKey: PropTypes.string,
@@ -388,13 +389,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
388
389
  disableTicks: PropTypes.bool,
389
390
  fill: PropTypes.string,
390
391
  hideTooltip: PropTypes.bool,
391
- id: PropTypes.string,
392
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
392
393
  label: PropTypes.string,
393
394
  labelFontSize: PropTypes.number,
394
395
  labelStyle: PropTypes.object,
395
396
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
396
397
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
397
398
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
399
+ reverse: PropTypes.bool,
398
400
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
399
401
  slotProps: PropTypes.object,
400
402
  slots: PropTypes.object,
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
88
88
  faded: PropTypes.oneOf(['global', 'none', 'series']),
89
89
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
90
90
  }),
91
- id: PropTypes.string.isRequired,
91
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
92
92
  label: PropTypes.string,
93
93
  markerSize: PropTypes.number,
94
94
  type: PropTypes.oneOf(['scatter']).isRequired,
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
88
88
  * @default xAxisIds[0] The id of the first provided axis
89
89
  */
90
90
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
91
- axisId: PropTypes.string,
91
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
92
92
  classes: PropTypes.object,
93
93
  disableLine: PropTypes.bool,
94
94
  disableTicks: PropTypes.bool,
@@ -138,7 +138,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
138
138
  * @default yAxisIds[0] The id of the first provided axis
139
139
  */
140
140
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
141
- axisId: PropTypes.string,
141
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
142
142
  classes: PropTypes.object,
143
143
  disableLine: PropTypes.bool,
144
144
  disableTicks: PropTypes.bool,
@@ -191,7 +191,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
191
191
  * @default null
192
192
  */
193
193
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
194
- axisId: PropTypes.string,
194
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
195
195
  classes: PropTypes.object,
196
196
  disableLine: PropTypes.bool,
197
197
  disableTicks: PropTypes.bool,
@@ -223,7 +223,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
223
223
  faded: PropTypes.oneOf(['global', 'none', 'series']),
224
224
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
225
225
  }),
226
- id: PropTypes.string,
226
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
227
227
  label: PropTypes.string,
228
228
  markerSize: PropTypes.number,
229
229
  type: PropTypes.oneOf(['scatter']),
@@ -257,7 +257,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
257
257
  * @default null
258
258
  */
259
259
  topAxis: PropTypes.oneOfType([PropTypes.shape({
260
- axisId: PropTypes.string,
260
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
261
261
  classes: PropTypes.object,
262
262
  disableLine: PropTypes.bool,
263
263
  disableTicks: PropTypes.bool,
@@ -294,7 +294,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
294
294
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
295
295
  */
296
296
  xAxis: PropTypes.arrayOf(PropTypes.shape({
297
- axisId: PropTypes.string,
297
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
298
298
  classes: PropTypes.object,
299
299
  data: PropTypes.array,
300
300
  dataKey: PropTypes.string,
@@ -302,13 +302,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
302
302
  disableTicks: PropTypes.bool,
303
303
  fill: PropTypes.string,
304
304
  hideTooltip: PropTypes.bool,
305
- id: PropTypes.string,
305
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
306
306
  label: PropTypes.string,
307
307
  labelFontSize: PropTypes.number,
308
308
  labelStyle: PropTypes.object,
309
309
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
310
310
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
311
311
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
312
+ reverse: PropTypes.bool,
312
313
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
313
314
  slotProps: PropTypes.object,
314
315
  slots: PropTypes.object,
@@ -328,7 +329,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
328
329
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
329
330
  */
330
331
  yAxis: PropTypes.arrayOf(PropTypes.shape({
331
- axisId: PropTypes.string,
332
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
332
333
  classes: PropTypes.object,
333
334
  data: PropTypes.array,
334
335
  dataKey: PropTypes.string,
@@ -336,13 +337,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
336
337
  disableTicks: PropTypes.bool,
337
338
  fill: PropTypes.string,
338
339
  hideTooltip: PropTypes.bool,
339
- id: PropTypes.string,
340
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
340
341
  label: PropTypes.string,
341
342
  labelFontSize: PropTypes.number,
342
343
  labelStyle: PropTypes.object,
343
344
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
344
345
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
345
346
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
347
+ reverse: PropTypes.bool,
346
348
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
347
349
  slotProps: PropTypes.object,
348
350
  slots: PropTypes.object,
@@ -42,9 +42,10 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
42
42
  slotProps,
43
43
  data,
44
44
  plotType = 'line',
45
- valueFormatter = v => v.toString(),
45
+ valueFormatter = value => value === null ? '' : value.toString(),
46
46
  area,
47
- curve = 'linear'
47
+ curve = 'linear',
48
+ skipAnimation = false
48
49
  } = props;
49
50
  const defaultXHighlight = showHighlight && plotType === 'bar' ? {
50
51
  x: 'band'
@@ -78,6 +79,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
78
79
  sx: sx,
79
80
  disableAxisListener: (!showTooltip || (tooltip == null ? void 0 : tooltip.trigger) !== 'axis') && (axisHighlight == null ? void 0 : axisHighlight.x) === 'none' && (axisHighlight == null ? void 0 : axisHighlight.y) === 'none',
80
81
  children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
82
+ skipAnimation: skipAnimation,
81
83
  slots: slots,
82
84
  slotProps: slotProps,
83
85
  sx: {
@@ -180,6 +182,12 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
180
182
  * @default false
181
183
  */
182
184
  showTooltip: PropTypes.bool,
185
+ /**
186
+ * If `true`, bar animations are skiped.
187
+ * @deprecated In v7 animations are skipped for sparkline.
188
+ * @default false
189
+ */
190
+ skipAnimation: PropTypes.bool,
183
191
  /**
184
192
  * The props used for each component slot.
185
193
  * @default {}
@@ -204,7 +212,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
204
212
  * Formatter used by the tooltip.
205
213
  * @param {number} value The value to format.
206
214
  * @returns {string} the formatted value.
207
- * @default (v: number) => v.toString()
215
+ * @default (value: number | null) => (value === null ? '' : value.toString())
208
216
  */
209
217
  valueFormatter: PropTypes.func,
210
218
  viewBox: PropTypes.shape({
@@ -223,7 +231,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
223
231
  * Notice it is a single configuration object, not an array of configuration.
224
232
  */
225
233
  xAxis: PropTypes.shape({
226
- axisId: PropTypes.string,
234
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
227
235
  classes: PropTypes.object,
228
236
  data: PropTypes.array,
229
237
  dataKey: PropTypes.string,
@@ -231,13 +239,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
231
239
  disableTicks: PropTypes.bool,
232
240
  fill: PropTypes.string,
233
241
  hideTooltip: PropTypes.bool,
234
- id: PropTypes.string,
242
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
235
243
  label: PropTypes.string,
236
244
  labelFontSize: PropTypes.number,
237
245
  labelStyle: PropTypes.object,
238
246
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
239
247
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
240
248
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
249
+ reverse: PropTypes.bool,
241
250
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
242
251
  slotProps: PropTypes.object,
243
252
  slots: PropTypes.object,
@@ -110,7 +110,7 @@ function CartesianContextProvider(props) {
110
110
  var _axis$scaleType, _axis$min, _axis$max, _axis$min2, _axis$max2;
111
111
  const isDefaultAxis = axisIndex === 0;
112
112
  const [minData, maxData] = getAxisExtremum(axis, xExtremumGetters, isDefaultAxis);
113
- const range = [drawingArea.left, drawingArea.left + drawingArea.width];
113
+ const range = axis.reverse ? [drawingArea.left + drawingArea.width, drawingArea.left] : [drawingArea.left, drawingArea.left + drawingArea.width];
114
114
  if (isBandScaleConfig(axis)) {
115
115
  var _axis$categoryGapRati, _axis$barGapRatio;
116
116
  const categoryGapRatio = (_axis$categoryGapRati = axis.categoryGapRatio) != null ? _axis$categoryGapRati : DEFAULT_CATEGORY_GAP_RATIO;
@@ -161,7 +161,7 @@ function CartesianContextProvider(props) {
161
161
  var _axis$scaleType2, _axis$min3, _axis$max3, _axis$min4, _axis$max4;
162
162
  const isDefaultAxis = axisIndex === 0;
163
163
  const [minData, maxData] = getAxisExtremum(axis, yExtremumGetters, isDefaultAxis);
164
- const range = [drawingArea.top + drawingArea.height, drawingArea.top];
164
+ const range = axis.reverse ? [drawingArea.top, drawingArea.top + drawingArea.height] : [drawingArea.top + drawingArea.height, drawingArea.top];
165
165
  if (isBandScaleConfig(axis)) {
166
166
  var _axis$categoryGapRati2;
167
167
  const categoryGapRatio = (_axis$categoryGapRati2 = axis.categoryGapRatio) != null ? _axis$categoryGapRati2 : DEFAULT_CATEGORY_GAP_RATIO;
@@ -231,7 +231,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
231
231
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
232
232
  */
233
233
  xAxis: PropTypes.arrayOf(PropTypes.shape({
234
- axisId: PropTypes.string,
234
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
235
235
  classes: PropTypes.object,
236
236
  data: PropTypes.array,
237
237
  dataKey: PropTypes.string,
@@ -239,13 +239,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
239
239
  disableTicks: PropTypes.bool,
240
240
  fill: PropTypes.string,
241
241
  hideTooltip: PropTypes.bool,
242
- id: PropTypes.string,
242
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
243
243
  label: PropTypes.string,
244
244
  labelFontSize: PropTypes.number,
245
245
  labelStyle: PropTypes.object,
246
246
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
247
247
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
248
248
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
249
+ reverse: PropTypes.bool,
249
250
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
250
251
  slotProps: PropTypes.object,
251
252
  slots: PropTypes.object,
@@ -265,7 +266,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
265
266
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
266
267
  */
267
268
  yAxis: PropTypes.arrayOf(PropTypes.shape({
268
- axisId: PropTypes.string,
269
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
269
270
  classes: PropTypes.object,
270
271
  data: PropTypes.array,
271
272
  dataKey: PropTypes.string,
@@ -273,13 +274,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
273
274
  disableTicks: PropTypes.bool,
274
275
  fill: PropTypes.string,
275
276
  hideTooltip: PropTypes.bool,
276
- id: PropTypes.string,
277
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
277
278
  label: PropTypes.string,
278
279
  labelFontSize: PropTypes.number,
279
280
  labelStyle: PropTypes.object,
280
281
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
281
282
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
282
283
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
284
+ reverse: PropTypes.bool,
283
285
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
284
286
  slotProps: PropTypes.object,
285
287
  slots: PropTypes.object,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v6.19.3
2
+ * @mui/x-charts v6.19.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -4,7 +4,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
4
4
  color: string;
5
5
  label?: string | undefined;
6
6
  value: number;
7
- id?: string | number | undefined;
7
+ id?: import("../models/seriesType").PieItemId | undefined;
8
8
  }[];
9
9
  type: "pie";
10
10
  innerRadius?: string | number | undefined;
@@ -37,7 +37,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
37
37
  arcLabelRadius?: number | undefined;
38
38
  color?: string | undefined;
39
39
  } | undefined;
40
- id?: string | undefined;
40
+ id?: import("../models/seriesType/common").SeriesId | undefined;
41
41
  color?: string | undefined;
42
42
  valueFormatter?: ((value: import("../models/helpers").MakeOptional<import("../models/seriesType").PieValueType, "id">) => string) | undefined;
43
43
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
@@ -48,7 +48,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
48
48
  label?: string | undefined;
49
49
  layout?: "horizontal" | "vertical" | undefined;
50
50
  stackOffset?: import("..").StackOffsetType | undefined;
51
- id?: string | undefined;
51
+ id?: import("../models/seriesType/common").SeriesId | undefined;
52
52
  color: string;
53
53
  valueFormatter?: ((value: number) => string) | undefined;
54
54
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
@@ -56,6 +56,17 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
56
56
  yAxisKey?: string | undefined;
57
57
  stack?: string | undefined;
58
58
  stackOrder?: import("..").StackOrderType | undefined;
59
+ } | {
60
+ type: "scatter";
61
+ data: import("../models/seriesType").ScatterValueType[];
62
+ markerSize?: number | undefined;
63
+ label?: string | undefined;
64
+ id?: import("../models/seriesType/common").SeriesId | undefined;
65
+ color: string;
66
+ valueFormatter?: ((value: import("../models/seriesType").ScatterValueType) => string) | undefined;
67
+ highlightScope?: Partial<import("..").HighlightScope> | undefined;
68
+ xAxisKey?: string | undefined;
69
+ yAxisKey?: string | undefined;
59
70
  } | {
60
71
  type: "line";
61
72
  data?: (number | null)[] | undefined;
@@ -68,22 +79,11 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
68
79
  disableHighlight?: boolean | undefined;
69
80
  connectNulls?: boolean | undefined;
70
81
  stackOffset?: import("..").StackOffsetType | undefined;
71
- id?: string | undefined;
82
+ id?: import("../models/seriesType/common").SeriesId | undefined;
72
83
  color: string;
73
84
  valueFormatter?: ((value: number) => string) | undefined;
74
85
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
75
86
  xAxisKey?: string | undefined;
76
87
  yAxisKey?: string | undefined;
77
88
  stackOrder?: import("..").StackOrderType | undefined;
78
- } | {
79
- type: "scatter";
80
- data: import("../models/seriesType").ScatterValueType[];
81
- markerSize?: number | undefined;
82
- label?: string | undefined;
83
- id?: string | undefined;
84
- color: string;
85
- valueFormatter?: ((value: import("../models/seriesType").ScatterValueType) => string) | undefined;
86
- highlightScope?: Partial<import("..").HighlightScope> | undefined;
87
- xAxisKey?: string | undefined;
88
- yAxisKey?: string | undefined;
89
89
  };
@@ -1,10 +1,7 @@
1
+ import { SeriesId } from '../models/seriesType/common';
1
2
  declare function defaultizeValueFormatter<ISeries extends {
2
3
  valueFormatter?: IFormatter;
3
- }, IFormatter extends (v: any) => string>(series: {
4
- [id: string]: ISeries;
5
- }, defaultValueFormatter: IFormatter): {
6
- [id: string]: ISeries & {
7
- valueFormatter: IFormatter;
8
- };
9
- };
4
+ }, IFormatter extends (v: any) => string>(series: Record<SeriesId, ISeries>, defaultValueFormatter: IFormatter): Record<SeriesId, ISeries & {
5
+ valueFormatter: IFormatter;
6
+ }>;
10
7
  export default defaultizeValueFormatter;
@@ -1,21 +1,18 @@
1
1
  import { Series } from 'd3-shape';
2
2
  import type { BarSeriesType, LineSeriesType } from '../models/seriesType';
3
3
  import type { StackOffsetType, StackOrderType } from '../models/stacking';
4
- type StackableSeries = {
5
- [id: string]: BarSeriesType;
6
- } | {
7
- [id: string]: LineSeriesType;
8
- };
4
+ import { SeriesId } from '../models/seriesType/common';
5
+ type StackableSeries = Record<SeriesId, BarSeriesType> | Record<SeriesId, LineSeriesType>;
9
6
  type FormatterParams = {
10
7
  series: StackableSeries;
11
- seriesOrder: string[];
8
+ seriesOrder: SeriesId[];
12
9
  defaultStrategy?: {
13
10
  stackOrder?: StackOrderType;
14
11
  stackOffset?: StackOffsetType;
15
12
  };
16
13
  };
17
14
  export type StackingGroupsType = {
18
- ids: string[];
15
+ ids: SeriesId[];
19
16
  stackingOrder: (series: Series<any, any>) => number[];
20
17
  stackingOffset: (series: Series<any, any>, order: Iterable<number>) => void;
21
18
  }[];