@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.
- package/CHANGELOG.md +100 -0
- package/ChartsRadialAxisHighlight/index.d.mts +6 -1
- package/ChartsRadialAxisHighlight/index.d.ts +6 -1
- package/ChartsRadialAxisHighlight/index.js +9 -2
- package/ChartsRadialAxisHighlight/index.mjs +8 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +1 -1
- package/ChartsRadialDataProvider/index.d.mts +5 -0
- package/ChartsRadialDataProvider/index.d.ts +5 -0
- package/ChartsRadialDataProvider/index.js +12 -1
- package/ChartsRadialDataProvider/index.mjs +7 -0
- package/ChartsRadialGrid/index.d.mts +6 -1
- package/ChartsRadialGrid/index.d.ts +6 -1
- package/ChartsRadialGrid/index.js +8 -2
- package/ChartsRadialGrid/index.mjs +8 -1
- package/ChartsRadiusAxis/index.d.mts +6 -1
- package/ChartsRadiusAxis/index.d.ts +6 -1
- package/ChartsRadiusAxis/index.js +10 -2
- package/ChartsRadiusAxis/index.mjs +7 -1
- package/ChartsRotationAxis/index.d.mts +6 -1
- package/ChartsRotationAxis/index.d.ts +6 -1
- package/ChartsRotationAxis/index.js +10 -2
- package/ChartsRotationAxis/index.mjs +7 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +11 -4
- package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaElement.mjs +1 -1
- package/LineChart/CircleMarkElement.js +1 -1
- package/LineChart/CircleMarkElement.mjs +1 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineElement.mjs +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkElement.mjs +1 -1
- package/ScatterChart/ScatterChart.js +7 -3
- package/ScatterChart/ScatterChart.mjs +7 -3
- package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/ScatterChart.plugins.mjs +2 -1
- package/ScatterChart/ScatterPlot.d.mts +4 -2
- package/ScatterChart/ScatterPlot.d.ts +4 -2
- package/ScatterChart/ScatterPlot.js +25 -3
- package/ScatterChart/ScatterPlot.mjs +25 -3
- package/ScatterChart/async/ScatterAsync.d.mts +9 -0
- package/ScatterChart/async/ScatterAsync.d.ts +9 -0
- package/ScatterChart/async/ScatterAsync.js +71 -0
- package/ScatterChart/async/ScatterAsync.mjs +67 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
- package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
- package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
- package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
- package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
- package/SparkLineChart/SparkLineChart.js +2 -1
- package/SparkLineChart/SparkLineChart.mjs +2 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/getSeriesColorFn.d.mts +5 -5
- package/internals/getSeriesColorFn.d.ts +5 -5
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +12 -0
- package/internals/index.mjs +1 -0
- package/internals/plugins/allPlugins.d.mts +4 -3
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/allPlugins.mjs +2 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +1 -1
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
- package/internals/scales/scaleBand.js +70 -43
- package/internals/scales/scaleBand.mjs +71 -44
- package/models/seriesType/bar.d.mts +1 -1
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.mts +4 -4
- package/models/seriesType/common.d.ts +4 -4
- package/models/seriesType/config.d.mts +3 -3
- package/models/seriesType/config.d.ts +3 -3
- package/models/seriesType/line.d.mts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.mts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/radar.d.mts +1 -1
- package/models/seriesType/radar.d.ts +1 -1
- package/models/seriesType/scatter.d.mts +1 -1
- package/models/seriesType/scatter.d.ts +1 -1
- 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
|
|
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
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
-
|
|
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
|
|
39
|
-
let
|
|
40
|
-
let
|
|
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
|
|
44
|
-
let
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
step = (
|
|
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
|
-
|
|
60
|
+
let adjustedStart = lo + (hi - lo - step * (n - paddingInner)) * align;
|
|
64
61
|
bandwidth = step * (1 - paddingInner);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
//
|
|
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<
|
|
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<
|
|
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<
|
|
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 {
|
|
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<
|
|
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<
|
|
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 {
|
|
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<
|
|
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,
|
|
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
|
|
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:
|
|
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,
|
|
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
|
|
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:
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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.
|
|
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",
|