@mui/x-charts 6.0.0-alpha.15 → 6.0.0-alpha.17
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 +13 -2
- package/BarChart/BarChart.js +45 -3
- 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/BarChart/formatter.js +1 -1
- package/CHANGELOG.md +131 -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 +2 -1
- package/ChartsLegend/ChartsLegend.js +12 -8
- package/ChartsSurface.js +2 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +29 -23
- package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +123 -35
- package/ChartsYAxis/ChartsYAxis.js +38 -16
- package/LineChart/AreaElement.d.ts +10 -0
- package/LineChart/AreaElement.js +12 -2
- package/LineChart/AreaPlot.d.ts +11 -0
- package/LineChart/AreaPlot.js +24 -7
- package/LineChart/LineChart.d.ts +10 -0
- package/LineChart/LineChart.js +36 -2
- 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 +14 -3
- package/LineChart/LinePlot.d.ts +10 -0
- package/LineChart/LinePlot.js +22 -11
- package/LineChart/MarkElement.d.ts +10 -0
- package/LineChart/MarkElement.js +12 -2
- package/LineChart/MarkPlot.d.ts +10 -0
- package/LineChart/MarkPlot.js +40 -9
- package/LineChart/formatter.js +4 -3
- package/PieChart/PieArc.js +2 -2
- package/PieChart/PieArcLabel.js +2 -2
- package/PieChart/PieChart.d.ts +10 -0
- package/PieChart/PieChart.js +37 -2
- 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 +10 -0
- package/ScatterChart/ScatterChart.js +36 -2
- 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/context/CartesianContextProvider.js +10 -2
- package/context/DrawingProvider.js +2 -2
- package/context/HighlightProvider.js +2 -2
- package/context/InteractionProvider.js +2 -2
- package/context/SeriesContextProvider.js +2 -2
- package/esm/BarChart/BarChart.js +43 -1
- 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 +16 -0
- package/esm/ChartsLegend/ChartsLegend.js +10 -6
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +27 -21
- package/esm/ChartsXAxis/ChartsXAxis.js +122 -34
- package/esm/ChartsYAxis/ChartsYAxis.js +36 -14
- package/esm/LineChart/AreaElement.js +10 -0
- package/esm/LineChart/AreaPlot.js +24 -6
- package/esm/LineChart/LineChart.js +34 -0
- package/esm/LineChart/LineElement.js +10 -0
- package/esm/LineChart/LineHighlightElement.js +10 -0
- package/esm/LineChart/LineHighlightPlot.js +12 -1
- package/esm/LineChart/LinePlot.js +23 -14
- package/esm/LineChart/MarkElement.js +10 -0
- package/esm/LineChart/MarkPlot.js +38 -7
- package/esm/LineChart/formatter.js +7 -3
- package/esm/PieChart/PieChart.js +35 -0
- 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 +34 -0
- package/esm/ScatterChart/ScatterPlot.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +14 -0
- package/esm/context/CartesianContextProvider.js +8 -0
- package/esm/hooks/useMounted.js +16 -0
- package/esm/hooks/useReducedMotion.js +27 -0
- package/esm/hooks/useTicks.js +12 -6
- package/esm/internals/components/ChartsText.js +19 -13
- package/esm/internals/geometry.js +36 -0
- package/hooks/useAxisEvents.js +2 -2
- package/hooks/useChartDimensions.js +2 -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 +18 -9
- package/hooks/useTicks.js +14 -8
- package/index.js +1 -1
- package/internals/components/ChartsText.d.ts +11 -8
- package/internals/components/ChartsText.js +21 -15
- package/internals/defaultizeColor.d.ts +2 -2
- package/internals/domUtils.d.ts +0 -1
- package/internals/geometry.d.ts +9 -0
- package/internals/geometry.js +42 -0
- package/legacy/BarChart/BarChart.js +43 -1
- 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 +16 -0
- package/legacy/ChartsLegend/ChartsLegend.js +14 -7
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +5 -1
- package/legacy/ChartsXAxis/ChartsXAxis.js +126 -36
- package/legacy/ChartsYAxis/ChartsYAxis.js +36 -14
- package/legacy/LineChart/AreaElement.js +10 -0
- package/legacy/LineChart/AreaPlot.js +27 -7
- package/legacy/LineChart/LineChart.js +34 -0
- package/legacy/LineChart/LineElement.js +10 -0
- package/legacy/LineChart/LineHighlightElement.js +10 -0
- package/legacy/LineChart/LineHighlightPlot.js +12 -1
- package/legacy/LineChart/LinePlot.js +25 -12
- package/legacy/LineChart/MarkElement.js +10 -0
- package/legacy/LineChart/MarkPlot.js +37 -7
- package/legacy/LineChart/formatter.js +7 -3
- package/legacy/PieChart/PieChart.js +35 -0
- 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 +34 -0
- package/legacy/ScatterChart/ScatterPlot.js +10 -0
- package/legacy/SparkLineChart/SparkLineChart.js +14 -0
- package/legacy/context/CartesianContextProvider.js +8 -0
- package/legacy/hooks/useMounted.js +21 -0
- package/legacy/hooks/useReducedMotion.js +27 -0
- package/legacy/hooks/useTicks.js +13 -6
- package/legacy/index.js +1 -1
- package/legacy/internals/components/ChartsText.js +17 -15
- package/legacy/internals/geometry.js +37 -0
- package/models/axis.d.ts +19 -2
- package/models/seriesType/line.d.ts +3 -3
- package/modern/BarChart/BarChart.js +43 -1
- 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 +16 -0
- package/modern/ChartsLegend/ChartsLegend.js +10 -6
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +27 -21
- package/modern/ChartsXAxis/ChartsXAxis.js +122 -34
- package/modern/ChartsYAxis/ChartsYAxis.js +36 -14
- package/modern/LineChart/AreaElement.js +10 -0
- package/modern/LineChart/AreaPlot.js +22 -5
- package/modern/LineChart/LineChart.js +34 -0
- package/modern/LineChart/LineElement.js +10 -0
- package/modern/LineChart/LineHighlightElement.js +10 -0
- package/modern/LineChart/LineHighlightPlot.js +12 -1
- package/modern/LineChart/LinePlot.js +20 -9
- package/modern/LineChart/MarkElement.js +10 -0
- package/modern/LineChart/MarkPlot.js +38 -7
- package/modern/LineChart/formatter.js +4 -3
- package/modern/PieChart/PieChart.js +35 -0
- 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 +34 -0
- package/modern/ScatterChart/ScatterPlot.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +14 -0
- package/modern/context/CartesianContextProvider.js +8 -0
- package/modern/hooks/useMounted.js +16 -0
- package/modern/hooks/useReducedMotion.js +27 -0
- package/modern/hooks/useTicks.js +12 -6
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsText.js +19 -13
- package/modern/internals/geometry.js +36 -0
- package/package.json +5 -3
|
@@ -10,8 +10,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
15
|
function ChartsClipPath(props) {
|
|
16
16
|
const {
|
|
17
17
|
id,
|
|
@@ -6,6 +6,7 @@ import { FormattedSeries } from '../context/SeriesContextProvider';
|
|
|
6
6
|
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
7
7
|
import { DefaultizedProps } from '../models/helpers';
|
|
8
8
|
import { LegendParams } from '../models/seriesType/config';
|
|
9
|
+
import { ChartsTextStyle } from '../internals/components/ChartsText';
|
|
9
10
|
import { CardinalDirections } from '../models/layout';
|
|
10
11
|
export interface ChartsLegendSlotsComponent {
|
|
11
12
|
legend?: React.JSXElementConstructor<LegendRendererProps>;
|
|
@@ -58,7 +59,7 @@ export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps,
|
|
|
58
59
|
* Style applied to legend labels.
|
|
59
60
|
* @default theme.typography.subtitle1
|
|
60
61
|
*/
|
|
61
|
-
labelStyle?:
|
|
62
|
+
labelStyle?: ChartsTextStyle;
|
|
62
63
|
/**
|
|
63
64
|
* Width of the item mark (in px).
|
|
64
65
|
* @default 20
|
|
@@ -19,9 +19,10 @@ var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
|
19
19
|
var _chartsLegendClasses = require("./chartsLegendClasses");
|
|
20
20
|
var _ChartsText = require("../internals/components/ChartsText");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["
|
|
23
|
-
|
|
24
|
-
function
|
|
22
|
+
const _excluded = ["rotate", "dominantBaseline"],
|
|
23
|
+
_excluded2 = ["label"];
|
|
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; }
|
|
25
26
|
const useUtilityClasses = ownerState => {
|
|
26
27
|
const {
|
|
27
28
|
classes,
|
|
@@ -84,11 +85,16 @@ function DefaultChartsLegend(props) {
|
|
|
84
85
|
const theme = (0, _styles.useTheme)();
|
|
85
86
|
const labelStyle = React.useMemo(() => (0, _extends2.default)({}, theme.typography.subtitle1, {
|
|
86
87
|
color: 'inherit',
|
|
88
|
+
dominantBaseline: 'central',
|
|
89
|
+
textAnchor: 'start',
|
|
87
90
|
fill: (theme.vars || theme).palette.text.primary,
|
|
88
91
|
lineHeight: 1
|
|
89
|
-
}, inLabelStyle),
|
|
92
|
+
}, inLabelStyle),
|
|
93
|
+
// To say to TS that the dominantBaseline and textAnchor are correct
|
|
94
|
+
[inLabelStyle, theme]);
|
|
90
95
|
const padding = React.useMemo(() => getStandardizedPadding(paddingProps), [paddingProps]);
|
|
91
|
-
const getItemSpace = React.useCallback((label,
|
|
96
|
+
const getItemSpace = React.useCallback((label, inStyle = {}) => {
|
|
97
|
+
const style = (0, _objectWithoutPropertiesLoose2.default)(inStyle, _excluded);
|
|
92
98
|
const linesSize = (0, _ChartsText.getWordsByLines)({
|
|
93
99
|
style,
|
|
94
100
|
needsComputation: true,
|
|
@@ -121,7 +127,7 @@ function DefaultChartsLegend(props) {
|
|
|
121
127
|
let {
|
|
122
128
|
label
|
|
123
129
|
} = _ref,
|
|
124
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(_ref,
|
|
130
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded2);
|
|
125
131
|
const itemSpace = getItemSpace(label, labelStyle);
|
|
126
132
|
const rep = (0, _extends2.default)({}, other, {
|
|
127
133
|
label,
|
|
@@ -228,8 +234,6 @@ function DefaultChartsLegend(props) {
|
|
|
228
234
|
fill: color
|
|
229
235
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsText.ChartsText, {
|
|
230
236
|
style: labelStyle,
|
|
231
|
-
dominantBaseline: "central",
|
|
232
|
-
textAnchor: "start",
|
|
233
237
|
text: label,
|
|
234
238
|
x: itemMarkWidth + markGap,
|
|
235
239
|
y: 0
|
package/ChartsSurface.js
CHANGED
|
@@ -12,8 +12,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _useAxisEvents = require("./hooks/useAxisEvents");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className"];
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
17
|
const ChartChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
18
18
|
name: 'MuiChartsSurface',
|
|
19
19
|
slot: 'Root'
|
|
@@ -14,8 +14,8 @@ var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
|
14
14
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
15
15
|
var _ChartsTooltipTable = require("./ChartsTooltipTable");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
19
|
function DefaultChartsAxisContent(props) {
|
|
20
20
|
const {
|
|
21
21
|
series,
|
|
@@ -49,27 +49,33 @@ function DefaultChartsAxisContent(props) {
|
|
|
49
49
|
label,
|
|
50
50
|
valueFormatter,
|
|
51
51
|
data
|
|
52
|
-
}) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
}) => {
|
|
53
|
+
const formattedValue = valueFormatter(data[dataIndex]);
|
|
54
|
+
if (formattedValue == null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltipTable.ChartsTooltipRow, {
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipCell, {
|
|
59
|
+
className: classes.markCell,
|
|
60
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipMark, {
|
|
61
|
+
ownerState: {
|
|
62
|
+
color
|
|
63
|
+
},
|
|
64
|
+
boxShadow: 1
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipCell, {
|
|
67
|
+
className: classes.labelCell,
|
|
68
|
+
children: label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
69
|
+
children: label
|
|
70
|
+
}) : null
|
|
71
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipCell, {
|
|
72
|
+
className: classes.valueCell,
|
|
73
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
74
|
+
children: formattedValue
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
}, id);
|
|
78
|
+
})
|
|
73
79
|
})]
|
|
74
80
|
})
|
|
75
81
|
});
|
|
@@ -12,8 +12,8 @@ var _utils = require("@mui/base/utils");
|
|
|
12
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
13
13
|
var _ChartsTooltipTable = require("./ChartsTooltipTable");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
17
|
function DefaultChartsItemContent(props) {
|
|
18
18
|
const {
|
|
19
19
|
series,
|
|
@@ -19,8 +19,8 @@ var _ChartsItemTooltipContent = require("./ChartsItemTooltipContent");
|
|
|
19
19
|
var _ChartsAxisTooltipContent = require("./ChartsAxisTooltipContent");
|
|
20
20
|
var _tooltipClasses = require("./tooltipClasses");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
function _getRequireWildcardCache(
|
|
23
|
-
function _interopRequireWildcard(
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
24
|
const useUtilityClasses = ownerState => {
|
|
25
25
|
const {
|
|
26
26
|
classes
|
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 {
|
|
@@ -18,10 +18,12 @@ var _useTicks = _interopRequireDefault(require("../hooks/useTicks"));
|
|
|
18
18
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
19
19
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
20
20
|
var _ChartsText = require("../internals/components/ChartsText");
|
|
21
|
+
var _geometry = require("../internals/geometry");
|
|
22
|
+
var _useMounted = require("../hooks/useMounted");
|
|
21
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
24
|
const _excluded = ["scale", "tickNumber"];
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
25
27
|
const useUtilityClasses = ownerState => {
|
|
26
28
|
const {
|
|
27
29
|
classes,
|
|
@@ -37,12 +39,64 @@ const useUtilityClasses = ownerState => {
|
|
|
37
39
|
};
|
|
38
40
|
return (0, _utils2.unstable_composeClasses)(slots, _axisClasses.getAxisUtilityClass, classes);
|
|
39
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
|
+
}
|
|
40
96
|
const defaultProps = {
|
|
41
97
|
position: 'bottom',
|
|
42
98
|
disableLine: false,
|
|
43
99
|
disableTicks: false,
|
|
44
|
-
tickFontSize: 12,
|
|
45
|
-
labelFontSize: 14,
|
|
46
100
|
tickSize: 6
|
|
47
101
|
};
|
|
48
102
|
function ChartsXAxis(inProps) {
|
|
@@ -61,18 +115,23 @@ function ChartsXAxis(inProps) {
|
|
|
61
115
|
}
|
|
62
116
|
} = _React$useContext,
|
|
63
117
|
settings = (0, _objectWithoutPropertiesLoose2.default)(_React$useContext.xAxis[_props$axisId], _excluded);
|
|
118
|
+
const isMounted = (0, _useMounted.useMounted)();
|
|
64
119
|
const defaultizedProps = (0, _extends2.default)({}, defaultProps, settings, props);
|
|
65
120
|
const {
|
|
66
121
|
position,
|
|
67
122
|
disableLine,
|
|
68
123
|
disableTicks,
|
|
69
|
-
|
|
124
|
+
tickLabelStyle,
|
|
70
125
|
label,
|
|
126
|
+
labelStyle,
|
|
127
|
+
tickFontSize,
|
|
71
128
|
labelFontSize,
|
|
72
129
|
tickSize: tickSizeProp,
|
|
73
130
|
valueFormatter,
|
|
74
131
|
slots,
|
|
75
|
-
slotProps
|
|
132
|
+
slotProps,
|
|
133
|
+
tickInterval,
|
|
134
|
+
tickLabelInterval
|
|
76
135
|
} = defaultizedProps;
|
|
77
136
|
const theme = (0, _styles.useTheme)();
|
|
78
137
|
const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
|
|
@@ -85,16 +144,7 @@ function ChartsXAxis(inProps) {
|
|
|
85
144
|
height
|
|
86
145
|
} = React.useContext(_DrawingProvider.DrawingContext);
|
|
87
146
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
88
|
-
const
|
|
89
|
-
scale: xScale,
|
|
90
|
-
tickNumber,
|
|
91
|
-
valueFormatter
|
|
92
|
-
});
|
|
93
|
-
const positionSigne = position === 'bottom' ? 1 : -1;
|
|
94
|
-
const labelRefPoint = {
|
|
95
|
-
x: left + width / 2,
|
|
96
|
-
y: positionSigne * (tickFontSize + tickSize + 10)
|
|
97
|
-
};
|
|
147
|
+
const positionSign = position === 'bottom' ? 1 : -1;
|
|
98
148
|
const Line = slots?.axisLine ?? 'line';
|
|
99
149
|
const Tick = slots?.axisTick ?? 'line';
|
|
100
150
|
const TickLabel = slots?.axisTickLabel ?? _ChartsText.ChartsText;
|
|
@@ -103,27 +153,40 @@ function ChartsXAxis(inProps) {
|
|
|
103
153
|
elementType: TickLabel,
|
|
104
154
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
105
155
|
additionalProps: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
fontSize: tickFontSize
|
|
110
|
-
},
|
|
156
|
+
style: (0, _extends2.default)({
|
|
157
|
+
textAnchor: 'middle',
|
|
158
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto',
|
|
159
|
+
fontSize: tickFontSize ?? 12
|
|
160
|
+
}, tickLabelStyle),
|
|
111
161
|
className: classes.tickLabel
|
|
112
162
|
},
|
|
113
163
|
className: classes.tickLabel,
|
|
114
164
|
ownerState: {}
|
|
115
165
|
});
|
|
166
|
+
const xTicks = (0, _useTicks.default)({
|
|
167
|
+
scale: xScale,
|
|
168
|
+
tickNumber,
|
|
169
|
+
valueFormatter,
|
|
170
|
+
tickInterval
|
|
171
|
+
});
|
|
172
|
+
const xTicksWithDimension = addLabelDimension(xTicks, {
|
|
173
|
+
tickLabelStyle: axisTickLabelProps.style,
|
|
174
|
+
tickLabelInterval,
|
|
175
|
+
isMounted
|
|
176
|
+
});
|
|
177
|
+
const labelRefPoint = {
|
|
178
|
+
x: left + width / 2,
|
|
179
|
+
y: positionSign * (tickSize + 22)
|
|
180
|
+
};
|
|
116
181
|
const axisLabelProps = (0, _utils.useSlotProps)({
|
|
117
182
|
elementType: Label,
|
|
118
183
|
externalSlotProps: slotProps?.axisLabel,
|
|
119
184
|
additionalProps: {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
className: classes.label
|
|
185
|
+
style: (0, _extends2.default)({
|
|
186
|
+
fontSize: labelFontSize ?? 14,
|
|
187
|
+
textAnchor: 'middle',
|
|
188
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
189
|
+
}, labelStyle)
|
|
127
190
|
},
|
|
128
191
|
ownerState: {}
|
|
129
192
|
});
|
|
@@ -134,23 +197,23 @@ function ChartsXAxis(inProps) {
|
|
|
134
197
|
x1: xScale.range()[0],
|
|
135
198
|
x2: xScale.range()[1],
|
|
136
199
|
className: classes.line
|
|
137
|
-
}, slotProps?.axisLine)),
|
|
200
|
+
}, slotProps?.axisLine)), xTicksWithDimension.map(({
|
|
138
201
|
formattedValue,
|
|
139
202
|
offset,
|
|
140
|
-
labelOffset
|
|
203
|
+
labelOffset,
|
|
204
|
+
skipLabel
|
|
141
205
|
}, index) => {
|
|
142
206
|
const xTickLabel = labelOffset ?? 0;
|
|
143
|
-
const yTickLabel =
|
|
207
|
+
const yTickLabel = positionSign * (tickSize + 3);
|
|
144
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
145
209
|
transform: `translate(${offset}, 0)`,
|
|
146
210
|
className: classes.tickContainer,
|
|
147
211
|
children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
|
|
148
|
-
y2:
|
|
212
|
+
y2: positionSign * tickSize,
|
|
149
213
|
className: classes.tick
|
|
150
|
-
}, 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)({
|
|
151
215
|
x: xTickLabel,
|
|
152
|
-
y: yTickLabel
|
|
153
|
-
"transform-origin": `${xTickLabel}px ${yTickLabel}px`
|
|
216
|
+
y: yTickLabel
|
|
154
217
|
}, axisTickLabelProps, {
|
|
155
218
|
text: formattedValue.toString()
|
|
156
219
|
}))]
|
|
@@ -198,8 +261,13 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
198
261
|
/**
|
|
199
262
|
* The font size of the axis label.
|
|
200
263
|
* @default 14
|
|
264
|
+
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
201
265
|
*/
|
|
202
266
|
labelFontSize: _propTypes.default.number,
|
|
267
|
+
/**
|
|
268
|
+
* The style applied to the axis label.
|
|
269
|
+
*/
|
|
270
|
+
labelStyle: _propTypes.default.object,
|
|
203
271
|
/**
|
|
204
272
|
* Position of the axis.
|
|
205
273
|
*/
|
|
@@ -222,8 +290,28 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
222
290
|
/**
|
|
223
291
|
* The font size of the axis ticks text.
|
|
224
292
|
* @default 12
|
|
293
|
+
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
225
294
|
*/
|
|
226
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,
|
|
227
315
|
/**
|
|
228
316
|
* Maximal step between two ticks.
|
|
229
317
|
* When using time data, the value is assumed to be in ms.
|
|
@@ -20,8 +20,8 @@ var _ChartsText = require("../internals/components/ChartsText");
|
|
|
20
20
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
const _excluded = ["scale", "tickNumber"];
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
25
25
|
const useUtilityClasses = ownerState => {
|
|
26
26
|
const {
|
|
27
27
|
classes,
|
|
@@ -90,9 +90,9 @@ function ChartsYAxis(inProps) {
|
|
|
90
90
|
tickNumber,
|
|
91
91
|
valueFormatter
|
|
92
92
|
});
|
|
93
|
-
const
|
|
93
|
+
const positionSign = position === 'right' ? 1 : -1;
|
|
94
94
|
const labelRefPoint = {
|
|
95
|
-
x:
|
|
95
|
+
x: positionSign * (tickFontSize + tickSize + 10),
|
|
96
96
|
y: top + height / 2
|
|
97
97
|
};
|
|
98
98
|
const Line = slots?.axisLine ?? 'line';
|
|
@@ -103,10 +103,10 @@ function ChartsYAxis(inProps) {
|
|
|
103
103
|
elementType: TickLabel,
|
|
104
104
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
105
105
|
additionalProps: {
|
|
106
|
-
textAnchor: position === 'right' ? 'start' : 'end',
|
|
107
|
-
dominantBaseline: 'central',
|
|
108
106
|
style: {
|
|
109
|
-
fontSize: tickFontSize
|
|
107
|
+
fontSize: tickFontSize,
|
|
108
|
+
textAnchor: position === 'right' ? 'start' : 'end',
|
|
109
|
+
dominantBaseline: 'central'
|
|
110
110
|
},
|
|
111
111
|
className: classes.tickLabel
|
|
112
112
|
},
|
|
@@ -116,14 +116,12 @@ function ChartsYAxis(inProps) {
|
|
|
116
116
|
elementType: Label,
|
|
117
117
|
externalSlotProps: slotProps?.axisLabel,
|
|
118
118
|
additionalProps: {
|
|
119
|
-
textAnchor: 'middle',
|
|
120
|
-
dominantBaseline: 'auto',
|
|
121
119
|
style: {
|
|
122
120
|
fontSize: labelFontSize,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
angle: positionSign * 90,
|
|
122
|
+
textAnchor: 'middle',
|
|
123
|
+
dominantBaseline: 'auto'
|
|
124
|
+
}
|
|
127
125
|
},
|
|
128
126
|
ownerState: {}
|
|
129
127
|
});
|
|
@@ -139,18 +137,17 @@ function ChartsYAxis(inProps) {
|
|
|
139
137
|
offset,
|
|
140
138
|
labelOffset
|
|
141
139
|
}, index) => {
|
|
142
|
-
const xTickLabel =
|
|
140
|
+
const xTickLabel = positionSign * (tickSize + 2);
|
|
143
141
|
const yTickLabel = labelOffset;
|
|
144
142
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
145
143
|
transform: `translate(0, ${offset})`,
|
|
146
144
|
className: classes.tickContainer,
|
|
147
145
|
children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
|
|
148
|
-
x2:
|
|
146
|
+
x2: positionSign * tickSize,
|
|
149
147
|
className: classes.tick
|
|
150
148
|
}, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
|
|
151
149
|
x: xTickLabel,
|
|
152
150
|
y: yTickLabel,
|
|
153
|
-
"transform-origin": `${xTickLabel}px ${yTickLabel}px`,
|
|
154
151
|
text: formattedValue.toString()
|
|
155
152
|
}, axisTickLabelProps))]
|
|
156
153
|
}, index);
|
|
@@ -197,8 +194,13 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
197
194
|
/**
|
|
198
195
|
* The font size of the axis label.
|
|
199
196
|
* @default 14
|
|
197
|
+
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
200
198
|
*/
|
|
201
199
|
labelFontSize: _propTypes.default.number,
|
|
200
|
+
/**
|
|
201
|
+
* The style applied to the axis label.
|
|
202
|
+
*/
|
|
203
|
+
labelStyle: _propTypes.default.object,
|
|
202
204
|
/**
|
|
203
205
|
* Position of the axis.
|
|
204
206
|
*/
|
|
@@ -221,8 +223,28 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
221
223
|
/**
|
|
222
224
|
* The font size of the axis ticks text.
|
|
223
225
|
* @default 12
|
|
226
|
+
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
224
227
|
*/
|
|
225
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,
|
|
226
248
|
/**
|
|
227
249
|
* Maximal step between two ticks.
|
|
228
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;
|