@mui/x-charts 6.0.0-alpha.13 → 6.0.0-alpha.15
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 +6 -3
- package/BarChart/BarChart.js +7 -10
- package/BarChart/BarElement.js +2 -4
- package/BarChart/formatter.js +1 -2
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +165 -1
- package/ChartContainer/index.js +2 -3
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsLegend/ChartsLegend.d.ts +43 -24
- package/ChartsLegend/ChartsLegend.js +186 -148
- package/ChartsLegend/chartsLegendClasses.js +1 -2
- package/ChartsLegend/utils.d.ts +1 -6
- package/ChartsSurface.js +5 -14
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +16 -6
- package/ChartsTooltip/ChartsTooltip.d.ts +23 -0
- package/ChartsTooltip/ChartsTooltip.js +47 -13
- package/ChartsTooltip/ChartsTooltipTable.js +6 -11
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/ChartsXAxis/ChartsXAxis.js +48 -25
- package/ChartsYAxis/ChartsYAxis.js +47 -26
- package/LineChart/AreaElement.js +2 -4
- package/LineChart/LineChart.d.ts +6 -3
- package/LineChart/LineChart.js +11 -11
- package/LineChart/LineElement.js +2 -4
- package/LineChart/LineHighlightElement.js +1 -2
- package/LineChart/MarkElement.js +1 -2
- package/LineChart/formatter.js +1 -2
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +1 -0
- package/PieChart/PieArc.js +6 -4
- package/PieChart/PieArcLabel.js +1 -2
- package/PieChart/PieChart.d.ts +8 -4
- package/PieChart/PieChart.js +11 -10
- package/PieChart/PiePlot.d.ts +8 -0
- package/PieChart/PiePlot.js +21 -5
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/ResponsiveChartContainer/index.js +2 -3
- package/ScatterChart/ScatterChart.d.ts +6 -3
- package/ScatterChart/ScatterChart.js +7 -10
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +3 -3
- package/SparkLineChart/SparkLineChart.js +7 -3
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +5 -8
- package/context/CartesianContextProvider.js +11 -12
- package/context/DrawingProvider.d.ts +2 -0
- package/context/DrawingProvider.js +4 -4
- package/context/HighlightProvider.js +1 -2
- package/context/InteractionProvider.js +1 -2
- package/context/SeriesContextProvider.js +1 -2
- package/esm/BarChart/BarChart.js +6 -8
- package/esm/ChartsLegend/ChartsLegend.js +184 -142
- package/esm/ChartsSurface.js +3 -11
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/esm/ChartsTooltip/ChartsTooltip.js +47 -12
- package/esm/ChartsXAxis/ChartsXAxis.js +47 -24
- package/esm/ChartsYAxis/ChartsYAxis.js +46 -25
- package/esm/LineChart/LineChart.js +10 -9
- package/esm/PieChart/PieArc.js +5 -2
- package/esm/PieChart/PieChart.js +11 -10
- package/esm/PieChart/PiePlot.js +17 -2
- package/esm/ScatterChart/ScatterChart.js +6 -8
- package/esm/SparkLineChart/SparkLineChart.js +6 -1
- package/esm/constants.js +1 -1
- package/esm/context/CartesianContextProvider.js +11 -11
- package/esm/context/DrawingProvider.js +2 -0
- package/esm/hooks/useChartDimensions.js +2 -0
- package/esm/hooks/useTicks.js +5 -5
- package/esm/internals/components/AxisSharedComponents.js +15 -70
- package/esm/internals/components/ChartsText.js +71 -0
- package/esm/internals/domUtils.js +113 -0
- package/hooks/useChartDimensions.d.ts +2 -0
- package/hooks/useChartDimensions.js +3 -2
- package/hooks/useTicks.d.ts +2 -3
- package/hooks/useTicks.js +7 -8
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -4
- package/internals/components/AxisSharedComponents.js +18 -78
- package/internals/components/ChartsText.d.ts +32 -0
- package/internals/components/ChartsText.js +81 -0
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/domUtils.d.ts +14 -0
- package/internals/domUtils.js +122 -0
- package/internals/stackSeries.js +2 -4
- package/legacy/BarChart/BarChart.js +6 -8
- package/legacy/ChartsLegend/ChartsLegend.js +196 -140
- package/legacy/ChartsSurface.js +2 -11
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/legacy/ChartsTooltip/ChartsTooltip.js +50 -12
- package/legacy/ChartsXAxis/ChartsXAxis.js +47 -24
- package/legacy/ChartsYAxis/ChartsYAxis.js +46 -25
- package/legacy/LineChart/LineChart.js +10 -9
- package/legacy/PieChart/PieArc.js +4 -1
- package/legacy/PieChart/PieChart.js +11 -10
- package/legacy/PieChart/PiePlot.js +17 -2
- package/legacy/ScatterChart/ScatterChart.js +6 -8
- package/legacy/SparkLineChart/SparkLineChart.js +6 -1
- package/legacy/constants.js +1 -1
- package/legacy/context/CartesianContextProvider.js +11 -11
- package/legacy/context/DrawingProvider.js +2 -0
- package/legacy/hooks/useChartDimensions.js +2 -0
- package/legacy/hooks/useTicks.js +5 -5
- 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/models/axis.d.ts +6 -5
- package/models/layout.d.ts +7 -6
- package/modern/BarChart/BarChart.js +6 -8
- package/modern/ChartsLegend/ChartsLegend.js +184 -142
- package/modern/ChartsSurface.js +3 -11
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/modern/ChartsTooltip/ChartsTooltip.js +46 -12
- package/modern/ChartsXAxis/ChartsXAxis.js +47 -24
- package/modern/ChartsYAxis/ChartsYAxis.js +46 -25
- package/modern/LineChart/LineChart.js +10 -9
- package/modern/PieChart/PieArc.js +5 -2
- package/modern/PieChart/PieChart.js +11 -10
- package/modern/PieChart/PiePlot.js +17 -2
- package/modern/ScatterChart/ScatterChart.js +6 -8
- package/modern/SparkLineChart/SparkLineChart.js +6 -1
- package/modern/constants.js +1 -1
- package/modern/context/CartesianContextProvider.js +11 -11
- package/modern/context/DrawingProvider.js +2 -0
- package/modern/hooks/useChartDimensions.js +2 -0
- package/modern/hooks/useTicks.js +5 -5
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +15 -70
- package/modern/internals/components/ChartsText.js +71 -0
- package/modern/internals/domUtils.js +113 -0
- package/package.json +3 -3
|
@@ -5,11 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ChartsTooltip = ChartsTooltip;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
11
13
|
var _Popper = require("@mui/base/Popper");
|
|
12
14
|
var _NoSsr = require("@mui/base/NoSsr");
|
|
15
|
+
var _utils = require("@mui/base/utils");
|
|
13
16
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
14
17
|
var _utils2 = require("./utils");
|
|
15
18
|
var _ChartsItemTooltipContent = require("./ChartsItemTooltipContent");
|
|
@@ -28,13 +31,25 @@ const useUtilityClasses = ownerState => {
|
|
|
28
31
|
labelCell: ['labelCell'],
|
|
29
32
|
valueCell: ['valueCell']
|
|
30
33
|
};
|
|
31
|
-
return (0,
|
|
34
|
+
return (0, _composeClasses.default)(slots, _tooltipClasses.getTooltipUtilityClass, classes);
|
|
32
35
|
};
|
|
36
|
+
const ChartsTooltipRoot = (0, _styles.styled)(_Popper.Popper, {
|
|
37
|
+
name: 'MuiChartsTooltip',
|
|
38
|
+
slot: 'Root',
|
|
39
|
+
overridesResolver: (_, styles) => styles.root
|
|
40
|
+
})(({
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
43
|
+
pointerEvents: 'none',
|
|
44
|
+
zIndex: theme.zIndex.modal
|
|
45
|
+
}));
|
|
33
46
|
function ChartsTooltip(props) {
|
|
34
47
|
const {
|
|
35
48
|
trigger = 'axis',
|
|
36
49
|
itemContent,
|
|
37
|
-
axisContent
|
|
50
|
+
axisContent,
|
|
51
|
+
slots,
|
|
52
|
+
slotProps
|
|
38
53
|
} = props;
|
|
39
54
|
const mousePosition = (0, _utils2.useMouseTracker)();
|
|
40
55
|
const {
|
|
@@ -47,33 +62,40 @@ function ChartsTooltip(props) {
|
|
|
47
62
|
const classes = useUtilityClasses({
|
|
48
63
|
classes: props.classes
|
|
49
64
|
});
|
|
65
|
+
const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
|
|
66
|
+
const popperProps = (0, _utils.useSlotProps)({
|
|
67
|
+
elementType: PopperComponent,
|
|
68
|
+
externalSlotProps: slotProps?.popper,
|
|
69
|
+
additionalProps: {
|
|
70
|
+
open: popperOpen,
|
|
71
|
+
placement: 'right-start',
|
|
72
|
+
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition)
|
|
73
|
+
},
|
|
74
|
+
ownerState: {}
|
|
75
|
+
});
|
|
50
76
|
if (trigger === 'none') {
|
|
51
77
|
return null;
|
|
52
78
|
}
|
|
53
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoSsr.NoSsr, {
|
|
54
|
-
children: popperOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
55
|
-
open: popperOpen,
|
|
56
|
-
placement: "right-start",
|
|
57
|
-
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition),
|
|
58
|
-
style: {
|
|
59
|
-
pointerEvents: 'none'
|
|
60
|
-
},
|
|
80
|
+
children: popperOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(PopperComponent, (0, _extends2.default)({}, popperProps, {
|
|
61
81
|
children: trigger === 'item' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsItemTooltipContent.ChartsItemTooltipContent, {
|
|
62
82
|
itemData: displayedData,
|
|
63
|
-
content: itemContent,
|
|
83
|
+
content: slots?.itemContent ?? itemContent,
|
|
84
|
+
contentProps: slotProps?.itemContent,
|
|
64
85
|
sx: {
|
|
65
86
|
mx: 2
|
|
66
87
|
},
|
|
67
88
|
classes: classes
|
|
68
89
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisTooltipContent.ChartsAxisTooltipContent, {
|
|
69
90
|
axisData: displayedData,
|
|
70
|
-
content: axisContent,
|
|
91
|
+
content: slots?.axisContent ?? axisContent,
|
|
92
|
+
contentProps: slotProps?.axisContent,
|
|
71
93
|
sx: {
|
|
72
94
|
mx: 2
|
|
73
95
|
},
|
|
74
96
|
classes: classes
|
|
75
97
|
})
|
|
76
|
-
})
|
|
98
|
+
}))
|
|
77
99
|
});
|
|
78
100
|
}
|
|
79
101
|
process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
@@ -83,6 +105,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
83
105
|
// ----------------------------------------------------------------------
|
|
84
106
|
/**
|
|
85
107
|
* Component to override the tooltip content when triger is set to 'axis'.
|
|
108
|
+
* @deprecated Use slots.axisContent instead
|
|
86
109
|
*/
|
|
87
110
|
axisContent: _propTypes.default.elementType,
|
|
88
111
|
/**
|
|
@@ -91,8 +114,19 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
91
114
|
classes: _propTypes.default.object,
|
|
92
115
|
/**
|
|
93
116
|
* Component to override the tooltip content when triger is set to 'item'.
|
|
117
|
+
* @deprecated Use slots.itemContent instead
|
|
94
118
|
*/
|
|
95
119
|
itemContent: _propTypes.default.elementType,
|
|
120
|
+
/**
|
|
121
|
+
* The props used for each component slot.
|
|
122
|
+
* @default {}
|
|
123
|
+
*/
|
|
124
|
+
slotProps: _propTypes.default.object,
|
|
125
|
+
/**
|
|
126
|
+
* Overridable component slots.
|
|
127
|
+
* @default {}
|
|
128
|
+
*/
|
|
129
|
+
slots: _propTypes.default.object,
|
|
96
130
|
/**
|
|
97
131
|
* Select the kind of tooltip to display
|
|
98
132
|
* - 'item': Shows data about the item below the mouse.
|
|
@@ -8,7 +8,7 @@ exports.ChartsTooltipTable = exports.ChartsTooltipRow = exports.ChartsTooltipPap
|
|
|
8
8
|
var _Box = _interopRequireDefault(require("@mui/system/Box"));
|
|
9
9
|
var _styles = require("@mui/material/styles");
|
|
10
10
|
var _tooltipClasses = require("./tooltipClasses");
|
|
11
|
-
const ChartsTooltipPaper = (0, _styles.styled)('div', {
|
|
11
|
+
const ChartsTooltipPaper = exports.ChartsTooltipPaper = (0, _styles.styled)('div', {
|
|
12
12
|
name: 'MuiChartsTooltip',
|
|
13
13
|
slot: 'Container'
|
|
14
14
|
})(({
|
|
@@ -20,8 +20,7 @@ const ChartsTooltipPaper = (0, _styles.styled)('div', {
|
|
|
20
20
|
border: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
21
21
|
borderRadius: theme.shape.borderRadius
|
|
22
22
|
}));
|
|
23
|
-
exports.
|
|
24
|
-
const ChartsTooltipTable = (0, _styles.styled)('table', {
|
|
23
|
+
const ChartsTooltipTable = exports.ChartsTooltipTable = (0, _styles.styled)('table', {
|
|
25
24
|
name: 'MuiChartsTooltip',
|
|
26
25
|
slot: 'Table'
|
|
27
26
|
})(({
|
|
@@ -32,8 +31,7 @@ const ChartsTooltipTable = (0, _styles.styled)('table', {
|
|
|
32
31
|
borderBottom: `solid ${(theme.vars || theme).palette.divider} 1px`
|
|
33
32
|
}
|
|
34
33
|
}));
|
|
35
|
-
exports.
|
|
36
|
-
const ChartsTooltipRow = (0, _styles.styled)('tr', {
|
|
34
|
+
const ChartsTooltipRow = exports.ChartsTooltipRow = (0, _styles.styled)('tr', {
|
|
37
35
|
name: 'MuiChartsTooltip',
|
|
38
36
|
slot: 'Row'
|
|
39
37
|
})(({
|
|
@@ -46,8 +44,7 @@ const ChartsTooltipRow = (0, _styles.styled)('tr', {
|
|
|
46
44
|
paddingBottom: theme.spacing(1)
|
|
47
45
|
}
|
|
48
46
|
}));
|
|
49
|
-
exports.
|
|
50
|
-
const ChartsTooltipCell = (0, _styles.styled)('td', {
|
|
47
|
+
const ChartsTooltipCell = exports.ChartsTooltipCell = (0, _styles.styled)('td', {
|
|
51
48
|
name: 'MuiChartsTooltip',
|
|
52
49
|
slot: 'Cell'
|
|
53
50
|
})(({
|
|
@@ -69,8 +66,7 @@ const ChartsTooltipCell = (0, _styles.styled)('td', {
|
|
|
69
66
|
paddingRight: theme.spacing(2)
|
|
70
67
|
}
|
|
71
68
|
}));
|
|
72
|
-
exports.
|
|
73
|
-
const ChartsTooltipMark = (0, _styles.styled)(_Box.default, {
|
|
69
|
+
const ChartsTooltipMark = exports.ChartsTooltipMark = (0, _styles.styled)(_Box.default, {
|
|
74
70
|
name: 'MuiChartsTooltip',
|
|
75
71
|
slot: 'Mark'
|
|
76
72
|
})(({
|
|
@@ -84,5 +80,4 @@ const ChartsTooltipMark = (0, _styles.styled)(_Box.default, {
|
|
|
84
80
|
borderColor: (theme.vars || theme).palette.background.paper,
|
|
85
81
|
border: `solid ${(theme.vars || theme).palette.background.paper} ${theme.spacing(0.25)}`,
|
|
86
82
|
boxSizing: 'content-box'
|
|
87
|
-
}));
|
|
88
|
-
exports.ChartsTooltipMark = ChartsTooltipMark;
|
|
83
|
+
}));
|
|
@@ -9,5 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getTooltipUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiChartsTooltip', slot);
|
|
11
11
|
}
|
|
12
|
-
const tooltipClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsTooltip', ['root', 'markCell', 'labelCell', 'valueCell']);
|
|
13
|
-
exports.tooltipClasses = tooltipClasses;
|
|
12
|
+
const tooltipClasses = exports.tooltipClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsTooltip', ['root', 'markCell', 'labelCell', 'valueCell']);
|
|
@@ -9,15 +9,17 @@ 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");
|
|
19
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["scale", "
|
|
22
|
+
const _excluded = ["scale", "tickNumber"];
|
|
21
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
25
|
const useUtilityClasses = ownerState => {
|
|
@@ -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: 'bottom',
|
|
@@ -54,7 +56,7 @@ function ChartsXAxis(inProps) {
|
|
|
54
56
|
xAxis: {
|
|
55
57
|
[_props$axisId]: {
|
|
56
58
|
scale: xScale,
|
|
57
|
-
|
|
59
|
+
tickNumber
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
} = _React$useContext,
|
|
@@ -85,7 +87,7 @@ function ChartsXAxis(inProps) {
|
|
|
85
87
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
86
88
|
const xTicks = (0, _useTicks.default)({
|
|
87
89
|
scale: xScale,
|
|
88
|
-
|
|
90
|
+
tickNumber,
|
|
89
91
|
valueFormatter
|
|
90
92
|
});
|
|
91
93
|
const positionSigne = position === 'bottom' ? 1 : -1;
|
|
@@ -93,10 +95,38 @@ function ChartsXAxis(inProps) {
|
|
|
93
95
|
x: left + width / 2,
|
|
94
96
|
y: positionSigne * (tickFontSize + tickSize + 10)
|
|
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
|
+
textAnchor: 'middle',
|
|
107
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto',
|
|
108
|
+
style: {
|
|
109
|
+
fontSize: tickFontSize
|
|
110
|
+
},
|
|
111
|
+
className: classes.tickLabel
|
|
112
|
+
},
|
|
113
|
+
className: classes.tickLabel,
|
|
114
|
+
ownerState: {}
|
|
115
|
+
});
|
|
116
|
+
const axisLabelProps = (0, _utils.useSlotProps)({
|
|
117
|
+
elementType: Label,
|
|
118
|
+
externalSlotProps: slotProps?.axisLabel,
|
|
119
|
+
additionalProps: {
|
|
120
|
+
textAnchor: 'middle',
|
|
121
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto',
|
|
122
|
+
style: {
|
|
123
|
+
fontSize: labelFontSize,
|
|
124
|
+
transformOrigin: `${labelRefPoint.x}px ${labelRefPoint.y}px`
|
|
125
|
+
},
|
|
126
|
+
className: classes.label
|
|
127
|
+
},
|
|
128
|
+
ownerState: {}
|
|
129
|
+
});
|
|
100
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
|
|
101
131
|
transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
|
|
102
132
|
className: classes.root,
|
|
@@ -120,24 +150,17 @@ function ChartsXAxis(inProps) {
|
|
|
120
150
|
}, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
|
|
121
151
|
x: xTickLabel,
|
|
122
152
|
y: yTickLabel,
|
|
123
|
-
"transform-origin": `${xTickLabel}px ${yTickLabel}px
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
className: classes.tickLabel
|
|
128
|
-
}, slotProps?.axisTickLabel, {
|
|
129
|
-
children: formattedValue
|
|
153
|
+
"transform-origin": `${xTickLabel}px ${yTickLabel}px`
|
|
154
|
+
}, axisTickLabelProps, {
|
|
155
|
+
text: formattedValue.toString()
|
|
130
156
|
}))]
|
|
131
157
|
}, index);
|
|
132
|
-
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}, slotProps?.axisLabel, {
|
|
139
|
-
children: label
|
|
140
|
-
}))]
|
|
158
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
159
|
+
className: classes.label,
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
|
|
161
|
+
text: label
|
|
162
|
+
}))
|
|
163
|
+
})]
|
|
141
164
|
});
|
|
142
165
|
}
|
|
143
166
|
process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
@@ -9,15 +9,17 @@ 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", "
|
|
22
|
+
const _excluded = ["scale", "tickNumber"];
|
|
21
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
25
|
const useUtilityClasses = ownerState => {
|
|
@@ -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,7 +87,7 @@ 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
93
|
const positionSigne = position === 'right' ? 1 : -1;
|
|
@@ -93,10 +95,38 @@ function ChartsYAxis(inProps) {
|
|
|
93
95
|
x: positionSigne * (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
|
+
textAnchor: position === 'right' ? 'start' : 'end',
|
|
107
|
+
dominantBaseline: 'central',
|
|
108
|
+
style: {
|
|
109
|
+
fontSize: tickFontSize
|
|
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
|
+
textAnchor: 'middle',
|
|
120
|
+
dominantBaseline: 'auto',
|
|
121
|
+
style: {
|
|
122
|
+
fontSize: labelFontSize,
|
|
123
|
+
transform: `rotate(${positionSigne * 90}deg)`,
|
|
124
|
+
transformOrigin: `${labelRefPoint.x}px ${labelRefPoint.y}px`
|
|
125
|
+
},
|
|
126
|
+
className: classes.label
|
|
127
|
+
},
|
|
128
|
+
ownerState: {}
|
|
129
|
+
});
|
|
100
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
|
|
101
131
|
transform: `translate(${position === 'right' ? left + width : left}, 0)`,
|
|
102
132
|
className: classes.root,
|
|
@@ -121,24 +151,15 @@ function ChartsYAxis(inProps) {
|
|
|
121
151
|
x: xTickLabel,
|
|
122
152
|
y: yTickLabel,
|
|
123
153
|
"transform-origin": `${xTickLabel}px ${yTickLabel}px`,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
className: classes.tickLabel
|
|
128
|
-
}, slotProps?.axisTickLabel, {
|
|
129
|
-
children: formattedValue.toLocaleString()
|
|
130
|
-
}))]
|
|
154
|
+
text: formattedValue.toString()
|
|
155
|
+
}, axisTickLabelProps))]
|
|
131
156
|
}, index);
|
|
132
|
-
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
className: classes.label
|
|
139
|
-
}, slotProps?.axisLabel, {
|
|
140
|
-
children: label
|
|
141
|
-
}))]
|
|
157
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
158
|
+
className: classes.label,
|
|
159
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
|
|
160
|
+
text: label
|
|
161
|
+
}))
|
|
162
|
+
})]
|
|
142
163
|
});
|
|
143
164
|
}
|
|
144
165
|
process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
package/LineChart/AreaElement.js
CHANGED
|
@@ -26,8 +26,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
26
|
function getAreaElementUtilityClass(slot) {
|
|
27
27
|
return (0, _generateUtilityClass.default)('MuiAreaElement', slot);
|
|
28
28
|
}
|
|
29
|
-
const areaElementClasses = (0, _generateUtilityClasses.default)('MuiAreaElement', ['root', 'highlighted', 'faded']);
|
|
30
|
-
exports.areaElementClasses = areaElementClasses;
|
|
29
|
+
const areaElementClasses = exports.areaElementClasses = (0, _generateUtilityClasses.default)('MuiAreaElement', ['root', 'highlighted', 'faded']);
|
|
31
30
|
const useUtilityClasses = ownerState => {
|
|
32
31
|
const {
|
|
33
32
|
classes,
|
|
@@ -40,7 +39,7 @@ const useUtilityClasses = ownerState => {
|
|
|
40
39
|
};
|
|
41
40
|
return (0, _composeClasses.default)(slots, getAreaElementUtilityClass, classes);
|
|
42
41
|
};
|
|
43
|
-
const AreaElementPath = (0, _styles.styled)('path', {
|
|
42
|
+
const AreaElementPath = exports.AreaElementPath = (0, _styles.styled)('path', {
|
|
44
43
|
name: 'MuiAreaElement',
|
|
45
44
|
slot: 'Root',
|
|
46
45
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -52,7 +51,6 @@ const AreaElementPath = (0, _styles.styled)('path', {
|
|
|
52
51
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
53
52
|
opacity: ownerState.isFaded ? 0.3 : 1
|
|
54
53
|
}));
|
|
55
|
-
exports.AreaElementPath = AreaElementPath;
|
|
56
54
|
AreaElementPath.propTypes = {
|
|
57
55
|
// ----------------------------- Warning --------------------------------
|
|
58
56
|
// | These PropTypes are generated from the TypeScript type definitions |
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -6,19 +6,22 @@ import { MarkPlotSlotComponentProps, MarkPlotSlotsComponent } from './MarkPlot';
|
|
|
6
6
|
import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
|
|
7
7
|
import { LineSeriesType } from '../models/seriesType/line';
|
|
8
8
|
import { MakeOptional } from '../models/helpers';
|
|
9
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
9
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
10
10
|
import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
|
|
11
11
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
12
12
|
import { ChartsAxisSlotComponentProps, ChartsAxisSlotsComponent } from '../models/axis';
|
|
13
13
|
import { LineHighlightPlotSlotsComponent, LineHighlightPlotSlotComponentProps } from './LineHighlightPlot';
|
|
14
|
-
export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
14
|
+
export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
15
15
|
}
|
|
16
|
-
export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
16
|
+
export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
17
17
|
}
|
|
18
18
|
export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
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.
|
package/LineChart/LineChart.js
CHANGED
|
@@ -23,7 +23,7 @@ var _LineHighlightPlot = require("./LineHighlightPlot");
|
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
26
|
+
const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
27
27
|
const {
|
|
28
28
|
xAxis,
|
|
29
29
|
yAxis,
|
|
@@ -96,12 +96,14 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
96
96
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
97
97
|
slots: slots,
|
|
98
98
|
slotProps: slotProps
|
|
99
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
99
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
100
|
+
slots: slots,
|
|
101
|
+
slotProps: slotProps
|
|
102
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
100
103
|
id: clipPathId
|
|
101
104
|
}), children]
|
|
102
105
|
});
|
|
103
106
|
});
|
|
104
|
-
exports.LineChart = LineChart;
|
|
105
107
|
process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
106
108
|
// ----------------------------- Warning --------------------------------
|
|
107
109
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -171,23 +173,19 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
171
173
|
tickNumber: _propTypes.default.number,
|
|
172
174
|
tickSize: _propTypes.default.number
|
|
173
175
|
}), _propTypes.default.string]),
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
178
|
+
*/
|
|
174
179
|
legend: _propTypes.default.shape({
|
|
175
180
|
classes: _propTypes.default.object,
|
|
176
181
|
direction: _propTypes.default.oneOf(['column', 'row']),
|
|
177
182
|
hidden: _propTypes.default.bool,
|
|
178
|
-
itemWidth: _propTypes.default.number,
|
|
179
|
-
markSize: _propTypes.default.number,
|
|
180
|
-
offset: _propTypes.default.shape({
|
|
181
|
-
x: _propTypes.default.number,
|
|
182
|
-
y: _propTypes.default.number
|
|
183
|
-
}),
|
|
184
183
|
position: _propTypes.default.shape({
|
|
185
184
|
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
186
185
|
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
187
186
|
}),
|
|
188
187
|
slotProps: _propTypes.default.object,
|
|
189
|
-
slots: _propTypes.default.object
|
|
190
|
-
spacing: _propTypes.default.number
|
|
188
|
+
slots: _propTypes.default.object
|
|
191
189
|
}),
|
|
192
190
|
margin: _propTypes.default.shape({
|
|
193
191
|
bottom: _propTypes.default.number,
|
|
@@ -256,6 +254,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
256
254
|
axisContent: _propTypes.default.elementType,
|
|
257
255
|
classes: _propTypes.default.object,
|
|
258
256
|
itemContent: _propTypes.default.elementType,
|
|
257
|
+
slotProps: _propTypes.default.object,
|
|
258
|
+
slots: _propTypes.default.object,
|
|
259
259
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
260
260
|
}),
|
|
261
261
|
/**
|
package/LineChart/LineElement.js
CHANGED
|
@@ -27,8 +27,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
function getLineElementUtilityClass(slot) {
|
|
28
28
|
return (0, _generateUtilityClass.default)('MuiLineElement', slot);
|
|
29
29
|
}
|
|
30
|
-
const lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
|
|
31
|
-
exports.lineElementClasses = lineElementClasses;
|
|
30
|
+
const lineElementClasses = exports.lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
|
|
32
31
|
const useUtilityClasses = ownerState => {
|
|
33
32
|
const {
|
|
34
33
|
classes,
|
|
@@ -41,7 +40,7 @@ const useUtilityClasses = ownerState => {
|
|
|
41
40
|
};
|
|
42
41
|
return (0, _composeClasses.default)(slots, getLineElementUtilityClass, classes);
|
|
43
42
|
};
|
|
44
|
-
const LineElementPath = (0, _styles.styled)('path', {
|
|
43
|
+
const LineElementPath = exports.LineElementPath = (0, _styles.styled)('path', {
|
|
45
44
|
name: 'MuiLineElement',
|
|
46
45
|
slot: 'Root',
|
|
47
46
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -55,7 +54,6 @@ const LineElementPath = (0, _styles.styled)('path', {
|
|
|
55
54
|
transition: 'opacity 0.2s ease-in, stroke 0.2s ease-in',
|
|
56
55
|
opacity: ownerState.isFaded ? 0.3 : 1
|
|
57
56
|
}));
|
|
58
|
-
exports.LineElementPath = LineElementPath;
|
|
59
57
|
LineElementPath.propTypes = {
|
|
60
58
|
// ----------------------------- Warning --------------------------------
|
|
61
59
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -22,8 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
22
22
|
function getHighlightElementUtilityClass(slot) {
|
|
23
23
|
return (0, _generateUtilityClass.default)('MuiHighlightElement', slot);
|
|
24
24
|
}
|
|
25
|
-
const lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
|
|
26
|
-
exports.lineHighlightElementClasses = lineHighlightElementClasses;
|
|
25
|
+
const lineHighlightElementClasses = exports.lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
|
|
27
26
|
const useUtilityClasses = ownerState => {
|
|
28
27
|
const {
|
|
29
28
|
classes,
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -26,8 +26,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
26
|
function getMarkElementUtilityClass(slot) {
|
|
27
27
|
return (0, _generateUtilityClass.default)('MuiMarkElement', slot);
|
|
28
28
|
}
|
|
29
|
-
const markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
30
|
-
exports.markElementClasses = markElementClasses;
|
|
29
|
+
const markElementClasses = exports.markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
31
30
|
const useUtilityClasses = ownerState => {
|
|
32
31
|
const {
|
|
33
32
|
classes,
|
package/LineChart/formatter.js
CHANGED
package/LineChart/legend.js
CHANGED
package/PieChart/PieArc.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export type PieArcProps = Omit<PieArcOwnerState, 'isFaded' | 'isHighlighted'> &
|
|
|
28
28
|
cornerRadius: PieSeriesType['cornerRadius'];
|
|
29
29
|
highlighted: PieSeriesType['highlighted'];
|
|
30
30
|
faded: PieSeriesType['faded'];
|
|
31
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
31
32
|
};
|
|
32
33
|
declare function PieArc(props: PieArcProps): React.JSX.Element;
|
|
33
34
|
declare namespace PieArc {
|