@mui/x-charts 7.0.0-alpha.9 → 7.0.0-beta.1
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 +2 -1
- package/BarChart/BarChart.js +24 -23
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarElement.js +6 -3
- package/BarChart/BarPlot.d.ts +8 -1
- package/BarChart/BarPlot.js +19 -5
- package/BarChart/formatter.js +1 -1
- package/CHANGELOG.md +386 -38
- package/ChartContainer/ChartContainer.d.ts +12 -0
- package/ChartContainer/ChartContainer.js +197 -0
- package/ChartContainer/index.d.ts +1 -11
- package/ChartContainer/index.js +9 -63
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.d.ts +20 -0
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +83 -0
- package/ChartsOnAxisClickHandler/index.d.ts +1 -0
- package/ChartsOnAxisClickHandler/index.js +16 -0
- package/ChartsOnAxisClickHandler/package.json +6 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +8 -59
- package/ChartsTooltip/ChartsItemTooltipContent.js +1 -11
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -58
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -11
- package/ChartsTooltip/utils.d.ts +3 -1
- package/ChartsTooltip/utils.js +8 -0
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.d.ts +7 -0
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
- package/LineChart/AnimatedArea.d.ts +1361 -0
- package/LineChart/AnimatedArea.js +111 -0
- package/LineChart/AnimatedLine.d.ts +1361 -0
- package/LineChart/AnimatedLine.js +113 -0
- package/LineChart/AreaElement.d.ts +17 -17
- package/LineChart/AreaElement.js +17 -34
- package/LineChart/AreaPlot.d.ts +12 -7
- package/LineChart/AreaPlot.js +91 -58
- package/LineChart/LineChart.d.ts +13 -4
- package/LineChart/LineChart.js +36 -29
- package/LineChart/LineElement.d.ts +17 -17
- package/LineChart/LineElement.js +16 -36
- package/LineChart/LineHighlightElement.js +3 -2
- package/LineChart/LinePlot.d.ts +12 -7
- package/LineChart/LinePlot.js +89 -56
- package/LineChart/MarkElement.d.ts +5 -2
- package/LineChart/MarkElement.js +26 -13
- package/LineChart/MarkPlot.d.ts +8 -1
- package/LineChart/MarkPlot.js +80 -51
- package/LineChart/formatter.js +1 -1
- package/LineChart/index.d.ts +2 -0
- package/LineChart/index.js +22 -0
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +1 -1
- package/PieChart/PieArcPlot.d.ts +2 -2
- package/PieChart/PieArcPlot.js +6 -6
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.js +5 -50
- package/PieChart/PiePlot.d.ts +1 -1
- package/PieChart/PiePlot.js +4 -4
- package/README.md +2 -2
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +16 -0
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +250 -0
- package/ResponsiveChartContainer/index.d.ts +1 -15
- package/ResponsiveChartContainer/index.js +8 -113
- package/ScatterChart/Scatter.d.ts +7 -1
- package/ScatterChart/Scatter.js +18 -23
- package/ScatterChart/ScatterChart.d.ts +8 -2
- package/ScatterChart/ScatterChart.js +12 -22
- package/ScatterChart/ScatterPlot.d.ts +1 -1
- package/ScatterChart/ScatterPlot.js +10 -2
- package/SparkLineChart/SparkLineChart.js +2 -0
- package/context/DrawingProvider.d.ts +6 -1
- package/context/DrawingProvider.js +9 -2
- package/context/InteractionProvider.d.ts +3 -3
- package/esm/BarChart/BarChart.js +24 -23
- package/esm/BarChart/BarElement.js +6 -3
- package/esm/BarChart/BarPlot.js +19 -5
- package/esm/BarChart/formatter.js +1 -1
- package/esm/ChartContainer/ChartContainer.js +189 -0
- package/esm/ChartContainer/index.js +1 -61
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +77 -0
- package/esm/ChartsOnAxisClickHandler/index.js +1 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -59
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +1 -11
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +9 -58
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -11
- package/esm/ChartsTooltip/utils.js +6 -0
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
- package/esm/LineChart/AnimatedArea.js +103 -0
- package/esm/LineChart/AnimatedLine.js +105 -0
- package/esm/LineChart/AreaElement.js +16 -33
- package/esm/LineChart/AreaPlot.js +92 -59
- package/esm/LineChart/LineChart.js +36 -29
- package/esm/LineChart/LineElement.js +16 -35
- package/esm/LineChart/LineHighlightElement.js +3 -2
- package/esm/LineChart/LinePlot.js +90 -57
- package/esm/LineChart/MarkElement.js +26 -13
- package/esm/LineChart/MarkPlot.js +80 -51
- package/esm/LineChart/formatter.js +1 -1
- package/esm/LineChart/index.js +2 -0
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +6 -6
- package/esm/PieChart/PieChart.js +5 -50
- package/esm/PieChart/PiePlot.js +4 -4
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +245 -0
- package/esm/ResponsiveChartContainer/index.js +1 -115
- package/esm/ScatterChart/Scatter.js +18 -23
- package/esm/ScatterChart/ScatterChart.js +12 -22
- package/esm/ScatterChart/ScatterPlot.js +10 -2
- package/esm/SparkLineChart/SparkLineChart.js +2 -0
- package/esm/context/DrawingProvider.js +9 -2
- package/esm/hooks/useDrawingArea.js +7 -3
- package/esm/index.js +1 -0
- package/esm/internals/geometry.js +1 -1
- package/esm/internals/useAnimatedPath.js +29 -0
- package/esm/internals/utils.js +7 -0
- package/hooks/useDrawingArea.d.ts +2 -0
- package/hooks/useDrawingArea.js +7 -3
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/geometry.js +1 -1
- package/internals/useAnimatedPath.d.ts +1 -0
- package/internals/useAnimatedPath.js +38 -0
- package/internals/utils.d.ts +4 -0
- package/internals/utils.js +8 -0
- package/legacy/BarChart/BarChart.js +24 -23
- package/legacy/BarChart/BarElement.js +5 -2
- package/legacy/BarChart/BarPlot.js +18 -4
- package/legacy/BarChart/formatter.js +1 -1
- package/legacy/ChartContainer/ChartContainer.js +187 -0
- package/legacy/ChartContainer/index.js +1 -59
- package/legacy/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
- package/legacy/ChartsOnAxisClickHandler/index.js +1 -0
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +8 -61
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +1 -11
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +9 -58
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -11
- package/legacy/ChartsTooltip/utils.js +6 -0
- package/legacy/ChartsVoronoiHandler/ChartsVoronoiHandler.js +88 -44
- package/legacy/LineChart/AnimatedArea.js +102 -0
- package/legacy/LineChart/AnimatedLine.js +104 -0
- package/legacy/LineChart/AreaElement.js +15 -35
- package/legacy/LineChart/AreaPlot.js +102 -66
- package/legacy/LineChart/LineChart.js +36 -29
- package/legacy/LineChart/LineElement.js +15 -37
- package/legacy/LineChart/LineHighlightElement.js +3 -2
- package/legacy/LineChart/LinePlot.js +97 -63
- package/legacy/LineChart/MarkElement.js +29 -12
- package/legacy/LineChart/MarkPlot.js +83 -53
- package/legacy/LineChart/formatter.js +1 -1
- package/legacy/LineChart/index.js +2 -0
- package/legacy/PieChart/PieArcLabelPlot.js +1 -1
- package/legacy/PieChart/PieArcPlot.js +6 -6
- package/legacy/PieChart/PieChart.js +5 -50
- package/legacy/PieChart/PiePlot.js +4 -4
- package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +253 -0
- package/legacy/ResponsiveChartContainer/index.js +1 -123
- package/legacy/ScatterChart/Scatter.js +20 -23
- package/legacy/ScatterChart/ScatterChart.js +12 -22
- package/legacy/ScatterChart/ScatterPlot.js +10 -2
- package/legacy/SparkLineChart/SparkLineChart.js +2 -0
- package/legacy/context/DrawingProvider.js +11 -2
- package/legacy/hooks/useDrawingArea.js +7 -3
- package/legacy/index.js +2 -1
- package/legacy/internals/geometry.js +1 -1
- package/legacy/internals/useAnimatedPath.js +32 -0
- package/legacy/internals/utils.js +7 -0
- package/modern/BarChart/BarChart.js +24 -23
- package/modern/BarChart/BarElement.js +6 -3
- package/modern/BarChart/BarPlot.js +19 -5
- package/modern/BarChart/formatter.js +1 -1
- package/modern/ChartContainer/ChartContainer.js +189 -0
- package/modern/ChartContainer/index.js +1 -61
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
- package/modern/ChartsOnAxisClickHandler/index.js +1 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -59
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +1 -11
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -58
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -11
- package/modern/ChartsTooltip/utils.js +6 -0
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
- package/modern/LineChart/AnimatedArea.js +103 -0
- package/modern/LineChart/AnimatedLine.js +105 -0
- package/modern/LineChart/AreaElement.js +16 -33
- package/modern/LineChart/AreaPlot.js +91 -58
- package/modern/LineChart/LineChart.js +36 -29
- package/modern/LineChart/LineElement.js +16 -35
- package/modern/LineChart/LineHighlightElement.js +3 -2
- package/modern/LineChart/LinePlot.js +89 -56
- package/modern/LineChart/MarkElement.js +26 -13
- package/modern/LineChart/MarkPlot.js +80 -51
- package/modern/LineChart/formatter.js +1 -1
- package/modern/LineChart/index.js +2 -0
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +6 -6
- package/modern/PieChart/PieChart.js +5 -50
- package/modern/PieChart/PiePlot.js +4 -4
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +242 -0
- package/modern/ResponsiveChartContainer/index.js +1 -112
- package/modern/ScatterChart/Scatter.js +18 -23
- package/modern/ScatterChart/ScatterChart.js +12 -22
- package/modern/ScatterChart/ScatterPlot.js +10 -2
- package/modern/SparkLineChart/SparkLineChart.js +2 -0
- package/modern/context/DrawingProvider.js +9 -2
- package/modern/hooks/useDrawingArea.js +7 -3
- package/modern/index.js +2 -1
- package/modern/internals/geometry.js +1 -1
- package/modern/internals/useAnimatedPath.js +29 -0
- package/modern/internals/utils.js +7 -0
- package/package.json +6 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { line as d3Line } from 'd3-shape';
|
|
@@ -11,26 +11,11 @@ import { getValueToPositionMapper } from '../hooks/useScale';
|
|
|
11
11
|
import getCurveFactory from '../internals/getCurve';
|
|
12
12
|
import { DEFAULT_X_AXIS_KEY } from '../constants';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
* Demos:
|
|
16
|
-
*
|
|
17
|
-
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
18
|
-
* - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
|
|
19
|
-
*
|
|
20
|
-
* API:
|
|
21
|
-
*
|
|
22
|
-
* - [LinePlot API](https://mui.com/x/api/charts/line-plot/)
|
|
23
|
-
*/
|
|
24
|
-
function LinePlot(props) {
|
|
25
|
-
const {
|
|
26
|
-
slots,
|
|
27
|
-
slotProps
|
|
28
|
-
} = props,
|
|
29
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
14
|
+
const useAggregatedData = () => {
|
|
30
15
|
const seriesData = React.useContext(SeriesContext).line;
|
|
31
16
|
const axisData = React.useContext(CartesianContext);
|
|
32
17
|
if (seriesData === undefined) {
|
|
33
|
-
return
|
|
18
|
+
return [];
|
|
34
19
|
}
|
|
35
20
|
const {
|
|
36
21
|
series,
|
|
@@ -44,46 +29,83 @@ function LinePlot(props) {
|
|
|
44
29
|
} = axisData;
|
|
45
30
|
const defaultXAxisId = xAxisIds[0];
|
|
46
31
|
const defaultYAxisId = yAxisIds[0];
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
|
|
66
|
-
}
|
|
67
|
-
if (xData.length < stackedData.length) {
|
|
68
|
-
throw new Error(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
|
|
69
|
-
}
|
|
32
|
+
return stackingGroups.flatMap(({
|
|
33
|
+
ids: groupIds
|
|
34
|
+
}) => {
|
|
35
|
+
return groupIds.flatMap(seriesId => {
|
|
36
|
+
var _xData$map;
|
|
37
|
+
const {
|
|
38
|
+
xAxisKey = defaultXAxisId,
|
|
39
|
+
yAxisKey = defaultYAxisId,
|
|
40
|
+
stackedData,
|
|
41
|
+
data,
|
|
42
|
+
connectNulls
|
|
43
|
+
} = series[seriesId];
|
|
44
|
+
const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
|
|
45
|
+
const yScale = yAxis[yAxisKey].scale;
|
|
46
|
+
const xData = xAxis[xAxisKey].data;
|
|
47
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
48
|
+
if (xData === undefined) {
|
|
49
|
+
throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
|
|
70
50
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, seriesId);
|
|
51
|
+
if (xData.length < stackedData.length) {
|
|
52
|
+
throw new Error(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const linePath = d3Line().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y(d => yScale(d.y[1]));
|
|
56
|
+
const formattedData = (_xData$map = xData == null ? void 0 : xData.map((x, index) => ({
|
|
57
|
+
x,
|
|
58
|
+
y: stackedData[index]
|
|
59
|
+
}))) != null ? _xData$map : [];
|
|
60
|
+
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
61
|
+
const d = linePath.curve(getCurveFactory(series[seriesId].curve))(d3Data) || '';
|
|
62
|
+
return _extends({}, series[seriesId], {
|
|
63
|
+
d,
|
|
64
|
+
seriesId
|
|
86
65
|
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Demos:
|
|
72
|
+
*
|
|
73
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
74
|
+
* - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
|
|
75
|
+
*
|
|
76
|
+
* API:
|
|
77
|
+
*
|
|
78
|
+
* - [LinePlot API](https://mui.com/x/api/charts/line-plot/)
|
|
79
|
+
*/
|
|
80
|
+
function LinePlot(props) {
|
|
81
|
+
const {
|
|
82
|
+
slots,
|
|
83
|
+
slotProps,
|
|
84
|
+
skipAnimation,
|
|
85
|
+
onItemClick
|
|
86
|
+
} = props,
|
|
87
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
88
|
+
const completedData = useAggregatedData();
|
|
89
|
+
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
90
|
+
children: completedData.map(({
|
|
91
|
+
d,
|
|
92
|
+
seriesId,
|
|
93
|
+
color,
|
|
94
|
+
highlightScope
|
|
95
|
+
}) => {
|
|
96
|
+
return /*#__PURE__*/_jsx(LineElement, {
|
|
97
|
+
id: seriesId,
|
|
98
|
+
d: d,
|
|
99
|
+
color: color,
|
|
100
|
+
highlightScope: highlightScope,
|
|
101
|
+
skipAnimation: skipAnimation,
|
|
102
|
+
slots: slots,
|
|
103
|
+
slotProps: slotProps,
|
|
104
|
+
onClick: onItemClick && (event => onItemClick(event, {
|
|
105
|
+
type: 'line',
|
|
106
|
+
seriesId
|
|
107
|
+
}))
|
|
108
|
+
}, seriesId);
|
|
87
109
|
})
|
|
88
110
|
}));
|
|
89
111
|
}
|
|
@@ -92,6 +114,17 @@ process.env.NODE_ENV !== "production" ? LinePlot.propTypes = {
|
|
|
92
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
93
115
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
94
116
|
// ----------------------------------------------------------------------
|
|
117
|
+
/**
|
|
118
|
+
* Callback fired when a line item is clicked.
|
|
119
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
120
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line item identifier.
|
|
121
|
+
*/
|
|
122
|
+
onItemClick: PropTypes.func,
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, animations are skipped.
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
skipAnimation: PropTypes.bool,
|
|
95
128
|
/**
|
|
96
129
|
* The props used for each component slot.
|
|
97
130
|
* @default {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "highlightScope"];
|
|
3
|
+
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "highlightScope", "onClick", "skipAnimation"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
@@ -8,6 +8,7 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
10
|
import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from 'd3-shape';
|
|
11
|
+
import { animated, to, useSpring } from '@react-spring/web';
|
|
11
12
|
import { getSymbol } from '../internals/utils';
|
|
12
13
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
13
14
|
import { getIsFaded, getIsHighlighted, useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
@@ -28,7 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
28
29
|
};
|
|
29
30
|
return composeClasses(slots, getMarkElementUtilityClass, classes);
|
|
30
31
|
};
|
|
31
|
-
const MarkElementPath = styled(
|
|
32
|
+
const MarkElementPath = styled(animated.path, {
|
|
32
33
|
name: 'MuiMarkElement',
|
|
33
34
|
slot: 'Root',
|
|
34
35
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -36,8 +37,6 @@ const MarkElementPath = styled('path', {
|
|
|
36
37
|
ownerState,
|
|
37
38
|
theme
|
|
38
39
|
}) => ({
|
|
39
|
-
transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
|
|
40
|
-
transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
|
|
41
40
|
fill: (theme.vars || theme).palette.background.paper,
|
|
42
41
|
stroke: ownerState.color,
|
|
43
42
|
strokeWidth: 2
|
|
@@ -53,9 +52,7 @@ MarkElementPath.propTypes = {
|
|
|
53
52
|
color: PropTypes.string.isRequired,
|
|
54
53
|
id: PropTypes.string.isRequired,
|
|
55
54
|
isFaded: PropTypes.bool.isRequired,
|
|
56
|
-
isHighlighted: PropTypes.bool.isRequired
|
|
57
|
-
x: PropTypes.number.isRequired,
|
|
58
|
-
y: PropTypes.number.isRequired
|
|
55
|
+
isHighlighted: PropTypes.bool.isRequired
|
|
59
56
|
}).isRequired,
|
|
60
57
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
61
58
|
};
|
|
@@ -79,7 +76,9 @@ function MarkElement(props) {
|
|
|
79
76
|
color,
|
|
80
77
|
shape,
|
|
81
78
|
dataIndex,
|
|
82
|
-
highlightScope
|
|
79
|
+
highlightScope,
|
|
80
|
+
onClick,
|
|
81
|
+
skipAnimation
|
|
83
82
|
} = props,
|
|
84
83
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
85
84
|
const getInteractionItemProps = useInteractionItemProps(highlightScope);
|
|
@@ -95,20 +94,29 @@ function MarkElement(props) {
|
|
|
95
94
|
type: 'line',
|
|
96
95
|
seriesId: id
|
|
97
96
|
}, highlightScope);
|
|
97
|
+
const position = useSpring({
|
|
98
|
+
x,
|
|
99
|
+
y,
|
|
100
|
+
immediate: skipAnimation
|
|
101
|
+
});
|
|
98
102
|
const ownerState = {
|
|
99
103
|
id,
|
|
100
104
|
classes: innerClasses,
|
|
101
105
|
isHighlighted,
|
|
102
106
|
isFaded,
|
|
103
|
-
color
|
|
104
|
-
x,
|
|
105
|
-
y
|
|
107
|
+
color
|
|
106
108
|
};
|
|
107
109
|
const classes = useUtilityClasses(ownerState);
|
|
108
110
|
return /*#__PURE__*/_jsx(MarkElementPath, _extends({}, other, {
|
|
111
|
+
style: {
|
|
112
|
+
transform: to([position.x, position.y], (pX, pY) => `translate(${pX}px, ${pY}px)`),
|
|
113
|
+
transformOrigin: to([position.x, position.y], (pX, pY) => `${pX}px ${pY}px`)
|
|
114
|
+
},
|
|
109
115
|
ownerState: ownerState,
|
|
110
116
|
className: classes.root,
|
|
111
|
-
d: d3Symbol(d3SymbolsFill[getSymbol(shape)])()
|
|
117
|
+
d: d3Symbol(d3SymbolsFill[getSymbol(shape)])(),
|
|
118
|
+
onClick: onClick,
|
|
119
|
+
cursor: onClick ? 'pointer' : 'unset'
|
|
112
120
|
}, getInteractionItemProps({
|
|
113
121
|
type: 'line',
|
|
114
122
|
seriesId: id,
|
|
@@ -132,6 +140,11 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
132
140
|
/**
|
|
133
141
|
* The shape of the marker.
|
|
134
142
|
*/
|
|
135
|
-
shape: PropTypes.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired
|
|
143
|
+
shape: PropTypes.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired,
|
|
144
|
+
/**
|
|
145
|
+
* If `true`, animations are skipped.
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
148
|
+
skipAnimation: PropTypes.bool
|
|
136
149
|
} : void 0;
|
|
137
150
|
export { MarkElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps"];
|
|
3
|
+
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
@@ -8,6 +8,8 @@ import { CartesianContext } from '../context/CartesianContextProvider';
|
|
|
8
8
|
import { MarkElement } from './MarkElement';
|
|
9
9
|
import { getValueToPositionMapper } from '../hooks/useScale';
|
|
10
10
|
import { DEFAULT_X_AXIS_KEY } from '../constants';
|
|
11
|
+
import { DrawingContext } from '../context/DrawingProvider';
|
|
12
|
+
import { cleanId } from '../internals/utils';
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
/**
|
|
13
15
|
* Demos:
|
|
@@ -23,11 +25,16 @@ function MarkPlot(props) {
|
|
|
23
25
|
var _slots$mark;
|
|
24
26
|
const {
|
|
25
27
|
slots,
|
|
26
|
-
slotProps
|
|
28
|
+
slotProps,
|
|
29
|
+
skipAnimation,
|
|
30
|
+
onItemClick
|
|
27
31
|
} = props,
|
|
28
32
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
29
33
|
const seriesData = React.useContext(SeriesContext).line;
|
|
30
34
|
const axisData = React.useContext(CartesianContext);
|
|
35
|
+
const {
|
|
36
|
+
chartId
|
|
37
|
+
} = React.useContext(DrawingContext);
|
|
31
38
|
const Mark = (_slots$mark = slots == null ? void 0 : slots.mark) != null ? _slots$mark : MarkElement;
|
|
32
39
|
if (seriesData === undefined) {
|
|
33
40
|
return null;
|
|
@@ -48,7 +55,7 @@ function MarkPlot(props) {
|
|
|
48
55
|
children: stackingGroups.flatMap(({
|
|
49
56
|
ids: groupIds
|
|
50
57
|
}) => {
|
|
51
|
-
return groupIds.
|
|
58
|
+
return groupIds.map(seriesId => {
|
|
52
59
|
const {
|
|
53
60
|
xAxisKey = defaultXAxisId,
|
|
54
61
|
yAxisKey = defaultYAxisId,
|
|
@@ -79,59 +86,70 @@ function MarkPlot(props) {
|
|
|
79
86
|
if (xData === undefined) {
|
|
80
87
|
throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
|
|
81
88
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
value
|
|
97
|
-
}) => {
|
|
98
|
-
if (value === null || y === null) {
|
|
99
|
-
// Remove missing data point
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
if (!isInRange({
|
|
103
|
-
x,
|
|
104
|
-
y
|
|
105
|
-
})) {
|
|
106
|
-
// Remove out of range
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
if (showMark === true) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
return showMark({
|
|
89
|
+
const clipId = cleanId(`${chartId}-${seriesId}-line-clip`); // We assume that if displaying line mark, the line will also be rendered
|
|
90
|
+
|
|
91
|
+
return /*#__PURE__*/_jsx("g", {
|
|
92
|
+
clipPath: `url(#${clipId})`,
|
|
93
|
+
children: xData == null ? void 0 : xData.map((x, index) => {
|
|
94
|
+
const value = data[index] == null ? null : stackedData[index][1];
|
|
95
|
+
return {
|
|
96
|
+
x: xScale(x),
|
|
97
|
+
y: value === null ? null : yScale(value),
|
|
98
|
+
position: x,
|
|
99
|
+
value,
|
|
100
|
+
index
|
|
101
|
+
};
|
|
102
|
+
}).filter(({
|
|
113
103
|
x,
|
|
114
104
|
y,
|
|
115
105
|
index,
|
|
116
106
|
position,
|
|
117
107
|
value
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
108
|
+
}) => {
|
|
109
|
+
if (value === null || y === null) {
|
|
110
|
+
// Remove missing data point
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (!isInRange({
|
|
114
|
+
x,
|
|
115
|
+
y
|
|
116
|
+
})) {
|
|
117
|
+
// Remove out of range
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (showMark === true) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return showMark({
|
|
124
|
+
x,
|
|
125
|
+
y,
|
|
126
|
+
index,
|
|
127
|
+
position,
|
|
128
|
+
value
|
|
129
|
+
});
|
|
130
|
+
}).map(({
|
|
131
|
+
x,
|
|
132
|
+
y,
|
|
133
|
+
index
|
|
134
|
+
}) => {
|
|
135
|
+
return /*#__PURE__*/_jsx(Mark, _extends({
|
|
136
|
+
id: seriesId,
|
|
137
|
+
dataIndex: index,
|
|
138
|
+
shape: "circle",
|
|
139
|
+
color: series[seriesId].color,
|
|
140
|
+
x: x,
|
|
141
|
+
y: y // Don't know why TS doesn't get from the filter that y can't be null
|
|
142
|
+
,
|
|
143
|
+
highlightScope: series[seriesId].highlightScope,
|
|
144
|
+
skipAnimation: skipAnimation,
|
|
145
|
+
onClick: onItemClick && (event => onItemClick(event, {
|
|
146
|
+
type: 'line',
|
|
147
|
+
seriesId,
|
|
148
|
+
dataIndex: index
|
|
149
|
+
}))
|
|
150
|
+
}, slotProps == null ? void 0 : slotProps.mark), `${seriesId}-${index}`);
|
|
151
|
+
})
|
|
152
|
+
}, seriesId);
|
|
135
153
|
});
|
|
136
154
|
})
|
|
137
155
|
}));
|
|
@@ -141,6 +159,17 @@ process.env.NODE_ENV !== "production" ? MarkPlot.propTypes = {
|
|
|
141
159
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
142
160
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
143
161
|
// ----------------------------------------------------------------------
|
|
162
|
+
/**
|
|
163
|
+
* Callback fired when a line mark item is clicked.
|
|
164
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
165
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line mark item identifier.
|
|
166
|
+
*/
|
|
167
|
+
onItemClick: PropTypes.func,
|
|
168
|
+
/**
|
|
169
|
+
* If `true`, animations are skipped.
|
|
170
|
+
* @default false
|
|
171
|
+
*/
|
|
172
|
+
skipAnimation: PropTypes.bool,
|
|
144
173
|
/**
|
|
145
174
|
* The props used for each component slot.
|
|
146
175
|
* @default {}
|
|
@@ -73,7 +73,7 @@ const formatter = (params, dataset) => {
|
|
|
73
73
|
return {
|
|
74
74
|
seriesOrder,
|
|
75
75
|
stackingGroups,
|
|
76
|
-
series: defaultizeValueFormatter(completedSeries, v => v
|
|
76
|
+
series: defaultizeValueFormatter(completedSeries, v => v == null ? '' : v.toLocaleString())
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
export default formatter;
|
package/esm/LineChart/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from './AreaPlot';
|
|
|
4
4
|
export * from './MarkPlot';
|
|
5
5
|
export * from './LineHighlightPlot';
|
|
6
6
|
export * from './AreaElement';
|
|
7
|
+
export * from './AnimatedArea';
|
|
7
8
|
export * from './LineElement';
|
|
9
|
+
export * from './AnimatedLine';
|
|
8
10
|
export * from './MarkElement';
|
|
9
11
|
export * from './LineHighlightElement';
|
|
@@ -175,7 +175,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
175
175
|
*/
|
|
176
176
|
paddingAngle: PropTypes.number,
|
|
177
177
|
/**
|
|
178
|
-
* If `true`, animations are
|
|
178
|
+
* If `true`, animations are skipped.
|
|
179
179
|
* @default false
|
|
180
180
|
*/
|
|
181
181
|
skipAnimation: PropTypes.bool,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlightScope", "highlighted", "faded", "data", "
|
|
3
|
+
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlightScope", "highlighted", "faded", "data", "onItemClick", "skipAnimation"],
|
|
4
4
|
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "arcLabelRadius", "outerRadius", "cornerRadius"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -25,7 +25,7 @@ function PieArcPlot(props) {
|
|
|
25
25
|
additionalRadius: -5
|
|
26
26
|
},
|
|
27
27
|
data,
|
|
28
|
-
|
|
28
|
+
onItemClick,
|
|
29
29
|
skipAnimation
|
|
30
30
|
} = props,
|
|
31
31
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -72,8 +72,8 @@ function PieArcPlot(props) {
|
|
|
72
72
|
highlightScope: highlightScope,
|
|
73
73
|
isFaded: item.isFaded,
|
|
74
74
|
isHighlighted: item.isHighlighted,
|
|
75
|
-
onClick:
|
|
76
|
-
|
|
75
|
+
onClick: onItemClick && (event => {
|
|
76
|
+
onItemClick(event, {
|
|
77
77
|
type: 'pie',
|
|
78
78
|
seriesId: id,
|
|
79
79
|
dataIndex: index
|
|
@@ -150,7 +150,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
150
150
|
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
151
151
|
* @param {DefaultizedPieValueType} item The pie item.
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
onItemClick: PropTypes.func,
|
|
154
154
|
/**
|
|
155
155
|
* The radius between circle center and the end of the arc.
|
|
156
156
|
*/
|
|
@@ -161,7 +161,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
161
161
|
*/
|
|
162
162
|
paddingAngle: PropTypes.number,
|
|
163
163
|
/**
|
|
164
|
-
* If `true`, animations are
|
|
164
|
+
* If `true`, animations are skipped.
|
|
165
165
|
* @default false
|
|
166
166
|
*/
|
|
167
167
|
skipAnimation: PropTypes.bool,
|
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -59,7 +59,7 @@ function PieChart(props) {
|
|
|
59
59
|
children,
|
|
60
60
|
slots,
|
|
61
61
|
slotProps,
|
|
62
|
-
|
|
62
|
+
onItemClick
|
|
63
63
|
} = props;
|
|
64
64
|
const margin = _extends({}, defaultMargin, marginProps);
|
|
65
65
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
@@ -88,7 +88,7 @@ function PieChart(props) {
|
|
|
88
88
|
}), /*#__PURE__*/_jsx(PiePlot, {
|
|
89
89
|
slots: slots,
|
|
90
90
|
slotProps: slotProps,
|
|
91
|
-
|
|
91
|
+
onItemClick: onItemClick,
|
|
92
92
|
skipAnimation: skipAnimation
|
|
93
93
|
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
94
94
|
slots: slots,
|
|
@@ -208,7 +208,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
208
208
|
right: PropTypes.number,
|
|
209
209
|
top: PropTypes.number
|
|
210
210
|
}),
|
|
211
|
-
|
|
211
|
+
onItemClick: PropTypes.func,
|
|
212
212
|
/**
|
|
213
213
|
* Indicate which axis to display the right of the charts.
|
|
214
214
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -236,54 +236,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
236
236
|
tickNumber: PropTypes.number,
|
|
237
237
|
tickSize: PropTypes.number
|
|
238
238
|
}), PropTypes.string]),
|
|
239
|
-
series: PropTypes.arrayOf(PropTypes.
|
|
240
|
-
arcLabel: PropTypes.oneOfType([PropTypes.oneOf(['formattedValue', 'label', 'value']), PropTypes.func]),
|
|
241
|
-
arcLabelMinAngle: PropTypes.number,
|
|
242
|
-
arcLabelRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
243
|
-
color: PropTypes.string,
|
|
244
|
-
cornerRadius: PropTypes.number,
|
|
245
|
-
cx: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
246
|
-
cy: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
247
|
-
data: PropTypes.arrayOf(PropTypes.shape({
|
|
248
|
-
color: PropTypes.string,
|
|
249
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
250
|
-
label: PropTypes.string,
|
|
251
|
-
value: PropTypes.number.isRequired
|
|
252
|
-
})).isRequired,
|
|
253
|
-
endAngle: PropTypes.number,
|
|
254
|
-
faded: PropTypes.shape({
|
|
255
|
-
additionalRadius: PropTypes.number,
|
|
256
|
-
arcLabelRadius: PropTypes.number,
|
|
257
|
-
color: PropTypes.string,
|
|
258
|
-
cornerRadius: PropTypes.number,
|
|
259
|
-
innerRadius: PropTypes.number,
|
|
260
|
-
outerRadius: PropTypes.number,
|
|
261
|
-
paddingAngle: PropTypes.number
|
|
262
|
-
}),
|
|
263
|
-
highlighted: PropTypes.shape({
|
|
264
|
-
additionalRadius: PropTypes.number,
|
|
265
|
-
arcLabelRadius: PropTypes.number,
|
|
266
|
-
color: PropTypes.string,
|
|
267
|
-
cornerRadius: PropTypes.number,
|
|
268
|
-
innerRadius: PropTypes.number,
|
|
269
|
-
outerRadius: PropTypes.number,
|
|
270
|
-
paddingAngle: PropTypes.number
|
|
271
|
-
}),
|
|
272
|
-
highlightScope: PropTypes.shape({
|
|
273
|
-
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
274
|
-
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
275
|
-
}),
|
|
276
|
-
id: PropTypes.string,
|
|
277
|
-
innerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
278
|
-
outerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
279
|
-
paddingAngle: PropTypes.number,
|
|
280
|
-
sortingValues: PropTypes.oneOfType([PropTypes.oneOf(['asc', 'desc', 'none']), PropTypes.func]),
|
|
281
|
-
startAngle: PropTypes.number,
|
|
282
|
-
type: PropTypes.oneOf(['pie']),
|
|
283
|
-
valueFormatter: PropTypes.func
|
|
284
|
-
})).isRequired,
|
|
239
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
285
240
|
/**
|
|
286
|
-
* If `true`, animations are
|
|
241
|
+
* If `true`, animations are skipped.
|
|
287
242
|
* @default false
|
|
288
243
|
*/
|
|
289
244
|
skipAnimation: PropTypes.bool,
|
package/esm/PieChart/PiePlot.js
CHANGED
|
@@ -22,7 +22,7 @@ function PiePlot(props) {
|
|
|
22
22
|
skipAnimation,
|
|
23
23
|
slots,
|
|
24
24
|
slotProps,
|
|
25
|
-
|
|
25
|
+
onItemClick
|
|
26
26
|
} = props;
|
|
27
27
|
const seriesData = React.useContext(SeriesContext).pie;
|
|
28
28
|
const {
|
|
@@ -70,7 +70,7 @@ function PiePlot(props) {
|
|
|
70
70
|
highlightScope: highlightScope,
|
|
71
71
|
highlighted: highlighted,
|
|
72
72
|
faded: faded,
|
|
73
|
-
|
|
73
|
+
onItemClick: onItemClick,
|
|
74
74
|
slots: slots,
|
|
75
75
|
slotProps: slotProps
|
|
76
76
|
})
|
|
@@ -124,9 +124,9 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
|
124
124
|
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
125
125
|
* @param {DefaultizedPieValueType} item The pie item.
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
onItemClick: PropTypes.func,
|
|
128
128
|
/**
|
|
129
|
-
* If `true`, animations are
|
|
129
|
+
* If `true`, animations are skipped.
|
|
130
130
|
* @default false
|
|
131
131
|
*/
|
|
132
132
|
skipAnimation: PropTypes.bool,
|