@mui/x-charts 6.0.0-alpha.6 → 6.0.0-alpha.8
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 -2
- package/BarChart/BarChart.js +84 -22
- package/BarChart/BarElement.d.ts +22 -0
- package/BarChart/BarElement.js +21 -10
- package/BarChart/BarPlot.d.ts +14 -1
- package/BarChart/BarPlot.js +48 -19
- package/BarChart/extremums.js +19 -3
- package/BarChart/formatter.js +3 -1
- package/CHANGELOG.md +213 -28
- package/ChartsAxis/ChartsAxis.d.ts +11 -1
- package/ChartsAxis/ChartsAxis.js +51 -6
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +3 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
- package/ChartsLegend/ChartsLegend.d.ts +25 -2
- package/ChartsLegend/ChartsLegend.js +49 -17
- package/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
- package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
- package/ChartsXAxis/ChartsXAxis.js +44 -9
- package/ChartsYAxis/ChartsYAxis.js +44 -9
- package/LineChart/AreaElement.d.ts +22 -0
- package/LineChart/AreaElement.js +31 -11
- package/LineChart/AreaPlot.d.ts +14 -1
- package/LineChart/AreaPlot.js +29 -3
- package/LineChart/LineChart.d.ts +20 -2
- package/LineChart/LineChart.js +63 -11
- package/LineChart/LineElement.d.ts +22 -0
- package/LineChart/LineElement.js +31 -10
- package/LineChart/LinePlot.d.ts +14 -1
- package/LineChart/LinePlot.js +35 -4
- package/LineChart/MarkPlot.d.ts +24 -1
- package/LineChart/MarkPlot.js +29 -4
- package/PieChart/PieArcLabel.js +0 -1
- package/PieChart/PieChart.d.ts +14 -2
- package/PieChart/PieChart.js +52 -10
- package/PieChart/PiePlot.d.ts +27 -1
- package/PieChart/PiePlot.js +29 -6
- package/ScatterChart/ScatterChart.d.ts +18 -2
- package/ScatterChart/ScatterChart.js +56 -10
- package/ScatterChart/ScatterPlot.d.ts +24 -1
- package/ScatterChart/ScatterPlot.js +28 -4
- package/SparkLineChart/SparkLineChart.d.ts +18 -0
- package/SparkLineChart/SparkLineChart.js +29 -6
- package/colorPalettes/colorPalettes.js +2 -2
- package/context/CartesianContextProvider.js +18 -12
- package/esm/BarChart/BarChart.js +88 -26
- package/esm/BarChart/BarElement.js +21 -11
- package/esm/BarChart/BarPlot.js +49 -20
- package/esm/BarChart/extremums.js +18 -2
- package/esm/BarChart/formatter.js +3 -1
- package/esm/ChartsAxis/ChartsAxis.js +51 -6
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
- package/esm/ChartsLegend/ChartsLegend.js +47 -14
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
- package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
- package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
- package/esm/LineChart/AreaElement.js +31 -11
- package/esm/LineChart/AreaPlot.js +31 -4
- package/esm/LineChart/LineChart.js +63 -11
- package/esm/LineChart/LineElement.js +31 -11
- package/esm/LineChart/LinePlot.js +43 -8
- package/esm/LineChart/MarkPlot.js +32 -5
- package/esm/PieChart/PieArcLabel.js +0 -1
- package/esm/PieChart/PieChart.js +52 -10
- package/esm/PieChart/PiePlot.js +31 -6
- package/esm/ScatterChart/ScatterChart.js +56 -10
- package/esm/ScatterChart/ScatterPlot.js +29 -4
- package/esm/SparkLineChart/SparkLineChart.js +29 -6
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/context/CartesianContextProvider.js +18 -12
- package/esm/hooks/useAxisEvents.js +21 -38
- package/esm/hooks/useTicks.js +11 -8
- package/esm/internals/components/AxisSharedComponents.js +10 -10
- package/hooks/useAxisEvents.js +21 -38
- package/hooks/useTicks.d.ts +20 -5
- package/hooks/useTicks.js +11 -8
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +4 -4
- package/internals/components/AxisSharedComponents.js +15 -15
- package/internals/defaultizeColor.d.ts +1 -0
- package/legacy/BarChart/BarChart.js +93 -29
- package/legacy/BarChart/BarElement.js +20 -10
- package/legacy/BarChart/BarPlot.js +49 -20
- package/legacy/BarChart/extremums.js +22 -2
- package/legacy/BarChart/formatter.js +3 -1
- package/legacy/ChartsAxis/ChartsAxis.js +51 -6
- package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
- package/legacy/ChartsLegend/ChartsLegend.js +46 -15
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
- package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
- package/legacy/LineChart/AreaElement.js +30 -10
- package/legacy/LineChart/AreaPlot.js +29 -4
- package/legacy/LineChart/LineChart.js +63 -11
- package/legacy/LineChart/LineElement.js +30 -10
- package/legacy/LineChart/LinePlot.js +36 -5
- package/legacy/LineChart/MarkPlot.js +30 -5
- package/legacy/PieChart/PieArcLabel.js +0 -1
- package/legacy/PieChart/PieChart.js +52 -10
- package/legacy/PieChart/PiePlot.js +29 -6
- package/legacy/ScatterChart/ScatterChart.js +56 -10
- package/legacy/ScatterChart/ScatterPlot.js +27 -4
- package/legacy/SparkLineChart/SparkLineChart.js +29 -6
- package/legacy/colorPalettes/colorPalettes.js +2 -2
- package/legacy/context/CartesianContextProvider.js +18 -12
- package/legacy/hooks/useAxisEvents.js +21 -37
- package/legacy/hooks/useTicks.js +11 -11
- package/legacy/index.js +1 -1
- package/legacy/internals/components/AxisSharedComponents.js +10 -10
- package/models/axis.d.ts +24 -1
- package/models/seriesType/bar.d.ts +6 -1
- package/modern/BarChart/BarChart.js +85 -23
- package/modern/BarChart/BarElement.js +20 -11
- package/modern/BarChart/BarPlot.js +48 -19
- package/modern/BarChart/extremums.js +18 -2
- package/modern/BarChart/formatter.js +3 -1
- package/modern/ChartsAxis/ChartsAxis.js +51 -6
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
- package/modern/ChartsLegend/ChartsLegend.js +46 -14
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
- package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
- package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
- package/modern/LineChart/AreaElement.js +30 -11
- package/modern/LineChart/AreaPlot.js +31 -4
- package/modern/LineChart/LineChart.js +63 -11
- package/modern/LineChart/LineElement.js +30 -11
- package/modern/LineChart/LinePlot.js +37 -5
- package/modern/LineChart/MarkPlot.js +31 -5
- package/modern/PieChart/PieArcLabel.js +0 -1
- package/modern/PieChart/PieChart.js +52 -10
- package/modern/PieChart/PiePlot.js +30 -6
- package/modern/ScatterChart/ScatterChart.js +56 -10
- package/modern/ScatterChart/ScatterPlot.js +28 -4
- package/modern/SparkLineChart/SparkLineChart.js +29 -6
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/context/CartesianContextProvider.js +18 -12
- package/modern/hooks/useAxisEvents.js +21 -38
- package/modern/hooks/useTicks.js +11 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +10 -10
- package/package.json +5 -5
- package/themeAugmentation/components.d.ts +0 -10
- package/themeAugmentation/overrides.d.ts +0 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["id", "dataIndex", "classes", "color", "highlightScope"];
|
|
3
|
+
var _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
6
7
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
7
8
|
import { styled } from '@mui/material/styles';
|
|
8
9
|
import { color as d3Color } from 'd3-color';
|
|
@@ -22,7 +23,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
22
23
|
};
|
|
23
24
|
return composeClasses(slots, getBarElementUtilityClass, classes);
|
|
24
25
|
};
|
|
25
|
-
var BarElementPath = styled('rect', {
|
|
26
|
+
export var BarElementPath = styled('rect', {
|
|
26
27
|
name: 'MuiBarElement',
|
|
27
28
|
slot: 'Root',
|
|
28
29
|
overridesResolver: function overridesResolver(_, styles) {
|
|
@@ -39,11 +40,14 @@ var BarElementPath = styled('rect', {
|
|
|
39
40
|
};
|
|
40
41
|
});
|
|
41
42
|
export function BarElement(props) {
|
|
43
|
+
var _slots$bar;
|
|
42
44
|
var id = props.id,
|
|
43
45
|
dataIndex = props.dataIndex,
|
|
44
46
|
innerClasses = props.classes,
|
|
45
47
|
color = props.color,
|
|
46
48
|
highlightScope = props.highlightScope,
|
|
49
|
+
slots = props.slots,
|
|
50
|
+
slotProps = props.slotProps,
|
|
47
51
|
other = _objectWithoutProperties(props, _excluded);
|
|
48
52
|
var getInteractionItemProps = useInteractionItemProps(highlightScope);
|
|
49
53
|
var _React$useContext = React.useContext(InteractionContext),
|
|
@@ -67,12 +71,18 @@ export function BarElement(props) {
|
|
|
67
71
|
isHighlighted: isHighlighted
|
|
68
72
|
};
|
|
69
73
|
var classes = useUtilityClasses(ownerState);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
var Bar = (_slots$bar = slots == null ? void 0 : slots.bar) != null ? _slots$bar : BarElementPath;
|
|
75
|
+
var barProps = useSlotProps({
|
|
76
|
+
elementType: Bar,
|
|
77
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.bar,
|
|
78
|
+
additionalProps: _extends({}, other, getInteractionItemProps({
|
|
79
|
+
type: 'bar',
|
|
80
|
+
seriesId: id,
|
|
81
|
+
dataIndex: dataIndex
|
|
82
|
+
}), {
|
|
83
|
+
className: classes.root
|
|
84
|
+
}),
|
|
85
|
+
ownerState: ownerState
|
|
86
|
+
});
|
|
87
|
+
return /*#__PURE__*/_jsx(Bar, _extends({}, barProps));
|
|
78
88
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
3
|
import * as React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
4
6
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
5
7
|
import { BarElement } from './BarElement';
|
|
@@ -32,7 +34,7 @@ function getBandSize(_ref) {
|
|
|
32
34
|
offset: offset
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
function BarPlot(props) {
|
|
36
38
|
var seriesData = React.useContext(SeriesContext).bar;
|
|
37
39
|
var axisData = React.useContext(CartesianContext);
|
|
38
40
|
if (seriesData === undefined) {
|
|
@@ -55,45 +57,72 @@ export function BarPlot() {
|
|
|
55
57
|
var yAxisKey = (_series$seriesId$yAxi = series[seriesId].yAxisKey) != null ? _series$seriesId$yAxi : defaultYAxisId;
|
|
56
58
|
var xAxisConfig = xAxis[xAxisKey];
|
|
57
59
|
var yAxisConfig = yAxis[yAxisKey];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
var verticalLayout = series[seriesId].layout === 'vertical';
|
|
61
|
+
var baseScaleConfig;
|
|
62
|
+
if (verticalLayout) {
|
|
63
|
+
if (!isBandScaleConfig(xAxisConfig)) {
|
|
64
|
+
throw new Error("Axis with id \"".concat(xAxisKey, "\" shoud be of type \"band\" to display the bar series of id \"").concat(seriesId, "\""));
|
|
65
|
+
}
|
|
66
|
+
if (xAxis[xAxisKey].data === undefined) {
|
|
67
|
+
throw new Error("Axis with id \"".concat(xAxisKey, "\" shoud have data property"));
|
|
68
|
+
}
|
|
69
|
+
baseScaleConfig = xAxisConfig;
|
|
70
|
+
} else {
|
|
71
|
+
if (!isBandScaleConfig(yAxisConfig)) {
|
|
72
|
+
throw new Error("Axis with id \"".concat(yAxisKey, "\" shoud be of type \"band\" to display the bar series of id \"").concat(seriesId, "\""));
|
|
73
|
+
}
|
|
74
|
+
if (yAxis[yAxisKey].data === undefined) {
|
|
75
|
+
throw new Error("Axis with id \"".concat(xAxisKey, "\" shoud have data property"));
|
|
76
|
+
}
|
|
77
|
+
baseScaleConfig = yAxisConfig;
|
|
63
78
|
}
|
|
64
79
|
var xScale = xAxisConfig.scale;
|
|
65
80
|
var yScale = yAxisConfig.scale;
|
|
66
|
-
|
|
67
|
-
// Currently assuming all bars are vertical
|
|
68
|
-
var bandWidth = xScale.bandwidth();
|
|
81
|
+
var bandWidth = baseScaleConfig.scale.bandwidth();
|
|
69
82
|
var _getBandSize = getBandSize({
|
|
70
83
|
bandWidth: bandWidth,
|
|
71
84
|
numberOfGroups: stackingGroups.length,
|
|
72
|
-
gapRatio:
|
|
85
|
+
gapRatio: baseScaleConfig.barGapRatio
|
|
73
86
|
}),
|
|
74
87
|
barWidth = _getBandSize.barWidth,
|
|
75
88
|
offset = _getBandSize.offset;
|
|
76
|
-
|
|
77
|
-
// @ts-ignore TODO: fix when adding a correct API for customisation
|
|
89
|
+
var barOffset = groupIndex * (barWidth + offset);
|
|
78
90
|
var _series$seriesId = series[seriesId],
|
|
79
91
|
stackedData = _series$seriesId.stackedData,
|
|
80
92
|
color = _series$seriesId.color;
|
|
81
93
|
return stackedData.map(function (values, dataIndex) {
|
|
82
|
-
var _xAxis$xAxisKey$data;
|
|
94
|
+
var _xAxis$xAxisKey$data, _yAxis$yAxisKey$data;
|
|
83
95
|
var baseline = Math.min.apply(Math, _toConsumableArray(values));
|
|
84
96
|
var value = Math.max.apply(Math, _toConsumableArray(values));
|
|
85
|
-
return /*#__PURE__*/_jsx(BarElement, {
|
|
97
|
+
return /*#__PURE__*/_jsx(BarElement, _extends({
|
|
86
98
|
id: seriesId,
|
|
87
99
|
dataIndex: dataIndex,
|
|
88
|
-
x: xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) +
|
|
89
|
-
y: yScale(value),
|
|
90
|
-
height: yScale(baseline) - yScale(value),
|
|
91
|
-
width: barWidth,
|
|
100
|
+
x: verticalLayout ? xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) + barOffset : xScale(baseline),
|
|
101
|
+
y: verticalLayout ? yScale(value) : yScale((_yAxis$yAxisKey$data = yAxis[yAxisKey].data) == null ? void 0 : _yAxis$yAxisKey$data[dataIndex]) + barOffset,
|
|
102
|
+
height: verticalLayout ? Math.abs(yScale(baseline) - yScale(value)) : barWidth,
|
|
103
|
+
width: verticalLayout ? barWidth : Math.abs(xScale(baseline) - xScale(value)),
|
|
92
104
|
color: color,
|
|
93
105
|
highlightScope: series[seriesId].highlightScope
|
|
94
|
-
}, "".concat(seriesId, "-").concat(dataIndex));
|
|
106
|
+
}, props), "".concat(seriesId, "-").concat(dataIndex));
|
|
95
107
|
});
|
|
96
108
|
});
|
|
97
109
|
})
|
|
98
110
|
});
|
|
99
|
-
}
|
|
111
|
+
}
|
|
112
|
+
process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
|
|
113
|
+
// ----------------------------- Warning --------------------------------
|
|
114
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
115
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
116
|
+
// ----------------------------------------------------------------------
|
|
117
|
+
/**
|
|
118
|
+
* The props used for each component slot.
|
|
119
|
+
* @default {}
|
|
120
|
+
*/
|
|
121
|
+
slotProps: PropTypes.object,
|
|
122
|
+
/**
|
|
123
|
+
* Overridable component slots.
|
|
124
|
+
* @default {}
|
|
125
|
+
*/
|
|
126
|
+
slots: PropTypes.object
|
|
127
|
+
} : void 0;
|
|
128
|
+
export { BarPlot };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
|
|
3
|
+
var getBaseExtremum = function getBaseExtremum(params) {
|
|
4
4
|
var _axis$data, _axis$data2;
|
|
5
5
|
var axis = params.axis;
|
|
6
6
|
var minX = Math.min.apply(Math, _toConsumableArray((_axis$data = axis.data) != null ? _axis$data : []));
|
|
7
7
|
var maxX = Math.max.apply(Math, _toConsumableArray((_axis$data2 = axis.data) != null ? _axis$data2 : []));
|
|
8
8
|
return [minX, maxX];
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
var getValueExtremum = function getValueExtremum(params) {
|
|
11
11
|
var series = params.series,
|
|
12
12
|
axis = params.axis,
|
|
13
13
|
isDefaultAxis = params.isDefaultAxis;
|
|
@@ -22,4 +22,24 @@ export var getExtremumY = function getExtremumY(params) {
|
|
|
22
22
|
seriesMax = _series$seriesId$stac2[1];
|
|
23
23
|
return [acc[0] === null ? seriesMin : Math.min(seriesMin, acc[0]), acc[1] === null ? seriesMax : Math.max(seriesMax, acc[1])];
|
|
24
24
|
}, [null, null]);
|
|
25
|
+
};
|
|
26
|
+
export var getExtremumX = function getExtremumX(params) {
|
|
27
|
+
// Notice that bar should be all horizontal or all vertical.
|
|
28
|
+
// Don't think it's a problem for now
|
|
29
|
+
var isHorizontal = Object.keys(params.series).some(function (seriesId) {
|
|
30
|
+
return params.series[seriesId].layout === 'horizontal';
|
|
31
|
+
});
|
|
32
|
+
if (isHorizontal) {
|
|
33
|
+
return getValueExtremum(params);
|
|
34
|
+
}
|
|
35
|
+
return getBaseExtremum(params);
|
|
36
|
+
};
|
|
37
|
+
export var getExtremumY = function getExtremumY(params) {
|
|
38
|
+
var isHorizontal = Object.keys(params.series).some(function (seriesId) {
|
|
39
|
+
return params.series[seriesId].layout === 'horizontal';
|
|
40
|
+
});
|
|
41
|
+
if (isHorizontal) {
|
|
42
|
+
return getBaseExtremum(params);
|
|
43
|
+
}
|
|
44
|
+
return getValueExtremum(params);
|
|
25
45
|
};
|
|
@@ -38,7 +38,9 @@ var formatter = function formatter(params, dataset) {
|
|
|
38
38
|
})).order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
39
39
|
ids.forEach(function (id, index) {
|
|
40
40
|
var dataKey = series[id].dataKey;
|
|
41
|
-
completedSeries[id] = _extends({
|
|
41
|
+
completedSeries[id] = _extends({
|
|
42
|
+
layout: 'vertical'
|
|
43
|
+
}, series[id], {
|
|
42
44
|
data: dataKey ? dataset.map(function (d) {
|
|
43
45
|
return d[dataKey];
|
|
44
46
|
}) : series[id].data,
|
|
@@ -16,11 +16,22 @@ var getAxisId = function getAxisId(propsValue) {
|
|
|
16
16
|
}
|
|
17
17
|
return propsValue;
|
|
18
18
|
};
|
|
19
|
+
var mergeProps = function mergeProps(axisConfig, slots, slotProps) {
|
|
20
|
+
return _typeof(axisConfig) === 'object' ? _extends({}, axisConfig, {
|
|
21
|
+
slots: _extends({}, slots, axisConfig == null ? void 0 : axisConfig.slots),
|
|
22
|
+
slotProps: _extends({}, slotProps, axisConfig == null ? void 0 : axisConfig.slotProps)
|
|
23
|
+
}) : {
|
|
24
|
+
slots: slots,
|
|
25
|
+
slotProps: slotProps
|
|
26
|
+
};
|
|
27
|
+
};
|
|
19
28
|
function ChartsAxis(props) {
|
|
20
29
|
var topAxis = props.topAxis,
|
|
21
30
|
leftAxis = props.leftAxis,
|
|
22
31
|
rightAxis = props.rightAxis,
|
|
23
|
-
bottomAxis = props.bottomAxis
|
|
32
|
+
bottomAxis = props.bottomAxis,
|
|
33
|
+
slots = props.slots,
|
|
34
|
+
slotProps = props.slotProps;
|
|
24
35
|
var _React$useContext = React.useContext(CartesianContext),
|
|
25
36
|
xAxis = _React$useContext.xAxis,
|
|
26
37
|
xAxisIds = _React$useContext.xAxisIds,
|
|
@@ -46,20 +57,24 @@ function ChartsAxis(props) {
|
|
|
46
57
|
if (bottomId !== null && !xAxis[bottomId]) {
|
|
47
58
|
throw Error("MUI: id used for bottom axis \"".concat(bottomId, "\" is not defined"));
|
|
48
59
|
}
|
|
60
|
+
var topAxisProps = mergeProps(topAxis, slots, slotProps);
|
|
61
|
+
var bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
|
|
62
|
+
var leftAxisProps = mergeProps(leftAxis, slots, slotProps);
|
|
63
|
+
var rightAxisProps = mergeProps(rightAxis, slots, slotProps);
|
|
49
64
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
50
|
-
children: [topId && /*#__PURE__*/_jsx(ChartsXAxis, _extends({
|
|
65
|
+
children: [topId && /*#__PURE__*/_jsx(ChartsXAxis, _extends({}, topAxisProps, {
|
|
51
66
|
position: "top",
|
|
52
67
|
axisId: topId
|
|
53
|
-
}
|
|
68
|
+
})), bottomId && /*#__PURE__*/_jsx(ChartsXAxis, _extends({}, bottomAxisProps, {
|
|
54
69
|
position: "bottom",
|
|
55
70
|
axisId: bottomId
|
|
56
|
-
}
|
|
71
|
+
})), leftId && /*#__PURE__*/_jsx(ChartsYAxis, _extends({}, leftAxisProps, {
|
|
57
72
|
position: "left",
|
|
58
73
|
axisId: leftId
|
|
59
|
-
}
|
|
74
|
+
})), rightId && /*#__PURE__*/_jsx(ChartsYAxis, _extends({}, rightAxisProps, {
|
|
60
75
|
position: "right",
|
|
61
76
|
axisId: rightId
|
|
62
|
-
}
|
|
77
|
+
}))]
|
|
63
78
|
});
|
|
64
79
|
}
|
|
65
80
|
process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
@@ -81,8 +96,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
81
96
|
label: PropTypes.string,
|
|
82
97
|
labelFontSize: PropTypes.number,
|
|
83
98
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
99
|
+
slotProps: PropTypes.object,
|
|
100
|
+
slots: PropTypes.object,
|
|
84
101
|
stroke: PropTypes.string,
|
|
85
102
|
tickFontSize: PropTypes.number,
|
|
103
|
+
tickMaxStep: PropTypes.number,
|
|
104
|
+
tickMinStep: PropTypes.number,
|
|
105
|
+
tickNumber: PropTypes.number,
|
|
86
106
|
tickSize: PropTypes.number
|
|
87
107
|
}), PropTypes.string]),
|
|
88
108
|
/**
|
|
@@ -99,8 +119,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
99
119
|
label: PropTypes.string,
|
|
100
120
|
labelFontSize: PropTypes.number,
|
|
101
121
|
position: PropTypes.oneOf(['left', 'right']),
|
|
122
|
+
slotProps: PropTypes.object,
|
|
123
|
+
slots: PropTypes.object,
|
|
102
124
|
stroke: PropTypes.string,
|
|
103
125
|
tickFontSize: PropTypes.number,
|
|
126
|
+
tickMaxStep: PropTypes.number,
|
|
127
|
+
tickMinStep: PropTypes.number,
|
|
128
|
+
tickNumber: PropTypes.number,
|
|
104
129
|
tickSize: PropTypes.number
|
|
105
130
|
}), PropTypes.string]),
|
|
106
131
|
/**
|
|
@@ -117,10 +142,25 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
117
142
|
label: PropTypes.string,
|
|
118
143
|
labelFontSize: PropTypes.number,
|
|
119
144
|
position: PropTypes.oneOf(['left', 'right']),
|
|
145
|
+
slotProps: PropTypes.object,
|
|
146
|
+
slots: PropTypes.object,
|
|
120
147
|
stroke: PropTypes.string,
|
|
121
148
|
tickFontSize: PropTypes.number,
|
|
149
|
+
tickMaxStep: PropTypes.number,
|
|
150
|
+
tickMinStep: PropTypes.number,
|
|
151
|
+
tickNumber: PropTypes.number,
|
|
122
152
|
tickSize: PropTypes.number
|
|
123
153
|
}), PropTypes.string]),
|
|
154
|
+
/**
|
|
155
|
+
* The props used for each component slot.
|
|
156
|
+
* @default {}
|
|
157
|
+
*/
|
|
158
|
+
slotProps: PropTypes.object,
|
|
159
|
+
/**
|
|
160
|
+
* Overridable component slots.
|
|
161
|
+
* @default {}
|
|
162
|
+
*/
|
|
163
|
+
slots: PropTypes.object,
|
|
124
164
|
/**
|
|
125
165
|
* Indicate which axis to display the top of the charts.
|
|
126
166
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
@@ -135,8 +175,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
135
175
|
label: PropTypes.string,
|
|
136
176
|
labelFontSize: PropTypes.number,
|
|
137
177
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
178
|
+
slotProps: PropTypes.object,
|
|
179
|
+
slots: PropTypes.object,
|
|
138
180
|
stroke: PropTypes.string,
|
|
139
181
|
tickFontSize: PropTypes.number,
|
|
182
|
+
tickMaxStep: PropTypes.number,
|
|
183
|
+
tickMinStep: PropTypes.number,
|
|
184
|
+
tickNumber: PropTypes.number,
|
|
140
185
|
tickSize: PropTypes.number
|
|
141
186
|
}), PropTypes.string])
|
|
142
187
|
} : void 0;
|
|
@@ -21,6 +21,7 @@ function ChartsAxisHighlight(props) {
|
|
|
21
21
|
var _React$useContext2 = React.useContext(InteractionContext),
|
|
22
22
|
axis = _React$useContext2.axis;
|
|
23
23
|
var getXPosition = getValueToPositionMapper(xScale);
|
|
24
|
+
var getYPosition = getValueToPositionMapper(yScale);
|
|
24
25
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
25
26
|
children: [xAxisHighlight === 'band' && axis.x !== null && isBandScale(xScale) && /*#__PURE__*/_jsx("path", {
|
|
26
27
|
d: "M ".concat(xScale(axis.x.value) - (xScale.step() - xScale.bandwidth()) / 2, " ").concat(yScale.range()[0], " l ").concat(xScale.step(), " 0 l 0 ").concat(yScale.range()[1] - yScale.range()[0], " l ").concat(-xScale.step(), " 0 Z"),
|
|
@@ -29,15 +30,22 @@ function ChartsAxisHighlight(props) {
|
|
|
29
30
|
style: {
|
|
30
31
|
pointerEvents: 'none'
|
|
31
32
|
}
|
|
33
|
+
}), yAxisHighlight === 'band' && axis.y !== null && isBandScale(yScale) && /*#__PURE__*/_jsx("path", {
|
|
34
|
+
d: "M ".concat(xScale.range()[0], " ").concat(yScale(axis.y.value) - (yScale.step() - yScale.bandwidth()) / 2, " l 0 ").concat(yScale.step(), " l ").concat(xScale.range()[1] - xScale.range()[0], " 0 l 0 ").concat(-yScale.step(), " Z"),
|
|
35
|
+
fill: "gray",
|
|
36
|
+
fillOpacity: 0.1,
|
|
37
|
+
style: {
|
|
38
|
+
pointerEvents: 'none'
|
|
39
|
+
}
|
|
32
40
|
}), xAxisHighlight === 'line' && axis.x !== null && /*#__PURE__*/_jsx("path", {
|
|
33
|
-
d: "M ".concat(getXPosition(axis.x.value), " ").concat(yScale
|
|
41
|
+
d: "M ".concat(getXPosition(axis.x.value), " ").concat(yScale.range()[0], " L ").concat(getXPosition(axis.x.value), " ").concat(yScale.range()[1]),
|
|
34
42
|
stroke: "black",
|
|
35
43
|
strokeDasharray: "5 2",
|
|
36
44
|
style: {
|
|
37
45
|
pointerEvents: 'none'
|
|
38
46
|
}
|
|
39
47
|
}), yAxisHighlight === 'line' && axis.y !== null && /*#__PURE__*/_jsx("path", {
|
|
40
|
-
d: "M ".concat(xScale.range()[0], " ").concat(
|
|
48
|
+
d: "M ".concat(xScale.range()[0], " ").concat(getYPosition(axis.y.value), " L ").concat(xScale.range()[1], " ").concat(getYPosition(axis.y.value)),
|
|
41
49
|
stroke: "black",
|
|
42
50
|
strokeDasharray: "5 2",
|
|
43
51
|
style: {
|
|
@@ -52,6 +60,6 @@ process.env.NODE_ENV !== "production" ? ChartsAxisHighlight.propTypes = {
|
|
|
52
60
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
53
61
|
// ----------------------------------------------------------------------
|
|
54
62
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
55
|
-
y: PropTypes.oneOf(['line', 'none'])
|
|
63
|
+
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
56
64
|
} : void 0;
|
|
57
65
|
export { ChartsAxisHighlight };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { useSlotProps } from '@mui/base/utils';
|
|
3
4
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
4
5
|
import { useThemeProps, useTheme, styled } from '@mui/material/styles';
|
|
5
6
|
import { DrawingContext } from '../context/DrawingProvider';
|
|
@@ -123,7 +124,7 @@ export var ChartsLegendLabel = styled('text', {
|
|
|
123
124
|
color: 'inherit',
|
|
124
125
|
transform: "translate(\n calc(var(--ChartsLegend-itemMarkSize) + var(--ChartsLegend-labelSpacing)),\n calc(0.5 * var(--ChartsLegend-itemMarkSize))\n )",
|
|
125
126
|
fill: theme.palette.text.primary,
|
|
126
|
-
|
|
127
|
+
dominantBaseline: 'central'
|
|
127
128
|
});
|
|
128
129
|
});
|
|
129
130
|
var defaultProps = {
|
|
@@ -136,25 +137,18 @@ var defaultProps = {
|
|
|
136
137
|
itemWidth: 100,
|
|
137
138
|
spacing: 2
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
name: 'MuiChartsLegend'
|
|
143
|
-
});
|
|
144
|
-
var position = props.position,
|
|
140
|
+
function DefaultChartsLegend(props) {
|
|
141
|
+
var hidden = props.hidden,
|
|
142
|
+
position = props.position,
|
|
145
143
|
direction = props.direction,
|
|
146
144
|
offset = props.offset,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}));
|
|
152
|
-
var drawingArea = React.useContext(DrawingContext);
|
|
153
|
-
var series = React.useContext(SeriesContext);
|
|
145
|
+
series = props.series,
|
|
146
|
+
seriesToDisplay = props.seriesToDisplay,
|
|
147
|
+
drawingArea = props.drawingArea,
|
|
148
|
+
classes = props.classes;
|
|
154
149
|
if (hidden) {
|
|
155
150
|
return null;
|
|
156
151
|
}
|
|
157
|
-
var seriesToDisplay = getSeriesToDisplay(series);
|
|
158
152
|
return /*#__PURE__*/_jsx(ChartsLegendRoot, {
|
|
159
153
|
ownerState: {
|
|
160
154
|
direction: direction,
|
|
@@ -187,4 +181,41 @@ export function ChartsLegend(inProps) {
|
|
|
187
181
|
}, id);
|
|
188
182
|
})
|
|
189
183
|
});
|
|
184
|
+
}
|
|
185
|
+
export function ChartsLegend(inProps) {
|
|
186
|
+
var _slots$legend;
|
|
187
|
+
var props = useThemeProps({
|
|
188
|
+
props: _extends({}, defaultProps, inProps),
|
|
189
|
+
name: 'MuiChartsLegend'
|
|
190
|
+
});
|
|
191
|
+
var position = props.position,
|
|
192
|
+
direction = props.direction,
|
|
193
|
+
offset = props.offset,
|
|
194
|
+
hidden = props.hidden,
|
|
195
|
+
slots = props.slots,
|
|
196
|
+
slotProps = props.slotProps;
|
|
197
|
+
var theme = useTheme();
|
|
198
|
+
var classes = useUtilityClasses(_extends({}, props, {
|
|
199
|
+
theme: theme
|
|
200
|
+
}));
|
|
201
|
+
var drawingArea = React.useContext(DrawingContext);
|
|
202
|
+
var series = React.useContext(SeriesContext);
|
|
203
|
+
var seriesToDisplay = getSeriesToDisplay(series);
|
|
204
|
+
var ChartLegendRender = (_slots$legend = slots == null ? void 0 : slots.legend) != null ? _slots$legend : DefaultChartsLegend;
|
|
205
|
+
var chartLegendRenderProps = useSlotProps({
|
|
206
|
+
elementType: ChartLegendRender,
|
|
207
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.legend,
|
|
208
|
+
additionalProps: {
|
|
209
|
+
position: position,
|
|
210
|
+
direction: direction,
|
|
211
|
+
offset: offset,
|
|
212
|
+
classes: classes,
|
|
213
|
+
drawingArea: drawingArea,
|
|
214
|
+
series: series,
|
|
215
|
+
hidden: hidden,
|
|
216
|
+
seriesToDisplay: seriesToDisplay
|
|
217
|
+
},
|
|
218
|
+
ownerState: {}
|
|
219
|
+
});
|
|
220
|
+
return /*#__PURE__*/_jsx(ChartLegendRender, _extends({}, chartLegendRenderProps));
|
|
190
221
|
}
|
|
@@ -71,30 +71,34 @@ export function ChartsAxisTooltipContent(props) {
|
|
|
71
71
|
axisData = props.axisData,
|
|
72
72
|
sx = props.sx,
|
|
73
73
|
classes = props.classes;
|
|
74
|
-
var
|
|
75
|
-
var
|
|
74
|
+
var isXaxis = (axisData.x && axisData.x.index) !== undefined;
|
|
75
|
+
var dataIndex = isXaxis ? axisData.x && axisData.x.index : axisData.y && axisData.y.index;
|
|
76
|
+
var axisValue = isXaxis ? axisData.x && axisData.x.value : axisData.y && axisData.y.value;
|
|
76
77
|
var _React$useContext = React.useContext(CartesianContext),
|
|
77
78
|
xAxisIds = _React$useContext.xAxisIds,
|
|
78
|
-
xAxis = _React$useContext.xAxis
|
|
79
|
+
xAxis = _React$useContext.xAxis,
|
|
80
|
+
yAxisIds = _React$useContext.yAxisIds,
|
|
81
|
+
yAxis = _React$useContext.yAxis;
|
|
79
82
|
var series = React.useContext(SeriesContext);
|
|
80
|
-
var
|
|
83
|
+
var USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
|
|
81
84
|
var relevantSeries = React.useMemo(function () {
|
|
82
85
|
var rep = [];
|
|
83
86
|
Object.keys(series).filter(function (seriesType) {
|
|
84
87
|
return ['bar', 'line', 'scatter'].includes(seriesType);
|
|
85
88
|
}).forEach(function (seriesType) {
|
|
86
89
|
series[seriesType].seriesOrder.forEach(function (seriesId) {
|
|
87
|
-
var
|
|
88
|
-
|
|
90
|
+
var item = series[seriesType].series[seriesId];
|
|
91
|
+
var axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
|
|
92
|
+
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
89
93
|
rep.push(series[seriesType].series[seriesId]);
|
|
90
94
|
}
|
|
91
95
|
});
|
|
92
96
|
});
|
|
93
97
|
return rep;
|
|
94
|
-
}, [
|
|
98
|
+
}, [USED_AXIS_ID, isXaxis, series]);
|
|
95
99
|
var relevantAxis = React.useMemo(function () {
|
|
96
|
-
return xAxis[
|
|
97
|
-
}, [
|
|
100
|
+
return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
|
|
101
|
+
}, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
|
|
98
102
|
var Content = content != null ? content : DefaultChartsAxisContent;
|
|
99
103
|
return /*#__PURE__*/_jsx(Content, {
|
|
100
104
|
axisData: axisData,
|
|
@@ -9,7 +9,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
|
|
|
9
9
|
import { DrawingContext } from '../context/DrawingProvider';
|
|
10
10
|
import useTicks from '../hooks/useTicks';
|
|
11
11
|
import { getAxisUtilityClass } from '../ChartsAxis/axisClasses';
|
|
12
|
-
import {
|
|
12
|
+
import { ChartsLine, ChartsTick, ChartsTickLabel, ChartsLabel, AxisRoot } from '../internals/components/AxisSharedComponents';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
@@ -34,6 +34,7 @@ var defaultProps = {
|
|
|
34
34
|
tickSize: 6
|
|
35
35
|
};
|
|
36
36
|
function ChartsXAxis(inProps) {
|
|
37
|
+
var _slots$axisLine, _slots$axisTick, _slots$axisTickLabel, _slots$axisLabel;
|
|
37
38
|
var props = useThemeProps({
|
|
38
39
|
props: _extends({}, defaultProps, inProps),
|
|
39
40
|
name: 'MuiChartsXAxis'
|
|
@@ -51,7 +52,9 @@ function ChartsXAxis(inProps) {
|
|
|
51
52
|
label = defaultizedProps.label,
|
|
52
53
|
labelFontSize = defaultizedProps.labelFontSize,
|
|
53
54
|
tickSizeProp = defaultizedProps.tickSize,
|
|
54
|
-
valueFormatter = defaultizedProps.valueFormatter
|
|
55
|
+
valueFormatter = defaultizedProps.valueFormatter,
|
|
56
|
+
slots = defaultizedProps.slots,
|
|
57
|
+
slotProps = defaultizedProps.slotProps;
|
|
55
58
|
var theme = useTheme();
|
|
56
59
|
var classes = useUtilityClasses(_extends({}, defaultizedProps, {
|
|
57
60
|
theme: theme
|
|
@@ -72,14 +75,18 @@ function ChartsXAxis(inProps) {
|
|
|
72
75
|
x: left + width / 2,
|
|
73
76
|
y: positionSigne * (tickFontSize + tickSize + 10)
|
|
74
77
|
};
|
|
78
|
+
var Line = (_slots$axisLine = slots == null ? void 0 : slots.axisLine) != null ? _slots$axisLine : ChartsLine;
|
|
79
|
+
var Tick = (_slots$axisTick = slots == null ? void 0 : slots.axisTick) != null ? _slots$axisTick : ChartsTick;
|
|
80
|
+
var TickLabel = (_slots$axisTickLabel = slots == null ? void 0 : slots.axisTickLabel) != null ? _slots$axisTickLabel : ChartsTickLabel;
|
|
81
|
+
var Label = (_slots$axisLabel = slots == null ? void 0 : slots.axisLabel) != null ? _slots$axisLabel : ChartsLabel;
|
|
75
82
|
return /*#__PURE__*/_jsxs(AxisRoot, {
|
|
76
83
|
transform: "translate(0, ".concat(position === 'bottom' ? top + height : top, ")"),
|
|
77
84
|
className: classes.root,
|
|
78
|
-
children: [!disableLine && /*#__PURE__*/_jsx(Line, {
|
|
85
|
+
children: [!disableLine && /*#__PURE__*/_jsx(Line, _extends({
|
|
79
86
|
x1: xScale.range()[0],
|
|
80
87
|
x2: xScale.range()[1],
|
|
81
88
|
className: classes.line
|
|
82
|
-
}), xTicks.map(function (_ref, index) {
|
|
89
|
+
}, slotProps == null ? void 0 : slotProps.axisLine)), xTicks.map(function (_ref, index) {
|
|
83
90
|
var formattedValue = _ref.formattedValue,
|
|
84
91
|
offset = _ref.offset,
|
|
85
92
|
labelOffset = _ref.labelOffset;
|
|
@@ -88,26 +95,28 @@ function ChartsXAxis(inProps) {
|
|
|
88
95
|
return /*#__PURE__*/_jsxs("g", {
|
|
89
96
|
transform: "translate(".concat(offset, ", 0)"),
|
|
90
97
|
className: classes.tickContainer,
|
|
91
|
-
children: [!disableTicks && /*#__PURE__*/_jsx(Tick, {
|
|
98
|
+
children: [!disableTicks && /*#__PURE__*/_jsx(Tick, _extends({
|
|
92
99
|
y2: positionSigne * tickSize,
|
|
93
100
|
className: classes.tick
|
|
94
|
-
}), formattedValue !== undefined && /*#__PURE__*/_jsx(TickLabel, {
|
|
101
|
+
}, slotProps == null ? void 0 : slotProps.axisTick)), formattedValue !== undefined && /*#__PURE__*/_jsx(TickLabel, _extends({
|
|
95
102
|
x: xTickLabel,
|
|
96
103
|
y: yTickLabel,
|
|
97
104
|
"transform-origin": "".concat(xTickLabel, "px ").concat(yTickLabel, "px"),
|
|
98
105
|
sx: {
|
|
99
106
|
fontSize: tickFontSize
|
|
100
107
|
},
|
|
101
|
-
className: classes.tickLabel
|
|
108
|
+
className: classes.tickLabel
|
|
109
|
+
}, slotProps == null ? void 0 : slotProps.axisTickLabel, {
|
|
102
110
|
children: formattedValue
|
|
103
|
-
})]
|
|
111
|
+
}))]
|
|
104
112
|
}, index);
|
|
105
113
|
}), label && /*#__PURE__*/_jsx(Label, _extends({}, labelRefPoint, {
|
|
106
114
|
sx: {
|
|
107
115
|
fontSize: labelFontSize,
|
|
108
116
|
transformOrigin: "".concat(labelRefPoint.x, "px ").concat(labelRefPoint.y, "px")
|
|
109
117
|
},
|
|
110
|
-
className: classes.label
|
|
118
|
+
className: classes.label
|
|
119
|
+
}, slotProps == null ? void 0 : slotProps.axisLabel, {
|
|
111
120
|
children: label
|
|
112
121
|
}))]
|
|
113
122
|
});
|
|
@@ -153,6 +162,16 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
153
162
|
* Position of the axis.
|
|
154
163
|
*/
|
|
155
164
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
165
|
+
/**
|
|
166
|
+
* The props used for each component slot.
|
|
167
|
+
* @default {}
|
|
168
|
+
*/
|
|
169
|
+
slotProps: PropTypes.object,
|
|
170
|
+
/**
|
|
171
|
+
* Overridable component slots.
|
|
172
|
+
* @default {}
|
|
173
|
+
*/
|
|
174
|
+
slots: PropTypes.object,
|
|
156
175
|
/**
|
|
157
176
|
* The stroke color of the axis line.
|
|
158
177
|
* @default 'currentColor'
|
|
@@ -163,6 +182,23 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
163
182
|
* @default 12
|
|
164
183
|
*/
|
|
165
184
|
tickFontSize: PropTypes.number,
|
|
185
|
+
/**
|
|
186
|
+
* Maximal step between two ticks.
|
|
187
|
+
* When using time data, the value is assumed to be in ms.
|
|
188
|
+
* Not supported by categorical axis (band, points).
|
|
189
|
+
*/
|
|
190
|
+
tickMaxStep: PropTypes.number,
|
|
191
|
+
/**
|
|
192
|
+
* Maximal step between two ticks.
|
|
193
|
+
* When using time data, the value is assumed to be in ms.
|
|
194
|
+
* Not supported by categorical axis (band, points).
|
|
195
|
+
*/
|
|
196
|
+
tickMinStep: PropTypes.number,
|
|
197
|
+
/**
|
|
198
|
+
* The number of ticks. This number is not guaranted.
|
|
199
|
+
* Not supported by categorical axis (band, points).
|
|
200
|
+
*/
|
|
201
|
+
tickNumber: PropTypes.number,
|
|
166
202
|
/**
|
|
167
203
|
* The size of the ticks.
|
|
168
204
|
* @default 6
|