@mui/x-charts 8.0.0-alpha.8 → 8.0.0-alpha.9
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/BarChart/BarChart.js +1 -1
- package/BarChart/plugin.js +2 -0
- package/CHANGELOG.md +436 -3
- package/ChartContainer/ChartContainer.d.ts +2 -2
- package/ChartContainer/ChartContainer.js +2 -2
- package/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.d.ts +7 -7
- package/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
- package/ChartDataProvider/package.json +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +13 -0
- package/ChartsSurface/ChartsSurface.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.js +1 -1
- package/ChartsTooltip/utils.js +2 -0
- package/Gauge/GaugeProvider.js +2 -0
- package/LineChart/AreaPlot.js +43 -10
- package/LineChart/CircleMarkElement.d.ts +0 -4
- package/LineChart/CircleMarkElement.js +2 -7
- package/LineChart/LineChart.d.ts +0 -4
- package/LineChart/LineChart.js +1 -5
- package/LineChart/LineHighlightElement.d.ts +5 -1
- package/LineChart/LineHighlightElement.js +29 -9
- package/LineChart/LineHighlightPlot.js +4 -2
- package/LineChart/LinePlot.js +43 -9
- package/LineChart/MarkPlot.d.ts +0 -6
- package/LineChart/MarkPlot.js +6 -12
- package/LineChart/plugin.js +2 -0
- package/LineChart/useLineChartProps.js +3 -5
- package/PieChart/PieChart.js +1 -1
- package/PieChart/plugin.js +3 -1
- package/ScatterChart/ScatterChart.js +1 -1
- package/ScatterChart/plugin.js +2 -0
- package/context/AnimationProvider/AnimationProvider.js +1 -1
- package/context/InteractionSelectors.d.ts +11 -11
- package/context/index.d.ts +0 -2
- package/context/index.js +1 -2
- package/hooks/useLegend.js +8 -13
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/defaultizeColor.d.ts +2 -0
- package/internals/index.d.ts +1 -2
- package/internals/index.js +1 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +5 -5
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts +90 -126
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +0 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +11 -11
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -1
- package/models/seriesType/line.d.ts +11 -0
- package/modern/BarChart/BarChart.js +1 -1
- package/modern/BarChart/plugin.js +2 -0
- package/modern/ChartContainer/ChartContainer.js +2 -2
- package/modern/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
- package/modern/ChartsSurface/ChartsSurface.js +1 -1
- package/modern/ChartsTooltip/utils.js +2 -0
- package/modern/Gauge/GaugeProvider.js +2 -0
- package/modern/LineChart/AreaPlot.js +43 -10
- package/modern/LineChart/CircleMarkElement.js +2 -7
- package/modern/LineChart/LineChart.js +1 -5
- package/modern/LineChart/LineHighlightElement.js +29 -9
- package/modern/LineChart/LineHighlightPlot.js +4 -2
- package/modern/LineChart/LinePlot.js +43 -9
- package/modern/LineChart/MarkPlot.js +6 -12
- package/modern/LineChart/plugin.js +2 -0
- package/modern/LineChart/useLineChartProps.js +3 -5
- package/modern/PieChart/PieChart.js +1 -1
- package/modern/PieChart/plugin.js +3 -1
- package/modern/ScatterChart/ScatterChart.js +1 -1
- package/modern/ScatterChart/plugin.js +2 -0
- package/modern/context/AnimationProvider/AnimationProvider.js +1 -1
- package/modern/context/index.js +1 -2
- package/modern/hooks/useLegend.js +8 -13
- package/modern/index.js +3 -2
- package/modern/internals/index.js +1 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
- package/node/BarChart/BarChart.js +2 -2
- package/node/BarChart/plugin.js +2 -0
- package/node/ChartContainer/ChartContainer.js +2 -2
- package/node/{context/ChartDataProvider → ChartDataProvider}/ChartDataProvider.js +4 -4
- package/node/ChartsSurface/ChartsSurface.js +1 -1
- package/node/ChartsTooltip/utils.js +1 -0
- package/node/Gauge/GaugeProvider.js +2 -2
- package/node/LineChart/AreaPlot.js +43 -10
- package/node/LineChart/CircleMarkElement.js +2 -7
- package/node/LineChart/LineChart.js +2 -6
- package/node/LineChart/LineHighlightElement.js +29 -9
- package/node/LineChart/LineHighlightPlot.js +4 -2
- package/node/LineChart/LinePlot.js +43 -9
- package/node/LineChart/MarkPlot.js +6 -12
- package/node/LineChart/plugin.js +2 -0
- package/node/LineChart/useLineChartProps.js +3 -5
- package/node/PieChart/PieChart.js +2 -2
- package/node/PieChart/plugin.js +3 -1
- package/node/ScatterChart/ScatterChart.js +2 -2
- package/node/ScatterChart/plugin.js +2 -0
- package/node/context/AnimationProvider/AnimationProvider.js +1 -1
- package/node/context/index.js +1 -12
- package/node/hooks/useLegend.js +8 -14
- package/node/index.js +12 -1
- package/node/internals/index.js +1 -13
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +3 -1
- package/package.json +3 -3
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +0 -13
- /package/{context/ChartDataProvider → ChartDataProvider}/index.d.ts +0 -0
- /package/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
- /package/modern/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/modern/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
- /package/node/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/node/{context/ChartDataProvider → ChartDataProvider}/useChartDataProviderProps.js +0 -0
package/hooks/useLegend.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import getScatterLegend from "../ScatterChart/legend.js";
|
|
5
|
-
import getLineLegend from "../LineChart/legend.js";
|
|
6
|
-
import getPieLegend from "../PieChart/legend.js";
|
|
3
|
+
import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useChartSeries/index.js";
|
|
7
4
|
import { useSeries } from "./useSeries.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
line: getLineLegend,
|
|
12
|
-
pie: getPieLegend
|
|
13
|
-
};
|
|
14
|
-
function getSeriesToDisplay(series) {
|
|
5
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
6
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
7
|
+
function getSeriesToDisplay(series, seriesConfig) {
|
|
15
8
|
return Object.keys(series).flatMap(seriesType => {
|
|
16
|
-
const getter =
|
|
9
|
+
const getter = seriesConfig[seriesType].legendGetter;
|
|
17
10
|
return getter === undefined ? [] : getter(series[seriesType]);
|
|
18
11
|
});
|
|
19
12
|
}
|
|
@@ -29,7 +22,9 @@ function getSeriesToDisplay(series) {
|
|
|
29
22
|
*/
|
|
30
23
|
export function useLegend() {
|
|
31
24
|
const series = useSeries();
|
|
25
|
+
const store = useStore();
|
|
26
|
+
const seriesConfig = useSelector(store, selectorChartSeriesConfig);
|
|
32
27
|
return {
|
|
33
|
-
items: getSeriesToDisplay(series)
|
|
28
|
+
items: getSeriesToDisplay(series, seriesConfig)
|
|
34
29
|
};
|
|
35
30
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts v8.0.0-alpha.
|
|
2
|
+
* @mui/x-charts v8.0.0-alpha.9
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -30,4 +30,5 @@ export * from "./ScatterChart/index.js";
|
|
|
30
30
|
export * from "./SparkLineChart/index.js";
|
|
31
31
|
export * from "./Gauge/index.js";
|
|
32
32
|
export * from "./ChartsSurface/index.js";
|
|
33
|
-
export * from "./ChartContainer/index.js";
|
|
33
|
+
export * from "./ChartContainer/index.js";
|
|
34
|
+
export * from "./ChartDataProvider/index.js";
|
|
@@ -53,7 +53,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
53
53
|
area?: boolean;
|
|
54
54
|
label?: string | ((location: "tooltip" | "legend") => string);
|
|
55
55
|
curve?: import("..").CurveType;
|
|
56
|
+
strictStepCurve?: boolean;
|
|
56
57
|
showMark?: boolean | ((params: import("..").ShowMarkParams) => boolean);
|
|
58
|
+
shape?: "circle" | "cross" | "diamond" | "square" | "star" | "triangle" | "wye";
|
|
57
59
|
disableHighlight?: boolean;
|
|
58
60
|
connectNulls?: boolean;
|
|
59
61
|
stackOffset?: import("..").StackOffsetType;
|
package/internals/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
|
8
8
|
export { useLineChartProps } from '../LineChart/useLineChartProps';
|
|
9
9
|
export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
10
10
|
export * from '../ChartContainer/useChartContainerProps';
|
|
11
|
-
export * from '../
|
|
11
|
+
export * from '../ChartDataProvider/useChartDataProviderProps';
|
|
12
12
|
export * from './plugins/corePlugins/useChartId';
|
|
13
13
|
export * from './plugins/corePlugins/useChartSeries';
|
|
14
14
|
export * from './plugins/corePlugins/useChartDimensions';
|
|
@@ -29,7 +29,6 @@ export * from './getScale';
|
|
|
29
29
|
export * from '../context/AnimationProvider';
|
|
30
30
|
export type * from '../context/context.types';
|
|
31
31
|
export { getAxisExtremum } from './plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum';
|
|
32
|
-
export * from '../context/ChartDataProvider';
|
|
33
32
|
export * from '../context/ChartProvider';
|
|
34
33
|
export * from '../models/seriesType/config';
|
|
35
34
|
export * from '../models/seriesType/common';
|
package/internals/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
|
11
11
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
12
12
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
13
13
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
14
|
-
export * from "../
|
|
14
|
+
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
15
15
|
|
|
16
16
|
// plugins
|
|
17
17
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
@@ -38,7 +38,6 @@ export * from "./getScale.js";
|
|
|
38
38
|
|
|
39
39
|
export * from "../context/AnimationProvider/index.js";
|
|
40
40
|
export { getAxisExtremum } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js";
|
|
41
|
-
export * from "../context/ChartDataProvider/index.js";
|
|
42
41
|
export * from "../context/ChartProvider/index.js";
|
|
43
42
|
|
|
44
43
|
// series configuration
|
|
@@ -67,8 +67,8 @@ export declare const selectorChartDrawingArea: ((state: import("../useChartId/us
|
|
|
67
67
|
dependencyRecomputations: () => number;
|
|
68
68
|
resetDependencyRecomputations: () => void;
|
|
69
69
|
} & {
|
|
70
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
71
70
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
71
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
72
72
|
};
|
|
73
73
|
export declare const selectorChartPropsSize: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("./useChartDimensions.types").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
|
|
74
74
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
@@ -120,8 +120,8 @@ export declare const selectorChartPropsSize: ((state: import("../useChartId/useC
|
|
|
120
120
|
dependencyRecomputations: () => number;
|
|
121
121
|
resetDependencyRecomputations: () => void;
|
|
122
122
|
} & {
|
|
123
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
124
123
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
124
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
125
125
|
};
|
|
126
126
|
export declare const selectorChartContainerSize: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("./useChartDimensions.types").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
|
|
127
127
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
@@ -173,8 +173,8 @@ export declare const selectorChartContainerSize: ((state: import("../useChartId/
|
|
|
173
173
|
dependencyRecomputations: () => number;
|
|
174
174
|
resetDependencyRecomputations: () => void;
|
|
175
175
|
} & {
|
|
176
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
177
176
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
177
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
178
178
|
};
|
|
179
179
|
/**
|
|
180
180
|
* Get the id attribute of the chart.
|
|
@@ -251,14 +251,14 @@ export declare const selectorChartHasIntrinsicSize: ((state: import("../useChart
|
|
|
251
251
|
dependencyRecomputations: () => number;
|
|
252
252
|
resetDependencyRecomputations: () => void;
|
|
253
253
|
} & {
|
|
254
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
255
254
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
255
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
256
256
|
}];
|
|
257
257
|
recomputations: () => number;
|
|
258
258
|
resetRecomputations: () => void;
|
|
259
259
|
dependencyRecomputations: () => number;
|
|
260
260
|
resetDependencyRecomputations: () => void;
|
|
261
261
|
} & {
|
|
262
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
263
262
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
263
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
264
264
|
};
|
|
@@ -31,6 +31,6 @@ export declare const selectorChartId: ((state: import("./useChartId.types").UseC
|
|
|
31
31
|
dependencyRecomputations: () => number;
|
|
32
32
|
resetDependencyRecomputations: () => void;
|
|
33
33
|
} & {
|
|
34
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
35
34
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
35
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
36
36
|
};
|
|
@@ -27,8 +27,8 @@ export declare const selectorChartSeriesProcessed: ((state: import("../useChartI
|
|
|
27
27
|
dependencyRecomputations: () => number;
|
|
28
28
|
resetDependencyRecomputations: () => void;
|
|
29
29
|
} & {
|
|
30
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
31
30
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
31
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
32
32
|
};
|
|
33
33
|
export declare const selectorChartSeriesConfig: ((state: import("../useChartId/useChartId.types").UseChartIdState & import("../useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("./useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<{}> & {
|
|
34
34
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
@@ -56,6 +56,6 @@ export declare const selectorChartSeriesConfig: ((state: import("../useChartId/u
|
|
|
56
56
|
dependencyRecomputations: () => number;
|
|
57
57
|
resetDependencyRecomputations: () => void;
|
|
58
58
|
} & {
|
|
59
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
60
59
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
60
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
61
61
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { useChartCartesianAxis } from './useChartCartesianAxis';
|
|
2
2
|
export type * from './useChartCartesianAxis.types';
|
|
3
|
+
export * from './useChartCartesianAxis.selectors';
|
|
3
4
|
export { defaultizeAxis } from './defaultizeAxis';
|
|
4
5
|
export * from './computeAxisValue';
|
|
5
6
|
export * from './zoom.types';
|