@mui/x-charts 7.23.2 → 7.23.6
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.d.ts +1 -1
- package/BarChart/BarChart.js +1 -1
- package/BarChart/BarElement.d.ts +1 -479
- package/BarChart/BarLabel/BarLabel.d.ts +1 -479
- package/CHANGELOG.md +190 -0
- package/ChartContainer/useChartContainerProps.d.ts +16 -16
- package/ChartContainer/useDefaultizeAxis.d.ts +8 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/LineChart/AnimatedArea.d.ts +1 -479
- package/LineChart/AnimatedArea.js +4 -1
- package/LineChart/AnimatedLine.d.ts +1 -479
- package/LineChart/AnimatedLine.js +4 -1
- package/LineChart/AppearingMask.js +1 -0
- package/LineChart/CircleMarkElement.js +1 -0
- package/LineChart/LineChart.d.ts +1 -1
- package/LineChart/LineChart.js +1 -1
- package/LineChart/MarkElement.js +3 -1
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PieArcLabel.js +13 -9
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.js +1 -1
- package/README.md +1 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +1 -1
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +1 -1
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +1 -1
- package/SparkLineChart/SparkLineChart.js +1 -4
- package/context/CartesianProvider/defaultizeAxis.d.ts +8 -8
- package/context/DrawingProvider.d.ts +2 -2
- package/context/PluginProvider/mergePlugins.d.ts +8 -8
- package/hooks/useSvgRef.d.ts +1 -1
- package/index.js +1 -1
- package/internals/defaultizeColor.d.ts +1 -1
- package/modern/BarChart/BarChart.js +1 -1
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/modern/LineChart/AnimatedArea.js +4 -1
- package/modern/LineChart/AnimatedLine.js +4 -1
- package/modern/LineChart/AppearingMask.js +1 -0
- package/modern/LineChart/CircleMarkElement.js +1 -0
- package/modern/LineChart/LineChart.js +1 -1
- package/modern/LineChart/MarkElement.js +3 -1
- package/modern/PieChart/PieArc.js +3 -1
- package/modern/PieChart/PieArcLabel.js +13 -9
- package/modern/PieChart/PieChart.js +1 -1
- package/modern/ScatterChart/ScatterChart.js +1 -1
- package/modern/SparkLineChart/SparkLineChart.js +1 -4
- package/modern/index.js +1 -1
- package/node/BarChart/BarChart.js +1 -1
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/node/LineChart/AnimatedArea.js +4 -1
- package/node/LineChart/AnimatedLine.js +4 -1
- package/node/LineChart/AppearingMask.js +1 -0
- package/node/LineChart/CircleMarkElement.js +1 -0
- package/node/LineChart/LineChart.js +1 -1
- package/node/LineChart/MarkElement.js +3 -1
- package/node/PieChart/PieArc.js +3 -1
- package/node/PieChart/PieArcLabel.js +13 -9
- package/node/PieChart/PieChart.js +1 -1
- package/node/ScatterChart/ScatterChart.js +1 -1
- package/node/SparkLineChart/SparkLineChart.js +1 -4
- package/node/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# MUI X Charts
|
|
2
2
|
|
|
3
3
|
This package is the community edition of the chart components.
|
|
4
|
-
It's part of [MUI X](https://mui.com/x/), an open-core extension of
|
|
4
|
+
It's part of [MUI X](https://mui.com/x/), an open-core extension of our Core libraries, with advanced components.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const useChartContainerDimensions: (inWidth?: number, inHeight?: number, resolveSizeBeforeRender?: boolean) => {
|
|
3
|
-
containerRef: React.
|
|
3
|
+
containerRef: React.RefObject<null>;
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
};
|
|
@@ -13,7 +13,7 @@ export declare const useResponsiveChartContainerProps: (props: ResponsiveChartCo
|
|
|
13
13
|
width: number | undefined;
|
|
14
14
|
height: number | undefined;
|
|
15
15
|
};
|
|
16
|
-
ref: import("react").
|
|
16
|
+
ref: import("react").RefObject<null>;
|
|
17
17
|
className?: string | undefined;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -30,7 +30,7 @@ export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, '
|
|
|
30
30
|
tooltip?: ChartsTooltipProps<'scatter'>;
|
|
31
31
|
/**
|
|
32
32
|
* The configuration of axes highlight.
|
|
33
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
33
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
34
34
|
* @default { x: 'none', y: 'none' }
|
|
35
35
|
*/
|
|
36
36
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
@@ -62,7 +62,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
62
62
|
// ----------------------------------------------------------------------
|
|
63
63
|
/**
|
|
64
64
|
* The configuration of axes highlight.
|
|
65
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
65
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
66
66
|
* @default { x: 'none', y: 'none' }
|
|
67
67
|
*/
|
|
68
68
|
axisHighlight: PropTypes.shape({
|
|
@@ -90,10 +90,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
90
90
|
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
91
91
|
skipAnimation: true,
|
|
92
92
|
slots: slots,
|
|
93
|
-
slotProps: slotProps
|
|
94
|
-
sx: {
|
|
95
|
-
shapeRendering: 'auto'
|
|
96
|
-
}
|
|
93
|
+
slotProps: slotProps
|
|
97
94
|
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
98
95
|
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
99
96
|
skipAnimation: true,
|
|
@@ -3,33 +3,33 @@ import { AxisConfig, ScaleName } from '../../models';
|
|
|
3
3
|
import { ChartsAxisProps } from '../../models/axis';
|
|
4
4
|
export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, axisName: "x" | "y") => {
|
|
5
5
|
reverse?: boolean | undefined;
|
|
6
|
-
|
|
7
|
-
stroke?: string | undefined;
|
|
6
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
8
7
|
data?: any[] | undefined;
|
|
8
|
+
dataKey?: string | undefined;
|
|
9
9
|
label?: string | undefined;
|
|
10
|
-
max?: (number | Date) | undefined;
|
|
11
10
|
min?: (number | Date) | undefined;
|
|
12
|
-
|
|
13
|
-
dataKey?: string | undefined;
|
|
14
|
-
sx?: import("@mui/system").SxProps | undefined;
|
|
15
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
11
|
+
max?: (number | Date) | undefined;
|
|
16
12
|
tickMaxStep?: number | undefined;
|
|
17
13
|
tickMinStep?: number | undefined;
|
|
18
14
|
tickNumber?: number | undefined;
|
|
19
15
|
disableLine?: boolean | undefined;
|
|
20
16
|
disableTicks?: boolean | undefined;
|
|
17
|
+
fill?: string | undefined;
|
|
21
18
|
tickFontSize?: number | undefined;
|
|
22
19
|
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
23
20
|
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
24
21
|
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
25
22
|
labelFontSize?: number | undefined;
|
|
23
|
+
stroke?: string | undefined;
|
|
26
24
|
tickSize?: number | undefined;
|
|
25
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
27
26
|
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
28
27
|
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
28
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
29
29
|
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
30
30
|
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
31
31
|
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
32
|
-
scaleType?: "linear" | "
|
|
32
|
+
scaleType?: "linear" | "band" | "point" | "log" | "pow" | "sqrt" | "time" | "utc" | undefined;
|
|
33
33
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
34
34
|
hideTooltip?: boolean | undefined;
|
|
35
35
|
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
@@ -3,7 +3,7 @@ import { LayoutConfig } from '../models/layout';
|
|
|
3
3
|
import { Initializable } from './context.types';
|
|
4
4
|
export interface DrawingProviderProps extends LayoutConfig {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
svgRef: React.RefObject<SVGSVGElement>;
|
|
6
|
+
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Defines the area in which it is possible to draw the charts.
|
|
@@ -57,6 +57,6 @@ export declare const DrawingContext: React.Context<DrawingArea & {
|
|
|
57
57
|
*/
|
|
58
58
|
chartId: string;
|
|
59
59
|
}>;
|
|
60
|
-
export type SvgContextState = React.RefObject<SVGSVGElement>;
|
|
60
|
+
export type SvgContextState = React.RefObject<SVGSVGElement | null>;
|
|
61
61
|
export declare const SvgContext: React.Context<Initializable<SvgContextState>>;
|
|
62
62
|
export declare function DrawingProvider(props: DrawingProviderProps): React.JSX.Element;
|
|
@@ -11,14 +11,6 @@ export declare const defaultPlugins: ({
|
|
|
11
11
|
yExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
12
12
|
rotationExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
13
13
|
radiusExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
14
|
-
} | {
|
|
15
|
-
seriesType: "line";
|
|
16
|
-
seriesFormatter: SeriesFormatter<"line">;
|
|
17
|
-
colorProcessor: ColorProcessor<"line">;
|
|
18
|
-
xExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
19
|
-
yExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
20
|
-
rotationExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
21
|
-
radiusExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
22
14
|
} | {
|
|
23
15
|
seriesType: "scatter";
|
|
24
16
|
seriesFormatter: SeriesFormatter<"scatter">;
|
|
@@ -27,6 +19,14 @@ export declare const defaultPlugins: ({
|
|
|
27
19
|
yExtremumGetter?: ExtremumGetter<"scatter"> | undefined;
|
|
28
20
|
rotationExtremumGetter?: ExtremumGetter<"scatter"> | undefined;
|
|
29
21
|
radiusExtremumGetter?: ExtremumGetter<"scatter"> | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
seriesType: "line";
|
|
24
|
+
seriesFormatter: SeriesFormatter<"line">;
|
|
25
|
+
colorProcessor: ColorProcessor<"line">;
|
|
26
|
+
xExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
27
|
+
yExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
28
|
+
rotationExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
29
|
+
radiusExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
30
30
|
} | {
|
|
31
31
|
seriesType: "pie";
|
|
32
32
|
seriesFormatter: SeriesFormatter<"pie">;
|
package/hooks/useSvgRef.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function useSvgRef(): React.
|
|
2
|
+
export declare function useSvgRef(): React.RefObject<SVGSVGElement | null>;
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AllSeriesType } from '../models/seriesType';
|
|
2
2
|
export declare function defaultizeColor(series: AllSeriesType, seriesIndex: number, colors?: string[]): {
|
|
3
3
|
data: {
|
|
4
|
-
color: string;
|
|
5
4
|
label?: (string | ((location: "tooltip" | "legend" | "arc") => string)) | undefined;
|
|
5
|
+
color: string;
|
|
6
6
|
value: number;
|
|
7
7
|
id?: import("..").PieItemId | undefined;
|
|
8
8
|
}[];
|
|
@@ -63,7 +63,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
63
63
|
* The configuration of axes highlight.
|
|
64
64
|
* Default is set to 'band' in the bar direction.
|
|
65
65
|
* Depends on `layout` prop.
|
|
66
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
66
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
67
67
|
*/
|
|
68
68
|
axisHighlight: PropTypes.shape({
|
|
69
69
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
@@ -102,10 +102,10 @@ function ChartsVoronoiHandler(props) {
|
|
|
102
102
|
lastFind.current = undefined;
|
|
103
103
|
}, [defaultXAxisId, defaultYAxisId, series, seriesOrder, xAxis, yAxis, drawingArea]);
|
|
104
104
|
React.useEffect(() => {
|
|
105
|
-
|
|
106
|
-
if (element === null) {
|
|
105
|
+
if (svgRef.current === null) {
|
|
107
106
|
return undefined;
|
|
108
107
|
}
|
|
108
|
+
const element = svgRef.current;
|
|
109
109
|
function getClosestPoint(event) {
|
|
110
110
|
// Get mouse coordinate in global SVG space
|
|
111
111
|
const svgPoint = getSVGPoint(element, event);
|
|
@@ -57,7 +57,10 @@ function AnimatedArea(props) {
|
|
|
57
57
|
return /*#__PURE__*/_jsx(AppearingMask, {
|
|
58
58
|
skipAnimation: skipAnimation,
|
|
59
59
|
id: `${ownerState.id}-area-clip`,
|
|
60
|
-
children: transitionChange((style, interpolator) =>
|
|
60
|
+
children: transitionChange((style, interpolator) =>
|
|
61
|
+
/*#__PURE__*/
|
|
62
|
+
// @ts-expect-error
|
|
63
|
+
_jsx(AreaElementPath, _extends({}, other, {
|
|
61
64
|
ownerState: ownerState,
|
|
62
65
|
d: style.value.to(interpolator)
|
|
63
66
|
})))
|
|
@@ -59,7 +59,10 @@ function AnimatedLine(props) {
|
|
|
59
59
|
return /*#__PURE__*/_jsx(AppearingMask, {
|
|
60
60
|
skipAnimation: skipAnimation,
|
|
61
61
|
id: `${ownerState.id}-line-clip`,
|
|
62
|
-
children: transitionChange((style, interpolator) =>
|
|
62
|
+
children: transitionChange((style, interpolator) =>
|
|
63
|
+
/*#__PURE__*/
|
|
64
|
+
// @ts-expect-error
|
|
65
|
+
_jsx(LineElementPath, _extends({}, other, {
|
|
63
66
|
ownerState: ownerState,
|
|
64
67
|
d: style.value.to(interpolator)
|
|
65
68
|
})))
|
|
@@ -69,7 +69,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
69
69
|
// ----------------------------------------------------------------------
|
|
70
70
|
/**
|
|
71
71
|
* The configuration of axes highlight.
|
|
72
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
72
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
73
73
|
* @default { x: 'line' }
|
|
74
74
|
*/
|
|
75
75
|
axisHighlight: PropTypes.shape({
|
|
@@ -79,7 +79,9 @@ function MarkElement(props) {
|
|
|
79
79
|
transform: to([position.x, position.y], (pX, pY) => `translate(${pX}px, ${pY}px)`),
|
|
80
80
|
transformOrigin: to([position.x, position.y], (pX, pY) => `${pX}px ${pY}px`)
|
|
81
81
|
},
|
|
82
|
-
ownerState: ownerState
|
|
82
|
+
ownerState: ownerState
|
|
83
|
+
// @ts-expect-error
|
|
84
|
+
,
|
|
83
85
|
className: classes.root,
|
|
84
86
|
d: d3Symbol(d3SymbolsFill[getSymbol(shape)])(),
|
|
85
87
|
onClick: onClick,
|
|
@@ -76,7 +76,9 @@ function PieArc(props) {
|
|
|
76
76
|
innerRadius: iR,
|
|
77
77
|
outerRadius: oR
|
|
78
78
|
})),
|
|
79
|
-
visibility: to([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
79
|
+
visibility: to([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
80
|
+
// @ts-expect-error
|
|
81
|
+
,
|
|
80
82
|
onClick: onClick,
|
|
81
83
|
cursor: onClick ? 'pointer' : 'unset',
|
|
82
84
|
ownerState: ownerState,
|
|
@@ -84,15 +84,19 @@ function PieArcLabel(props) {
|
|
|
84
84
|
isHighlighted
|
|
85
85
|
};
|
|
86
86
|
const classes = useUtilityClasses(ownerState);
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
return (
|
|
88
|
+
/*#__PURE__*/
|
|
89
|
+
// @ts-expect-error
|
|
90
|
+
_jsx(PieArcLabelRoot, _extends({
|
|
91
|
+
className: classes.root
|
|
92
|
+
}, other, {
|
|
93
|
+
style: _extends({
|
|
94
|
+
x: to([startAngle, endAngle, paddingAngle, arcLabelRadius, cornerRadius], getLabelPosition(formattedArcLabel, 'x')),
|
|
95
|
+
y: to([startAngle, endAngle, paddingAngle, arcLabelRadius, cornerRadius], getLabelPosition(formattedArcLabel, 'y'))
|
|
96
|
+
}, style),
|
|
97
|
+
children: formattedArcLabel
|
|
98
|
+
}))
|
|
99
|
+
);
|
|
96
100
|
}
|
|
97
101
|
process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
98
102
|
// ----------------------------- Warning --------------------------------
|
|
@@ -137,7 +137,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
137
137
|
// ----------------------------------------------------------------------
|
|
138
138
|
/**
|
|
139
139
|
* The configuration of axes highlight.
|
|
140
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
140
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
141
141
|
* @default { x: 'none', y: 'none' }
|
|
142
142
|
*/
|
|
143
143
|
axisHighlight: PropTypes.shape({
|
|
@@ -62,7 +62,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
62
62
|
// ----------------------------------------------------------------------
|
|
63
63
|
/**
|
|
64
64
|
* The configuration of axes highlight.
|
|
65
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
65
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
66
66
|
* @default { x: 'none', y: 'none' }
|
|
67
67
|
*/
|
|
68
68
|
axisHighlight: PropTypes.shape({
|
|
@@ -90,10 +90,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
90
90
|
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
91
91
|
skipAnimation: true,
|
|
92
92
|
slots: slots,
|
|
93
|
-
slotProps: slotProps
|
|
94
|
-
sx: {
|
|
95
|
-
shapeRendering: 'auto'
|
|
96
|
-
}
|
|
93
|
+
slotProps: slotProps
|
|
97
94
|
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
98
95
|
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
99
96
|
skipAnimation: true,
|
package/modern/index.js
CHANGED
|
@@ -70,7 +70,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
70
70
|
* The configuration of axes highlight.
|
|
71
71
|
* Default is set to 'band' in the bar direction.
|
|
72
72
|
* Depends on `layout` prop.
|
|
73
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
73
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
74
74
|
*/
|
|
75
75
|
axisHighlight: _propTypes.default.shape({
|
|
76
76
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
@@ -109,10 +109,10 @@ function ChartsVoronoiHandler(props) {
|
|
|
109
109
|
lastFind.current = undefined;
|
|
110
110
|
}, [defaultXAxisId, defaultYAxisId, series, seriesOrder, xAxis, yAxis, drawingArea]);
|
|
111
111
|
React.useEffect(() => {
|
|
112
|
-
|
|
113
|
-
if (element === null) {
|
|
112
|
+
if (svgRef.current === null) {
|
|
114
113
|
return undefined;
|
|
115
114
|
}
|
|
115
|
+
const element = svgRef.current;
|
|
116
116
|
function getClosestPoint(event) {
|
|
117
117
|
// Get mouse coordinate in global SVG space
|
|
118
118
|
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event);
|
|
@@ -65,7 +65,10 @@ function AnimatedArea(props) {
|
|
|
65
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppearingMask.AppearingMask, {
|
|
66
66
|
skipAnimation: skipAnimation,
|
|
67
67
|
id: `${ownerState.id}-area-clip`,
|
|
68
|
-
children: transitionChange((style, interpolator) =>
|
|
68
|
+
children: transitionChange((style, interpolator) =>
|
|
69
|
+
/*#__PURE__*/
|
|
70
|
+
// @ts-expect-error
|
|
71
|
+
(0, _jsxRuntime.jsx)(AreaElementPath, (0, _extends2.default)({}, other, {
|
|
69
72
|
ownerState: ownerState,
|
|
70
73
|
d: style.value.to(interpolator)
|
|
71
74
|
})))
|
|
@@ -67,7 +67,10 @@ function AnimatedLine(props) {
|
|
|
67
67
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppearingMask.AppearingMask, {
|
|
68
68
|
skipAnimation: skipAnimation,
|
|
69
69
|
id: `${ownerState.id}-line-clip`,
|
|
70
|
-
children: transitionChange((style, interpolator) =>
|
|
70
|
+
children: transitionChange((style, interpolator) =>
|
|
71
|
+
/*#__PURE__*/
|
|
72
|
+
// @ts-expect-error
|
|
73
|
+
(0, _jsxRuntime.jsx)(LineElementPath, (0, _extends2.default)({}, other, {
|
|
71
74
|
ownerState: ownerState,
|
|
72
75
|
d: style.value.to(interpolator)
|
|
73
76
|
})))
|
|
@@ -35,6 +35,7 @@ function AppearingMask(props) {
|
|
|
35
35
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("clipPath", {
|
|
36
36
|
id: clipId,
|
|
37
37
|
children: transitionAppear(style => /*#__PURE__*/(0, _jsxRuntime.jsx)(_web.animated.rect, {
|
|
38
|
+
// @ts-expect-error
|
|
38
39
|
x: 0,
|
|
39
40
|
y: 0,
|
|
40
41
|
width: style.animatedWidth,
|
|
@@ -75,6 +75,7 @@ function CircleMarkElement(props) {
|
|
|
75
75
|
};
|
|
76
76
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
77
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_web.animated.circle, (0, _extends2.default)({}, other, {
|
|
78
|
+
// @ts-expect-error
|
|
78
79
|
cx: position.x,
|
|
79
80
|
cy: position.y,
|
|
80
81
|
r: 5,
|
|
@@ -76,7 +76,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
76
76
|
// ----------------------------------------------------------------------
|
|
77
77
|
/**
|
|
78
78
|
* The configuration of axes highlight.
|
|
79
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
79
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
80
80
|
* @default { x: 'line' }
|
|
81
81
|
*/
|
|
82
82
|
axisHighlight: _propTypes.default.shape({
|
|
@@ -86,7 +86,9 @@ function MarkElement(props) {
|
|
|
86
86
|
transform: (0, _web.to)([position.x, position.y], (pX, pY) => `translate(${pX}px, ${pY}px)`),
|
|
87
87
|
transformOrigin: (0, _web.to)([position.x, position.y], (pX, pY) => `${pX}px ${pY}px`)
|
|
88
88
|
},
|
|
89
|
-
ownerState: ownerState
|
|
89
|
+
ownerState: ownerState
|
|
90
|
+
// @ts-expect-error
|
|
91
|
+
,
|
|
90
92
|
className: classes.root,
|
|
91
93
|
d: (0, _d3Shape.symbol)(_d3Shape.symbolsFill[(0, _getSymbol.getSymbol)(shape)])(),
|
|
92
94
|
onClick: onClick,
|
package/node/PieChart/PieArc.js
CHANGED
|
@@ -85,7 +85,9 @@ function PieArc(props) {
|
|
|
85
85
|
innerRadius: iR,
|
|
86
86
|
outerRadius: oR
|
|
87
87
|
})),
|
|
88
|
-
visibility: (0, _web.to)([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
88
|
+
visibility: (0, _web.to)([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
89
|
+
// @ts-expect-error
|
|
90
|
+
,
|
|
89
91
|
onClick: onClick,
|
|
90
92
|
cursor: onClick ? 'pointer' : 'unset',
|
|
91
93
|
ownerState: ownerState,
|
|
@@ -93,15 +93,19 @@ function PieArcLabel(props) {
|
|
|
93
93
|
isHighlighted
|
|
94
94
|
};
|
|
95
95
|
const classes = useUtilityClasses(ownerState);
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
return (
|
|
97
|
+
/*#__PURE__*/
|
|
98
|
+
// @ts-expect-error
|
|
99
|
+
(0, _jsxRuntime.jsx)(PieArcLabelRoot, (0, _extends2.default)({
|
|
100
|
+
className: classes.root
|
|
101
|
+
}, other, {
|
|
102
|
+
style: (0, _extends2.default)({
|
|
103
|
+
x: (0, _web.to)([startAngle, endAngle, paddingAngle, arcLabelRadius, cornerRadius], getLabelPosition(formattedArcLabel, 'x')),
|
|
104
|
+
y: (0, _web.to)([startAngle, endAngle, paddingAngle, arcLabelRadius, cornerRadius], getLabelPosition(formattedArcLabel, 'y'))
|
|
105
|
+
}, style),
|
|
106
|
+
children: formattedArcLabel
|
|
107
|
+
}))
|
|
108
|
+
);
|
|
105
109
|
}
|
|
106
110
|
process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
107
111
|
// ----------------------------- Warning --------------------------------
|
|
@@ -144,7 +144,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
144
144
|
// ----------------------------------------------------------------------
|
|
145
145
|
/**
|
|
146
146
|
* The configuration of axes highlight.
|
|
147
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
147
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
148
148
|
* @default { x: 'none', y: 'none' }
|
|
149
149
|
*/
|
|
150
150
|
axisHighlight: _propTypes.default.shape({
|
|
@@ -69,7 +69,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
69
69
|
// ----------------------------------------------------------------------
|
|
70
70
|
/**
|
|
71
71
|
* The configuration of axes highlight.
|
|
72
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
72
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
73
73
|
* @default { x: 'none', y: 'none' }
|
|
74
74
|
*/
|
|
75
75
|
axisHighlight: _propTypes.default.shape({
|
|
@@ -97,10 +97,7 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
|
|
|
97
97
|
children: [plotType === 'bar' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.BarPlot, {
|
|
98
98
|
skipAnimation: true,
|
|
99
99
|
slots: slots,
|
|
100
|
-
slotProps: slotProps
|
|
101
|
-
sx: {
|
|
102
|
-
shapeRendering: 'auto'
|
|
103
|
-
}
|
|
100
|
+
slotProps: slotProps
|
|
104
101
|
}), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
105
102
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.AreaPlot, {
|
|
106
103
|
skipAnimation: true,
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "7.23.
|
|
3
|
+
"version": "7.23.6",
|
|
4
4
|
"description": "The community edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@react-spring/web": "^9.7.5",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"prop-types": "^15.8.1",
|
|
38
|
-
"@mui/x-
|
|
39
|
-
"@mui/x-
|
|
38
|
+
"@mui/x-internals": "7.23.6",
|
|
39
|
+
"@mui/x-charts-vendor": "7.20.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@emotion/react": "^11.9.0",
|