@mui/x-charts 7.3.0 → 7.3.2
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 +5 -3
- package/BarChart/BarChart.js +23 -102
- package/BarChart/BarElement.d.ts +63 -62
- package/BarChart/BarElement.js +1 -2
- package/BarChart/BarPlot.js +9 -9
- package/CHANGELOG.md +155 -7
- package/ChartContainer/ChartContainer.js +3 -1
- package/ChartsAxis/ChartsAxis.js +7 -99
- package/ChartsAxis/axisClasses.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
- package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
- package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
- package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
- package/ChartsOverlay/ChartsOverlay.js +41 -0
- package/ChartsOverlay/index.d.ts +3 -0
- package/ChartsOverlay/index.js +26 -0
- package/ChartsOverlay/package.json +6 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsSurface.js +1 -1
- package/ChartsText/ChartsText.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +18 -5
- package/ChartsTooltip/ChartsItemTooltipContent.js +20 -4
- package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
- package/ChartsTooltip/ChartsTooltip.js +3 -3
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -7
- package/ChartsTooltip/ChartsTooltipTable.js +8 -9
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -6
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -4
- package/ChartsTooltip/utils.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +8 -1
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxis.js +8 -1
- package/Gauge/Gauge.js +2 -2
- package/Gauge/GaugeContainer.js +2 -2
- package/Gauge/GaugeProvider.d.ts +2 -2
- package/Gauge/GaugeProvider.js +2 -2
- package/Gauge/GaugeReferenceArc.js +1 -1
- package/Gauge/GaugeValueArc.js +1 -1
- package/Gauge/GaugeValueText.js +1 -1
- package/Gauge/gaugeClasses.d.ts +2 -2
- package/Gauge/utils.d.ts +1 -1
- package/Gauge/utils.js +4 -4
- package/LineChart/AnimatedArea.d.ts +63 -62
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.d.ts +63 -62
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaPlot.js +1 -1
- package/LineChart/LineChart.d.ts +5 -3
- package/LineChart/LineChart.js +20 -99
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.js +1 -1
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/LinePlot.js +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkPlot.js +1 -1
- package/PieChart/PieArc.d.ts +2 -1
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArcLabel.d.ts +2 -1
- package/PieChart/PieArcLabel.js +2 -2
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +4 -4
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.js +4 -4
- package/PieChart/PieChart.d.ts +5 -3
- package/PieChart/PieChart.js +23 -99
- package/PieChart/PiePlot.js +1 -1
- package/PieChart/dataTransform/transition.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +1 -1
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.js +1 -1
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/ScatterChart.d.ts +6 -3
- package/ScatterChart/ScatterChart.js +74 -125
- package/ScatterChart/ScatterPlot.js +9 -2
- package/ScatterChart/getColor.d.ts +2 -1
- package/ScatterChart/getColor.js +18 -1
- package/SparkLineChart/SparkLineChart.js +1 -1
- package/context/CartesianContextProvider.d.ts +2 -1
- package/context/CartesianContextProvider.js +1 -1
- package/context/DrawingProvider.js +1 -1
- package/context/HighlightProvider.js +1 -1
- package/context/InteractionProvider.js +1 -1
- package/context/SeriesContextProvider.js +2 -2
- package/context/ZAxisContextProvider.d.ts +33 -0
- package/context/ZAxisContextProvider.js +98 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +8 -1
- package/esm/BarChart/BarChart.js +23 -103
- package/esm/BarChart/BarElement.js +0 -1
- package/esm/BarChart/BarPlot.js +8 -8
- package/esm/ChartContainer/ChartContainer.js +3 -2
- package/esm/ChartsAxis/ChartsAxis.js +7 -100
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
- package/esm/ChartsGrid/ChartsGrid.js +1 -2
- package/esm/ChartsLegend/DefaultChartsLegend.js +1 -2
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
- package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
- package/esm/ChartsOverlay/index.js +3 -0
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
- package/esm/ChartsSurface.js +1 -2
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipTable.js +8 -8
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
- package/esm/ChartsXAxis/ChartsXAxis.js +8 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +8 -2
- package/esm/Gauge/Gauge.js +2 -3
- package/esm/Gauge/GaugeContainer.js +1 -1
- package/esm/Gauge/GaugeProvider.js +1 -1
- package/esm/Gauge/utils.js +4 -4
- package/esm/LineChart/AnimatedArea.js +1 -2
- package/esm/LineChart/AnimatedLine.js +1 -2
- package/esm/LineChart/LineChart.js +20 -100
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/PieChart/PieArcLabelPlot.js +3 -3
- package/esm/PieChart/PieArcPlot.js +3 -3
- package/esm/PieChart/PieChart.js +23 -100
- package/esm/PieChart/PiePlot.js +1 -2
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
- package/esm/ScatterChart/ScatterChart.js +74 -126
- package/esm/ScatterChart/ScatterPlot.js +8 -1
- package/esm/ScatterChart/getColor.js +18 -1
- package/esm/SparkLineChart/SparkLineChart.js +1 -2
- package/esm/context/SeriesContextProvider.js +1 -1
- package/esm/context/ZAxisContextProvider.js +89 -0
- package/esm/context/index.js +1 -1
- package/esm/hooks/useReducedMotion.js +1 -1
- package/esm/hooks/useScale.js +1 -1
- package/esm/hooks/useTicks.js +4 -0
- package/esm/internals/colorGetter.js +2 -2
- package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
- package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
- package/esm/internals/utils.js +1 -1
- package/esm/models/z-axis.js +1 -0
- package/hooks/useAxisEvents.js +1 -1
- package/hooks/useChartDimensions.js +1 -1
- package/hooks/useChartId.js +1 -1
- package/hooks/useDrawingArea.js +1 -1
- package/hooks/useInteractionItemProps.js +1 -1
- package/hooks/useMounted.js +1 -1
- package/hooks/useReducedMotion.d.ts +1 -1
- package/hooks/useReducedMotion.js +1 -1
- package/hooks/useScale.d.ts +4 -4
- package/hooks/useScale.js +2 -2
- package/hooks/useSeries.js +1 -1
- package/hooks/useSvgRef.js +1 -1
- package/hooks/useTicks.js +5 -1
- package/index.js +1 -1
- package/internals/colorGetter.d.ts +3 -1
- package/internals/colorGetter.js +2 -2
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -6
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +4 -4
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -4
- package/internals/defaultizeColor.d.ts +1 -0
- package/internals/useAnimatedPath.d.ts +1 -0
- package/internals/useAnimatedPath.js +1 -1
- package/internals/utils.d.ts +1 -1
- package/internals/utils.js +1 -1
- package/models/axis.d.ts +1 -1
- package/models/colorMapping.d.ts +3 -2
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +9 -4
- package/models/seriesType/scatter.d.ts +5 -0
- package/models/z-axis.d.ts +14 -0
- package/models/z-axis.js +5 -0
- package/modern/BarChart/BarChart.js +23 -103
- package/modern/BarChart/BarElement.js +0 -1
- package/modern/BarChart/BarPlot.js +8 -8
- package/modern/ChartContainer/ChartContainer.js +3 -2
- package/modern/ChartsAxis/ChartsAxis.js +7 -100
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
- package/modern/ChartsGrid/ChartsGrid.js +1 -2
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -2
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
- package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
- package/modern/ChartsOverlay/index.js +3 -0
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
- package/modern/ChartsSurface.js +1 -2
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipTable.js +8 -8
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
- package/modern/ChartsXAxis/ChartsXAxis.js +8 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +8 -2
- package/modern/Gauge/Gauge.js +2 -3
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/Gauge/GaugeProvider.js +1 -1
- package/modern/Gauge/utils.js +4 -4
- package/modern/LineChart/AnimatedArea.js +1 -2
- package/modern/LineChart/AnimatedLine.js +1 -2
- package/modern/LineChart/LineChart.js +20 -100
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/PieChart/PieArcLabelPlot.js +3 -3
- package/modern/PieChart/PieArcPlot.js +3 -3
- package/modern/PieChart/PieChart.js +23 -100
- package/modern/PieChart/PiePlot.js +1 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
- package/modern/ScatterChart/ScatterChart.js +74 -126
- package/modern/ScatterChart/ScatterPlot.js +8 -1
- package/modern/ScatterChart/getColor.js +18 -1
- package/modern/SparkLineChart/SparkLineChart.js +1 -2
- package/modern/context/SeriesContextProvider.js +1 -1
- package/modern/context/ZAxisContextProvider.js +89 -0
- package/modern/context/index.js +1 -1
- package/modern/hooks/useReducedMotion.js +1 -1
- package/modern/hooks/useScale.js +1 -1
- package/modern/hooks/useTicks.js +4 -0
- package/modern/index.js +1 -1
- package/modern/internals/colorGetter.js +2 -2
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
- package/modern/internals/utils.js +1 -1
- package/modern/models/z-axis.js +1 -0
- package/package.json +3 -5
|
@@ -7,6 +7,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
|
|
|
7
7
|
import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
|
|
8
8
|
import { isCartesianSeriesType } from './utils';
|
|
9
9
|
import colorGetter from '../internals/colorGetter';
|
|
10
|
+
import { ZAxisContext } from '../context/ZAxisContextProvider';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
function ChartsAxisTooltipContent(props) {
|
|
12
13
|
const {
|
|
@@ -25,6 +26,10 @@ function ChartsAxisTooltipContent(props) {
|
|
|
25
26
|
yAxisIds,
|
|
26
27
|
yAxis
|
|
27
28
|
} = React.useContext(CartesianContext);
|
|
29
|
+
const {
|
|
30
|
+
zAxisIds,
|
|
31
|
+
zAxis
|
|
32
|
+
} = React.useContext(ZAxisContext);
|
|
28
33
|
const series = React.useContext(SeriesContext);
|
|
29
34
|
const USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
|
|
30
35
|
const relevantSeries = React.useMemo(() => {
|
|
@@ -35,15 +40,23 @@ function ChartsAxisTooltipContent(props) {
|
|
|
35
40
|
const axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
|
|
36
41
|
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
37
42
|
const seriesToAdd = series[seriesType].series[seriesId];
|
|
38
|
-
|
|
43
|
+
let getColor;
|
|
44
|
+
switch (seriesToAdd.type) {
|
|
45
|
+
case 'scatter':
|
|
46
|
+
getColor = colorGetter(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]], zAxis[seriesToAdd.zAxisKey ?? zAxisIds[0]]);
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
getColor = colorGetter(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]]);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
39
52
|
rep.push(_extends({}, seriesToAdd, {
|
|
40
|
-
getColor
|
|
53
|
+
getColor
|
|
41
54
|
}));
|
|
42
55
|
}
|
|
43
56
|
});
|
|
44
57
|
});
|
|
45
58
|
return rep;
|
|
46
|
-
}, [USED_AXIS_ID, isXaxis, series, xAxis, xAxisIds, yAxis, yAxisIds]);
|
|
59
|
+
}, [USED_AXIS_ID, isXaxis, series, xAxis, xAxisIds, yAxis, yAxisIds, zAxis, zAxisIds]);
|
|
47
60
|
const relevantAxis = React.useMemo(() => {
|
|
48
61
|
return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
|
|
49
62
|
}, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
|
|
@@ -93,7 +106,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
|
93
106
|
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
|
|
94
107
|
})
|
|
95
108
|
}),
|
|
96
|
-
axisValue: PropTypes.
|
|
109
|
+
axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
|
|
97
110
|
classes: PropTypes.object,
|
|
98
111
|
dataIndex: PropTypes.number,
|
|
99
112
|
series: PropTypes.arrayOf(PropTypes.object),
|
|
@@ -6,6 +6,7 @@ import { SeriesContext } from '../context/SeriesContextProvider';
|
|
|
6
6
|
import { DefaultChartsItemTooltipContent } from './DefaultChartsItemTooltipContent';
|
|
7
7
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
8
8
|
import colorGetter from '../internals/colorGetter';
|
|
9
|
+
import { ZAxisContext } from '../context/ZAxisContextProvider';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
function ChartsItemTooltipContent(props) {
|
|
11
12
|
const {
|
|
@@ -16,16 +17,31 @@ function ChartsItemTooltipContent(props) {
|
|
|
16
17
|
contentProps
|
|
17
18
|
} = props;
|
|
18
19
|
const series = React.useContext(SeriesContext)[itemData.type].series[itemData.seriesId];
|
|
19
|
-
const axisData = React.useContext(CartesianContext);
|
|
20
20
|
const {
|
|
21
21
|
xAxis,
|
|
22
22
|
yAxis,
|
|
23
23
|
xAxisIds,
|
|
24
24
|
yAxisIds
|
|
25
|
-
} =
|
|
25
|
+
} = React.useContext(CartesianContext);
|
|
26
|
+
const {
|
|
27
|
+
zAxis,
|
|
28
|
+
zAxisIds
|
|
29
|
+
} = React.useContext(ZAxisContext);
|
|
26
30
|
const defaultXAxisId = xAxisIds[0];
|
|
27
31
|
const defaultYAxisId = yAxisIds[0];
|
|
28
|
-
const
|
|
32
|
+
const defaultZAxisId = zAxisIds[0];
|
|
33
|
+
let getColor;
|
|
34
|
+
switch (series.type) {
|
|
35
|
+
case 'pie':
|
|
36
|
+
getColor = colorGetter(series);
|
|
37
|
+
break;
|
|
38
|
+
case 'scatter':
|
|
39
|
+
getColor = colorGetter(series, xAxis[series.xAxisKey ?? defaultXAxisId], yAxis[series.yAxisKey ?? defaultYAxisId], zAxis[series.zAxisKey ?? defaultZAxisId]);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
getColor = colorGetter(series, xAxis[series.xAxisKey ?? defaultXAxisId], yAxis[series.yAxisKey ?? defaultYAxisId]);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
29
45
|
const Content = content ?? DefaultChartsItemTooltipContent;
|
|
30
46
|
const chartTooltipContentProps = useSlotProps({
|
|
31
47
|
elementType: Content,
|
|
@@ -113,7 +113,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
113
113
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
114
114
|
// ----------------------------------------------------------------------
|
|
115
115
|
/**
|
|
116
|
-
* Component to override the tooltip content when
|
|
116
|
+
* Component to override the tooltip content when trigger is set to 'axis'.
|
|
117
117
|
* @deprecated Use slots.axisContent instead
|
|
118
118
|
*/
|
|
119
119
|
axisContent: PropTypes.elementType,
|
|
@@ -122,7 +122,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
122
122
|
*/
|
|
123
123
|
classes: PropTypes.object,
|
|
124
124
|
/**
|
|
125
|
-
* Component to override the tooltip content when
|
|
125
|
+
* Component to override the tooltip content when trigger is set to 'item'.
|
|
126
126
|
* @deprecated Use slots.itemContent instead
|
|
127
127
|
*/
|
|
128
128
|
itemContent: PropTypes.elementType,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Box from '@mui/system/Box';
|
|
2
1
|
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { shouldForwardProp } from '@mui/system';
|
|
3
3
|
import { chartsTooltipClasses } from './chartsTooltipClasses';
|
|
4
4
|
export const ChartsTooltipPaper = styled('div', {
|
|
5
5
|
name: 'MuiChartsTooltip',
|
|
@@ -7,10 +7,10 @@ export const ChartsTooltipPaper = styled('div', {
|
|
|
7
7
|
})(({
|
|
8
8
|
theme
|
|
9
9
|
}) => ({
|
|
10
|
+
boxShadow: theme.shadows[1],
|
|
10
11
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
11
12
|
color: (theme.vars || theme).palette.text.primary,
|
|
12
13
|
transition: theme.transitions.create('box-shadow'),
|
|
13
|
-
border: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
14
14
|
borderRadius: theme.shape.borderRadius
|
|
15
15
|
}));
|
|
16
16
|
export const ChartsTooltipTable = styled('table', {
|
|
@@ -59,19 +59,19 @@ export const ChartsTooltipCell = styled('td', {
|
|
|
59
59
|
paddingRight: theme.spacing(2)
|
|
60
60
|
}
|
|
61
61
|
}));
|
|
62
|
-
|
|
63
|
-
// eslint-disable-next-line material-ui/no-styled-box
|
|
64
|
-
export const ChartsTooltipMark = styled(Box, {
|
|
62
|
+
export const ChartsTooltipMark = styled('div', {
|
|
65
63
|
name: 'MuiChartsTooltip',
|
|
66
|
-
slot: 'Mark'
|
|
64
|
+
slot: 'Mark',
|
|
65
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'color'
|
|
67
66
|
})(({
|
|
68
67
|
theme,
|
|
69
|
-
|
|
68
|
+
color
|
|
70
69
|
}) => ({
|
|
71
70
|
width: theme.spacing(1),
|
|
72
71
|
height: theme.spacing(1),
|
|
73
72
|
borderRadius: '50%',
|
|
74
|
-
|
|
73
|
+
boxShadow: theme.shadows[1],
|
|
74
|
+
backgroundColor: color,
|
|
75
75
|
borderColor: (theme.vars || theme).palette.background.paper,
|
|
76
76
|
border: `solid ${(theme.vars || theme).palette.background.paper} ${theme.spacing(0.25)}`,
|
|
77
77
|
boxSizing: 'content-box'
|
|
@@ -4,8 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import Typography from '@mui/material/Typography';
|
|
5
5
|
import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from './ChartsTooltipTable';
|
|
6
6
|
import { isCartesianSeries, utcFormatter } from './utils';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
function DefaultChartsAxisTooltipContent(props) {
|
|
10
9
|
const {
|
|
11
10
|
series,
|
|
@@ -56,10 +55,7 @@ function DefaultChartsAxisTooltipContent(props) {
|
|
|
56
55
|
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
57
56
|
className: clsx(classes.markCell, classes.cell),
|
|
58
57
|
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
59
|
-
|
|
60
|
-
color: getColor(dataIndex) ?? color
|
|
61
|
-
},
|
|
62
|
-
boxShadow: 1,
|
|
58
|
+
color: getColor(dataIndex) ?? color,
|
|
63
59
|
className: classes.mark
|
|
64
60
|
})
|
|
65
61
|
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
@@ -104,7 +100,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
|
|
|
104
100
|
/**
|
|
105
101
|
* The value associated to the current mouse position.
|
|
106
102
|
*/
|
|
107
|
-
axisValue: PropTypes.
|
|
103
|
+
axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
|
|
108
104
|
/**
|
|
109
105
|
* Override or extend the styles applied to the component.
|
|
110
106
|
*/
|
|
@@ -2,8 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
function DefaultChartsItemTooltipContent(props) {
|
|
8
7
|
const {
|
|
9
8
|
series,
|
|
@@ -40,9 +39,7 @@ function DefaultChartsItemTooltipContent(props) {
|
|
|
40
39
|
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
41
40
|
className: clsx(classes.markCell, classes.cell),
|
|
42
41
|
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
43
|
-
|
|
44
|
-
color
|
|
45
|
-
},
|
|
42
|
+
color: color,
|
|
46
43
|
className: classes.mark
|
|
47
44
|
})
|
|
48
45
|
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
@@ -15,8 +15,7 @@ import { getMinXTranslation } from '../internals/geometry';
|
|
|
15
15
|
import { useMounted } from '../hooks/useMounted';
|
|
16
16
|
import { useDrawingArea } from '../hooks/useDrawingArea';
|
|
17
17
|
import { getWordsByLines } from '../internals/getWordsByLines';
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const useUtilityClasses = ownerState => {
|
|
21
20
|
const {
|
|
22
21
|
classes,
|
|
@@ -204,6 +203,13 @@ function ChartsXAxis(inProps) {
|
|
|
204
203
|
},
|
|
205
204
|
ownerState: {}
|
|
206
205
|
});
|
|
206
|
+
const domain = xScale.domain();
|
|
207
|
+
if (domain.length === 0 || domain[0] === domain[1]) {
|
|
208
|
+
// Skip axis rendering if
|
|
209
|
+
// - the data is empty (for band and point axis)
|
|
210
|
+
// - No data is associated to the axis (other scale types)
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
207
213
|
return /*#__PURE__*/_jsxs(AxisRoot, {
|
|
208
214
|
transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
|
|
209
215
|
className: classes.root,
|
|
@@ -12,8 +12,7 @@ import { useDrawingArea } from '../hooks/useDrawingArea';
|
|
|
12
12
|
import { AxisRoot } from '../internals/components/AxisSharedComponents';
|
|
13
13
|
import { ChartsText } from '../ChartsText';
|
|
14
14
|
import { getAxisUtilityClass } from '../ChartsAxis/axisClasses';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
const useUtilityClasses = ownerState => {
|
|
18
17
|
const {
|
|
19
18
|
classes,
|
|
@@ -139,6 +138,13 @@ function ChartsYAxis(inProps) {
|
|
|
139
138
|
},
|
|
140
139
|
ownerState: {}
|
|
141
140
|
});
|
|
141
|
+
const domain = yScale.domain();
|
|
142
|
+
if (domain.length === 0 || domain[0] === domain[1]) {
|
|
143
|
+
// Skip axis rendering if
|
|
144
|
+
// - the data is empty (for band and point axis)
|
|
145
|
+
// - No data is associated to the axis (other scale types)
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
142
148
|
return /*#__PURE__*/_jsxs(AxisRoot, {
|
|
143
149
|
transform: `translate(${position === 'right' ? left + width : left}, 0)`,
|
|
144
150
|
className: classes.root,
|
package/modern/Gauge/Gauge.js
CHANGED
|
@@ -9,8 +9,7 @@ import { GaugeValueArc } from './GaugeValueArc';
|
|
|
9
9
|
import { GaugeReferenceArc } from './GaugeReferenceArc';
|
|
10
10
|
import { getGaugeUtilityClass } from './gaugeClasses';
|
|
11
11
|
import { GaugeValueText } from './GaugeValueText';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
const useUtilityClasses = props => {
|
|
15
14
|
const {
|
|
16
15
|
classes
|
|
@@ -85,7 +84,7 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
|
|
|
85
84
|
*/
|
|
86
85
|
height: PropTypes.number,
|
|
87
86
|
/**
|
|
88
|
-
* The radius between circle center and the
|
|
87
|
+
* The radius between circle center and the beginning of the arc.
|
|
89
88
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
90
89
|
* The '100%' is the maximal radius that fit into the drawing area.
|
|
91
90
|
* @default '80%'
|
|
@@ -145,7 +145,7 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
|
|
|
145
145
|
*/
|
|
146
146
|
height: PropTypes.number,
|
|
147
147
|
/**
|
|
148
|
-
* The radius between circle center and the
|
|
148
|
+
* The radius between circle center and the beginning of the arc.
|
|
149
149
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
150
150
|
* The '100%' is the maximal radius that fit into the drawing area.
|
|
151
151
|
* @default '80%'
|
|
@@ -48,7 +48,7 @@ export function GaugeProvider(props) {
|
|
|
48
48
|
let cy = top + innerCy;
|
|
49
49
|
const maxRadius = getAvailableRadius(innerCx, innerCy, width, height, ratios);
|
|
50
50
|
|
|
51
|
-
// If the center is not defined, after computation of the available radius,
|
|
51
|
+
// If the center is not defined, after computation of the available radius, update the center to use the remaining space.
|
|
52
52
|
if (cxParam === undefined) {
|
|
53
53
|
const usedWidth = maxRadius * (ratios.maxX - ratios.minX);
|
|
54
54
|
cx = left + (width - usedWidth) / 2 + ratios.cx * usedWidth;
|
package/modern/Gauge/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ function getPoint(angle) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Returns the ratio of the arc bounding box and its center.
|
|
11
11
|
* @param startAngle The start angle (in deg)
|
|
12
12
|
* @param endAngle The end angle (in deg)
|
|
13
13
|
*/
|
|
@@ -20,9 +20,9 @@ export function getArcRatios(startAngle, endAngle) {
|
|
|
20
20
|
const maxAngle = Math.max(startAngle, endAngle);
|
|
21
21
|
const initialAngle = Math.floor(minAngle / 90) * 90;
|
|
22
22
|
for (let step = 1; step <= 4; step += 1) {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
points.push(getPoint(
|
|
23
|
+
const cardinalAngle = initialAngle + step * 90;
|
|
24
|
+
if (cardinalAngle < maxAngle) {
|
|
25
|
+
points.push(getPoint(cardinalAngle));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const minX = Math.min(...points.map(([x]) => x));
|
|
@@ -9,8 +9,7 @@ import { animated, useSpring } from '@react-spring/web';
|
|
|
9
9
|
import { useAnimatedPath } from '../internals/useAnimatedPath';
|
|
10
10
|
import { cleanId } from '../internals/utils';
|
|
11
11
|
import { useChartId, useDrawingArea } from '../hooks';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
export const AreaElementPath = styled(animated.path, {
|
|
15
14
|
name: 'MuiAreaElement',
|
|
16
15
|
slot: 'Root',
|
|
@@ -10,8 +10,7 @@ import { useAnimatedPath } from '../internals/useAnimatedPath';
|
|
|
10
10
|
import { cleanId } from '../internals/utils';
|
|
11
11
|
import { useChartId } from '../hooks/useChartId';
|
|
12
12
|
import { useDrawingArea } from '../hooks/useDrawingArea';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
14
|
export const LineElementPath = styled(animated.path, {
|
|
16
15
|
name: 'MuiLineElement',
|
|
17
16
|
slot: 'Root',
|
|
@@ -15,8 +15,8 @@ import { ChartsClipPath } from '../ChartsClipPath';
|
|
|
15
15
|
import { LineHighlightPlot } from './LineHighlightPlot';
|
|
16
16
|
import { ChartsGrid } from '../ChartsGrid';
|
|
17
17
|
import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
|
|
18
|
-
import {
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
/**
|
|
21
21
|
* Demos:
|
|
22
22
|
*
|
|
@@ -56,7 +56,8 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
56
56
|
children,
|
|
57
57
|
slots,
|
|
58
58
|
slotProps,
|
|
59
|
-
skipAnimation
|
|
59
|
+
skipAnimation,
|
|
60
|
+
loading
|
|
60
61
|
} = props;
|
|
61
62
|
const id = useId();
|
|
62
63
|
const clipPathId = `${id}-clip-path`;
|
|
@@ -98,6 +99,10 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
98
99
|
slotProps: slotProps,
|
|
99
100
|
onItemClick: onLineClick,
|
|
100
101
|
skipAnimation: skipAnimation
|
|
102
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
103
|
+
loading: loading,
|
|
104
|
+
slots: slots,
|
|
105
|
+
slotProps: slotProps
|
|
101
106
|
})]
|
|
102
107
|
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
103
108
|
topAxis: topAxis,
|
|
@@ -117,7 +122,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
117
122
|
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
118
123
|
slots: slots,
|
|
119
124
|
slotProps: slotProps
|
|
120
|
-
})), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
|
|
125
|
+
})), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
|
|
121
126
|
slots: slots,
|
|
122
127
|
slotProps: slotProps
|
|
123
128
|
})), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
@@ -144,30 +149,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
144
149
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
145
150
|
* @default xAxisIds[0] The id of the first provided axis
|
|
146
151
|
*/
|
|
147
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.
|
|
148
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
149
|
-
classes: PropTypes.object,
|
|
150
|
-
disableLine: PropTypes.bool,
|
|
151
|
-
disableTicks: PropTypes.bool,
|
|
152
|
-
fill: PropTypes.string,
|
|
153
|
-
label: PropTypes.string,
|
|
154
|
-
labelFontSize: PropTypes.number,
|
|
155
|
-
labelStyle: PropTypes.object,
|
|
156
|
-
position: PropTypes.oneOf(['bottom', 'top']),
|
|
157
|
-
slotProps: PropTypes.object,
|
|
158
|
-
slots: PropTypes.object,
|
|
159
|
-
stroke: PropTypes.string,
|
|
160
|
-
tickFontSize: PropTypes.number,
|
|
161
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
162
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
163
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
164
|
-
tickLabelStyle: PropTypes.object,
|
|
165
|
-
tickMaxStep: PropTypes.number,
|
|
166
|
-
tickMinStep: PropTypes.number,
|
|
167
|
-
tickNumber: PropTypes.number,
|
|
168
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
169
|
-
tickSize: PropTypes.number
|
|
170
|
-
}), PropTypes.string]),
|
|
152
|
+
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
171
153
|
children: PropTypes.node,
|
|
172
154
|
className: PropTypes.string,
|
|
173
155
|
/**
|
|
@@ -206,30 +188,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
206
188
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
207
189
|
* @default yAxisIds[0] The id of the first provided axis
|
|
208
190
|
*/
|
|
209
|
-
leftAxis: PropTypes.oneOfType([PropTypes.
|
|
210
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
211
|
-
classes: PropTypes.object,
|
|
212
|
-
disableLine: PropTypes.bool,
|
|
213
|
-
disableTicks: PropTypes.bool,
|
|
214
|
-
fill: PropTypes.string,
|
|
215
|
-
label: PropTypes.string,
|
|
216
|
-
labelFontSize: PropTypes.number,
|
|
217
|
-
labelStyle: PropTypes.object,
|
|
218
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
219
|
-
slotProps: PropTypes.object,
|
|
220
|
-
slots: PropTypes.object,
|
|
221
|
-
stroke: PropTypes.string,
|
|
222
|
-
tickFontSize: PropTypes.number,
|
|
223
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
224
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
225
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
226
|
-
tickLabelStyle: PropTypes.object,
|
|
227
|
-
tickMaxStep: PropTypes.number,
|
|
228
|
-
tickMinStep: PropTypes.number,
|
|
229
|
-
tickNumber: PropTypes.number,
|
|
230
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
231
|
-
tickSize: PropTypes.number
|
|
232
|
-
}), PropTypes.string]),
|
|
191
|
+
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
233
192
|
/**
|
|
234
193
|
* @deprecated Consider using `slotProps.legend` instead.
|
|
235
194
|
*/
|
|
@@ -244,6 +203,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
244
203
|
slotProps: PropTypes.object,
|
|
245
204
|
slots: PropTypes.object
|
|
246
205
|
}),
|
|
206
|
+
/**
|
|
207
|
+
* If `true`, a loading overlay is displayed.
|
|
208
|
+
*/
|
|
209
|
+
loading: PropTypes.bool,
|
|
247
210
|
/**
|
|
248
211
|
* The margin between the SVG and the drawing area.
|
|
249
212
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
@@ -280,32 +243,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
280
243
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
281
244
|
* @default null
|
|
282
245
|
*/
|
|
283
|
-
rightAxis: PropTypes.oneOfType([PropTypes.
|
|
284
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
285
|
-
classes: PropTypes.object,
|
|
286
|
-
disableLine: PropTypes.bool,
|
|
287
|
-
disableTicks: PropTypes.bool,
|
|
288
|
-
fill: PropTypes.string,
|
|
289
|
-
label: PropTypes.string,
|
|
290
|
-
labelFontSize: PropTypes.number,
|
|
291
|
-
labelStyle: PropTypes.object,
|
|
292
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
293
|
-
slotProps: PropTypes.object,
|
|
294
|
-
slots: PropTypes.object,
|
|
295
|
-
stroke: PropTypes.string,
|
|
296
|
-
tickFontSize: PropTypes.number,
|
|
297
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
298
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
299
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
300
|
-
tickLabelStyle: PropTypes.object,
|
|
301
|
-
tickMaxStep: PropTypes.number,
|
|
302
|
-
tickMinStep: PropTypes.number,
|
|
303
|
-
tickNumber: PropTypes.number,
|
|
304
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
305
|
-
tickSize: PropTypes.number
|
|
306
|
-
}), PropTypes.string]),
|
|
246
|
+
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
307
247
|
/**
|
|
308
248
|
* The series to display in the line chart.
|
|
249
|
+
* An array of [[LineSeriesType]] objects.
|
|
309
250
|
*/
|
|
310
251
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
311
252
|
/**
|
|
@@ -343,30 +284,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
343
284
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
344
285
|
* @default null
|
|
345
286
|
*/
|
|
346
|
-
topAxis: PropTypes.oneOfType([PropTypes.
|
|
347
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
348
|
-
classes: PropTypes.object,
|
|
349
|
-
disableLine: PropTypes.bool,
|
|
350
|
-
disableTicks: PropTypes.bool,
|
|
351
|
-
fill: PropTypes.string,
|
|
352
|
-
label: PropTypes.string,
|
|
353
|
-
labelFontSize: PropTypes.number,
|
|
354
|
-
labelStyle: PropTypes.object,
|
|
355
|
-
position: PropTypes.oneOf(['bottom', 'top']),
|
|
356
|
-
slotProps: PropTypes.object,
|
|
357
|
-
slots: PropTypes.object,
|
|
358
|
-
stroke: PropTypes.string,
|
|
359
|
-
tickFontSize: PropTypes.number,
|
|
360
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
361
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
362
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
363
|
-
tickLabelStyle: PropTypes.object,
|
|
364
|
-
tickMaxStep: PropTypes.number,
|
|
365
|
-
tickMinStep: PropTypes.number,
|
|
366
|
-
tickNumber: PropTypes.number,
|
|
367
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
368
|
-
tickSize: PropTypes.number
|
|
369
|
-
}), PropTypes.string]),
|
|
287
|
+
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
370
288
|
viewBox: PropTypes.shape({
|
|
371
289
|
height: PropTypes.number,
|
|
372
290
|
width: PropTypes.number,
|
|
@@ -380,6 +298,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
380
298
|
/**
|
|
381
299
|
* The configuration of the x-axes.
|
|
382
300
|
* If not provided, a default axis config is used.
|
|
301
|
+
* An array of [[AxisConfig]] objects.
|
|
383
302
|
*/
|
|
384
303
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
385
304
|
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -432,6 +351,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
432
351
|
/**
|
|
433
352
|
* The configuration of the y-axes.
|
|
434
353
|
* If not provided, a default axis config is used.
|
|
354
|
+
* An array of [[AxisConfig]] objects.
|
|
435
355
|
*/
|
|
436
356
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
437
357
|
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -39,7 +39,7 @@ const PieArcLabelRoot = styled(animated.text, {
|
|
|
39
39
|
}));
|
|
40
40
|
/**
|
|
41
41
|
* Helper to compute label position.
|
|
42
|
-
* It's not an inline function because we need it in
|
|
42
|
+
* It's not an inline function because we need it in interpolation.
|
|
43
43
|
*/
|
|
44
44
|
const getLabelPosition = (formattedArcLabel, variable) => (startAngle, endAngle, padAngle, arcLabelRadius, cornerRadius) => {
|
|
45
45
|
if (!formattedArcLabel) {
|
|
@@ -129,7 +129,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
129
129
|
value: PropTypes.number.isRequired
|
|
130
130
|
})).isRequired,
|
|
131
131
|
/**
|
|
132
|
-
* Override the arc
|
|
132
|
+
* Override the arc attributes when it is faded.
|
|
133
133
|
* @default { additionalRadius: -5 }
|
|
134
134
|
*/
|
|
135
135
|
faded: PropTypes.shape({
|
|
@@ -142,7 +142,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
142
142
|
paddingAngle: PropTypes.number
|
|
143
143
|
}),
|
|
144
144
|
/**
|
|
145
|
-
* Override the arc
|
|
145
|
+
* Override the arc attributes when it is highlighted.
|
|
146
146
|
*/
|
|
147
147
|
highlighted: PropTypes.shape({
|
|
148
148
|
additionalRadius: PropTypes.number,
|
|
@@ -159,7 +159,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
|
159
159
|
}),
|
|
160
160
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
161
161
|
/**
|
|
162
|
-
* The radius between circle center and the
|
|
162
|
+
* The radius between circle center and the beginning of the arc.
|
|
163
163
|
* @default 0
|
|
164
164
|
*/
|
|
165
165
|
innerRadius: PropTypes.number,
|
|
@@ -109,7 +109,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
109
109
|
value: PropTypes.number.isRequired
|
|
110
110
|
})).isRequired,
|
|
111
111
|
/**
|
|
112
|
-
* Override the arc
|
|
112
|
+
* Override the arc attributes when it is faded.
|
|
113
113
|
* @default { additionalRadius: -5 }
|
|
114
114
|
*/
|
|
115
115
|
faded: PropTypes.shape({
|
|
@@ -122,7 +122,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
122
122
|
paddingAngle: PropTypes.number
|
|
123
123
|
}),
|
|
124
124
|
/**
|
|
125
|
-
* Override the arc
|
|
125
|
+
* Override the arc attributes when it is highlighted.
|
|
126
126
|
*/
|
|
127
127
|
highlighted: PropTypes.shape({
|
|
128
128
|
additionalRadius: PropTypes.number,
|
|
@@ -139,7 +139,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
|
139
139
|
}),
|
|
140
140
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
141
141
|
/**
|
|
142
|
-
* The radius between circle center and the
|
|
142
|
+
* The radius between circle center and the beginning of the arc.
|
|
143
143
|
* @default 0
|
|
144
144
|
*/
|
|
145
145
|
innerRadius: PropTypes.number,
|