@mui/x-charts 7.0.0-beta.1 → 7.0.0-beta.3
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 +21 -5
- package/BarChart/BarChart.js +37 -13
- package/BarChart/BarElement.d.ts +20 -13
- package/BarChart/BarElement.js +1 -0
- package/BarChart/BarPlot.d.ts +3 -5
- package/BarChart/BarPlot.js +9 -10
- package/CHANGELOG.md +223 -1
- package/ChartContainer/ChartContainer.js +6 -4
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsGrid/ChartsGrid.d.ts +30 -0
- package/ChartsGrid/ChartsGrid.js +128 -0
- package/ChartsGrid/chartsGridClasses.d.ts +13 -0
- package/ChartsGrid/chartsGridClasses.js +14 -0
- package/ChartsGrid/index.d.ts +2 -0
- package/ChartsGrid/index.js +27 -0
- package/ChartsGrid/package.json +6 -0
- package/ChartsLegend/ChartsLegend.d.ts +5 -54
- package/ChartsLegend/ChartsLegend.js +2 -307
- package/ChartsLegend/DefaultChartsLegend.d.ts +60 -0
- package/ChartsLegend/DefaultChartsLegend.js +294 -0
- package/ChartsLegend/index.d.ts +1 -0
- package/ChartsLegend/index.js +11 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/common.d.ts +2 -1
- package/ChartsSurface.js +6 -4
- package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsTooltip/utils.d.ts +1 -0
- package/ChartsTooltip/utils.js +7 -0
- package/ChartsXAxis/ChartsXAxis.js +15 -11
- package/ChartsYAxis/ChartsYAxis.js +3 -3
- package/Gauge/Gauge.d.ts +13 -0
- package/Gauge/Gauge.js +156 -0
- package/Gauge/GaugeContainer.d.ts +19 -0
- package/Gauge/GaugeContainer.js +216 -0
- package/Gauge/GaugeProvider.d.ts +117 -0
- package/Gauge/GaugeProvider.js +96 -0
- package/Gauge/GaugeReferenceArc.d.ts +2 -0
- package/Gauge/GaugeReferenceArc.js +44 -0
- package/Gauge/GaugeValueArc.d.ts +2 -0
- package/Gauge/GaugeValueArc.js +51 -0
- package/Gauge/GaugeValueText.d.ts +15 -0
- package/Gauge/GaugeValueText.js +77 -0
- package/Gauge/gaugeClasses.d.ts +14 -0
- package/Gauge/gaugeClasses.js +15 -0
- package/Gauge/index.d.ts +7 -0
- package/Gauge/index.js +87 -0
- package/Gauge/package.json +6 -0
- package/Gauge/utils.d.ts +19 -0
- package/Gauge/utils.js +75 -0
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +2 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/LineChart.d.ts +24 -5
- package/LineChart/LineChart.js +41 -13
- package/LineChart/LineElement.d.ts +2 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.d.ts +3 -2
- package/LineChart/LineHighlightElement.js +2 -1
- package/LineChart/MarkElement.d.ts +3 -2
- package/LineChart/MarkElement.js +1 -0
- package/PieChart/PieArc.d.ts +7 -6
- package/PieChart/PieArc.js +10 -9
- package/PieChart/PieArcLabel.d.ts +3 -2
- package/PieChart/PieArcLabel.js +1 -0
- package/PieChart/PieArcLabelPlot.js +14 -14
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.d.ts +22 -0
- package/PieChart/PieChart.js +32 -8
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +2 -0
- package/ResponsiveChartContainer/useChartContainerDimensions.js +76 -0
- package/ScatterChart/ScatterChart.d.ts +18 -0
- package/ScatterChart/ScatterChart.js +35 -8
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +5 -4
- package/context/CartesianContextProvider.js +8 -6
- package/esm/BarChart/BarChart.js +37 -13
- package/esm/BarChart/BarElement.js +1 -0
- package/esm/BarChart/BarPlot.js +8 -10
- package/esm/ChartContainer/ChartContainer.js +6 -4
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsGrid/ChartsGrid.js +121 -0
- package/esm/ChartsGrid/chartsGridClasses.js +6 -0
- package/esm/ChartsGrid/index.js +2 -0
- package/esm/ChartsLegend/ChartsLegend.js +2 -307
- package/esm/ChartsLegend/DefaultChartsLegend.js +286 -0
- package/esm/ChartsLegend/index.js +1 -0
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/esm/ChartsSurface.js +6 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsTooltip/utils.js +6 -0
- package/esm/ChartsXAxis/ChartsXAxis.js +14 -10
- package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
- package/esm/Gauge/Gauge.js +149 -0
- package/esm/Gauge/GaugeContainer.js +211 -0
- package/esm/Gauge/GaugeProvider.js +85 -0
- package/esm/Gauge/GaugeReferenceArc.js +35 -0
- package/esm/Gauge/GaugeValueArc.js +42 -0
- package/esm/Gauge/GaugeValueText.js +69 -0
- package/esm/Gauge/gaugeClasses.js +7 -0
- package/esm/Gauge/index.js +7 -0
- package/esm/Gauge/utils.js +68 -0
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaElement.js +1 -1
- package/esm/LineChart/LineChart.js +41 -13
- package/esm/LineChart/LineElement.js +1 -1
- package/esm/LineChart/LineHighlightElement.js +2 -1
- package/esm/LineChart/MarkElement.js +1 -0
- package/esm/PieChart/PieArc.js +10 -9
- package/esm/PieChart/PieArcLabel.js +1 -0
- package/esm/PieChart/PieArcLabelPlot.js +14 -14
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +32 -8
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
- package/esm/ScatterChart/ScatterChart.js +35 -8
- package/esm/SparkLineChart/SparkLineChart.js +5 -4
- package/esm/context/CartesianContextProvider.js +8 -6
- package/esm/hooks/useTicks.js +2 -3
- package/esm/index.js +2 -0
- package/hooks/useTicks.d.ts +1 -2
- package/hooks/useTicks.js +2 -3
- package/index.d.ts +2 -0
- package/index.js +23 -1
- package/internals/defaultizeColor.d.ts +16 -16
- package/internals/defaultizeValueFormatter.d.ts +4 -7
- package/internals/stackSeries.d.ts +4 -7
- package/legacy/BarChart/BarChart.js +37 -13
- package/legacy/BarChart/BarElement.js +1 -0
- package/legacy/BarChart/BarPlot.js +10 -10
- package/legacy/ChartContainer/ChartContainer.js +6 -4
- package/legacy/ChartsAxis/ChartsAxis.js +4 -4
- package/legacy/ChartsGrid/ChartsGrid.js +119 -0
- package/legacy/ChartsGrid/chartsGridClasses.js +6 -0
- package/legacy/ChartsGrid/index.js +2 -0
- package/legacy/ChartsLegend/ChartsLegend.js +2 -323
- package/legacy/ChartsLegend/DefaultChartsLegend.js +302 -0
- package/legacy/ChartsLegend/index.js +1 -0
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/legacy/ChartsSurface.js +5 -3
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/legacy/ChartsTooltip/utils.js +6 -0
- package/legacy/ChartsXAxis/ChartsXAxis.js +13 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +2 -2
- package/legacy/Gauge/Gauge.js +146 -0
- package/legacy/Gauge/GaugeContainer.js +215 -0
- package/legacy/Gauge/GaugeProvider.js +87 -0
- package/legacy/Gauge/GaugeReferenceArc.js +37 -0
- package/legacy/Gauge/GaugeValueArc.js +44 -0
- package/legacy/Gauge/GaugeValueText.js +66 -0
- package/legacy/Gauge/gaugeClasses.js +7 -0
- package/legacy/Gauge/index.js +7 -0
- package/legacy/Gauge/utils.js +84 -0
- package/legacy/LineChart/AnimatedArea.js +1 -1
- package/legacy/LineChart/AnimatedLine.js +1 -1
- package/legacy/LineChart/AreaElement.js +1 -1
- package/legacy/LineChart/LineChart.js +41 -13
- package/legacy/LineChart/LineElement.js +1 -1
- package/legacy/LineChart/LineHighlightElement.js +2 -1
- package/legacy/LineChart/MarkElement.js +1 -0
- package/legacy/PieChart/PieArc.js +11 -10
- package/legacy/PieChart/PieArcLabel.js +1 -0
- package/legacy/PieChart/PieArcLabelPlot.js +15 -15
- package/legacy/PieChart/PieArcPlot.js +1 -1
- package/legacy/PieChart/PieChart.js +32 -8
- package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +13 -81
- package/legacy/ResponsiveChartContainer/useChartContainerDimensions.js +73 -0
- package/legacy/ScatterChart/ScatterChart.js +35 -8
- package/legacy/SparkLineChart/SparkLineChart.js +6 -5
- package/legacy/context/CartesianContextProvider.js +8 -6
- package/legacy/hooks/useTicks.js +2 -3
- package/legacy/index.js +3 -1
- package/models/axis.d.ts +7 -2
- package/models/seriesType/common.d.ts +2 -1
- package/models/seriesType/config.d.ts +7 -12
- package/models/seriesType/line.d.ts +2 -2
- package/models/seriesType/pie.d.ts +7 -3
- package/models/seriesType/scatter.d.ts +5 -2
- package/modern/BarChart/BarChart.js +37 -13
- package/modern/BarChart/BarElement.js +1 -0
- package/modern/BarChart/BarPlot.js +8 -10
- package/modern/ChartContainer/ChartContainer.js +6 -4
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsGrid/ChartsGrid.js +121 -0
- package/modern/ChartsGrid/chartsGridClasses.js +6 -0
- package/modern/ChartsGrid/index.js +2 -0
- package/modern/ChartsLegend/ChartsLegend.js +2 -307
- package/modern/ChartsLegend/DefaultChartsLegend.js +286 -0
- package/modern/ChartsLegend/index.js +1 -0
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/modern/ChartsSurface.js +6 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsTooltip/utils.js +6 -0
- package/modern/ChartsXAxis/ChartsXAxis.js +14 -10
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
- package/modern/Gauge/Gauge.js +149 -0
- package/modern/Gauge/GaugeContainer.js +208 -0
- package/modern/Gauge/GaugeProvider.js +85 -0
- package/modern/Gauge/GaugeReferenceArc.js +35 -0
- package/modern/Gauge/GaugeValueArc.js +42 -0
- package/modern/Gauge/GaugeValueText.js +69 -0
- package/modern/Gauge/gaugeClasses.js +7 -0
- package/modern/Gauge/index.js +7 -0
- package/modern/Gauge/utils.js +68 -0
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaElement.js +1 -1
- package/modern/LineChart/LineChart.js +41 -13
- package/modern/LineChart/LineElement.js +1 -1
- package/modern/LineChart/LineHighlightElement.js +2 -1
- package/modern/LineChart/MarkElement.js +1 -0
- package/modern/PieChart/PieArc.js +10 -9
- package/modern/PieChart/PieArcLabel.js +1 -0
- package/modern/PieChart/PieArcLabelPlot.js +14 -14
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +32 -8
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
- package/modern/ScatterChart/ScatterChart.js +35 -8
- package/modern/SparkLineChart/SparkLineChart.js +5 -4
- package/modern/context/CartesianContextProvider.js +8 -6
- package/modern/hooks/useTicks.js +2 -3
- package/modern/index.js +3 -1
- package/package.json +4 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["text", "className"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useGaugeState } from './GaugeProvider';
|
|
7
|
+
import { ChartsText } from '../ChartsText';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
function defaultFormatter({
|
|
10
|
+
value
|
|
11
|
+
}) {
|
|
12
|
+
return value === null ? 'NaN' : value.toLocaleString();
|
|
13
|
+
}
|
|
14
|
+
function GaugeValueText(props) {
|
|
15
|
+
const {
|
|
16
|
+
text = defaultFormatter,
|
|
17
|
+
className
|
|
18
|
+
} = props,
|
|
19
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
|
+
const {
|
|
21
|
+
value,
|
|
22
|
+
valueMin,
|
|
23
|
+
valueMax,
|
|
24
|
+
cx,
|
|
25
|
+
cy
|
|
26
|
+
} = useGaugeState();
|
|
27
|
+
const formattedText = typeof text === 'function' ? text({
|
|
28
|
+
value,
|
|
29
|
+
valueMin,
|
|
30
|
+
valueMax
|
|
31
|
+
}) : text;
|
|
32
|
+
if (formattedText === null) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/_jsx("g", {
|
|
36
|
+
className: className,
|
|
37
|
+
children: /*#__PURE__*/_jsx(ChartsText, _extends({
|
|
38
|
+
x: cx,
|
|
39
|
+
y: cy,
|
|
40
|
+
text: formattedText,
|
|
41
|
+
style: {
|
|
42
|
+
textAnchor: 'middle',
|
|
43
|
+
dominantBaseline: 'central'
|
|
44
|
+
}
|
|
45
|
+
}, other))
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
process.env.NODE_ENV !== "production" ? GaugeValueText.propTypes = {
|
|
49
|
+
// ----------------------------- Warning --------------------------------
|
|
50
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
51
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
52
|
+
// ----------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* Height of a text line (in `em`).
|
|
55
|
+
*/
|
|
56
|
+
lineHeight: PropTypes.number,
|
|
57
|
+
/**
|
|
58
|
+
* If `true`, the line width is computed.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
needsComputation: PropTypes.bool,
|
|
62
|
+
ownerState: PropTypes.any,
|
|
63
|
+
/**
|
|
64
|
+
* Style applied to text elements.
|
|
65
|
+
*/
|
|
66
|
+
style: PropTypes.object,
|
|
67
|
+
text: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
68
|
+
} : void 0;
|
|
69
|
+
export { GaugeValueText };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
export function getGaugeUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiGauge', slot);
|
|
5
|
+
}
|
|
6
|
+
export const gaugeClasses = generateUtilityClasses('MuiGauge', ['root', 'valueArc', 'referenceArc', 'valueText']);
|
|
7
|
+
export default gaugeClasses;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function deg2rad(angle) {
|
|
2
|
+
return Math.PI * angle / 180;
|
|
3
|
+
}
|
|
4
|
+
function getPoint(angle) {
|
|
5
|
+
const radAngle = deg2rad(angle);
|
|
6
|
+
return [Math.sin(radAngle), -Math.cos(radAngle)];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Retruns the ratio of the arc bounding box and its center.
|
|
11
|
+
* @param startAngle The start angle (in deg)
|
|
12
|
+
* @param endAngle The end angle (in deg)
|
|
13
|
+
*/
|
|
14
|
+
export function getArcRatios(startAngle, endAngle) {
|
|
15
|
+
// Set the start, end and center point.
|
|
16
|
+
const points = [[0, 0], getPoint(startAngle), getPoint(endAngle)];
|
|
17
|
+
|
|
18
|
+
// Add cardinal points included in the arc
|
|
19
|
+
const minAngle = Math.min(startAngle, endAngle);
|
|
20
|
+
const maxAngle = Math.max(startAngle, endAngle);
|
|
21
|
+
const initialAngle = Math.floor(minAngle / 90) * 90;
|
|
22
|
+
for (let step = 1; step <= 4; step += 1) {
|
|
23
|
+
const cartinalAngle = initialAngle + step * 90;
|
|
24
|
+
if (cartinalAngle < maxAngle) {
|
|
25
|
+
points.push(getPoint(cartinalAngle));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const minX = Math.min(...points.map(([x]) => x));
|
|
29
|
+
const maxX = Math.max(...points.map(([x]) => x));
|
|
30
|
+
const minY = Math.min(...points.map(([, y]) => y));
|
|
31
|
+
const maxY = Math.max(...points.map(([, y]) => y));
|
|
32
|
+
return {
|
|
33
|
+
cx: -minX / (maxX - minX),
|
|
34
|
+
cy: -minY / (maxY - minY),
|
|
35
|
+
minX,
|
|
36
|
+
maxX,
|
|
37
|
+
minY,
|
|
38
|
+
maxY
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function getAvailableRadius(cx, cy, width, height, {
|
|
42
|
+
minX,
|
|
43
|
+
maxX,
|
|
44
|
+
minY,
|
|
45
|
+
maxY
|
|
46
|
+
}) {
|
|
47
|
+
return Math.min(...[{
|
|
48
|
+
ratio: Math.abs(minX),
|
|
49
|
+
space: cx
|
|
50
|
+
}, {
|
|
51
|
+
ratio: Math.abs(maxX),
|
|
52
|
+
space: width - cx
|
|
53
|
+
}, {
|
|
54
|
+
ratio: Math.abs(minY),
|
|
55
|
+
space: cy
|
|
56
|
+
}, {
|
|
57
|
+
ratio: Math.abs(maxY),
|
|
58
|
+
space: height - cy
|
|
59
|
+
}].map(({
|
|
60
|
+
ratio,
|
|
61
|
+
space
|
|
62
|
+
}) => {
|
|
63
|
+
if (ratio < 0.00001) {
|
|
64
|
+
return Infinity;
|
|
65
|
+
}
|
|
66
|
+
return space / ratio;
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
@@ -90,7 +90,7 @@ process.env.NODE_ENV !== "production" ? AnimatedArea.propTypes = {
|
|
|
90
90
|
ownerState: PropTypes.shape({
|
|
91
91
|
classes: PropTypes.object,
|
|
92
92
|
color: PropTypes.string.isRequired,
|
|
93
|
-
id: PropTypes.string.isRequired,
|
|
93
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
94
94
|
isFaded: PropTypes.bool.isRequired,
|
|
95
95
|
isHighlighted: PropTypes.bool.isRequired
|
|
96
96
|
}).isRequired,
|
|
@@ -92,7 +92,7 @@ process.env.NODE_ENV !== "production" ? AnimatedLine.propTypes = {
|
|
|
92
92
|
ownerState: PropTypes.shape({
|
|
93
93
|
classes: PropTypes.object,
|
|
94
94
|
color: PropTypes.string.isRequired,
|
|
95
|
-
id: PropTypes.string.isRequired,
|
|
95
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
96
96
|
isFaded: PropTypes.bool.isRequired,
|
|
97
97
|
isHighlighted: PropTypes.bool.isRequired
|
|
98
98
|
}).isRequired,
|
|
@@ -96,7 +96,7 @@ process.env.NODE_ENV !== "production" ? AreaElement.propTypes = {
|
|
|
96
96
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
97
97
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
98
98
|
}),
|
|
99
|
-
id: PropTypes.string.isRequired,
|
|
99
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
100
100
|
/**
|
|
101
101
|
* If `true`, animations are skipped.
|
|
102
102
|
* @default false
|
|
@@ -13,6 +13,7 @@ import { ChartsLegend } from '../ChartsLegend';
|
|
|
13
13
|
import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
|
|
14
14
|
import { ChartsClipPath } from '../ChartsClipPath';
|
|
15
15
|
import { LineHighlightPlot } from './LineHighlightPlot';
|
|
16
|
+
import { ChartsGrid } from '../ChartsGrid';
|
|
16
17
|
import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
|
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -47,6 +48,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
47
48
|
},
|
|
48
49
|
disableLineItemHighlight,
|
|
49
50
|
legend,
|
|
51
|
+
grid,
|
|
50
52
|
topAxis,
|
|
51
53
|
leftAxis,
|
|
52
54
|
rightAxis,
|
|
@@ -81,6 +83,9 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
81
83
|
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
82
84
|
children: [onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, {
|
|
83
85
|
onAxisClick: onAxisClick
|
|
86
|
+
}), grid && /*#__PURE__*/_jsx(ChartsGrid, {
|
|
87
|
+
vertical: grid.vertical,
|
|
88
|
+
horizontal: grid.horizontal
|
|
84
89
|
}), /*#__PURE__*/_jsxs("g", {
|
|
85
90
|
clipPath: `url(#${clipPathId})`,
|
|
86
91
|
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
@@ -126,11 +131,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
126
131
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
127
132
|
// ----------------------------------------------------------------------
|
|
128
133
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* - 'none': display nothing.
|
|
132
|
-
* - 'line': display a line at the current mouse position.
|
|
133
|
-
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
134
|
+
* The configuration of axes highlight.
|
|
135
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
|
|
134
136
|
* @default { x: 'line' }
|
|
135
137
|
*/
|
|
136
138
|
axisHighlight: PropTypes.shape({
|
|
@@ -143,7 +145,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
143
145
|
* @default xAxisIds[0] The id of the first provided axis
|
|
144
146
|
*/
|
|
145
147
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
146
|
-
axisId: PropTypes.string,
|
|
148
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
147
149
|
classes: PropTypes.object,
|
|
148
150
|
disableLine: PropTypes.bool,
|
|
149
151
|
disableTicks: PropTypes.bool,
|
|
@@ -186,6 +188,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
186
188
|
* If `true`, render the line highlight item.
|
|
187
189
|
*/
|
|
188
190
|
disableLineItemHighlight: PropTypes.bool,
|
|
191
|
+
/**
|
|
192
|
+
* Option to display a cartesian grid in the background.
|
|
193
|
+
*/
|
|
194
|
+
grid: PropTypes.shape({
|
|
195
|
+
horizontal: PropTypes.bool,
|
|
196
|
+
vertical: PropTypes.bool
|
|
197
|
+
}),
|
|
189
198
|
/**
|
|
190
199
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
191
200
|
* @default undefined
|
|
@@ -197,7 +206,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
197
206
|
* @default yAxisIds[0] The id of the first provided axis
|
|
198
207
|
*/
|
|
199
208
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
200
|
-
axisId: PropTypes.string,
|
|
209
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
201
210
|
classes: PropTypes.object,
|
|
202
211
|
disableLine: PropTypes.bool,
|
|
203
212
|
disableTicks: PropTypes.bool,
|
|
@@ -244,6 +253,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
244
253
|
right: PropTypes.number,
|
|
245
254
|
top: PropTypes.number
|
|
246
255
|
}),
|
|
256
|
+
/**
|
|
257
|
+
* Callback fired when an area element is clicked.
|
|
258
|
+
*/
|
|
247
259
|
onAreaClick: PropTypes.func,
|
|
248
260
|
/**
|
|
249
261
|
* The function called for onClick events.
|
|
@@ -252,7 +264,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
252
264
|
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
253
265
|
*/
|
|
254
266
|
onAxisClick: PropTypes.func,
|
|
267
|
+
/**
|
|
268
|
+
* Callback fired when a line element is clicked.
|
|
269
|
+
*/
|
|
255
270
|
onLineClick: PropTypes.func,
|
|
271
|
+
/**
|
|
272
|
+
* Callback fired when a mark element is clicked.
|
|
273
|
+
*/
|
|
256
274
|
onMarkClick: PropTypes.func,
|
|
257
275
|
/**
|
|
258
276
|
* Indicate which axis to display the right of the charts.
|
|
@@ -260,7 +278,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
260
278
|
* @default null
|
|
261
279
|
*/
|
|
262
280
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
263
|
-
axisId: PropTypes.string,
|
|
281
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
264
282
|
classes: PropTypes.object,
|
|
265
283
|
disableLine: PropTypes.bool,
|
|
266
284
|
disableTicks: PropTypes.bool,
|
|
@@ -281,6 +299,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
281
299
|
tickNumber: PropTypes.number,
|
|
282
300
|
tickSize: PropTypes.number
|
|
283
301
|
}), PropTypes.string]),
|
|
302
|
+
/**
|
|
303
|
+
* The series to display in the line chart.
|
|
304
|
+
*/
|
|
284
305
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
285
306
|
/**
|
|
286
307
|
* If `true`, animations are skipped.
|
|
@@ -299,6 +320,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
299
320
|
slots: PropTypes.object,
|
|
300
321
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
301
322
|
title: PropTypes.string,
|
|
323
|
+
/**
|
|
324
|
+
* The configuration of the tooltip.
|
|
325
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
326
|
+
* @default { trigger: 'item' }
|
|
327
|
+
*/
|
|
302
328
|
tooltip: PropTypes.shape({
|
|
303
329
|
axisContent: PropTypes.elementType,
|
|
304
330
|
classes: PropTypes.object,
|
|
@@ -313,7 +339,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
313
339
|
* @default null
|
|
314
340
|
*/
|
|
315
341
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
316
|
-
axisId: PropTypes.string,
|
|
342
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
317
343
|
classes: PropTypes.object,
|
|
318
344
|
disableLine: PropTypes.bool,
|
|
319
345
|
disableTicks: PropTypes.bool,
|
|
@@ -350,7 +376,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
350
376
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
351
377
|
*/
|
|
352
378
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
353
|
-
axisId: PropTypes.string,
|
|
379
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
354
380
|
classes: PropTypes.object,
|
|
355
381
|
data: PropTypes.array,
|
|
356
382
|
dataKey: PropTypes.string,
|
|
@@ -358,13 +384,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
358
384
|
disableTicks: PropTypes.bool,
|
|
359
385
|
fill: PropTypes.string,
|
|
360
386
|
hideTooltip: PropTypes.bool,
|
|
361
|
-
id: PropTypes.string,
|
|
387
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
362
388
|
label: PropTypes.string,
|
|
363
389
|
labelFontSize: PropTypes.number,
|
|
364
390
|
labelStyle: PropTypes.object,
|
|
365
391
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
366
392
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
367
393
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
394
|
+
reverse: PropTypes.bool,
|
|
368
395
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
369
396
|
slotProps: PropTypes.object,
|
|
370
397
|
slots: PropTypes.object,
|
|
@@ -384,7 +411,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
384
411
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
385
412
|
*/
|
|
386
413
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
387
|
-
axisId: PropTypes.string,
|
|
414
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
388
415
|
classes: PropTypes.object,
|
|
389
416
|
data: PropTypes.array,
|
|
390
417
|
dataKey: PropTypes.string,
|
|
@@ -392,13 +419,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
392
419
|
disableTicks: PropTypes.bool,
|
|
393
420
|
fill: PropTypes.string,
|
|
394
421
|
hideTooltip: PropTypes.bool,
|
|
395
|
-
id: PropTypes.string,
|
|
422
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
396
423
|
label: PropTypes.string,
|
|
397
424
|
labelFontSize: PropTypes.number,
|
|
398
425
|
labelStyle: PropTypes.object,
|
|
399
426
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
400
427
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
401
428
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
429
|
+
reverse: PropTypes.bool,
|
|
402
430
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
403
431
|
slotProps: PropTypes.object,
|
|
404
432
|
slots: PropTypes.object,
|
|
@@ -96,7 +96,7 @@ process.env.NODE_ENV !== "production" ? LineElement.propTypes = {
|
|
|
96
96
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
97
97
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
98
98
|
}),
|
|
99
|
-
id: PropTypes.string.isRequired,
|
|
99
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
100
100
|
/**
|
|
101
101
|
* If `true`, animations are skipped.
|
|
102
102
|
* @default false
|
|
@@ -74,6 +74,7 @@ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
|
|
|
74
74
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
75
75
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
76
76
|
// ----------------------------------------------------------------------
|
|
77
|
-
classes: PropTypes.object
|
|
77
|
+
classes: PropTypes.object,
|
|
78
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
78
79
|
} : void 0;
|
|
79
80
|
export { LineHighlightElement };
|
|
@@ -136,6 +136,7 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
136
136
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
137
137
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
138
138
|
}),
|
|
139
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
139
140
|
/**
|
|
140
141
|
* The shape of the marker.
|
|
141
142
|
*/
|
|
@@ -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 = ["
|
|
3
|
+
const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "highlightScope", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { arc as d3Arc } from 'd3-shape';
|
|
@@ -40,20 +40,20 @@ const PieArcRoot = styled(animated.path, {
|
|
|
40
40
|
}));
|
|
41
41
|
function PieArc(props) {
|
|
42
42
|
const {
|
|
43
|
-
id,
|
|
44
|
-
dataIndex,
|
|
45
43
|
classes: innerClasses,
|
|
46
44
|
color,
|
|
45
|
+
cornerRadius,
|
|
46
|
+
dataIndex,
|
|
47
|
+
endAngle,
|
|
47
48
|
highlightScope,
|
|
48
|
-
|
|
49
|
+
id,
|
|
50
|
+
innerRadius,
|
|
49
51
|
isFaded,
|
|
50
52
|
isHighlighted,
|
|
51
|
-
|
|
52
|
-
endAngle,
|
|
53
|
-
paddingAngle,
|
|
54
|
-
innerRadius,
|
|
53
|
+
onClick,
|
|
55
54
|
outerRadius,
|
|
56
|
-
|
|
55
|
+
paddingAngle,
|
|
56
|
+
startAngle
|
|
57
57
|
} = props,
|
|
58
58
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
59
59
|
const ownerState = {
|
|
@@ -95,6 +95,7 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
|
95
95
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
96
96
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
97
97
|
}),
|
|
98
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
98
99
|
isFaded: PropTypes.bool.isRequired,
|
|
99
100
|
isHighlighted: PropTypes.bool.isRequired
|
|
100
101
|
} : void 0;
|
|
@@ -98,6 +98,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
|
98
98
|
// ----------------------------------------------------------------------
|
|
99
99
|
classes: PropTypes.object,
|
|
100
100
|
formattedArcLabel: PropTypes.string,
|
|
101
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
101
102
|
isFaded: PropTypes.bool.isRequired,
|
|
102
103
|
isHighlighted: PropTypes.bool.isRequired
|
|
103
104
|
} : void 0;
|
|
@@ -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 = ["
|
|
3
|
+
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "highlightScope", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"],
|
|
4
4
|
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "arcLabelRadius", "cornerRadius"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -25,23 +25,23 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
|
25
25
|
}
|
|
26
26
|
function PieArcLabelPlot(props) {
|
|
27
27
|
const {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
innerRadius,
|
|
31
|
-
outerRadius,
|
|
28
|
+
arcLabel,
|
|
29
|
+
arcLabelMinAngle = 0,
|
|
32
30
|
arcLabelRadius,
|
|
33
31
|
cornerRadius = 0,
|
|
34
|
-
|
|
35
|
-
id,
|
|
36
|
-
highlightScope,
|
|
37
|
-
highlighted,
|
|
32
|
+
data,
|
|
38
33
|
faded = {
|
|
39
34
|
additionalRadius: -5
|
|
40
35
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
highlighted,
|
|
37
|
+
highlightScope,
|
|
38
|
+
id,
|
|
39
|
+
innerRadius,
|
|
40
|
+
outerRadius,
|
|
41
|
+
paddingAngle = 0,
|
|
42
|
+
skipAnimation,
|
|
43
|
+
slotProps,
|
|
44
|
+
slots
|
|
45
45
|
} = props,
|
|
46
46
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
47
|
const transformedData = useTransformData({
|
|
@@ -157,7 +157,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
157
157
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
158
158
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
159
159
|
}),
|
|
160
|
-
id: PropTypes.string.isRequired,
|
|
160
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
161
161
|
/**
|
|
162
162
|
* The radius between circle center and the begining of the arc.
|
|
163
163
|
* @default 0
|
|
@@ -137,7 +137,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
137
137
|
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
138
138
|
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
139
139
|
}),
|
|
140
|
-
id: PropTypes.string.isRequired,
|
|
140
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
141
141
|
/**
|
|
142
142
|
* The radius between circle center and the begining of the arc.
|
|
143
143
|
* @default 0
|
|
@@ -101,6 +101,11 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
101
101
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
102
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
103
103
|
// ----------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* The configuration of axes highlight.
|
|
106
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
|
|
107
|
+
* @default { x: 'none', y: 'none' }
|
|
108
|
+
*/
|
|
104
109
|
axisHighlight: PropTypes.shape({
|
|
105
110
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
106
111
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
@@ -111,7 +116,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
111
116
|
* @default null
|
|
112
117
|
*/
|
|
113
118
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
114
|
-
axisId: PropTypes.string,
|
|
119
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
115
120
|
classes: PropTypes.object,
|
|
116
121
|
disableLine: PropTypes.bool,
|
|
117
122
|
disableTicks: PropTypes.bool,
|
|
@@ -161,7 +166,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
161
166
|
* @default null
|
|
162
167
|
*/
|
|
163
168
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
164
|
-
axisId: PropTypes.string,
|
|
169
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
165
170
|
classes: PropTypes.object,
|
|
166
171
|
disableLine: PropTypes.bool,
|
|
167
172
|
disableTicks: PropTypes.bool,
|
|
@@ -183,6 +188,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
183
188
|
tickSize: PropTypes.number
|
|
184
189
|
}), PropTypes.string]),
|
|
185
190
|
/**
|
|
191
|
+
* The props of the legend.
|
|
192
|
+
* @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
|
|
186
193
|
* @deprecated Consider using `slotProps.legend` instead.
|
|
187
194
|
*/
|
|
188
195
|
legend: PropTypes.shape({
|
|
@@ -208,6 +215,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
208
215
|
right: PropTypes.number,
|
|
209
216
|
top: PropTypes.number
|
|
210
217
|
}),
|
|
218
|
+
/**
|
|
219
|
+
* Callback fired when a pie arc is clicked.
|
|
220
|
+
*/
|
|
211
221
|
onItemClick: PropTypes.func,
|
|
212
222
|
/**
|
|
213
223
|
* Indicate which axis to display the right of the charts.
|
|
@@ -215,7 +225,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
215
225
|
* @default null
|
|
216
226
|
*/
|
|
217
227
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
218
|
-
axisId: PropTypes.string,
|
|
228
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
219
229
|
classes: PropTypes.object,
|
|
220
230
|
disableLine: PropTypes.bool,
|
|
221
231
|
disableTicks: PropTypes.bool,
|
|
@@ -236,6 +246,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
236
246
|
tickNumber: PropTypes.number,
|
|
237
247
|
tickSize: PropTypes.number
|
|
238
248
|
}), PropTypes.string]),
|
|
249
|
+
/**
|
|
250
|
+
* The series to display in the pie chart.
|
|
251
|
+
*/
|
|
239
252
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
240
253
|
/**
|
|
241
254
|
* If `true`, animations are skipped.
|
|
@@ -247,9 +260,18 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
247
260
|
* @default {}
|
|
248
261
|
*/
|
|
249
262
|
slotProps: PropTypes.object,
|
|
263
|
+
/**
|
|
264
|
+
* Overridable component slots.
|
|
265
|
+
* @default {}
|
|
266
|
+
*/
|
|
250
267
|
slots: PropTypes.object,
|
|
251
268
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
252
269
|
title: PropTypes.string,
|
|
270
|
+
/**
|
|
271
|
+
* The configuration of the tooltip.
|
|
272
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
273
|
+
* @default { trigger: 'item' }
|
|
274
|
+
*/
|
|
253
275
|
tooltip: PropTypes.shape({
|
|
254
276
|
axisContent: PropTypes.elementType,
|
|
255
277
|
classes: PropTypes.object,
|
|
@@ -264,7 +286,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
264
286
|
* @default null
|
|
265
287
|
*/
|
|
266
288
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
267
|
-
axisId: PropTypes.string,
|
|
289
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
268
290
|
classes: PropTypes.object,
|
|
269
291
|
disableLine: PropTypes.bool,
|
|
270
292
|
disableTicks: PropTypes.bool,
|
|
@@ -301,7 +323,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
301
323
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
302
324
|
*/
|
|
303
325
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
304
|
-
axisId: PropTypes.string,
|
|
326
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
305
327
|
classes: PropTypes.object,
|
|
306
328
|
data: PropTypes.array,
|
|
307
329
|
dataKey: PropTypes.string,
|
|
@@ -309,13 +331,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
309
331
|
disableTicks: PropTypes.bool,
|
|
310
332
|
fill: PropTypes.string,
|
|
311
333
|
hideTooltip: PropTypes.bool,
|
|
312
|
-
id: PropTypes.string,
|
|
334
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
313
335
|
label: PropTypes.string,
|
|
314
336
|
labelFontSize: PropTypes.number,
|
|
315
337
|
labelStyle: PropTypes.object,
|
|
316
338
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
317
339
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
318
340
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
341
|
+
reverse: PropTypes.bool,
|
|
319
342
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
320
343
|
slotProps: PropTypes.object,
|
|
321
344
|
slots: PropTypes.object,
|
|
@@ -335,7 +358,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
335
358
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
336
359
|
*/
|
|
337
360
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
338
|
-
axisId: PropTypes.string,
|
|
361
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
339
362
|
classes: PropTypes.object,
|
|
340
363
|
data: PropTypes.array,
|
|
341
364
|
dataKey: PropTypes.string,
|
|
@@ -343,13 +366,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
343
366
|
disableTicks: PropTypes.bool,
|
|
344
367
|
fill: PropTypes.string,
|
|
345
368
|
hideTooltip: PropTypes.bool,
|
|
346
|
-
id: PropTypes.string,
|
|
369
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
347
370
|
label: PropTypes.string,
|
|
348
371
|
labelFontSize: PropTypes.number,
|
|
349
372
|
labelStyle: PropTypes.object,
|
|
350
373
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
351
374
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
352
375
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
376
|
+
reverse: PropTypes.bool,
|
|
353
377
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
354
378
|
slotProps: PropTypes.object,
|
|
355
379
|
slots: PropTypes.object,
|