@mui/x-charts 6.0.0-alpha.14 → 6.0.0-alpha.16
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 +16 -2
- package/BarChart/BarChart.js +49 -11
- package/BarChart/BarElement.d.ts +1318 -3
- package/BarChart/BarElement.js +10 -8
- package/BarChart/BarPlot.d.ts +17 -1
- package/BarChart/BarPlot.js +152 -66
- package/CHANGELOG.md +169 -0
- package/ChartContainer/index.js +5 -2
- package/ChartsAxis/ChartsAxis.js +18 -2
- package/ChartsAxis/axisClasses.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/ChartsClipPath/ChartsClipPath.js +2 -2
- package/ChartsLegend/ChartsLegend.d.ts +44 -24
- package/ChartsLegend/ChartsLegend.js +191 -145
- package/ChartsLegend/utils.d.ts +1 -6
- package/ChartsSurface.js +5 -13
- package/ChartsTooltip/ChartsAxisTooltipContent.js +2 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +151 -40
- package/ChartsYAxis/ChartsYAxis.js +76 -33
- package/LineChart/AreaElement.d.ts +10 -0
- package/LineChart/AreaElement.js +12 -2
- package/LineChart/AreaPlot.d.ts +11 -0
- package/LineChart/AreaPlot.js +13 -2
- package/LineChart/LineChart.d.ts +13 -0
- package/LineChart/LineChart.js +40 -10
- package/LineChart/LineElement.d.ts +10 -0
- package/LineChart/LineElement.js +12 -2
- package/LineChart/LineHighlightElement.d.ts +10 -0
- package/LineChart/LineHighlightElement.js +12 -2
- package/LineChart/LineHighlightPlot.d.ts +10 -0
- package/LineChart/LineHighlightPlot.js +12 -2
- package/LineChart/LinePlot.d.ts +10 -0
- package/LineChart/LinePlot.js +12 -2
- package/LineChart/MarkElement.d.ts +10 -0
- package/LineChart/MarkElement.js +12 -2
- package/LineChart/MarkPlot.d.ts +10 -0
- package/LineChart/MarkPlot.js +12 -2
- package/PieChart/PieArc.js +2 -2
- package/PieChart/PieArcLabel.js +2 -2
- package/PieChart/PieChart.d.ts +13 -0
- package/PieChart/PieChart.js +41 -10
- package/PieChart/PiePlot.d.ts +10 -0
- package/PieChart/PiePlot.js +12 -2
- package/ResponsiveChartContainer/index.js +4 -4
- package/ScatterChart/Scatter.d.ts +10 -0
- package/ScatterChart/Scatter.js +12 -2
- package/ScatterChart/ScatterChart.d.ts +13 -0
- package/ScatterChart/ScatterChart.js +40 -10
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +12 -2
- package/SparkLineChart/SparkLineChart.d.ts +9 -0
- package/SparkLineChart/SparkLineChart.js +16 -2
- package/constants.js +1 -1
- package/context/CartesianContextProvider.js +20 -12
- package/context/DrawingProvider.d.ts +2 -0
- package/context/DrawingProvider.js +4 -2
- package/context/HighlightProvider.js +2 -2
- package/context/InteractionProvider.js +2 -2
- package/context/SeriesContextProvider.js +2 -2
- package/esm/BarChart/BarChart.js +47 -9
- package/esm/BarChart/BarElement.js +7 -4
- package/esm/BarChart/BarPlot.js +152 -67
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +16 -0
- package/esm/ChartsLegend/ChartsLegend.js +188 -142
- package/esm/ChartsSurface.js +3 -11
- package/esm/ChartsXAxis/ChartsXAxis.js +148 -37
- package/esm/ChartsYAxis/ChartsYAxis.js +73 -30
- package/esm/LineChart/AreaElement.js +10 -0
- package/esm/LineChart/AreaPlot.js +11 -0
- package/esm/LineChart/LineChart.js +38 -8
- package/esm/LineChart/LineElement.js +10 -0
- package/esm/LineChart/LineHighlightElement.js +10 -0
- package/esm/LineChart/LineHighlightPlot.js +10 -0
- package/esm/LineChart/LinePlot.js +10 -0
- package/esm/LineChart/MarkElement.js +10 -0
- package/esm/LineChart/MarkPlot.js +10 -0
- package/esm/PieChart/PieChart.js +39 -8
- package/esm/PieChart/PiePlot.js +10 -0
- package/esm/ResponsiveChartContainer/index.js +2 -2
- package/esm/ScatterChart/Scatter.js +10 -0
- package/esm/ScatterChart/ScatterChart.js +38 -8
- package/esm/ScatterChart/ScatterPlot.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +14 -0
- package/esm/constants.js +1 -1
- package/esm/context/CartesianContextProvider.js +19 -11
- package/esm/context/DrawingProvider.js +2 -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 +75 -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 +4 -2
- 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 +18 -12
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -4
- package/internals/components/AxisSharedComponents.js +16 -71
- package/internals/components/ChartsText.d.ts +35 -0
- package/internals/components/ChartsText.js +85 -0
- package/internals/defaultizeColor.d.ts +1 -1
- 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/legacy/BarChart/BarChart.js +47 -9
- package/legacy/BarChart/BarElement.js +6 -3
- package/legacy/BarChart/BarPlot.js +151 -63
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +16 -0
- package/legacy/ChartsLegend/ChartsLegend.js +203 -140
- package/legacy/ChartsSurface.js +2 -11
- package/legacy/ChartsXAxis/ChartsXAxis.js +152 -39
- package/legacy/ChartsYAxis/ChartsYAxis.js +73 -30
- package/legacy/LineChart/AreaElement.js +10 -0
- package/legacy/LineChart/AreaPlot.js +11 -0
- package/legacy/LineChart/LineChart.js +38 -8
- package/legacy/LineChart/LineElement.js +10 -0
- package/legacy/LineChart/LineHighlightElement.js +10 -0
- package/legacy/LineChart/LineHighlightPlot.js +10 -0
- package/legacy/LineChart/LinePlot.js +10 -0
- package/legacy/LineChart/MarkElement.js +10 -0
- package/legacy/LineChart/MarkPlot.js +10 -0
- package/legacy/PieChart/PieChart.js +39 -8
- package/legacy/PieChart/PiePlot.js +10 -0
- package/legacy/ResponsiveChartContainer/index.js +2 -2
- package/legacy/ScatterChart/Scatter.js +10 -0
- package/legacy/ScatterChart/ScatterChart.js +38 -8
- package/legacy/ScatterChart/ScatterPlot.js +10 -0
- package/legacy/SparkLineChart/SparkLineChart.js +14 -0
- package/legacy/constants.js +1 -1
- package/legacy/context/CartesianContextProvider.js +19 -11
- package/legacy/context/DrawingProvider.js +2 -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 +9 -63
- package/legacy/internals/components/ChartsText.js +77 -0
- package/legacy/internals/domUtils.js +121 -0
- package/legacy/internals/geometry.js +37 -0
- package/models/axis.d.ts +25 -7
- package/models/layout.d.ts +7 -6
- package/models/seriesType/line.d.ts +2 -2
- package/modern/BarChart/BarChart.js +47 -9
- package/modern/BarChart/BarElement.js +7 -4
- package/modern/BarChart/BarPlot.js +149 -65
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +16 -0
- package/modern/ChartsLegend/ChartsLegend.js +188 -142
- package/modern/ChartsSurface.js +3 -11
- package/modern/ChartsXAxis/ChartsXAxis.js +148 -37
- package/modern/ChartsYAxis/ChartsYAxis.js +73 -30
- package/modern/LineChart/AreaElement.js +10 -0
- package/modern/LineChart/AreaPlot.js +11 -0
- package/modern/LineChart/LineChart.js +38 -8
- package/modern/LineChart/LineElement.js +10 -0
- package/modern/LineChart/LineHighlightElement.js +10 -0
- package/modern/LineChart/LineHighlightPlot.js +10 -0
- package/modern/LineChart/LinePlot.js +10 -0
- package/modern/LineChart/MarkElement.js +10 -0
- package/modern/LineChart/MarkPlot.js +10 -0
- package/modern/PieChart/PieChart.js +39 -8
- package/modern/PieChart/PiePlot.js +10 -0
- package/modern/ResponsiveChartContainer/index.js +2 -2
- package/modern/ScatterChart/Scatter.js +10 -0
- package/modern/ScatterChart/ScatterChart.js +38 -8
- package/modern/ScatterChart/ScatterPlot.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +14 -0
- package/modern/constants.js +1 -1
- package/modern/context/CartesianContextProvider.js +19 -11
- package/modern/context/DrawingProvider.js +2 -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 +75 -0
- package/modern/internals/domUtils.js +113 -0
- package/modern/internals/geometry.js +36 -0
- package/package.json +5 -3
package/ChartsTooltip/utils.js
CHANGED
|
@@ -8,8 +8,8 @@ exports.getTootipHasData = getTootipHasData;
|
|
|
8
8
|
exports.useMouseTracker = useMouseTracker;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
13
|
function generateVirtualElement(mousePosition) {
|
|
14
14
|
if (mousePosition === null) {
|
|
15
15
|
return {
|
|
@@ -9,17 +9,21 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _utils = require("@mui/utils");
|
|
12
|
+
var _utils = require("@mui/base/utils");
|
|
13
|
+
var _utils2 = require("@mui/utils");
|
|
13
14
|
var _styles = require("@mui/material/styles");
|
|
14
15
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
15
16
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
16
17
|
var _useTicks = _interopRequireDefault(require("../hooks/useTicks"));
|
|
17
18
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
18
19
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
20
|
+
var _ChartsText = require("../internals/components/ChartsText");
|
|
21
|
+
var _geometry = require("../internals/geometry");
|
|
22
|
+
var _useMounted = require("../hooks/useMounted");
|
|
19
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["scale", "
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
24
|
+
const _excluded = ["scale", "tickNumber"];
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
23
27
|
const useUtilityClasses = ownerState => {
|
|
24
28
|
const {
|
|
25
29
|
classes,
|
|
@@ -33,14 +37,66 @@ const useUtilityClasses = ownerState => {
|
|
|
33
37
|
tickLabel: ['tickLabel'],
|
|
34
38
|
label: ['label']
|
|
35
39
|
};
|
|
36
|
-
return (0,
|
|
40
|
+
return (0, _utils2.unstable_composeClasses)(slots, _axisClasses.getAxisUtilityClass, classes);
|
|
37
41
|
};
|
|
42
|
+
function addLabelDimension(xTicks, {
|
|
43
|
+
tickLabelStyle: style,
|
|
44
|
+
tickLabelInterval,
|
|
45
|
+
isMounted
|
|
46
|
+
}) {
|
|
47
|
+
const withDimension = xTicks.map(tick => {
|
|
48
|
+
if (!isMounted || tick.formattedValue === undefined) {
|
|
49
|
+
return (0, _extends2.default)({}, tick, {
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const tickSizes = (0, _ChartsText.getWordsByLines)({
|
|
55
|
+
style,
|
|
56
|
+
needsComputation: true,
|
|
57
|
+
text: tick.formattedValue
|
|
58
|
+
});
|
|
59
|
+
return (0, _extends2.default)({}, tick, {
|
|
60
|
+
width: Math.max(...tickSizes.map(size => size.width)),
|
|
61
|
+
height: Math.max(tickSizes.length * tickSizes[0].height)
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
if (typeof tickLabelInterval === 'function') {
|
|
65
|
+
return withDimension.map((item, index) => (0, _extends2.default)({}, item, {
|
|
66
|
+
skipLabel: !tickLabelInterval(item.value, index)
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Filter label to avoid overlap
|
|
71
|
+
let textStart = 0;
|
|
72
|
+
let textEnd = 0;
|
|
73
|
+
return withDimension.map((item, labelIndex) => {
|
|
74
|
+
const {
|
|
75
|
+
width,
|
|
76
|
+
offset,
|
|
77
|
+
labelOffset,
|
|
78
|
+
height
|
|
79
|
+
} = item;
|
|
80
|
+
const distance = (0, _geometry.getMinXTranslation)(width, height, style?.angle);
|
|
81
|
+
const textPosition = offset + labelOffset;
|
|
82
|
+
const gapRatio = 1.2; // Ratio applied to the minimal distance to add some margin.
|
|
83
|
+
|
|
84
|
+
textStart = textPosition - gapRatio * distance / 2;
|
|
85
|
+
if (labelIndex > 0 && textStart < textEnd) {
|
|
86
|
+
// Except for the first label, we skip all label that overlap with the last accepted.
|
|
87
|
+
// Notice that the early return prevents `textEnd` from being updated.
|
|
88
|
+
return (0, _extends2.default)({}, item, {
|
|
89
|
+
skipLabel: true
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
textEnd = textPosition + gapRatio * distance / 2;
|
|
93
|
+
return item;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
38
96
|
const defaultProps = {
|
|
39
97
|
position: 'bottom',
|
|
40
98
|
disableLine: false,
|
|
41
99
|
disableTicks: false,
|
|
42
|
-
tickFontSize: 12,
|
|
43
|
-
labelFontSize: 14,
|
|
44
100
|
tickSize: 6
|
|
45
101
|
};
|
|
46
102
|
function ChartsXAxis(inProps) {
|
|
@@ -54,23 +110,28 @@ function ChartsXAxis(inProps) {
|
|
|
54
110
|
xAxis: {
|
|
55
111
|
[_props$axisId]: {
|
|
56
112
|
scale: xScale,
|
|
57
|
-
|
|
113
|
+
tickNumber
|
|
58
114
|
}
|
|
59
115
|
}
|
|
60
116
|
} = _React$useContext,
|
|
61
117
|
settings = (0, _objectWithoutPropertiesLoose2.default)(_React$useContext.xAxis[_props$axisId], _excluded);
|
|
118
|
+
const isMounted = (0, _useMounted.useMounted)();
|
|
62
119
|
const defaultizedProps = (0, _extends2.default)({}, defaultProps, settings, props);
|
|
63
120
|
const {
|
|
64
121
|
position,
|
|
65
122
|
disableLine,
|
|
66
123
|
disableTicks,
|
|
67
|
-
|
|
124
|
+
tickLabelStyle,
|
|
68
125
|
label,
|
|
126
|
+
labelStyle,
|
|
127
|
+
tickFontSize,
|
|
69
128
|
labelFontSize,
|
|
70
129
|
tickSize: tickSizeProp,
|
|
71
130
|
valueFormatter,
|
|
72
131
|
slots,
|
|
73
|
-
slotProps
|
|
132
|
+
slotProps,
|
|
133
|
+
tickInterval,
|
|
134
|
+
tickLabelInterval
|
|
74
135
|
} = defaultizedProps;
|
|
75
136
|
const theme = (0, _styles.useTheme)();
|
|
76
137
|
const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
|
|
@@ -83,20 +144,52 @@ function ChartsXAxis(inProps) {
|
|
|
83
144
|
height
|
|
84
145
|
} = React.useContext(_DrawingProvider.DrawingContext);
|
|
85
146
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
147
|
+
const positionSign = position === 'bottom' ? 1 : -1;
|
|
148
|
+
const Line = slots?.axisLine ?? 'line';
|
|
149
|
+
const Tick = slots?.axisTick ?? 'line';
|
|
150
|
+
const TickLabel = slots?.axisTickLabel ?? _ChartsText.ChartsText;
|
|
151
|
+
const Label = slots?.axisLabel ?? _ChartsText.ChartsText;
|
|
152
|
+
const axisTickLabelProps = (0, _utils.useSlotProps)({
|
|
153
|
+
elementType: TickLabel,
|
|
154
|
+
externalSlotProps: slotProps?.axisTickLabel,
|
|
155
|
+
additionalProps: {
|
|
156
|
+
style: (0, _extends2.default)({
|
|
157
|
+
textAnchor: 'middle',
|
|
158
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto',
|
|
159
|
+
fontSize: tickFontSize ?? 12
|
|
160
|
+
}, tickLabelStyle),
|
|
161
|
+
className: classes.tickLabel
|
|
162
|
+
},
|
|
163
|
+
className: classes.tickLabel,
|
|
164
|
+
ownerState: {}
|
|
165
|
+
});
|
|
86
166
|
const xTicks = (0, _useTicks.default)({
|
|
87
167
|
scale: xScale,
|
|
88
|
-
|
|
89
|
-
valueFormatter
|
|
168
|
+
tickNumber,
|
|
169
|
+
valueFormatter,
|
|
170
|
+
tickInterval
|
|
171
|
+
});
|
|
172
|
+
const xTicksWithDimension = addLabelDimension(xTicks, {
|
|
173
|
+
tickLabelStyle: axisTickLabelProps.style,
|
|
174
|
+
tickLabelInterval,
|
|
175
|
+
isMounted
|
|
90
176
|
});
|
|
91
|
-
const positionSigne = position === 'bottom' ? 1 : -1;
|
|
92
177
|
const labelRefPoint = {
|
|
93
178
|
x: left + width / 2,
|
|
94
|
-
y:
|
|
179
|
+
y: positionSign * (tickSize + 22)
|
|
95
180
|
};
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
181
|
+
const axisLabelProps = (0, _utils.useSlotProps)({
|
|
182
|
+
elementType: Label,
|
|
183
|
+
externalSlotProps: slotProps?.axisLabel,
|
|
184
|
+
additionalProps: {
|
|
185
|
+
style: (0, _extends2.default)({
|
|
186
|
+
fontSize: labelFontSize ?? 14,
|
|
187
|
+
textAnchor: 'middle',
|
|
188
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
189
|
+
}, labelStyle)
|
|
190
|
+
},
|
|
191
|
+
ownerState: {}
|
|
192
|
+
});
|
|
100
193
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
|
|
101
194
|
transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
|
|
102
195
|
className: classes.root,
|
|
@@ -104,40 +197,33 @@ function ChartsXAxis(inProps) {
|
|
|
104
197
|
x1: xScale.range()[0],
|
|
105
198
|
x2: xScale.range()[1],
|
|
106
199
|
className: classes.line
|
|
107
|
-
}, slotProps?.axisLine)),
|
|
200
|
+
}, slotProps?.axisLine)), xTicksWithDimension.map(({
|
|
108
201
|
formattedValue,
|
|
109
202
|
offset,
|
|
110
|
-
labelOffset
|
|
203
|
+
labelOffset,
|
|
204
|
+
skipLabel
|
|
111
205
|
}, index) => {
|
|
112
206
|
const xTickLabel = labelOffset ?? 0;
|
|
113
|
-
const yTickLabel =
|
|
207
|
+
const yTickLabel = positionSign * (tickSize + 3);
|
|
114
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
115
209
|
transform: `translate(${offset}, 0)`,
|
|
116
210
|
className: classes.tickContainer,
|
|
117
211
|
children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
|
|
118
|
-
y2:
|
|
212
|
+
y2: positionSign * tickSize,
|
|
119
213
|
className: classes.tick
|
|
120
|
-
}, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
|
|
214
|
+
}, slotProps?.axisTick)), formattedValue !== undefined && !skipLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
|
|
121
215
|
x: xTickLabel,
|
|
122
|
-
y: yTickLabel
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
fontSize: tickFontSize
|
|
126
|
-
},
|
|
127
|
-
className: classes.tickLabel
|
|
128
|
-
}, slotProps?.axisTickLabel, {
|
|
129
|
-
children: formattedValue
|
|
216
|
+
y: yTickLabel
|
|
217
|
+
}, axisTickLabelProps, {
|
|
218
|
+
text: formattedValue.toString()
|
|
130
219
|
}))]
|
|
131
220
|
}, index);
|
|
132
|
-
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}, slotProps?.axisLabel, {
|
|
139
|
-
children: label
|
|
140
|
-
}))]
|
|
221
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
222
|
+
className: classes.label,
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
|
|
224
|
+
text: label
|
|
225
|
+
}))
|
|
226
|
+
})]
|
|
141
227
|
});
|
|
142
228
|
}
|
|
143
229
|
process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
@@ -175,8 +261,13 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
175
261
|
/**
|
|
176
262
|
* The font size of the axis label.
|
|
177
263
|
* @default 14
|
|
264
|
+
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
178
265
|
*/
|
|
179
266
|
labelFontSize: _propTypes.default.number,
|
|
267
|
+
/**
|
|
268
|
+
* The style applied to the axis label.
|
|
269
|
+
*/
|
|
270
|
+
labelStyle: _propTypes.default.object,
|
|
180
271
|
/**
|
|
181
272
|
* Position of the axis.
|
|
182
273
|
*/
|
|
@@ -199,8 +290,28 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
199
290
|
/**
|
|
200
291
|
* The font size of the axis ticks text.
|
|
201
292
|
* @default 12
|
|
293
|
+
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
202
294
|
*/
|
|
203
295
|
tickFontSize: _propTypes.default.number,
|
|
296
|
+
/**
|
|
297
|
+
* Defines which ticks are displayed. Its value can be:
|
|
298
|
+
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
|
|
299
|
+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
|
|
300
|
+
* - an array containing the values where ticks should be displayed.
|
|
301
|
+
* @default 'auto'
|
|
302
|
+
*/
|
|
303
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
304
|
+
/**
|
|
305
|
+
* Defines which ticks get its label displayed. Its value can be:
|
|
306
|
+
* - 'auto' In such case, labels are displayed if they do not overlap with the previous one.
|
|
307
|
+
* - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones.
|
|
308
|
+
* @default 'auto'
|
|
309
|
+
*/
|
|
310
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
311
|
+
/**
|
|
312
|
+
* The style applied to ticks text.
|
|
313
|
+
*/
|
|
314
|
+
tickLabelStyle: _propTypes.default.object,
|
|
204
315
|
/**
|
|
205
316
|
* Maximal step between two ticks.
|
|
206
317
|
* When using time data, the value is assumed to be in ms.
|
|
@@ -9,17 +9,19 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _utils = require("@mui/utils");
|
|
12
|
+
var _utils = require("@mui/base/utils");
|
|
13
|
+
var _utils2 = require("@mui/utils");
|
|
13
14
|
var _styles = require("@mui/material/styles");
|
|
14
15
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
15
16
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
16
17
|
var _useTicks = _interopRequireDefault(require("../hooks/useTicks"));
|
|
17
18
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
19
|
+
var _ChartsText = require("../internals/components/ChartsText");
|
|
18
20
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
19
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["scale", "
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
22
|
+
const _excluded = ["scale", "tickNumber"];
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
23
25
|
const useUtilityClasses = ownerState => {
|
|
24
26
|
const {
|
|
25
27
|
classes,
|
|
@@ -33,7 +35,7 @@ const useUtilityClasses = ownerState => {
|
|
|
33
35
|
tickLabel: ['tickLabel'],
|
|
34
36
|
label: ['label']
|
|
35
37
|
};
|
|
36
|
-
return (0,
|
|
38
|
+
return (0, _utils2.unstable_composeClasses)(slots, _axisClasses.getAxisUtilityClass, classes);
|
|
37
39
|
};
|
|
38
40
|
const defaultProps = {
|
|
39
41
|
position: 'left',
|
|
@@ -54,7 +56,7 @@ function ChartsYAxis(inProps) {
|
|
|
54
56
|
yAxis: {
|
|
55
57
|
[_props$axisId]: {
|
|
56
58
|
scale: yScale,
|
|
57
|
-
|
|
59
|
+
tickNumber
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
} = _React$useContext,
|
|
@@ -85,18 +87,44 @@ function ChartsYAxis(inProps) {
|
|
|
85
87
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
86
88
|
const yTicks = (0, _useTicks.default)({
|
|
87
89
|
scale: yScale,
|
|
88
|
-
|
|
90
|
+
tickNumber,
|
|
89
91
|
valueFormatter
|
|
90
92
|
});
|
|
91
|
-
const
|
|
93
|
+
const positionSign = position === 'right' ? 1 : -1;
|
|
92
94
|
const labelRefPoint = {
|
|
93
|
-
x:
|
|
95
|
+
x: positionSign * (tickFontSize + tickSize + 10),
|
|
94
96
|
y: top + height / 2
|
|
95
97
|
};
|
|
96
|
-
const Line = slots?.axisLine ??
|
|
97
|
-
const Tick = slots?.axisTick ??
|
|
98
|
-
const TickLabel = slots?.axisTickLabel ??
|
|
99
|
-
const Label = slots?.axisLabel ??
|
|
98
|
+
const Line = slots?.axisLine ?? 'line';
|
|
99
|
+
const Tick = slots?.axisTick ?? 'line';
|
|
100
|
+
const TickLabel = slots?.axisTickLabel ?? _ChartsText.ChartsText;
|
|
101
|
+
const Label = slots?.axisLabel ?? _ChartsText.ChartsText;
|
|
102
|
+
const axisTickLabelProps = (0, _utils.useSlotProps)({
|
|
103
|
+
elementType: TickLabel,
|
|
104
|
+
externalSlotProps: slotProps?.axisTickLabel,
|
|
105
|
+
additionalProps: {
|
|
106
|
+
style: {
|
|
107
|
+
fontSize: tickFontSize,
|
|
108
|
+
textAnchor: position === 'right' ? 'start' : 'end',
|
|
109
|
+
dominantBaseline: 'central'
|
|
110
|
+
},
|
|
111
|
+
className: classes.tickLabel
|
|
112
|
+
},
|
|
113
|
+
ownerState: {}
|
|
114
|
+
});
|
|
115
|
+
const axisLabelProps = (0, _utils.useSlotProps)({
|
|
116
|
+
elementType: Label,
|
|
117
|
+
externalSlotProps: slotProps?.axisLabel,
|
|
118
|
+
additionalProps: {
|
|
119
|
+
style: {
|
|
120
|
+
fontSize: labelFontSize,
|
|
121
|
+
angle: positionSign * 90,
|
|
122
|
+
textAnchor: 'middle',
|
|
123
|
+
dominantBaseline: 'auto'
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
ownerState: {}
|
|
127
|
+
});
|
|
100
128
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
|
|
101
129
|
transform: `translate(${position === 'right' ? left + width : left}, 0)`,
|
|
102
130
|
className: classes.root,
|
|
@@ -109,36 +137,26 @@ function ChartsYAxis(inProps) {
|
|
|
109
137
|
offset,
|
|
110
138
|
labelOffset
|
|
111
139
|
}, index) => {
|
|
112
|
-
const xTickLabel =
|
|
140
|
+
const xTickLabel = positionSign * (tickSize + 2);
|
|
113
141
|
const yTickLabel = labelOffset;
|
|
114
142
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
115
143
|
transform: `translate(0, ${offset})`,
|
|
116
144
|
className: classes.tickContainer,
|
|
117
145
|
children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
|
|
118
|
-
x2:
|
|
146
|
+
x2: positionSign * tickSize,
|
|
119
147
|
className: classes.tick
|
|
120
148
|
}, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
|
|
121
149
|
x: xTickLabel,
|
|
122
150
|
y: yTickLabel,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
fontSize: tickFontSize
|
|
126
|
-
},
|
|
127
|
-
className: classes.tickLabel
|
|
128
|
-
}, slotProps?.axisTickLabel, {
|
|
129
|
-
children: formattedValue.toLocaleString()
|
|
130
|
-
}))]
|
|
151
|
+
text: formattedValue.toString()
|
|
152
|
+
}, axisTickLabelProps))]
|
|
131
153
|
}, index);
|
|
132
|
-
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
className: classes.label
|
|
139
|
-
}, slotProps?.axisLabel, {
|
|
140
|
-
children: label
|
|
141
|
-
}))]
|
|
154
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
155
|
+
className: classes.label,
|
|
156
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
|
|
157
|
+
text: label
|
|
158
|
+
}))
|
|
159
|
+
})]
|
|
142
160
|
});
|
|
143
161
|
}
|
|
144
162
|
process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
@@ -176,8 +194,13 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
176
194
|
/**
|
|
177
195
|
* The font size of the axis label.
|
|
178
196
|
* @default 14
|
|
197
|
+
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
179
198
|
*/
|
|
180
199
|
labelFontSize: _propTypes.default.number,
|
|
200
|
+
/**
|
|
201
|
+
* The style applied to the axis label.
|
|
202
|
+
*/
|
|
203
|
+
labelStyle: _propTypes.default.object,
|
|
181
204
|
/**
|
|
182
205
|
* Position of the axis.
|
|
183
206
|
*/
|
|
@@ -200,8 +223,28 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
200
223
|
/**
|
|
201
224
|
* The font size of the axis ticks text.
|
|
202
225
|
* @default 12
|
|
226
|
+
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
203
227
|
*/
|
|
204
228
|
tickFontSize: _propTypes.default.number,
|
|
229
|
+
/**
|
|
230
|
+
* Defines which ticks are displayed. Its value can be:
|
|
231
|
+
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
|
|
232
|
+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
|
|
233
|
+
* - an array containing the values where ticks should be displayed.
|
|
234
|
+
* @default 'auto'
|
|
235
|
+
*/
|
|
236
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
237
|
+
/**
|
|
238
|
+
* Defines which ticks get its label displayed. Its value can be:
|
|
239
|
+
* - 'auto' In such case, labels are displayed if they do not overlap with the previous one.
|
|
240
|
+
* - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones.
|
|
241
|
+
* @default 'auto'
|
|
242
|
+
*/
|
|
243
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
244
|
+
/**
|
|
245
|
+
* The style applied to ticks text.
|
|
246
|
+
*/
|
|
247
|
+
tickLabelStyle: _propTypes.default.object,
|
|
205
248
|
/**
|
|
206
249
|
* Maximal step between two ticks.
|
|
207
250
|
* When using time data, the value is assumed to be in ms.
|
|
@@ -43,6 +43,16 @@ export type AreaElementProps = Omit<AreaElementOwnerState, 'isFaded' | 'isHighli
|
|
|
43
43
|
area?: React.ElementType;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Demos:
|
|
48
|
+
*
|
|
49
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
50
|
+
* - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
|
|
51
|
+
*
|
|
52
|
+
* API:
|
|
53
|
+
*
|
|
54
|
+
* - [AreaElement API](https://mui.com/x/api/charts/area-element/)
|
|
55
|
+
*/
|
|
46
56
|
declare function AreaElement(props: AreaElementProps): React.JSX.Element;
|
|
47
57
|
declare namespace AreaElement {
|
|
48
58
|
var propTypes: any;
|
package/LineChart/AreaElement.js
CHANGED
|
@@ -21,8 +21,8 @@ var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
|
21
21
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const _excluded = ["id", "classes", "color", "highlightScope", "slots", "slotProps"];
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
26
|
function getAreaElementUtilityClass(slot) {
|
|
27
27
|
return (0, _generateUtilityClass.default)('MuiAreaElement', slot);
|
|
28
28
|
}
|
|
@@ -66,6 +66,16 @@ AreaElementPath.propTypes = {
|
|
|
66
66
|
}).isRequired,
|
|
67
67
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
68
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* Demos:
|
|
71
|
+
*
|
|
72
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
73
|
+
* - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
|
|
74
|
+
*
|
|
75
|
+
* API:
|
|
76
|
+
*
|
|
77
|
+
* - [AreaElement API](https://mui.com/x/api/charts/area-element/)
|
|
78
|
+
*/
|
|
69
79
|
function AreaElement(props) {
|
|
70
80
|
const {
|
|
71
81
|
id,
|
package/LineChart/AreaPlot.d.ts
CHANGED
|
@@ -8,6 +8,17 @@ export interface AreaPlotSlotComponentProps {
|
|
|
8
8
|
}
|
|
9
9
|
export interface AreaPlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<AreaElementProps, 'slots' | 'slotProps'> {
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Demos:
|
|
13
|
+
*
|
|
14
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
15
|
+
* - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
|
|
16
|
+
* - [Stacking](https://mui.com/x/react-charts/stacking/)
|
|
17
|
+
*
|
|
18
|
+
* API:
|
|
19
|
+
*
|
|
20
|
+
* - [AreaPlot API](https://mui.com/x/api/charts/area-plot/)
|
|
21
|
+
*/
|
|
11
22
|
declare function AreaPlot(props: AreaPlotProps): React.JSX.Element | null;
|
|
12
23
|
declare namespace AreaPlot {
|
|
13
24
|
var propTypes: any;
|
package/LineChart/AreaPlot.js
CHANGED
|
@@ -17,8 +17,19 @@ var _useScale = require("../hooks/useScale");
|
|
|
17
17
|
var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
const _excluded = ["slots", "slotProps"];
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
/**
|
|
23
|
+
* Demos:
|
|
24
|
+
*
|
|
25
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
26
|
+
* - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
|
|
27
|
+
* - [Stacking](https://mui.com/x/react-charts/stacking/)
|
|
28
|
+
*
|
|
29
|
+
* API:
|
|
30
|
+
*
|
|
31
|
+
* - [AreaPlot API](https://mui.com/x/api/charts/area-plot/)
|
|
32
|
+
*/
|
|
22
33
|
function AreaPlot(props) {
|
|
23
34
|
const {
|
|
24
35
|
slots,
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
|
|
|
19
19
|
series: MakeOptional<LineSeriesType, 'type'>[];
|
|
20
20
|
tooltip?: ChartsTooltipProps;
|
|
21
21
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
24
|
+
*/
|
|
22
25
|
legend?: ChartsLegendProps;
|
|
23
26
|
/**
|
|
24
27
|
* If `true`, render the line highlight item.
|
|
@@ -35,5 +38,15 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
|
|
|
35
38
|
*/
|
|
36
39
|
slotProps?: LineChartSlotComponentProps;
|
|
37
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Demos:
|
|
43
|
+
*
|
|
44
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
45
|
+
* - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
|
|
46
|
+
*
|
|
47
|
+
* API:
|
|
48
|
+
*
|
|
49
|
+
* - [LineChart API](https://mui.com/x/api/charts/line-chart/)
|
|
50
|
+
*/
|
|
38
51
|
declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<unknown>>;
|
|
39
52
|
export { LineChart };
|