@mui/x-charts 9.4.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/ChartsRadialAxisHighlight/index.d.mts +6 -1
  3. package/ChartsRadialAxisHighlight/index.d.ts +6 -1
  4. package/ChartsRadialAxisHighlight/index.js +9 -2
  5. package/ChartsRadialAxisHighlight/index.mjs +8 -1
  6. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
  7. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
  8. package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +1 -1
  9. package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +1 -1
  10. package/ChartsRadialDataProvider/index.d.mts +5 -0
  11. package/ChartsRadialDataProvider/index.d.ts +5 -0
  12. package/ChartsRadialDataProvider/index.js +12 -1
  13. package/ChartsRadialDataProvider/index.mjs +7 -0
  14. package/ChartsRadialGrid/index.d.mts +6 -1
  15. package/ChartsRadialGrid/index.d.ts +6 -1
  16. package/ChartsRadialGrid/index.js +8 -2
  17. package/ChartsRadialGrid/index.mjs +8 -1
  18. package/ChartsRadiusAxis/index.d.mts +6 -1
  19. package/ChartsRadiusAxis/index.d.ts +6 -1
  20. package/ChartsRadiusAxis/index.js +10 -2
  21. package/ChartsRadiusAxis/index.mjs +7 -1
  22. package/ChartsRotationAxis/index.d.mts +6 -1
  23. package/ChartsRotationAxis/index.d.ts +6 -1
  24. package/ChartsRotationAxis/index.js +10 -2
  25. package/ChartsRotationAxis/index.mjs +7 -1
  26. package/ChartsTooltip/ChartsTooltipContainer.js +11 -4
  27. package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
  28. package/LineChart/AreaElement.js +1 -1
  29. package/LineChart/AreaElement.mjs +1 -1
  30. package/LineChart/CircleMarkElement.js +1 -1
  31. package/LineChart/CircleMarkElement.mjs +1 -1
  32. package/LineChart/LineElement.js +1 -1
  33. package/LineChart/LineElement.mjs +1 -1
  34. package/LineChart/MarkElement.js +1 -1
  35. package/LineChart/MarkElement.mjs +1 -1
  36. package/ScatterChart/ScatterChart.js +7 -3
  37. package/ScatterChart/ScatterChart.mjs +7 -3
  38. package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
  39. package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  40. package/ScatterChart/ScatterChart.plugins.js +2 -1
  41. package/ScatterChart/ScatterChart.plugins.mjs +2 -1
  42. package/ScatterChart/ScatterPlot.d.mts +4 -2
  43. package/ScatterChart/ScatterPlot.d.ts +4 -2
  44. package/ScatterChart/ScatterPlot.js +25 -3
  45. package/ScatterChart/ScatterPlot.mjs +25 -3
  46. package/ScatterChart/async/ScatterAsync.d.mts +9 -0
  47. package/ScatterChart/async/ScatterAsync.d.ts +9 -0
  48. package/ScatterChart/async/ScatterAsync.js +71 -0
  49. package/ScatterChart/async/ScatterAsync.mjs +67 -0
  50. package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
  51. package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
  52. package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
  53. package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
  54. package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
  55. package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
  56. package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
  57. package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
  58. package/SparkLineChart/SparkLineChart.js +2 -1
  59. package/SparkLineChart/SparkLineChart.mjs +2 -1
  60. package/index.js +1 -1
  61. package/index.mjs +1 -1
  62. package/internals/getSeriesColorFn.d.mts +5 -5
  63. package/internals/getSeriesColorFn.d.ts +5 -5
  64. package/internals/index.d.mts +1 -0
  65. package/internals/index.d.ts +1 -0
  66. package/internals/index.js +12 -0
  67. package/internals/index.mjs +1 -0
  68. package/internals/plugins/allPlugins.d.mts +4 -3
  69. package/internals/plugins/allPlugins.d.ts +4 -3
  70. package/internals/plugins/allPlugins.js +2 -1
  71. package/internals/plugins/allPlugins.mjs +2 -1
  72. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
  73. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
  74. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
  75. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
  76. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
  77. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
  78. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
  79. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
  80. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
  81. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
  82. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +1 -1
  83. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +1 -1
  84. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
  85. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
  86. package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
  87. package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
  88. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
  89. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
  90. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
  91. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
  92. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
  93. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
  94. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
  95. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
  96. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
  97. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
  98. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
  99. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
  100. package/internals/scales/scaleBand.js +70 -43
  101. package/internals/scales/scaleBand.mjs +71 -44
  102. package/models/seriesType/bar.d.mts +1 -1
  103. package/models/seriesType/bar.d.ts +1 -1
  104. package/models/seriesType/common.d.mts +4 -4
  105. package/models/seriesType/common.d.ts +4 -4
  106. package/models/seriesType/config.d.mts +3 -3
  107. package/models/seriesType/config.d.ts +3 -3
  108. package/models/seriesType/line.d.mts +1 -1
  109. package/models/seriesType/line.d.ts +1 -1
  110. package/models/seriesType/pie.d.mts +1 -1
  111. package/models/seriesType/pie.d.ts +1 -1
  112. package/models/seriesType/radar.d.mts +1 -1
  113. package/models/seriesType/radar.d.ts +1 -1
  114. package/models/seriesType/scatter.d.mts +1 -1
  115. package/models/seriesType/scatter.d.ts +1 -1
  116. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable func-names */
