@mui/x-charts 6.0.0-alpha.8 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +19 -5
- package/BarChart/BarChart.js +52 -13
- package/BarChart/BarElement.d.ts +1319 -4
- package/BarChart/BarElement.js +10 -10
- package/BarChart/BarPlot.d.ts +17 -1
- package/BarChart/BarPlot.js +152 -66
- package/BarChart/formatter.js +2 -3
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +786 -48
- package/ChartContainer/index.js +7 -5
- package/ChartsAxis/ChartsAxis.d.ts +9 -0
- package/ChartsAxis/ChartsAxis.js +28 -2
- package/ChartsAxis/axisClasses.d.ts +1 -1
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +21 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +61 -22
- package/ChartsClipPath/ChartsClipPath.d.ts +5 -0
- package/ChartsClipPath/ChartsClipPath.js +7 -2
- package/ChartsLegend/ChartsLegend.d.ts +44 -24
- package/ChartsLegend/ChartsLegend.js +192 -150
- package/ChartsLegend/chartsLegendClasses.js +1 -2
- package/ChartsLegend/utils.d.ts +1 -6
- package/ChartsSurface.d.ts +1 -1
- package/ChartsSurface.js +9 -18
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
- package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
- package/ChartsTooltip/ChartsTooltip.js +62 -18
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
- package/ChartsTooltip/ChartsTooltipTable.js +22 -20
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
- package/ChartsXAxis/ChartsXAxis.js +161 -40
- package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
- package/ChartsYAxis/ChartsYAxis.js +86 -33
- package/LineChart/AreaElement.d.ts +12 -2
- package/LineChart/AreaElement.js +14 -6
- package/LineChart/AreaPlot.d.ts +11 -0
- package/LineChart/AreaPlot.js +27 -8
- package/LineChart/LineChart.d.ts +21 -3
- package/LineChart/LineChart.js +61 -14
- package/LineChart/LineElement.d.ts +12 -2
- package/LineChart/LineElement.js +14 -6
- package/LineChart/LineHighlightElement.d.ts +31 -0
- package/LineChart/LineHighlightElement.js +88 -0
- package/LineChart/LineHighlightPlot.d.ts +35 -0
- package/LineChart/LineHighlightPlot.js +110 -0
- package/LineChart/LinePlot.d.ts +10 -0
- package/LineChart/LinePlot.js +25 -12
- package/LineChart/MarkElement.d.ts +11 -1
- package/LineChart/MarkElement.js +15 -9
- package/LineChart/MarkPlot.d.ts +10 -0
- package/LineChart/MarkPlot.js +62 -15
- package/LineChart/formatter.js +5 -5
- package/LineChart/index.d.ts +2 -0
- package/LineChart/index.js +20 -0
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +12 -14
- package/PieChart/PieArc.js +28 -60
- package/PieChart/PieArcLabel.d.ts +9 -10
- package/PieChart/PieArcLabel.js +46 -38
- package/PieChart/PieArcLabelPlot.d.ts +28 -0
- package/PieChart/PieArcLabelPlot.js +99 -0
- package/PieChart/PieArcPlot.d.ts +35 -0
- package/PieChart/PieArcPlot.js +92 -0
- package/PieChart/PieChart.d.ts +19 -5
- package/PieChart/PieChart.js +61 -14
- package/PieChart/PiePlot.d.ts +15 -9
- package/PieChart/PiePlot.js +77 -55
- package/PieChart/dataTransform/transition.d.ts +4 -0
- package/PieChart/dataTransform/transition.js +136 -0
- package/PieChart/dataTransform/useTransformData.d.ts +15 -0
- package/PieChart/dataTransform/useTransformData.js +67 -0
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/README.md +8 -14
- package/ResponsiveChartContainer/index.js +7 -8
- package/ScatterChart/Scatter.d.ts +10 -0
- package/ScatterChart/Scatter.js +12 -2
- package/ScatterChart/ScatterChart.d.ts +16 -3
- package/ScatterChart/ScatterChart.js +43 -12
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +12 -2
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +13 -3
- package/SparkLineChart/SparkLineChart.js +34 -18
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +5 -8
- package/context/CartesianContextProvider.d.ts +5 -0
- package/context/CartesianContextProvider.js +31 -16
- package/context/DrawingProvider.d.ts +7 -0
- package/context/DrawingProvider.js +12 -6
- package/context/HighlightProvider.js +3 -4
- package/context/InteractionProvider.js +3 -4
- package/context/SeriesContextProvider.js +3 -4
- package/esm/BarChart/BarChart.js +49 -9
- package/esm/BarChart/BarElement.js +7 -4
- package/esm/BarChart/BarPlot.js +152 -67
- package/esm/BarChart/formatter.js +1 -1
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +26 -0
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
- package/esm/ChartsLegend/ChartsLegend.js +188 -142
- package/esm/ChartsSurface.js +4 -12
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
- package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/esm/ChartsXAxis/ChartsXAxis.js +158 -37
- package/esm/ChartsYAxis/ChartsYAxis.js +83 -30
- package/esm/LineChart/AreaElement.js +10 -0
- package/esm/LineChart/AreaPlot.js +26 -6
- package/esm/LineChart/LineChart.js +58 -10
- package/esm/LineChart/LineElement.js +10 -0
- package/esm/LineChart/LineHighlightElement.js +78 -0
- package/esm/LineChart/LineHighlightPlot.js +103 -0
- package/esm/LineChart/LinePlot.js +25 -14
- package/esm/LineChart/MarkElement.js +12 -5
- package/esm/LineChart/MarkPlot.js +60 -13
- package/esm/LineChart/formatter.js +7 -3
- package/esm/LineChart/index.js +3 -1
- package/esm/PieChart/PieArc.js +26 -58
- package/esm/PieChart/PieArcLabel.js +43 -34
- package/esm/PieChart/PieArcLabelPlot.js +92 -0
- package/esm/PieChart/PieArcPlot.js +84 -0
- package/esm/PieChart/PieChart.js +59 -12
- package/esm/PieChart/PiePlot.js +76 -57
- package/esm/PieChart/dataTransform/transition.js +130 -0
- package/esm/PieChart/dataTransform/useTransformData.js +59 -0
- package/esm/ResponsiveChartContainer/index.js +3 -3
- package/esm/ScatterChart/Scatter.js +10 -0
- package/esm/ScatterChart/ScatterChart.js +40 -8
- package/esm/ScatterChart/ScatterPlot.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +32 -15
- package/esm/constants.js +1 -1
- package/esm/context/CartesianContextProvider.js +30 -14
- package/esm/context/DrawingProvider.js +8 -0
- package/esm/hooks/useChartDimensions.js +2 -0
- package/esm/hooks/useMounted.js +16 -0
- package/esm/hooks/useReducedMotion.js +27 -0
- package/esm/hooks/useTicks.js +15 -9
- package/esm/internals/components/AxisSharedComponents.js +15 -70
- package/esm/internals/components/ChartsText.js +77 -0
- package/esm/internals/domUtils.js +113 -0
- package/esm/internals/geometry.js +36 -0
- package/hooks/useAxisEvents.js +2 -2
- package/hooks/useChartDimensions.d.ts +2 -0
- package/hooks/useChartDimensions.js +5 -4
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +2 -2
- package/hooks/useMounted.d.ts +1 -0
- package/hooks/useMounted.js +25 -0
- package/hooks/useReducedMotion.d.ts +8 -0
- package/hooks/useReducedMotion.js +33 -0
- package/hooks/useScale.d.ts +2 -2
- package/hooks/useScale.js +2 -2
- package/hooks/useTicks.d.ts +19 -11
- package/hooks/useTicks.js +19 -14
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -4
- package/internals/components/AxisSharedComponents.js +18 -78
- package/internals/components/ChartsText.d.ts +35 -0
- package/internals/components/ChartsText.js +87 -0
- package/internals/defaultizeColor.d.ts +8 -1
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/domUtils.d.ts +13 -0
- package/internals/domUtils.js +122 -0
- package/internals/geometry.d.ts +9 -0
- package/internals/geometry.js +42 -0
- package/internals/stackSeries.js +2 -4
- package/legacy/BarChart/BarChart.js +49 -9
- package/legacy/BarChart/BarElement.js +6 -3
- package/legacy/BarChart/BarPlot.js +151 -63
- package/legacy/BarChart/formatter.js +1 -1
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +26 -0
- package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
- package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
- package/legacy/ChartsLegend/ChartsLegend.js +203 -140
- package/legacy/ChartsSurface.js +3 -12
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
- package/legacy/ChartsXAxis/ChartsXAxis.js +162 -39
- package/legacy/ChartsYAxis/ChartsYAxis.js +83 -30
- package/legacy/LineChart/AreaElement.js +10 -0
- package/legacy/LineChart/AreaPlot.js +31 -7
- package/legacy/LineChart/LineChart.js +58 -10
- package/legacy/LineChart/LineElement.js +10 -0
- package/legacy/LineChart/LineHighlightElement.js +77 -0
- package/legacy/LineChart/LineHighlightPlot.js +96 -0
- package/legacy/LineChart/LinePlot.js +29 -12
- package/legacy/LineChart/MarkElement.js +12 -5
- package/legacy/LineChart/MarkPlot.js +50 -5
- package/legacy/LineChart/formatter.js +7 -3
- package/legacy/LineChart/index.js +3 -1
- package/legacy/PieChart/PieArc.js +30 -62
- package/legacy/PieChart/PieArcLabel.js +48 -34
- package/legacy/PieChart/PieArcLabelPlot.js +93 -0
- package/legacy/PieChart/PieArcPlot.js +84 -0
- package/legacy/PieChart/PieChart.js +59 -12
- package/legacy/PieChart/PiePlot.js +76 -59
- package/legacy/PieChart/dataTransform/transition.js +142 -0
- package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
- package/legacy/ResponsiveChartContainer/index.js +3 -3
- package/legacy/ScatterChart/Scatter.js +10 -0
- package/legacy/ScatterChart/ScatterChart.js +40 -8
- package/legacy/ScatterChart/ScatterPlot.js +10 -0
- package/legacy/SparkLineChart/SparkLineChart.js +32 -13
- package/legacy/constants.js +1 -1
- package/legacy/context/CartesianContextProvider.js +30 -14
- package/legacy/context/DrawingProvider.js +8 -0
- package/legacy/hooks/useChartDimensions.js +2 -0
- package/legacy/hooks/useMounted.js +21 -0
- package/legacy/hooks/useReducedMotion.js +27 -0
- package/legacy/hooks/useTicks.js +16 -9
- package/legacy/index.js +1 -1
- package/legacy/internals/components/AxisSharedComponents.js +11 -65
- package/legacy/internals/components/ChartsText.js +79 -0
- package/legacy/internals/domUtils.js +121 -0
- package/legacy/internals/geometry.js +37 -0
- package/models/axis.d.ts +27 -9
- package/models/layout.d.ts +7 -6
- package/models/seriesType/line.d.ts +39 -1
- package/models/seriesType/pie.d.ts +5 -1
- package/modern/BarChart/BarChart.js +49 -9
- package/modern/BarChart/BarElement.js +7 -4
- package/modern/BarChart/BarPlot.js +149 -65
- package/modern/BarChart/formatter.js +1 -1
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +26 -0
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
- package/modern/ChartsLegend/ChartsLegend.js +188 -142
- package/modern/ChartsSurface.js +4 -12
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
- package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/modern/ChartsXAxis/ChartsXAxis.js +158 -37
- package/modern/ChartsYAxis/ChartsYAxis.js +83 -30
- package/modern/LineChart/AreaElement.js +10 -0
- package/modern/LineChart/AreaPlot.js +25 -6
- package/modern/LineChart/LineChart.js +58 -10
- package/modern/LineChart/LineElement.js +10 -0
- package/modern/LineChart/LineHighlightElement.js +78 -0
- package/modern/LineChart/LineHighlightPlot.js +102 -0
- package/modern/LineChart/LinePlot.js +23 -10
- package/modern/LineChart/MarkElement.js +12 -5
- package/modern/LineChart/MarkPlot.js +60 -13
- package/modern/LineChart/formatter.js +4 -3
- package/modern/LineChart/index.js +3 -1
- package/modern/PieChart/PieArc.js +26 -57
- package/modern/PieChart/PieArcLabel.js +43 -34
- package/modern/PieChart/PieArcLabelPlot.js +90 -0
- package/modern/PieChart/PieArcPlot.js +83 -0
- package/modern/PieChart/PieChart.js +59 -12
- package/modern/PieChart/PiePlot.js +76 -55
- package/modern/PieChart/dataTransform/transition.js +130 -0
- package/modern/PieChart/dataTransform/useTransformData.js +58 -0
- package/modern/ResponsiveChartContainer/index.js +3 -3
- package/modern/ScatterChart/Scatter.js +10 -0
- package/modern/ScatterChart/ScatterChart.js +40 -8
- package/modern/ScatterChart/ScatterPlot.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +32 -15
- package/modern/constants.js +1 -1
- package/modern/context/CartesianContextProvider.js +29 -13
- package/modern/context/DrawingProvider.js +8 -0
- package/modern/hooks/useChartDimensions.js +2 -0
- package/modern/hooks/useMounted.js +16 -0
- package/modern/hooks/useReducedMotion.js +27 -0
- package/modern/hooks/useTicks.js +15 -9
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +15 -70
- package/modern/internals/components/ChartsText.js +77 -0
- package/modern/internals/domUtils.js +113 -0
- package/modern/internals/geometry.js +36 -0
- package/package.json +9 -6
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
|
@@ -4,90 +4,30 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.AxisRoot = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _styles = require("@mui/material/styles");
|
|
10
10
|
var _axisClasses = require("../../ChartsAxis/axisClasses");
|
|
11
|
-
const AxisRoot = (0, _styles.styled)('g', {
|
|
11
|
+
const AxisRoot = exports.AxisRoot = (0, _styles.styled)('g', {
|
|
12
12
|
name: 'MuiChartsAxis',
|
|
13
13
|
slot: 'Root',
|
|
14
14
|
overridesResolver: (props, styles) => styles.root
|
|
15
|
-
})({
|
|
16
|
-
[`&.${_axisClasses.axisClasses.directionY}`]: {
|
|
17
|
-
[`.${_axisClasses.axisClasses.tickLabel}`]: {
|
|
18
|
-
dominantBaseline: 'middle'
|
|
19
|
-
},
|
|
20
|
-
[`.${_axisClasses.axisClasses.label}`]: {
|
|
21
|
-
dominantBaseline: 'auto',
|
|
22
|
-
textAnchor: 'middle'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
[`&.${_axisClasses.axisClasses.left}`]: {
|
|
26
|
-
[`.${_axisClasses.axisClasses.tickLabel}`]: {
|
|
27
|
-
dominantBaseline: 'central',
|
|
28
|
-
textAnchor: 'end'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
[`&.${_axisClasses.axisClasses.right}`]: {
|
|
32
|
-
[`.${_axisClasses.axisClasses.tickLabel}`]: {
|
|
33
|
-
dominantBaseline: 'central',
|
|
34
|
-
textAnchor: 'start'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
[`&.${_axisClasses.axisClasses.bottom}`]: {
|
|
38
|
-
[`.${_axisClasses.axisClasses.tickLabel}, .${_axisClasses.axisClasses.label}`]: {
|
|
39
|
-
dominantBaseline: 'hanging',
|
|
40
|
-
textAnchor: 'middle'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
[`&.${_axisClasses.axisClasses.top}`]: {
|
|
44
|
-
[`.${_axisClasses.axisClasses.tickLabel}, .${_axisClasses.axisClasses.label}`]: {
|
|
45
|
-
dominantBaseline: 'baseline',
|
|
46
|
-
textAnchor: 'middle'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
exports.AxisRoot = AxisRoot;
|
|
51
|
-
const ChartsLine = (0, _styles.styled)('line', {
|
|
52
|
-
name: 'MuiChartsAxis',
|
|
53
|
-
slot: 'Line',
|
|
54
|
-
overridesResolver: (props, styles) => styles.line
|
|
55
15
|
})(({
|
|
56
16
|
theme
|
|
57
17
|
}) => ({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const ChartsTickLabel = (0, _styles.styled)('text', {
|
|
75
|
-
name: 'MuiChartsAxis',
|
|
76
|
-
slot: 'TickLabel',
|
|
77
|
-
overridesResolver: (props, styles) => styles.tickLabel
|
|
78
|
-
})(({
|
|
79
|
-
theme
|
|
80
|
-
}) => (0, _extends2.default)({}, theme.typography.caption, {
|
|
81
|
-
fill: theme.palette.text.primary
|
|
82
|
-
}));
|
|
83
|
-
exports.ChartsTickLabel = ChartsTickLabel;
|
|
84
|
-
const ChartsLabel = (0, _styles.styled)('text', {
|
|
85
|
-
name: 'MuiChartsAxis',
|
|
86
|
-
slot: 'Label',
|
|
87
|
-
overridesResolver: (props, styles) => styles.label
|
|
88
|
-
})(({
|
|
89
|
-
theme
|
|
90
|
-
}) => (0, _extends2.default)({}, theme.typography.body1, {
|
|
91
|
-
fill: theme.palette.text.primary
|
|
92
|
-
}));
|
|
93
|
-
exports.ChartsLabel = ChartsLabel;
|
|
18
|
+
[`& .${_axisClasses.axisClasses.tickLabel}`]: (0, _extends2.default)({}, theme.typography.caption, {
|
|
19
|
+
fill: (theme.vars || theme).palette.text.primary
|
|
20
|
+
}),
|
|
21
|
+
[`& .${_axisClasses.axisClasses.label}`]: (0, _extends2.default)({}, theme.typography.body1, {
|
|
22
|
+
fill: (theme.vars || theme).palette.text.primary
|
|
23
|
+
}),
|
|
24
|
+
[`& .${_axisClasses.axisClasses.line}`]: {
|
|
25
|
+
stroke: (theme.vars || theme).palette.text.primary,
|
|
26
|
+
shapeRendering: 'crispEdges',
|
|
27
|
+
strokeWidth: 1
|
|
28
|
+
},
|
|
29
|
+
[`& .${_axisClasses.axisClasses.tick}`]: {
|
|
30
|
+
stroke: (theme.vars || theme).palette.text.primary,
|
|
31
|
+
shapeRendering: 'crispEdges'
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ChartsTextBaseline = 'hanging' | 'central' | 'auto';
|
|
3
|
+
export interface ChartsTextStyle extends React.CSSProperties {
|
|
4
|
+
angle?: number;
|
|
5
|
+
/**
|
|
6
|
+
* The text baseline
|
|
7
|
+
* @default 'central'
|
|
8
|
+
*/
|
|
9
|
+
dominantBaseline?: ChartsTextBaseline;
|
|
10
|
+
}
|
|
11
|
+
interface GetWordsByLinesParams {
|
|
12
|
+
/**
|
|
13
|
+
* Text displayed.
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* Style applied to text elements.
|
|
18
|
+
*/
|
|
19
|
+
style?: ChartsTextStyle;
|
|
20
|
+
/**
|
|
21
|
+
* If true, the line width is computed.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
needsComputation?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ChartsTextProps extends Omit<React.SVGTextElementAttributes<SVGTextElement>, 'width' | 'ref' | 'style' | 'dominantBaseline'>, GetWordsByLinesParams {
|
|
27
|
+
/**
|
|
28
|
+
* Height of a text line (in `em`).
|
|
29
|
+
*/
|
|
30
|
+
lineHeight?: number;
|
|
31
|
+
ownerState?: any;
|
|
32
|
+
}
|
|
33
|
+
export declare function getWordsByLines({ style, needsComputation, text }: GetWordsByLinesParams): any[];
|
|
34
|
+
export declare function ChartsText(props: ChartsTextProps): React.JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ChartsText = ChartsText;
|
|
8
|
+
exports.getWordsByLines = getWordsByLines;
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _domUtils = require("../domUtils");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const _excluded = ["x", "y", "style", "text", "ownerState"],
|
|
15
|
+
_excluded2 = ["angle", "textAnchor", "dominantBaseline"];
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
function getWordsByLines({
|
|
19
|
+
style,
|
|
20
|
+
needsComputation,
|
|
21
|
+
text
|
|
22
|
+
}) {
|
|
23
|
+
return text.split('\n').map(subText => (0, _extends2.default)({
|
|
24
|
+
text: subText
|
|
25
|
+
}, needsComputation ? (0, _domUtils.getStringSize)(subText, style) : {
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 0
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
function ChartsText(props) {
|
|
31
|
+
const {
|
|
32
|
+
x,
|
|
33
|
+
y,
|
|
34
|
+
style: styleProps,
|
|
35
|
+
text
|
|
36
|
+
} = props,
|
|
37
|
+
textProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
|
+
const _ref = styleProps ?? {},
|
|
39
|
+
{
|
|
40
|
+
angle,
|
|
41
|
+
textAnchor,
|
|
42
|
+
dominantBaseline
|
|
43
|
+
} = _ref,
|
|
44
|
+
style = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded2);
|
|
45
|
+
const wordsByLines = React.useMemo(() => getWordsByLines({
|
|
46
|
+
style,
|
|
47
|
+
needsComputation: text.includes('\n'),
|
|
48
|
+
text
|
|
49
|
+
}), [style, text]);
|
|
50
|
+
let startDy;
|
|
51
|
+
switch (dominantBaseline) {
|
|
52
|
+
case 'hanging':
|
|
53
|
+
startDy = 0;
|
|
54
|
+
break;
|
|
55
|
+
case 'central':
|
|
56
|
+
startDy = (wordsByLines.length - 1) / 2 * -wordsByLines[0].height;
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
startDy = (wordsByLines.length - 1) * -wordsByLines[0].height;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
const transforms = [];
|
|
63
|
+
// if (scaleToFit) {
|
|
64
|
+
// const lineWidth = wordsByLines[0].width;
|
|
65
|
+
// transforms.push(`scale(${(isNumber(width as number) ? (width as number) / lineWidth : 1) / lineWidth})`);
|
|
66
|
+
// }
|
|
67
|
+
if (angle) {
|
|
68
|
+
transforms.push(`rotate(${angle}, ${x}, ${y})`);
|
|
69
|
+
}
|
|
70
|
+
if (transforms.length) {
|
|
71
|
+
textProps.transform = transforms.join(' ');
|
|
72
|
+
}
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", (0, _extends2.default)({}, textProps, {
|
|
74
|
+
x: x,
|
|
75
|
+
y: y,
|
|
76
|
+
textAnchor: textAnchor,
|
|
77
|
+
dominantBaseline: dominantBaseline,
|
|
78
|
+
style: style,
|
|
79
|
+
children: wordsByLines.map((line, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("tspan", {
|
|
80
|
+
x: x,
|
|
81
|
+
dy: `${index === 0 ? startDy : wordsByLines[0].height}px`,
|
|
82
|
+
dominantBaseline: dominantBaseline // Propagated to fix Safari issue: https://github.com/mui/mui-x/issues/10808
|
|
83
|
+
,
|
|
84
|
+
children: line.text
|
|
85
|
+
}, index))
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
@@ -23,12 +23,16 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
23
23
|
innerRadius?: number | undefined;
|
|
24
24
|
outerRadius?: number | undefined;
|
|
25
25
|
cornerRadius?: number | undefined;
|
|
26
|
+
paddingAngle?: number | undefined;
|
|
27
|
+
color?: string | undefined;
|
|
26
28
|
} | undefined;
|
|
27
29
|
faded?: {
|
|
28
30
|
additionalRadius?: number | undefined;
|
|
29
31
|
innerRadius?: number | undefined;
|
|
30
32
|
outerRadius?: number | undefined;
|
|
31
33
|
cornerRadius?: number | undefined;
|
|
34
|
+
paddingAngle?: number | undefined;
|
|
35
|
+
color?: string | undefined;
|
|
32
36
|
} | undefined;
|
|
33
37
|
id?: string | undefined;
|
|
34
38
|
color?: string | undefined;
|
|
@@ -51,12 +55,15 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
51
55
|
stackOrder?: "reverse" | "none" | "appearance" | "ascending" | "descending" | "insideOut" | undefined;
|
|
52
56
|
} | {
|
|
53
57
|
type: "line";
|
|
54
|
-
data?: number[] | undefined;
|
|
58
|
+
data?: (number | null)[] | undefined;
|
|
55
59
|
dataKey?: string | undefined;
|
|
56
60
|
stack?: string | undefined;
|
|
57
61
|
area?: boolean | undefined;
|
|
58
62
|
label?: string | undefined;
|
|
59
63
|
curve?: import("../models/seriesType").CurveType | undefined;
|
|
64
|
+
showMark?: boolean | ((params: import("../models/seriesType").ShowMarkParams<number | Date>) => boolean) | undefined;
|
|
65
|
+
disableHighlight?: boolean | undefined;
|
|
66
|
+
connectNulls?: boolean | undefined;
|
|
60
67
|
id?: string | undefined;
|
|
61
68
|
color: string;
|
|
62
69
|
valueFormatter?: ((value: number) => string) | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param style React style object
|
|
4
|
+
* @returns CSS styling string
|
|
5
|
+
*/
|
|
6
|
+
export declare const getStyleString: (style: React.CSSProperties) => string;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param text The string to estimate
|
|
10
|
+
* @param style The style applied
|
|
11
|
+
* @returns width and height of the text
|
|
12
|
+
*/
|
|
13
|
+
export declare const getStringSize: (text: string | number, style?: React.CSSProperties) => any;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getStyleString = exports.getStringSize = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
// DOM utils taken from
|
|
10
|
+
// https://github.com/recharts/recharts/blob/master/src/util/DOMUtils.ts
|
|
11
|
+
|
|
12
|
+
const isSsr = () => !(typeof window !== 'undefined' && window.document && window.setTimeout);
|
|
13
|
+
const stringCache = {
|
|
14
|
+
widthCache: {},
|
|
15
|
+
cacheCount: 0
|
|
16
|
+
};
|
|
17
|
+
const MAX_CACHE_NUM = 2000;
|
|
18
|
+
const SPAN_STYLE = {
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
top: '-20000px',
|
|
21
|
+
left: 0,
|
|
22
|
+
padding: 0,
|
|
23
|
+
margin: 0,
|
|
24
|
+
border: 'none',
|
|
25
|
+
whiteSpace: 'pre'
|
|
26
|
+
};
|
|
27
|
+
const STYLE_LIST = ['minWidth', 'maxWidth', 'width', 'minHeight', 'maxHeight', 'height', 'top', 'left', 'fontSize', 'padding', 'margin', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom'];
|
|
28
|
+
const MEASUREMENT_SPAN_ID = 'mui_measurement_span';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param name CSS property name
|
|
33
|
+
* @param value
|
|
34
|
+
* @returns add 'px' for distance properties
|
|
35
|
+
*/
|
|
36
|
+
function autoCompleteStyle(name, value) {
|
|
37
|
+
if (STYLE_LIST.indexOf(name) >= 0 && value === +value) {
|
|
38
|
+
return `${value}px`;
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param text camelcase css property
|
|
46
|
+
* @returns css property
|
|
47
|
+
*/
|
|
48
|
+
function camelToMiddleLine(text) {
|
|
49
|
+
const strs = text.split('');
|
|
50
|
+
const formatStrs = strs.reduce((result, entry) => {
|
|
51
|
+
if (entry === entry.toUpperCase()) {
|
|
52
|
+
return [...result, '-', entry.toLowerCase()];
|
|
53
|
+
}
|
|
54
|
+
return [...result, entry];
|
|
55
|
+
}, []);
|
|
56
|
+
return formatStrs.join('');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param style React style object
|
|
62
|
+
* @returns CSS styling string
|
|
63
|
+
*/
|
|
64
|
+
const getStyleString = style => Object.keys(style).sort().reduce((result, s) => `${result}${camelToMiddleLine(s)}:${autoCompleteStyle(s, style[s])};`, '');
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param text The string to estimate
|
|
69
|
+
* @param style The style applied
|
|
70
|
+
* @returns width and height of the text
|
|
71
|
+
*/
|
|
72
|
+
exports.getStyleString = getStyleString;
|
|
73
|
+
const getStringSize = (text, style = {}) => {
|
|
74
|
+
if (text === undefined || text === null || isSsr()) {
|
|
75
|
+
return {
|
|
76
|
+
width: 0,
|
|
77
|
+
height: 0
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const str = `${text}`;
|
|
81
|
+
const styleString = getStyleString(style);
|
|
82
|
+
const cacheKey = `${str}-${styleString}`;
|
|
83
|
+
if (stringCache.widthCache[cacheKey]) {
|
|
84
|
+
return stringCache.widthCache[cacheKey];
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
|
|
88
|
+
if (measurementSpan === null) {
|
|
89
|
+
measurementSpan = document.createElement('span');
|
|
90
|
+
measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
|
|
91
|
+
measurementSpan.setAttribute('aria-hidden', 'true');
|
|
92
|
+
document.body.appendChild(measurementSpan);
|
|
93
|
+
}
|
|
94
|
+
// Need to use CSS Object Model (CSSOM) to be able to comply with Content Security Policy (CSP)
|
|
95
|
+
// https://en.wikipedia.org/wiki/Content_Security_Policy
|
|
96
|
+
const measurementSpanStyle = (0, _extends2.default)({}, SPAN_STYLE, style);
|
|
97
|
+
Object.keys(measurementSpanStyle).map(styleKey => {
|
|
98
|
+
measurementSpan.style[camelToMiddleLine(styleKey)] = autoCompleteStyle(styleKey, measurementSpanStyle[styleKey]);
|
|
99
|
+
return styleKey;
|
|
100
|
+
});
|
|
101
|
+
measurementSpan.textContent = str;
|
|
102
|
+
const rect = measurementSpan.getBoundingClientRect();
|
|
103
|
+
const result = {
|
|
104
|
+
width: rect.width,
|
|
105
|
+
height: rect.height
|
|
106
|
+
};
|
|
107
|
+
stringCache.widthCache[cacheKey] = result;
|
|
108
|
+
if (stringCache.cacheCount + 1 > MAX_CACHE_NUM) {
|
|
109
|
+
stringCache.cacheCount = 0;
|
|
110
|
+
stringCache.widthCache = {};
|
|
111
|
+
} else {
|
|
112
|
+
stringCache.cacheCount += 1;
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
} catch (e) {
|
|
116
|
+
return {
|
|
117
|
+
width: 0,
|
|
118
|
+
height: 0
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
exports.getStringSize = getStringSize;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the minimal translation along the x-axis to avoid overflow of a rectangle of a given width, height, and rotation.
|
|
3
|
+
* This assumes that all rectangles have the same height and angle between -90 and 90.
|
|
4
|
+
* Otherwise it would be problematic because you need the height/width of the next rectangle to do the correct computation.
|
|
5
|
+
* @param width the side along the x axis.
|
|
6
|
+
* @param height the side along the y axis.
|
|
7
|
+
* @param angle the rotation in degrees.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getMinXTranslation(width: number, height: number, angle?: number): number;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMinXTranslation = getMinXTranslation;
|
|
7
|
+
const ANGLE_APPROX = 5; // Angle (in deg) for which we approximate the rectangle as perfectly horizontal/vertical
|
|
8
|
+
|
|
9
|
+
let warnedOnce = false;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Return the minimal translation along the x-axis to avoid overflow of a rectangle of a given width, height, and rotation.
|
|
13
|
+
* This assumes that all rectangles have the same height and angle between -90 and 90.
|
|
14
|
+
* Otherwise it would be problematic because you need the height/width of the next rectangle to do the correct computation.
|
|
15
|
+
* @param width the side along the x axis.
|
|
16
|
+
* @param height the side along the y axis.
|
|
17
|
+
* @param angle the rotation in degrees.
|
|
18
|
+
*/
|
|
19
|
+
function getMinXTranslation(width, height, angle = 0) {
|
|
20
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
21
|
+
if (!warnedOnce && angle > 90 && angle < -90) {
|
|
22
|
+
warnedOnce = true;
|
|
23
|
+
console.warn([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`].join('\n'));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
|
|
27
|
+
|
|
28
|
+
if (standardAngle < ANGLE_APPROX) {
|
|
29
|
+
// It's nearly horizontal
|
|
30
|
+
return width;
|
|
31
|
+
}
|
|
32
|
+
if (standardAngle > 90 - ANGLE_APPROX) {
|
|
33
|
+
// It's nearly vertical
|
|
34
|
+
return height;
|
|
35
|
+
}
|
|
36
|
+
const radAngle = standardAngle * Math.PI / 180;
|
|
37
|
+
const angleSwich = Math.atan2(height, width);
|
|
38
|
+
if (radAngle < angleSwich) {
|
|
39
|
+
return width / Math.cos(radAngle);
|
|
40
|
+
}
|
|
41
|
+
return height / Math.sin(radAngle);
|
|
42
|
+
}
|
package/internals/stackSeries.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getStackingGroups = exports.StackOrder = exports.StackOffset = void 0;
|
|
7
7
|
var _d3Shape = require("d3-shape");
|
|
8
|
-
const StackOrder = {
|
|
8
|
+
const StackOrder = exports.StackOrder = {
|
|
9
9
|
/**
|
|
10
10
|
* Series order such that the earliest series (according to the maximum value) is at the bottom.
|
|
11
11
|
* */
|
|
@@ -31,8 +31,7 @@ const StackOrder = {
|
|
|
31
31
|
*/
|
|
32
32
|
reverse: _d3Shape.stackOrderReverse
|
|
33
33
|
};
|
|
34
|
-
exports.
|
|
35
|
-
const StackOffset = {
|
|
34
|
+
const StackOffset = exports.StackOffset = {
|
|
36
35
|
/**
|
|
37
36
|
* Applies a zero baseline and normalizes the values for each point such that the topline is always one.
|
|
38
37
|
* */
|
|
@@ -60,7 +59,6 @@ const StackOffset = {
|
|
|
60
59
|
* @param series the object of all bars series
|
|
61
60
|
* @returns an array of groups, including the ids, the stacking order, and the stacking offset.
|
|
62
61
|
*/
|
|
63
|
-
exports.StackOffset = StackOffset;
|
|
64
62
|
const getStackingGroups = params => {
|
|
65
63
|
const {
|
|
66
64
|
series,
|
|
@@ -13,6 +13,17 @@ import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
|
|
|
13
13
|
import { ChartsClipPath } from '../ChartsClipPath';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
/**
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [Bars](https://mui.com/x/react-charts/bars/)
|
|
20
|
+
* - [Bar demonstration](https://mui.com/x/react-charts/bar-demo/)
|
|
21
|
+
* - [Stacking](https://mui.com/x/react-charts/stacking/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [BarChart API](https://mui.com/x/api/charts/bar-chart/)
|
|
26
|
+
*/
|
|
16
27
|
var BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
17
28
|
var xAxis = props.xAxis,
|
|
18
29
|
yAxis = props.yAxis,
|
|
@@ -31,6 +42,7 @@ var BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
31
42
|
leftAxis = props.leftAxis,
|
|
32
43
|
rightAxis = props.rightAxis,
|
|
33
44
|
bottomAxis = props.bottomAxis,
|
|
45
|
+
skipAnimation = props.skipAnimation,
|
|
34
46
|
children = props.children,
|
|
35
47
|
slots = props.slots,
|
|
36
48
|
slotProps = props.slotProps;
|
|
@@ -81,7 +93,8 @@ var BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
81
93
|
clipPath: "url(#".concat(clipPathId, ")"),
|
|
82
94
|
children: /*#__PURE__*/_jsx(BarPlot, {
|
|
83
95
|
slots: slots,
|
|
84
|
-
slotProps: slotProps
|
|
96
|
+
slotProps: slotProps,
|
|
97
|
+
skipAnimation: skipAnimation
|
|
85
98
|
})
|
|
86
99
|
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
87
100
|
topAxis: topAxis,
|
|
@@ -123,11 +136,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
123
136
|
fill: PropTypes.string,
|
|
124
137
|
label: PropTypes.string,
|
|
125
138
|
labelFontSize: PropTypes.number,
|
|
139
|
+
labelStyle: PropTypes.object,
|
|
126
140
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
127
141
|
slotProps: PropTypes.object,
|
|
128
142
|
slots: PropTypes.object,
|
|
129
143
|
stroke: PropTypes.string,
|
|
130
144
|
tickFontSize: PropTypes.number,
|
|
145
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
146
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
147
|
+
tickLabelStyle: PropTypes.object,
|
|
131
148
|
tickMaxStep: PropTypes.number,
|
|
132
149
|
tickMinStep: PropTypes.number,
|
|
133
150
|
tickNumber: PropTypes.number,
|
|
@@ -157,33 +174,33 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
157
174
|
fill: PropTypes.string,
|
|
158
175
|
label: PropTypes.string,
|
|
159
176
|
labelFontSize: PropTypes.number,
|
|
177
|
+
labelStyle: PropTypes.object,
|
|
160
178
|
position: PropTypes.oneOf(['left', 'right']),
|
|
161
179
|
slotProps: PropTypes.object,
|
|
162
180
|
slots: PropTypes.object,
|
|
163
181
|
stroke: PropTypes.string,
|
|
164
182
|
tickFontSize: PropTypes.number,
|
|
183
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
184
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
185
|
+
tickLabelStyle: PropTypes.object,
|
|
165
186
|
tickMaxStep: PropTypes.number,
|
|
166
187
|
tickMinStep: PropTypes.number,
|
|
167
188
|
tickNumber: PropTypes.number,
|
|
168
189
|
tickSize: PropTypes.number
|
|
169
190
|
}), PropTypes.string]),
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
193
|
+
*/
|
|
170
194
|
legend: PropTypes.shape({
|
|
171
195
|
classes: PropTypes.object,
|
|
172
196
|
direction: PropTypes.oneOf(['column', 'row']),
|
|
173
197
|
hidden: PropTypes.bool,
|
|
174
|
-
itemWidth: PropTypes.number,
|
|
175
|
-
markSize: PropTypes.number,
|
|
176
|
-
offset: PropTypes.shape({
|
|
177
|
-
x: PropTypes.number,
|
|
178
|
-
y: PropTypes.number
|
|
179
|
-
}),
|
|
180
198
|
position: PropTypes.shape({
|
|
181
199
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
182
200
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
183
201
|
}),
|
|
184
202
|
slotProps: PropTypes.object,
|
|
185
|
-
slots: PropTypes.object
|
|
186
|
-
spacing: PropTypes.number
|
|
203
|
+
slots: PropTypes.object
|
|
187
204
|
}),
|
|
188
205
|
margin: PropTypes.shape({
|
|
189
206
|
bottom: PropTypes.number,
|
|
@@ -204,11 +221,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
204
221
|
fill: PropTypes.string,
|
|
205
222
|
label: PropTypes.string,
|
|
206
223
|
labelFontSize: PropTypes.number,
|
|
224
|
+
labelStyle: PropTypes.object,
|
|
207
225
|
position: PropTypes.oneOf(['left', 'right']),
|
|
208
226
|
slotProps: PropTypes.object,
|
|
209
227
|
slots: PropTypes.object,
|
|
210
228
|
stroke: PropTypes.string,
|
|
211
229
|
tickFontSize: PropTypes.number,
|
|
230
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
231
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
232
|
+
tickLabelStyle: PropTypes.object,
|
|
212
233
|
tickMaxStep: PropTypes.number,
|
|
213
234
|
tickMinStep: PropTypes.number,
|
|
214
235
|
tickNumber: PropTypes.number,
|
|
@@ -233,6 +254,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
233
254
|
xAxisKey: PropTypes.string,
|
|
234
255
|
yAxisKey: PropTypes.string
|
|
235
256
|
})).isRequired,
|
|
257
|
+
/**
|
|
258
|
+
* If `true`, animations are skiped.
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
skipAnimation: PropTypes.bool,
|
|
236
262
|
/**
|
|
237
263
|
* The props used for each component slot.
|
|
238
264
|
* @default {}
|
|
@@ -249,6 +275,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
249
275
|
axisContent: PropTypes.elementType,
|
|
250
276
|
classes: PropTypes.object,
|
|
251
277
|
itemContent: PropTypes.elementType,
|
|
278
|
+
slotProps: PropTypes.object,
|
|
279
|
+
slots: PropTypes.object,
|
|
252
280
|
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
253
281
|
}),
|
|
254
282
|
/**
|
|
@@ -264,11 +292,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
264
292
|
fill: PropTypes.string,
|
|
265
293
|
label: PropTypes.string,
|
|
266
294
|
labelFontSize: PropTypes.number,
|
|
295
|
+
labelStyle: PropTypes.object,
|
|
267
296
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
268
297
|
slotProps: PropTypes.object,
|
|
269
298
|
slots: PropTypes.object,
|
|
270
299
|
stroke: PropTypes.string,
|
|
271
300
|
tickFontSize: PropTypes.number,
|
|
301
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
302
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
303
|
+
tickLabelStyle: PropTypes.object,
|
|
272
304
|
tickMaxStep: PropTypes.number,
|
|
273
305
|
tickMinStep: PropTypes.number,
|
|
274
306
|
tickNumber: PropTypes.number,
|
|
@@ -293,6 +325,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
293
325
|
id: PropTypes.string,
|
|
294
326
|
label: PropTypes.string,
|
|
295
327
|
labelFontSize: PropTypes.number,
|
|
328
|
+
labelStyle: PropTypes.object,
|
|
296
329
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
297
330
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
298
331
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
@@ -301,6 +334,9 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
301
334
|
slots: PropTypes.object,
|
|
302
335
|
stroke: PropTypes.string,
|
|
303
336
|
tickFontSize: PropTypes.number,
|
|
337
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
338
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
339
|
+
tickLabelStyle: PropTypes.object,
|
|
304
340
|
tickMaxStep: PropTypes.number,
|
|
305
341
|
tickMinStep: PropTypes.number,
|
|
306
342
|
tickNumber: PropTypes.number,
|
|
@@ -319,6 +355,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
319
355
|
id: PropTypes.string,
|
|
320
356
|
label: PropTypes.string,
|
|
321
357
|
labelFontSize: PropTypes.number,
|
|
358
|
+
labelStyle: PropTypes.object,
|
|
322
359
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
323
360
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
324
361
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
@@ -327,6 +364,9 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
327
364
|
slots: PropTypes.object,
|
|
328
365
|
stroke: PropTypes.string,
|
|
329
366
|
tickFontSize: PropTypes.number,
|
|
367
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
368
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
369
|
+
tickLabelStyle: PropTypes.object,
|
|
330
370
|
tickMaxStep: PropTypes.number,
|
|
331
371
|
tickMinStep: PropTypes.number,
|
|
332
372
|
tickNumber: PropTypes.number,
|