@mui/x-charts 8.10.2 → 8.11.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/BarChart/BarChart.js +0 -36
- package/CHANGELOG.md +140 -13
- package/ChartContainer/ChartContainer.js +0 -56
- package/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/ChartsOverlay/ChartsOverlay.js +11 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +0 -10
- package/ChartsXAxis/useAxisProps.d.ts +9 -171
- package/ChartsXAxis/utilities.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxis.js +0 -10
- package/ChartsYAxis/useAxisProps.d.ts +9 -171
- package/ChartsYAxis/utilities.d.ts +1 -1
- package/LineChart/LineChart.js +0 -36
- package/PieChart/PieChart.js +2 -2
- package/RadarChart/RadarAxis/RadarAxis.d.ts +29 -0
- package/RadarChart/RadarAxis/RadarAxis.js +101 -0
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +20 -0
- package/RadarChart/RadarAxis/RadarAxis.utils.js +66 -0
- package/RadarChart/RadarAxis/index.d.ts +3 -0
- package/RadarChart/RadarAxis/index.js +39 -0
- package/RadarChart/RadarAxis/radarAxisClasses.d.ts +12 -0
- package/RadarChart/RadarAxis/radarAxisClasses.js +25 -0
- package/RadarChart/RadarAxis/useRadarAxis.d.ts +34 -0
- package/RadarChart/RadarAxis/useRadarAxis.js +82 -0
- package/RadarChart/RadarGrid/useRadarGridData.js +8 -5
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +1 -1
- package/RadarChart/index.d.ts +1 -0
- package/RadarChart/index.js +12 -0
- package/ScatterChart/ScatterChart.js +0 -36
- package/SparkLineChart/SparkLineChart.js +0 -36
- package/esm/BarChart/BarChart.js +0 -36
- package/esm/ChartContainer/ChartContainer.js +0 -56
- package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/esm/ChartsOverlay/ChartsOverlay.js +11 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +0 -10
- package/esm/ChartsXAxis/useAxisProps.d.ts +9 -171
- package/esm/ChartsXAxis/utilities.d.ts +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +0 -10
- package/esm/ChartsYAxis/useAxisProps.d.ts +9 -171
- package/esm/ChartsYAxis/utilities.d.ts +1 -1
- package/esm/LineChart/LineChart.js +0 -36
- package/esm/PieChart/PieChart.js +2 -2
- package/esm/RadarChart/RadarAxis/RadarAxis.d.ts +29 -0
- package/esm/RadarChart/RadarAxis/RadarAxis.js +94 -0
- package/esm/RadarChart/RadarAxis/RadarAxis.utils.d.ts +20 -0
- package/esm/RadarChart/RadarAxis/RadarAxis.utils.js +60 -0
- package/esm/RadarChart/RadarAxis/index.d.ts +3 -0
- package/esm/RadarChart/RadarAxis/index.js +3 -0
- package/esm/RadarChart/RadarAxis/radarAxisClasses.d.ts +12 -0
- package/esm/RadarChart/RadarAxis/radarAxisClasses.js +15 -0
- package/esm/RadarChart/RadarAxis/useRadarAxis.d.ts +34 -0
- package/esm/RadarChart/RadarAxis/useRadarAxis.js +76 -0
- package/esm/RadarChart/RadarGrid/useRadarGridData.js +8 -5
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +1 -1
- package/esm/RadarChart/index.d.ts +1 -0
- package/esm/RadarChart/index.js +1 -0
- package/esm/ScatterChart/ScatterChart.js +0 -36
- package/esm/SparkLineChart/SparkLineChart.js +0 -36
- package/esm/hooks/animation/useAnimatePieArcLabel.js +2 -2
- package/esm/hooks/useInteractionItemProps.d.ts +5 -5
- package/esm/hooks/useInteractionItemProps.js +6 -20
- package/esm/index.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +3 -3
- package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +3 -3
- package/esm/models/axis.d.ts +0 -10
- package/esm/models/seriesType/config.d.ts +6 -0
- package/esm/models/seriesType/index.d.ts +1 -0
- package/hooks/animation/useAnimatePieArcLabel.js +2 -2
- package/hooks/useInteractionItemProps.d.ts +5 -5
- package/hooks/useInteractionItemProps.js +6 -20
- package/index.js +1 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +3 -3
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +3 -3
- package/models/axis.d.ts +0 -10
- package/models/seriesType/config.d.ts +6 -0
- package/models/seriesType/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -14,25 +14,14 @@ export const useInteractionItemProps = (data, skip) => {
|
|
|
14
14
|
const interactionActive = React.useRef(false);
|
|
15
15
|
const onPointerEnter = React.useCallback(() => {
|
|
16
16
|
interactionActive.current = true;
|
|
17
|
-
instance.setItemInteraction(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dataIndex: data.dataIndex
|
|
21
|
-
});
|
|
22
|
-
instance.setHighlight({
|
|
23
|
-
seriesId: data.seriesId,
|
|
24
|
-
dataIndex: data.dataIndex
|
|
25
|
-
});
|
|
26
|
-
}, [instance, data.type, data.seriesId, data.dataIndex]);
|
|
17
|
+
instance.setItemInteraction(data);
|
|
18
|
+
instance.setHighlight(data);
|
|
19
|
+
}, [instance, data]);
|
|
27
20
|
const onPointerLeave = React.useCallback(() => {
|
|
28
21
|
interactionActive.current = false;
|
|
29
|
-
instance.removeItemInteraction(
|
|
30
|
-
type: data.type,
|
|
31
|
-
seriesId: data.seriesId,
|
|
32
|
-
dataIndex: data.dataIndex
|
|
33
|
-
});
|
|
22
|
+
instance.removeItemInteraction(data);
|
|
34
23
|
instance.clearHighlight();
|
|
35
|
-
}, [instance, data
|
|
24
|
+
}, [instance, data]);
|
|
36
25
|
React.useEffect(() => {
|
|
37
26
|
return () => {
|
|
38
27
|
/* Clean up state if this item is unmounted while active. */
|
|
@@ -67,10 +56,7 @@ export function getInteractionItemProps(instance, item) {
|
|
|
67
56
|
return;
|
|
68
57
|
}
|
|
69
58
|
instance.setItemInteraction(item);
|
|
70
|
-
instance.setHighlight(
|
|
71
|
-
seriesId: item.seriesId,
|
|
72
|
-
dataIndex: item.dataIndex
|
|
73
|
-
});
|
|
59
|
+
instance.setHighlight(item);
|
|
74
60
|
}
|
|
75
61
|
function onPointerLeave() {
|
|
76
62
|
if (!item) {
|
package/esm/index.js
CHANGED
package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
-
import { ChartItemIdentifier, ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
|
+
import { ChartItemIdentifier, ChartSeriesType, type ChartItemIdentifierWithData } from "../../../../models/seriesType/config.js";
|
|
3
3
|
export type Coordinate = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
@@ -13,7 +13,7 @@ export interface UseChartInteractionInstance {
|
|
|
13
13
|
* Setter for the item the user is interacting with.
|
|
14
14
|
* @param {ChartItemIdentifier} newItem The identifier of the item.
|
|
15
15
|
*/
|
|
16
|
-
setItemInteraction: (newItem:
|
|
16
|
+
setItemInteraction: (newItem: ChartItemIdentifierWithData<ChartSeriesType>) => void;
|
|
17
17
|
/**
|
|
18
18
|
* Remove item interaction if the current if the provided item is still the one interacting.
|
|
19
19
|
* @param {ChartItemIdentifier} itemToRemove The identifier of the item.
|
|
@@ -30,7 +30,7 @@ export interface UseChartInteractionState {
|
|
|
30
30
|
/**
|
|
31
31
|
* The item currently interacting.
|
|
32
32
|
*/
|
|
33
|
-
item: null |
|
|
33
|
+
item: null | ChartItemIdentifierWithData<ChartSeriesType>;
|
|
34
34
|
/**
|
|
35
35
|
* The x/y SVG coordinate of the "main" pointer
|
|
36
36
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartItemIdentifierWithData, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
|
|
2
2
|
import { SeriesId } from "../../../../models/seriesType/common.js";
|
|
3
3
|
import { AxisId, ChartsRotationAxisProps, ChartsRadiusAxisProps, PolarAxisDefaultized, ComputedXAxis, ComputedYAxis } from "../../../../models/axis.js";
|
|
4
4
|
import { ChartsLabelMarkProps } from "../../../../ChartsLabel/ChartsLabelMark.js";
|
|
@@ -7,7 +7,7 @@ export interface ItemTooltip<T extends ChartSeriesType> {
|
|
|
7
7
|
/**
|
|
8
8
|
* An object that identifies the item to display.
|
|
9
9
|
*/
|
|
10
|
-
identifier:
|
|
10
|
+
identifier: ChartItemIdentifierWithData<T>;
|
|
11
11
|
/**
|
|
12
12
|
* The color associated with the item.
|
|
13
13
|
*/
|
|
@@ -59,7 +59,7 @@ export type TooltipGetter<TSeriesType extends ChartSeriesType> = (params: {
|
|
|
59
59
|
series: ChartSeriesDefaultized<TSeriesType>;
|
|
60
60
|
axesConfig: TooltipGetterAxesConfig;
|
|
61
61
|
getColor: ColorGetter<TSeriesType>;
|
|
62
|
-
identifier:
|
|
62
|
+
identifier: ChartItemIdentifierWithData<TSeriesType> | null;
|
|
63
63
|
}) => (TSeriesType extends 'radar' ? ItemTooltipWithMultipleValues<TSeriesType> : ItemTooltip<TSeriesType>) | null;
|
|
64
64
|
/**
|
|
65
65
|
* If `axisId` is set to undefined, the default axis will be used.
|
package/esm/models/axis.d.ts
CHANGED
|
@@ -55,11 +55,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
55
55
|
* @default false
|
|
56
56
|
*/
|
|
57
57
|
disableTicks?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The fill color of the axis text.
|
|
60
|
-
* @default 'currentColor'
|
|
61
|
-
*/
|
|
62
|
-
fill?: string;
|
|
63
58
|
/**
|
|
64
59
|
* The style applied to ticks text.
|
|
65
60
|
*/
|
|
@@ -79,11 +74,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
79
74
|
* The label of the axis.
|
|
80
75
|
*/
|
|
81
76
|
label?: string;
|
|
82
|
-
/**
|
|
83
|
-
* The stroke color of the axis line.
|
|
84
|
-
* @default 'currentColor'
|
|
85
|
-
*/
|
|
86
|
-
stroke?: string;
|
|
87
77
|
/**
|
|
88
78
|
* The size of the ticks.
|
|
89
79
|
* @default 6
|
|
@@ -21,6 +21,7 @@ export interface ChartsSeriesConfig {
|
|
|
21
21
|
*/
|
|
22
22
|
seriesProp: BarSeriesType;
|
|
23
23
|
itemIdentifier: BarItemIdentifier;
|
|
24
|
+
itemIdentifierWithData: BarItemIdentifier;
|
|
24
25
|
valueType: number | null;
|
|
25
26
|
canBeStacked: true;
|
|
26
27
|
axisType: 'cartesian';
|
|
@@ -32,6 +33,7 @@ export interface ChartsSeriesConfig {
|
|
|
32
33
|
series: DefaultizedLineSeriesType;
|
|
33
34
|
seriesProp: LineSeriesType;
|
|
34
35
|
itemIdentifier: LineItemIdentifier;
|
|
36
|
+
itemIdentifierWithData: LineItemIdentifier;
|
|
35
37
|
valueType: number | null;
|
|
36
38
|
canBeStacked: true;
|
|
37
39
|
axisType: 'cartesian';
|
|
@@ -44,6 +46,7 @@ export interface ChartsSeriesConfig {
|
|
|
44
46
|
seriesProp: ScatterSeriesType;
|
|
45
47
|
valueType: ScatterValueType;
|
|
46
48
|
itemIdentifier: ScatterItemIdentifier;
|
|
49
|
+
itemIdentifierWithData: ScatterItemIdentifier;
|
|
47
50
|
axisType: 'cartesian';
|
|
48
51
|
};
|
|
49
52
|
pie: {
|
|
@@ -55,6 +58,7 @@ export interface ChartsSeriesConfig {
|
|
|
55
58
|
series: DefaultizedPieSeriesType;
|
|
56
59
|
seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
|
|
57
60
|
itemIdentifier: PieItemIdentifier;
|
|
61
|
+
itemIdentifierWithData: PieItemIdentifier;
|
|
58
62
|
valueType: DefaultizedPieValueType;
|
|
59
63
|
};
|
|
60
64
|
radar: {
|
|
@@ -64,6 +68,7 @@ export interface ChartsSeriesConfig {
|
|
|
64
68
|
series: DefaultizedRadarSeriesType;
|
|
65
69
|
seriesProp: RadarSeriesType;
|
|
66
70
|
itemIdentifier: RadarItemIdentifier;
|
|
71
|
+
itemIdentifierWithData: RadarItemIdentifier;
|
|
67
72
|
valueType: number;
|
|
68
73
|
axisType: 'polar';
|
|
69
74
|
};
|
|
@@ -85,6 +90,7 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
|
|
|
85
90
|
stackedData: [number, number][];
|
|
86
91
|
} : ChartsSeriesConfig[T]['series'];
|
|
87
92
|
export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
|
|
93
|
+
export type ChartItemIdentifierWithData<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
|
|
88
94
|
export type DatasetElementType<T> = {
|
|
89
95
|
[key: string]: Readonly<T>;
|
|
90
96
|
};
|
|
@@ -18,6 +18,7 @@ type DefaultizedCartesianSeriesType = DefaultizedSeriesType<CartesianChartSeries
|
|
|
18
18
|
*/
|
|
19
19
|
type StackableSeriesType = DefaultizedSeriesType<StackableChartSeriesType>;
|
|
20
20
|
export type SeriesItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
|
|
21
|
+
export type SeriesItemIdentifierWithData<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
|
|
21
22
|
export * from "./line.js";
|
|
22
23
|
export * from "./bar.js";
|
|
23
24
|
export * from "./scatter.js";
|
|
@@ -41,8 +41,8 @@ function useAnimatePieArcLabel(props) {
|
|
|
41
41
|
return (0, _useAnimate.useAnimate)({
|
|
42
42
|
startAngle: props.startAngle,
|
|
43
43
|
endAngle: props.endAngle,
|
|
44
|
-
innerRadius: props
|
|
45
|
-
outerRadius: props
|
|
44
|
+
innerRadius: props.arcLabelRadius ?? props.innerRadius,
|
|
45
|
+
outerRadius: props.arcLabelRadius ?? props.outerRadius,
|
|
46
46
|
paddingAngle: props.paddingAngle,
|
|
47
47
|
cornerRadius: props.cornerRadius
|
|
48
48
|
}, {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SeriesItemIdentifierWithData } from "../models/index.js";
|
|
3
3
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
4
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ChartSeriesType, type ChartItemIdentifierWithData } from "../models/seriesType/config.js";
|
|
6
6
|
import { ChartInstance } from "../internals/plugins/models/index.js";
|
|
7
|
-
export declare const useInteractionItemProps: (data:
|
|
7
|
+
export declare const useInteractionItemProps: (data: SeriesItemIdentifierWithData, skip?: boolean) => {
|
|
8
8
|
onPointerEnter?: () => void;
|
|
9
9
|
onPointerLeave?: () => void;
|
|
10
10
|
onPointerDown?: (event: React.PointerEvent) => void;
|
|
11
11
|
};
|
|
12
|
-
export declare const useInteractionAllItemProps: (data:
|
|
12
|
+
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifierWithData[], skip?: boolean) => {
|
|
13
13
|
onPointerEnter?: () => void;
|
|
14
14
|
onPointerLeave?: () => void;
|
|
15
15
|
onPointerDown?: (event: React.PointerEvent) => void;
|
|
16
16
|
}[];
|
|
17
|
-
export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item:
|
|
17
|
+
export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item: ChartItemIdentifierWithData<ChartSeriesType>): {
|
|
18
18
|
onPointerEnter?: () => void;
|
|
19
19
|
onPointerLeave?: () => void;
|
|
20
20
|
onPointerDown?: (event: React.PointerEvent) => void;
|
|
@@ -21,25 +21,14 @@ const useInteractionItemProps = (data, skip) => {
|
|
|
21
21
|
const interactionActive = React.useRef(false);
|
|
22
22
|
const onPointerEnter = React.useCallback(() => {
|
|
23
23
|
interactionActive.current = true;
|
|
24
|
-
instance.setItemInteraction(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
dataIndex: data.dataIndex
|
|
28
|
-
});
|
|
29
|
-
instance.setHighlight({
|
|
30
|
-
seriesId: data.seriesId,
|
|
31
|
-
dataIndex: data.dataIndex
|
|
32
|
-
});
|
|
33
|
-
}, [instance, data.type, data.seriesId, data.dataIndex]);
|
|
24
|
+
instance.setItemInteraction(data);
|
|
25
|
+
instance.setHighlight(data);
|
|
26
|
+
}, [instance, data]);
|
|
34
27
|
const onPointerLeave = React.useCallback(() => {
|
|
35
28
|
interactionActive.current = false;
|
|
36
|
-
instance.removeItemInteraction(
|
|
37
|
-
type: data.type,
|
|
38
|
-
seriesId: data.seriesId,
|
|
39
|
-
dataIndex: data.dataIndex
|
|
40
|
-
});
|
|
29
|
+
instance.removeItemInteraction(data);
|
|
41
30
|
instance.clearHighlight();
|
|
42
|
-
}, [instance, data
|
|
31
|
+
}, [instance, data]);
|
|
43
32
|
React.useEffect(() => {
|
|
44
33
|
return () => {
|
|
45
34
|
/* Clean up state if this item is unmounted while active. */
|
|
@@ -76,10 +65,7 @@ function getInteractionItemProps(instance, item) {
|
|
|
76
65
|
return;
|
|
77
66
|
}
|
|
78
67
|
instance.setItemInteraction(item);
|
|
79
|
-
instance.setHighlight(
|
|
80
|
-
seriesId: item.seriesId,
|
|
81
|
-
dataIndex: item.dataIndex
|
|
82
|
-
});
|
|
68
|
+
instance.setHighlight(item);
|
|
83
69
|
}
|
|
84
70
|
function onPointerLeave() {
|
|
85
71
|
if (!item) {
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
-
import { ChartItemIdentifier, ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
|
+
import { ChartItemIdentifier, ChartSeriesType, type ChartItemIdentifierWithData } from "../../../../models/seriesType/config.js";
|
|
3
3
|
export type Coordinate = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
@@ -13,7 +13,7 @@ export interface UseChartInteractionInstance {
|
|
|
13
13
|
* Setter for the item the user is interacting with.
|
|
14
14
|
* @param {ChartItemIdentifier} newItem The identifier of the item.
|
|
15
15
|
*/
|
|
16
|
-
setItemInteraction: (newItem:
|
|
16
|
+
setItemInteraction: (newItem: ChartItemIdentifierWithData<ChartSeriesType>) => void;
|
|
17
17
|
/**
|
|
18
18
|
* Remove item interaction if the current if the provided item is still the one interacting.
|
|
19
19
|
* @param {ChartItemIdentifier} itemToRemove The identifier of the item.
|
|
@@ -30,7 +30,7 @@ export interface UseChartInteractionState {
|
|
|
30
30
|
/**
|
|
31
31
|
* The item currently interacting.
|
|
32
32
|
*/
|
|
33
|
-
item: null |
|
|
33
|
+
item: null | ChartItemIdentifierWithData<ChartSeriesType>;
|
|
34
34
|
/**
|
|
35
35
|
* The x/y SVG coordinate of the "main" pointer
|
|
36
36
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartItemIdentifierWithData, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
|
|
2
2
|
import { SeriesId } from "../../../../models/seriesType/common.js";
|
|
3
3
|
import { AxisId, ChartsRotationAxisProps, ChartsRadiusAxisProps, PolarAxisDefaultized, ComputedXAxis, ComputedYAxis } from "../../../../models/axis.js";
|
|
4
4
|
import { ChartsLabelMarkProps } from "../../../../ChartsLabel/ChartsLabelMark.js";
|
|
@@ -7,7 +7,7 @@ export interface ItemTooltip<T extends ChartSeriesType> {
|
|
|
7
7
|
/**
|
|
8
8
|
* An object that identifies the item to display.
|
|
9
9
|
*/
|
|
10
|
-
identifier:
|
|
10
|
+
identifier: ChartItemIdentifierWithData<T>;
|
|
11
11
|
/**
|
|
12
12
|
* The color associated with the item.
|
|
13
13
|
*/
|
|
@@ -59,7 +59,7 @@ export type TooltipGetter<TSeriesType extends ChartSeriesType> = (params: {
|
|
|
59
59
|
series: ChartSeriesDefaultized<TSeriesType>;
|
|
60
60
|
axesConfig: TooltipGetterAxesConfig;
|
|
61
61
|
getColor: ColorGetter<TSeriesType>;
|
|
62
|
-
identifier:
|
|
62
|
+
identifier: ChartItemIdentifierWithData<TSeriesType> | null;
|
|
63
63
|
}) => (TSeriesType extends 'radar' ? ItemTooltipWithMultipleValues<TSeriesType> : ItemTooltip<TSeriesType>) | null;
|
|
64
64
|
/**
|
|
65
65
|
* If `axisId` is set to undefined, the default axis will be used.
|
package/models/axis.d.ts
CHANGED
|
@@ -55,11 +55,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
55
55
|
* @default false
|
|
56
56
|
*/
|
|
57
57
|
disableTicks?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The fill color of the axis text.
|
|
60
|
-
* @default 'currentColor'
|
|
61
|
-
*/
|
|
62
|
-
fill?: string;
|
|
63
58
|
/**
|
|
64
59
|
* The style applied to ticks text.
|
|
65
60
|
*/
|
|
@@ -79,11 +74,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
79
74
|
* The label of the axis.
|
|
80
75
|
*/
|
|
81
76
|
label?: string;
|
|
82
|
-
/**
|
|
83
|
-
* The stroke color of the axis line.
|
|
84
|
-
* @default 'currentColor'
|
|
85
|
-
*/
|
|
86
|
-
stroke?: string;
|
|
87
77
|
/**
|
|
88
78
|
* The size of the ticks.
|
|
89
79
|
* @default 6
|
|
@@ -21,6 +21,7 @@ export interface ChartsSeriesConfig {
|
|
|
21
21
|
*/
|
|
22
22
|
seriesProp: BarSeriesType;
|
|
23
23
|
itemIdentifier: BarItemIdentifier;
|
|
24
|
+
itemIdentifierWithData: BarItemIdentifier;
|
|
24
25
|
valueType: number | null;
|
|
25
26
|
canBeStacked: true;
|
|
26
27
|
axisType: 'cartesian';
|
|
@@ -32,6 +33,7 @@ export interface ChartsSeriesConfig {
|
|
|
32
33
|
series: DefaultizedLineSeriesType;
|
|
33
34
|
seriesProp: LineSeriesType;
|
|
34
35
|
itemIdentifier: LineItemIdentifier;
|
|
36
|
+
itemIdentifierWithData: LineItemIdentifier;
|
|
35
37
|
valueType: number | null;
|
|
36
38
|
canBeStacked: true;
|
|
37
39
|
axisType: 'cartesian';
|
|
@@ -44,6 +46,7 @@ export interface ChartsSeriesConfig {
|
|
|
44
46
|
seriesProp: ScatterSeriesType;
|
|
45
47
|
valueType: ScatterValueType;
|
|
46
48
|
itemIdentifier: ScatterItemIdentifier;
|
|
49
|
+
itemIdentifierWithData: ScatterItemIdentifier;
|
|
47
50
|
axisType: 'cartesian';
|
|
48
51
|
};
|
|
49
52
|
pie: {
|
|
@@ -55,6 +58,7 @@ export interface ChartsSeriesConfig {
|
|
|
55
58
|
series: DefaultizedPieSeriesType;
|
|
56
59
|
seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
|
|
57
60
|
itemIdentifier: PieItemIdentifier;
|
|
61
|
+
itemIdentifierWithData: PieItemIdentifier;
|
|
58
62
|
valueType: DefaultizedPieValueType;
|
|
59
63
|
};
|
|
60
64
|
radar: {
|
|
@@ -64,6 +68,7 @@ export interface ChartsSeriesConfig {
|
|
|
64
68
|
series: DefaultizedRadarSeriesType;
|
|
65
69
|
seriesProp: RadarSeriesType;
|
|
66
70
|
itemIdentifier: RadarItemIdentifier;
|
|
71
|
+
itemIdentifierWithData: RadarItemIdentifier;
|
|
67
72
|
valueType: number;
|
|
68
73
|
axisType: 'polar';
|
|
69
74
|
};
|
|
@@ -85,6 +90,7 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
|
|
|
85
90
|
stackedData: [number, number][];
|
|
86
91
|
} : ChartsSeriesConfig[T]['series'];
|
|
87
92
|
export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
|
|
93
|
+
export type ChartItemIdentifierWithData<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
|
|
88
94
|
export type DatasetElementType<T> = {
|
|
89
95
|
[key: string]: Readonly<T>;
|
|
90
96
|
};
|
|
@@ -18,6 +18,7 @@ type DefaultizedCartesianSeriesType = DefaultizedSeriesType<CartesianChartSeries
|
|
|
18
18
|
*/
|
|
19
19
|
type StackableSeriesType = DefaultizedSeriesType<StackableChartSeriesType>;
|
|
20
20
|
export type SeriesItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
|
|
21
|
+
export type SeriesItemIdentifierWithData<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
|
|
21
22
|
export * from "./line.js";
|
|
22
23
|
export * from "./bar.js";
|
|
23
24
|
export * from "./scatter.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of MUI X Charts components.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"reselect": "^5.1.1",
|
|
37
37
|
"use-sync-external-store": "^1.5.0",
|
|
38
|
-
"@mui/x-
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
38
|
+
"@mui/x-charts-vendor": "8.11.0",
|
|
39
|
+
"@mui/x-internal-gestures": "0.2.5",
|
|
40
|
+
"@mui/x-internals": "8.11.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@emotion/react": "^11.9.0",
|