2
2
  // Adapted from d3-scale v4.0.2
3
3
  // https://github.com/d3/d3-scale/blob/d6904a4bde09e16005e0ad8ca3e25b10ce54fa0d/src/band.js
4
- import { InternMap, range as sequence } from '@mui/x-charts-vendor/d3-array';
4
+ import { InternMap } from '@mui/x-charts-vendor/d3-array';
5
5
  export function keyof(value) {
6
6
  if (Array.isArray(value)) {
7
7
  return JSON.stringify(value);
@@ -13,60 +13,57 @@ export function keyof(value) {
13
13
  }
14
14
 
15
15
  /**
16
- * Constructs a new band scale with the specified range, no padding, no rounding and center alignment.
17
- * The domain defaults to the empty domain.
18
- * If range is not specified, it defaults to the unit range [0, 1].
19
- *
20
- * The generic corresponds to the data type of domain elements.
21
- *
22
- * @param range A two-element array of numeric values.
23
- */
24
-
25
- /**
26
- * Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
27
- *
28
- * The generic corresponds to the data type of domain elements.
29
- *
30
- * @param domain Array of domain values.
31
- * @param range A two-element array of numeric values.
16
+ * The internal state shared when copying a scale. The domain index (`InternMap`) is the expensive
17
+ * part to build — `O(domain)` and is immutable once set (the domain setter replaces it rather than
18
+ * mutating it), so a copy can share the same reference instead of rebuilding it. This makes `copy()`
19
+ * `O(1)`, which matters because zooming copies the scale on every frame to apply a new range.
32
20
  */
33
21
 
34
- export function scaleBand(...args) {
22
+ function createScaleBand(seed) {
35
23
  // @ts-expect-error, InternMap accepts two arguments, but its types are set as Map, which doesn't.
36
- let index = new InternMap(undefined, keyof);
37
- let domain = [];
38
- let ordinalRange = [];
39
- let r0 = 0;
40
- let r1 = 1;
24
+ let index = seed ? seed.index : new InternMap(undefined, keyof);
25
+ let domain = seed ? seed.domain : [];
26
+ let r0 = seed ? seed.r0 : 0;
27
+ let r1 = seed ? seed.r1 : 1;
28
+ let isRound = seed ? seed.isRound : false;
29
+ let paddingInner = seed ? seed.paddingInner : 0;
30
+ let paddingOuter = seed ? seed.paddingOuter : 0;
31
+ let align = seed ? seed.align : 0.5;
32
+
33
+ // Derived on every rescale. Positions are affine in the index, so they are computed on demand in
34
+ // `scale()` rather than materialized into an array — keeping rescale `O(1)` instead of `O(domain)`.
41
35
  let step;
42
36
  let bandwidth;
43
- let isRound = false;
44
- let paddingInner = 0;
45
- let paddingOuter = 0;
46
- let align = 0.5;
37
+ let reverse = false;
38
+ let start = 0;
47
39
  const scale = d => {
48
40
  const i = index.get(d);
49
41
  if (i === undefined) {
50
42
  return undefined;
51
43
  }
52
- return ordinalRange[i % ordinalRange.length];
44
+ const n = domain.length;
45
+ if (n === 0) {
46
+ return undefined;
47
+ }
48
+ const k = reverse ? n - 1 - i % n : i % n;
49
+ return start + step * k;
53
50
  };
54
51
  const rescale = () => {
55
52
  const n = domain.length;
56
- const reverse = r1 < r0;
57
- const start = reverse ? r1 : r0;
58
- const stop = reverse ? r0 : r1;
59
- step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
53
+ reverse = r1 < r0;
54
+ const lo = reverse ? r1 : r0;
55
+ const hi = reverse ? r0 : r1;
56
+ step = (hi - lo) / Math.max(1, n - paddingInner + paddingOuter * 2);
60
57
  if (isRound) {
61
58
  step = Math.floor(step);
62
59
  }
63
- const adjustedStart = start + (stop - start - step * (n - paddingInner)) * align;
60
+ let adjustedStart = lo + (hi - lo - step * (n - paddingInner)) * align;
64
61
  bandwidth = step * (1 - paddingInner);
65
- const finalStart = isRound ? Math.round(adjustedStart) : adjustedStart;
66
- const finalBandwidth = isRound ? Math.round(bandwidth) : bandwidth;
67
- bandwidth = finalBandwidth;
68
- const values = sequence(n).map(i => finalStart + step * i);
69
- ordinalRange = reverse ? values.reverse() : values;
62
+ if (isRound) {
63
+ adjustedStart = Math.round(adjustedStart);
64
+ bandwidth = Math.round(bandwidth);
65
+ }
66
+ start = adjustedStart;
70
67
  return scale;
71
68
  };
72
69
  scale.domain = function (_) {
@@ -141,19 +138,49 @@ export function scaleBand(...args) {
141
138
  align = Math.max(0, Math.min(1, _));
142
139
  return rescale();
143
140
  };
144
- scale.copy = () => {
145
- return scaleBand(domain, [r0, r1]).round(isRound).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
146
- };
147
141
 
148
- // Initialize from arguments
142
+ // Shares the immutable domain index with the copy, so copying does not rebuild it.
143
+ scale.copy = () => createScaleBand({
144
+ index,
145
+ domain,
146
+ r0,
147
+ r1,
148
+ isRound,
149
+ paddingInner,
150
+ paddingOuter,
151
+ align
152
+ });
153
+ rescale();
154
+ return scale;
155
+ }
156
+
157
+ /**
158
+ * Constructs a new band scale with the specified range, no padding, no rounding and center alignment.
159
+ * The domain defaults to the empty domain.
160
+ * If range is not specified, it defaults to the unit range [0, 1].
161
+ *
162
+ * The generic corresponds to the data type of domain elements.
163
+ *
164
+ * @param range A two-element array of numeric values.
165
+ */
166
+
167
+ /**
168
+ * Constructs a new band scale with the specified domain and range, no padding, no rounding and center alignment.
169
+ *
170
+ * The generic corresponds to the data type of domain elements.
171
+ *
172
+ * @param domain Array of domain values.
173
+ * @param range A two-element array of numeric values.
174
+ */
175
+
176
+ export function scaleBand(...args) {
177
+ const scale = createScaleBand();
149
178
  const [arg0, arg1] = args;
150
179
  if (args.length > 1) {
151
180
  scale.domain(arg0);
152
181
  scale.range(arg1);
153
182
  } else if (arg0) {
154
183
  scale.range(arg0);
155
- } else {
156
- rescale();
157
184
  }
158
185
  return scale;
159
186
  }
@@ -52,7 +52,7 @@ export interface CommonBarSeriesType {
52
52
  */
53
53
  barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
54
54
  }
55
- export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
55
+ export interface BarSeriesType extends CommonSeriesType<'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
56
56
  type: 'bar';
57
57
  /**
58
58
  * The placement of the bar label. It accepts the following values:
@@ -52,7 +52,7 @@ export interface CommonBarSeriesType {
52
52
  */
53
53
  barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
54
54
  }
55
- export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
55
+ export interface BarSeriesType extends CommonSeriesType<'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
56
56
  type: 'bar';
57
57
  /**
58
58
  * The placement of the bar label. It accepts the following values:
@@ -1,7 +1,7 @@
1
1
  import type { StackOffsetType, StackOrderType } from "../stacking.mjs";
2
2
  import type { ChartsLabelMarkType } from "../../ChartsLabel/ChartsLabelMark.mjs";
3
3
  import type { AxisId } from "../axis.mjs";
4
- import type { ChartSeriesType, HighlightScope } from "./config.mjs";
4
+ import type { ChartSeriesType, ChartsSeriesConfig, HighlightScope } from "./config.mjs";
5
5
  /**
6
6
  * The unique identifier of a series.
7
7
  */
@@ -33,18 +33,18 @@ export interface SeriesColor<TValue> {
33
33
  */
34
34
  colorGetter?: (data: ColorCallbackValue<TValue>) => string;
35
35
  }
36
- export interface CommonSeriesType<TValue, SeriesType extends ChartSeriesType> extends SeriesColor<TValue> {
36
+ export interface CommonSeriesType<SeriesType extends ChartSeriesType> extends SeriesColor<ChartsSeriesConfig[SeriesType]['valueType']> {
37
37
  /**
38
38
  * The id of this series.
39
39
  */
40
40
  id?: SeriesId;
41
41
  /**
42
42
  * Formatter used to render values in tooltip or other data display.
43
- * @param {TValue} value The series' value to render.
43
+ * @param {ChartsSeriesConfig[SeriesType]['valueType']} value The series' value to render.
44
44
  * @param {SeriesValueFormatterContext} context The rendering context of the value.
45
45
  * @returns {string | null} The string to display or null if the value should not be shown.
46
46
  */
47
- valueFormatter?: SeriesValueFormatter<TValue>;
47
+ valueFormatter?: SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>;
48
48
  /**
49
49
  * The scope to apply when the series is highlighted.
50
50
  */
@@ -1,7 +1,7 @@
1
1
  import type { StackOffsetType, StackOrderType } from "../stacking.js";
2
2
  import type { ChartsLabelMarkType } from "../../ChartsLabel/ChartsLabelMark.js";
3
3
  import type { AxisId } from "../axis.js";
4
- import type { ChartSeriesType, HighlightScope } from "./config.js";
4
+ import type { ChartSeriesType, ChartsSeriesConfig, HighlightScope } from "./config.js";
5
5
  /**
6
6
  * The unique identifier of a series.
7
7
  */
@@ -33,18 +33,18 @@ export interface SeriesColor<TValue> {
33
33
  */
34
34
  colorGetter?: (data: ColorCallbackValue<TValue>) => string;
35
35
  }
36
- export interface CommonSeriesType<TValue, SeriesType extends ChartSeriesType> extends SeriesColor<TValue> {
36
+ export interface CommonSeriesType<SeriesType extends ChartSeriesType> extends SeriesColor<ChartsSeriesConfig[SeriesType]['valueType']> {
37
37
  /**
38
38
  * The id of this series.
39
39
  */
40
40
  id?: SeriesId;
41
41
  /**
42
42
  * Formatter used to render values in tooltip or other data display.
43
- * @param {TValue} value The series' value to render.
43
+ * @param {ChartsSeriesConfig[SeriesType]['valueType']} value The series' value to render.
44
44
  * @param {SeriesValueFormatterContext} context The rendering context of the value.
45
45
  * @returns {string | null} The string to display or null if the value should not be shown.
46
46
  */
47
- valueFormatter?: SeriesValueFormatter<TValue>;
47
+ valueFormatter?: SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>;
48
48
  /**
49
49
  * The scope to apply when the series is highlighted.
50
50
  */
@@ -2,7 +2,7 @@ import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-intern
2
2
  import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.mjs";
3
3
  import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.mjs";
4
4
  import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.mjs";
5
- import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType, PieSeriesLayout } from "./pie.mjs";
5
+ import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.mjs";
6
6
  import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.mjs";
7
7
  import type { SeriesColor, SeriesId } from "./common.mjs";
8
8
  import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.mjs";
@@ -74,7 +74,7 @@ export interface ChartsSeriesConfig {
74
74
  };
75
75
  };
76
76
  scatter: {
77
- seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType | null>, 'color'>;
77
+ seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
78
78
  series: DefaultizedScatterSeriesType;
79
79
  seriesLayout: {};
80
80
  seriesProp: ScatterSeriesType;
@@ -104,7 +104,7 @@ export interface ChartsSeriesConfig {
104
104
  seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
105
105
  itemIdentifier: PieItemIdentifier;
106
106
  itemIdentifierWithData: PieItemIdentifier;
107
- valueType: DefaultizedPieValueType;
107
+ valueType: PieValueType;
108
108
  highlightScope: CommonHighlightScope;
109
109
  descriptionGetterParams: {
110
110
  identifier: PieItemIdentifier;
@@ -2,7 +2,7 @@ import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-intern
2
2
  import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.js";
3
3
  import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.js";
4
4
  import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.js";
5
- import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType, PieSeriesLayout } from "./pie.js";
5
+ import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.js";
6
6
  import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.js";
7
7
  import type { SeriesColor, SeriesId } from "./common.js";
8
8
  import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.js";
@@ -74,7 +74,7 @@ export interface ChartsSeriesConfig {
74
74
  };
75
75
  };
76
76
  scatter: {
77
- seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType | null>, 'color'>;
77
+ seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
78
78
  series: DefaultizedScatterSeriesType;
79
79
  seriesLayout: {};
80
80
  seriesProp: ScatterSeriesType;
@@ -104,7 +104,7 @@ export interface ChartsSeriesConfig {
104
104
  seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
105
105
  itemIdentifier: PieItemIdentifier;
106
106
  itemIdentifierWithData: PieItemIdentifier;
107
- valueType: DefaultizedPieValueType;
107
+ valueType: PieValueType;
108
108
  highlightScope: CommonHighlightScope;
109
109
  descriptionGetterParams: {
110
110
  identifier: PieItemIdentifier;
@@ -96,7 +96,7 @@ export interface CommonLineSeriesType {
96
96
  */
97
97
  baseline?: number | 'min' | 'max';
98
98
  }
99
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
99
+ export interface LineSeriesType extends CommonSeriesType<'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
100
100
  type: 'line';
101
101
  /**
102
102
  * Defines how stacked series handle negative values.
@@ -96,7 +96,7 @@ export interface CommonLineSeriesType {
96
96
  */
97
97
  baseline?: number | 'min' | 'max';
98
98
  }
99
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
99
+ export interface LineSeriesType extends CommonSeriesType<'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
100
100
  type: 'line';
101
101
  /**
102
102
  * Defines how stacked series handle negative values.
@@ -26,7 +26,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
26
26
  hidden: boolean;
27
27
  };
28
28
  export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
29
- export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData, 'pie'> {
29
+ export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<'pie'> {
30
30
  type: 'pie';
31
31
  data: Readonly<TData[]>;
32
32
  /**
@@ -26,7 +26,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
26
26
  hidden: boolean;
27
27
  };
28
28
  export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
29
- export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData, 'pie'> {
29
+ export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<'pie'> {
30
30
  type: 'pie';
31
31
  data: Readonly<TData[]>;
32
32
  /**
@@ -1,6 +1,6 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { SeriesId, CommonDefaultizedProps, CommonSeriesType } from "./common.mjs";
3
- export interface RadarSeriesType extends CommonSeriesType<number, 'radar'> {
3
+ export interface RadarSeriesType extends CommonSeriesType<'radar'> {
4
4
  type: 'radar';
5
5
  data: number[];
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { SeriesId, CommonDefaultizedProps, CommonSeriesType } from "./common.js";
3
- export interface RadarSeriesType extends CommonSeriesType<number, 'radar'> {
3
+ export interface RadarSeriesType extends CommonSeriesType<'radar'> {
4
4
  type: 'radar';
5
5
  data: number[];
6
6
  /**
@@ -22,7 +22,7 @@ export type ScatterValueType = {
22
22
  */
23
23
  id?: string | number;
24
24
  };
25
- export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null, 'scatter'>, CartesianSeriesType {
25
+ export interface ScatterSeriesType extends CommonSeriesType<'scatter'>, CartesianSeriesType {
26
26
  type: 'scatter';
27
27
  data?: readonly ScatterValueType[];
28
28
  /**
@@ -22,7 +22,7 @@ export type ScatterValueType = {
22
22
  */
23
23
  id?: string | number;
24
24
  };
25
- export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null, 'scatter'>, CartesianSeriesType {
25
+ export interface ScatterSeriesType extends CommonSeriesType<'scatter'>, CartesianSeriesType {
26
26
  type: 'scatter';
27
27
  data?: readonly ScatterValueType[];
28
28
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
6
  "license": "MIT",
@@ -34,9 +34,9 @@
34
34
  "prop-types": "^15.8.1",
35
35
  "reselect": "^5.2.0",
36
36
  "use-sync-external-store": "^1.6.0",
37
+ "@mui/x-charts-vendor": "^9.4.0",
37
38
  "@mui/x-internal-gestures": "^9.3.0",
38
- "@mui/x-internals": "^9.1.0",
39
- "@mui/x-charts-vendor": "^9.4.0"
39
+ "@mui/x-internals": "^9.1.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/react": "^11.9.0",