@mui/x-charts 6.18.1 → 6.18.3
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/BarElement.d.ts +5 -1
- package/BarChart/BarElement.js +24 -1
- package/BarChart/index.d.ts +3 -2
- package/BarChart/index.js +31 -12
- package/CHANGELOG.md +112 -0
- package/ChartsLegend/index.d.ts +1 -0
- package/ChartsLegend/index.js +11 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +6 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.js +93 -69
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +6 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +38 -53
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltip.js +13 -5
- package/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +7 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +174 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +8 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +99 -0
- package/ChartsTooltip/chartsTooltipClasses.d.ts +21 -0
- package/ChartsTooltip/chartsTooltipClasses.js +12 -0
- package/ChartsTooltip/index.d.ts +5 -0
- package/ChartsTooltip/index.js +55 -0
- package/ChartsTooltip/utils.d.ts +1 -1
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsYAxis/ChartsYAxis.js +6 -4
- package/LineChart/extremums.js +25 -8
- package/LineChart/index.d.ts +5 -5
- package/LineChart/index.js +50 -41
- package/PieChart/PieArc.d.ts +5 -2
- package/PieChart/PieArc.js +17 -2
- package/PieChart/PieArcLabel.d.ts +1 -1
- package/PieChart/PieArcLabel.js +5 -10
- package/PieChart/PieArcLabelPlot.d.ts +5 -1
- package/PieChart/PieArcLabelPlot.js +91 -3
- package/PieChart/PieArcPlot.d.ts +5 -1
- package/PieChart/PieArcPlot.js +90 -3
- package/PieChart/index.d.ts +4 -2
- package/PieChart/index.js +42 -18
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/index.d.ts +3 -3
- package/ScatterChart/index.js +31 -19
- package/esm/BarChart/BarElement.js +26 -2
- package/esm/BarChart/index.js +3 -2
- package/esm/ChartsLegend/index.js +2 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +95 -71
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +40 -54
- package/esm/ChartsTooltip/ChartsTooltip.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +168 -0
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/esm/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/esm/ChartsTooltip/index.js +6 -1
- package/esm/ChartsTooltip/utils.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +6 -4
- package/esm/LineChart/extremums.js +25 -8
- package/esm/LineChart/index.js +5 -5
- package/esm/PieChart/PieArc.js +18 -2
- package/esm/PieChart/PieArcLabel.js +7 -11
- package/esm/PieChart/PieArcLabelPlot.js +92 -3
- package/esm/PieChart/PieArcPlot.js +91 -3
- package/esm/PieChart/index.js +4 -2
- package/esm/ScatterChart/Scatter.js +1 -1
- package/esm/ScatterChart/index.js +3 -3
- package/esm/internals/defaultizeValueFormatter.js +4 -3
- package/index.js +1 -1
- package/internals/defaultizeValueFormatter.d.ts +3 -1
- package/internals/defaultizeValueFormatter.js +3 -3
- package/legacy/BarChart/BarElement.js +26 -2
- package/legacy/BarChart/index.js +3 -2
- package/legacy/ChartsLegend/index.js +2 -1
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +95 -70
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +40 -51
- package/legacy/ChartsTooltip/ChartsTooltip.js +20 -12
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +89 -0
- package/legacy/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/legacy/ChartsTooltip/index.js +6 -1
- package/legacy/ChartsTooltip/utils.js +1 -1
- package/legacy/ChartsYAxis/ChartsYAxis.js +6 -4
- package/legacy/LineChart/extremums.js +29 -14
- package/legacy/LineChart/index.js +5 -5
- package/legacy/PieChart/PieArc.js +18 -2
- package/legacy/PieChart/PieArcLabel.js +7 -11
- package/legacy/PieChart/PieArcLabelPlot.js +92 -3
- package/legacy/PieChart/PieArcPlot.js +91 -3
- package/legacy/PieChart/index.js +4 -2
- package/legacy/ScatterChart/Scatter.js +1 -1
- package/legacy/ScatterChart/index.js +3 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/defaultizeValueFormatter.js +4 -3
- package/models/seriesType/config.d.ts +5 -1
- package/models/seriesType/scatter.d.ts +1 -1
- package/modern/BarChart/BarElement.js +26 -2
- package/modern/BarChart/index.js +3 -2
- package/modern/ChartsLegend/index.js +2 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +95 -70
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +40 -54
- package/modern/ChartsTooltip/ChartsTooltip.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/modern/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/modern/ChartsTooltip/index.js +6 -1
- package/modern/ChartsTooltip/utils.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +6 -4
- package/modern/LineChart/extremums.js +25 -8
- package/modern/LineChart/index.js +5 -5
- package/modern/PieChart/PieArc.js +18 -2
- package/modern/PieChart/PieArcLabel.js +7 -11
- package/modern/PieChart/PieArcLabelPlot.js +92 -3
- package/modern/PieChart/PieArcPlot.js +91 -3
- package/modern/PieChart/index.js +4 -2
- package/modern/ScatterChart/Scatter.js +1 -1
- package/modern/ScatterChart/index.js +3 -3
- package/modern/index.js +1 -1
- package/modern/internals/defaultizeValueFormatter.js +3 -3
- package/package.json +1 -1
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
- package/ChartsTooltip/tooltipClasses.d.ts +0 -13
- package/ChartsTooltip/tooltipClasses.js +0 -12
- package/esm/ChartsTooltip/tooltipClasses.js +0 -5
- package/legacy/ChartsTooltip/tooltipClasses.js +0 -5
- package/modern/ChartsTooltip/tooltipClasses.js +0 -5
|
@@ -1,77 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { useSlotProps } from '@mui/base/utils';
|
|
5
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
6
6
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
7
|
-
import {
|
|
7
|
+
import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
export function DefaultChartsAxisContent(props) {
|
|
11
|
-
const {
|
|
12
|
-
series,
|
|
13
|
-
axis,
|
|
14
|
-
dataIndex,
|
|
15
|
-
axisValue,
|
|
16
|
-
sx,
|
|
17
|
-
classes
|
|
18
|
-
} = props;
|
|
19
|
-
if (dataIndex == null) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const axisFormatter = axis.valueFormatter ?? (v => v.toLocaleString());
|
|
23
|
-
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
24
|
-
sx: sx,
|
|
25
|
-
className: classes.root,
|
|
26
|
-
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
27
|
-
children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
|
|
28
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
|
|
29
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
30
|
-
colSpan: 3,
|
|
31
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
32
|
-
children: axisFormatter(axisValue)
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
37
|
-
children: series.map(({
|
|
38
|
-
color,
|
|
39
|
-
id,
|
|
40
|
-
label,
|
|
41
|
-
valueFormatter,
|
|
42
|
-
data
|
|
43
|
-
}) => {
|
|
44
|
-
const formattedValue = valueFormatter(data[dataIndex]);
|
|
45
|
-
if (formattedValue == null) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
49
|
-
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
50
|
-
className: classes.markCell,
|
|
51
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
52
|
-
ownerState: {
|
|
53
|
-
color
|
|
54
|
-
},
|
|
55
|
-
boxShadow: 1
|
|
56
|
-
})
|
|
57
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
58
|
-
className: classes.labelCell,
|
|
59
|
-
children: label ? /*#__PURE__*/_jsx(Typography, {
|
|
60
|
-
children: label
|
|
61
|
-
}) : null
|
|
62
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
63
|
-
className: classes.valueCell,
|
|
64
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
65
|
-
children: formattedValue
|
|
66
|
-
})
|
|
67
|
-
})]
|
|
68
|
-
}, id);
|
|
69
|
-
})
|
|
70
|
-
})]
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export function ChartsAxisTooltipContent(props) {
|
|
9
|
+
function ChartsAxisTooltipContent(props) {
|
|
75
10
|
const {
|
|
76
11
|
content,
|
|
77
12
|
contentProps,
|
|
@@ -106,7 +41,7 @@ export function ChartsAxisTooltipContent(props) {
|
|
|
106
41
|
const relevantAxis = React.useMemo(() => {
|
|
107
42
|
return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
|
|
108
43
|
}, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
|
|
109
|
-
const Content = content ??
|
|
44
|
+
const Content = content ?? DefaultChartsAxisTooltipContent;
|
|
110
45
|
const chartTooltipContentProps = useSlotProps({
|
|
111
46
|
elementType: Content,
|
|
112
47
|
externalSlotProps: contentProps,
|
|
@@ -122,4 +57,94 @@ export function ChartsAxisTooltipContent(props) {
|
|
|
122
57
|
ownerState: {}
|
|
123
58
|
});
|
|
124
59
|
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
125
|
-
}
|
|
60
|
+
}
|
|
61
|
+
process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
62
|
+
// ----------------------------- Warning --------------------------------
|
|
63
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
65
|
+
// ----------------------------------------------------------------------
|
|
66
|
+
axisData: PropTypes.shape({
|
|
67
|
+
x: PropTypes.shape({
|
|
68
|
+
index: PropTypes.number,
|
|
69
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
70
|
+
}),
|
|
71
|
+
y: PropTypes.shape({
|
|
72
|
+
index: PropTypes.number,
|
|
73
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
74
|
+
})
|
|
75
|
+
}).isRequired,
|
|
76
|
+
classes: PropTypes.object.isRequired,
|
|
77
|
+
content: PropTypes.elementType,
|
|
78
|
+
contentProps: PropTypes.shape({
|
|
79
|
+
axis: PropTypes.shape({
|
|
80
|
+
axisId: PropTypes.string,
|
|
81
|
+
classes: PropTypes.object,
|
|
82
|
+
data: PropTypes.array,
|
|
83
|
+
dataKey: PropTypes.string,
|
|
84
|
+
disableLine: PropTypes.bool,
|
|
85
|
+
disableTicks: PropTypes.bool,
|
|
86
|
+
fill: PropTypes.string,
|
|
87
|
+
hideTooltip: PropTypes.bool,
|
|
88
|
+
id: PropTypes.string.isRequired,
|
|
89
|
+
label: PropTypes.string,
|
|
90
|
+
labelFontSize: PropTypes.number,
|
|
91
|
+
labelStyle: PropTypes.object,
|
|
92
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
93
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
94
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
95
|
+
scale: PropTypes.func.isRequired,
|
|
96
|
+
scaleType: PropTypes.oneOf(['time']).isRequired,
|
|
97
|
+
slotProps: PropTypes.object,
|
|
98
|
+
slots: PropTypes.object,
|
|
99
|
+
stroke: PropTypes.string,
|
|
100
|
+
tickFontSize: PropTypes.number,
|
|
101
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
102
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
103
|
+
tickLabelStyle: PropTypes.object,
|
|
104
|
+
tickMaxStep: PropTypes.number,
|
|
105
|
+
tickMinStep: PropTypes.number,
|
|
106
|
+
tickNumber: PropTypes.number.isRequired,
|
|
107
|
+
tickSize: PropTypes.number,
|
|
108
|
+
valueFormatter: PropTypes.func
|
|
109
|
+
}),
|
|
110
|
+
axisData: PropTypes.shape({
|
|
111
|
+
x: PropTypes.shape({
|
|
112
|
+
index: PropTypes.number,
|
|
113
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
114
|
+
}),
|
|
115
|
+
y: PropTypes.shape({
|
|
116
|
+
index: PropTypes.number,
|
|
117
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
118
|
+
})
|
|
119
|
+
}),
|
|
120
|
+
axisValue: PropTypes.any,
|
|
121
|
+
classes: PropTypes.object,
|
|
122
|
+
dataIndex: PropTypes.number,
|
|
123
|
+
series: PropTypes.arrayOf(PropTypes.shape({
|
|
124
|
+
area: PropTypes.bool,
|
|
125
|
+
color: PropTypes.string.isRequired,
|
|
126
|
+
connectNulls: PropTypes.bool,
|
|
127
|
+
curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
128
|
+
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
129
|
+
dataKey: PropTypes.string,
|
|
130
|
+
disableHighlight: PropTypes.bool,
|
|
131
|
+
highlightScope: PropTypes.shape({
|
|
132
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
133
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
134
|
+
}),
|
|
135
|
+
id: PropTypes.string.isRequired,
|
|
136
|
+
label: PropTypes.string,
|
|
137
|
+
showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
138
|
+
stack: PropTypes.string,
|
|
139
|
+
stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
|
|
140
|
+
stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
|
|
141
|
+
type: PropTypes.oneOf(['line']).isRequired,
|
|
142
|
+
valueFormatter: PropTypes.func.isRequired,
|
|
143
|
+
xAxisKey: PropTypes.string,
|
|
144
|
+
yAxisKey: PropTypes.string
|
|
145
|
+
})),
|
|
146
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
147
|
+
}),
|
|
148
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
149
|
+
} : void 0;
|
|
150
|
+
export { ChartsAxisTooltipContent };
|
|
@@ -1,60 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
5
|
-
import {
|
|
6
|
+
import { DefaultChartsItemTooltipContent } from './DefaultChartsItemTooltipContent';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
export function DefaultChartsItemContent(props) {
|
|
9
|
-
const {
|
|
10
|
-
series,
|
|
11
|
-
itemData,
|
|
12
|
-
sx,
|
|
13
|
-
classes
|
|
14
|
-
} = props;
|
|
15
|
-
if (itemData.dataIndex === undefined) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const {
|
|
19
|
-
displayedLabel,
|
|
20
|
-
color
|
|
21
|
-
} = series.type === 'pie' ? {
|
|
22
|
-
color: series.data[itemData.dataIndex].color,
|
|
23
|
-
displayedLabel: series.data[itemData.dataIndex].label
|
|
24
|
-
} : {
|
|
25
|
-
color: series.color,
|
|
26
|
-
displayedLabel: series.label
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// TODO: Manage to let TS understand series.data and series.valueFormatter are coherent
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
const formattedValue = series.valueFormatter(series.data[itemData.dataIndex]);
|
|
32
|
-
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
33
|
-
sx: sx,
|
|
34
|
-
className: classes.root,
|
|
35
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
|
|
36
|
-
children: /*#__PURE__*/_jsx("tbody", {
|
|
37
|
-
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
38
|
-
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
39
|
-
className: classes.markCell,
|
|
40
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
41
|
-
ownerState: {
|
|
42
|
-
color
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
46
|
-
className: classes.labelCell,
|
|
47
|
-
children: displayedLabel
|
|
48
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
49
|
-
className: classes.valueCell,
|
|
50
|
-
children: formattedValue
|
|
51
|
-
})]
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
export function ChartsItemTooltipContent(props) {
|
|
8
|
+
function ChartsItemTooltipContent(props) {
|
|
58
9
|
const {
|
|
59
10
|
content,
|
|
60
11
|
itemData,
|
|
@@ -63,7 +14,7 @@ export function ChartsItemTooltipContent(props) {
|
|
|
63
14
|
contentProps
|
|
64
15
|
} = props;
|
|
65
16
|
const series = React.useContext(SeriesContext)[itemData.type].series[itemData.seriesId];
|
|
66
|
-
const Content = content ??
|
|
17
|
+
const Content = content ?? DefaultChartsItemTooltipContent;
|
|
67
18
|
const chartTooltipContentProps = useSlotProps({
|
|
68
19
|
elementType: Content,
|
|
69
20
|
externalSlotProps: contentProps,
|
|
@@ -76,4 +27,39 @@ export function ChartsItemTooltipContent(props) {
|
|
|
76
27
|
ownerState: {}
|
|
77
28
|
});
|
|
78
29
|
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
79
|
-
}
|
|
30
|
+
}
|
|
31
|
+
process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
|
|
32
|
+
// ----------------------------- Warning --------------------------------
|
|
33
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
34
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
35
|
+
// ----------------------------------------------------------------------
|
|
36
|
+
classes: PropTypes.object.isRequired,
|
|
37
|
+
content: PropTypes.elementType,
|
|
38
|
+
contentProps: PropTypes.shape({
|
|
39
|
+
classes: PropTypes.object,
|
|
40
|
+
itemData: PropTypes.shape({
|
|
41
|
+
dataIndex: PropTypes.number,
|
|
42
|
+
seriesId: PropTypes.string.isRequired,
|
|
43
|
+
type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
|
|
44
|
+
}),
|
|
45
|
+
series: PropTypes.shape({
|
|
46
|
+
color: PropTypes.string,
|
|
47
|
+
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
48
|
+
highlightScope: PropTypes.shape({
|
|
49
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
50
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
51
|
+
}),
|
|
52
|
+
id: PropTypes.string.isRequired,
|
|
53
|
+
type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired,
|
|
54
|
+
valueFormatter: PropTypes.func.isRequired
|
|
55
|
+
}),
|
|
56
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
57
|
+
}),
|
|
58
|
+
itemData: PropTypes.shape({
|
|
59
|
+
dataIndex: PropTypes.number,
|
|
60
|
+
seriesId: PropTypes.string.isRequired,
|
|
61
|
+
type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
|
|
62
|
+
}).isRequired,
|
|
63
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
64
|
+
} : void 0;
|
|
65
|
+
export { ChartsItemTooltipContent };
|
|
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
6
6
|
import { Popper } from '@mui/base/Popper';
|
|
7
7
|
import { NoSsr } from '@mui/base/NoSsr';
|
|
8
8
|
import { useSlotProps } from '@mui/base/utils';
|
|
9
9
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
10
|
-
import { generateVirtualElement, useMouseTracker,
|
|
10
|
+
import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
|
|
11
11
|
import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
|
|
12
12
|
import { ChartsAxisTooltipContent } from './ChartsAxisTooltipContent';
|
|
13
|
-
import {
|
|
13
|
+
import { getChartsTooltipUtilityClass } from './chartsTooltipClasses';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
@@ -18,11 +18,15 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
} = ownerState;
|
|
19
19
|
const slots = {
|
|
20
20
|
root: ['root'],
|
|
21
|
+
table: ['table'],
|
|
22
|
+
row: ['row'],
|
|
23
|
+
cell: ['cell'],
|
|
24
|
+
mark: ['mark'],
|
|
21
25
|
markCell: ['markCell'],
|
|
22
26
|
labelCell: ['labelCell'],
|
|
23
27
|
valueCell: ['valueCell']
|
|
24
28
|
};
|
|
25
|
-
return composeClasses(slots,
|
|
29
|
+
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
26
30
|
};
|
|
27
31
|
const ChartsTooltipRoot = styled(Popper, {
|
|
28
32
|
name: 'MuiChartsTooltip',
|
|
@@ -45,23 +49,27 @@ const ChartsTooltipRoot = styled(Popper, {
|
|
|
45
49
|
* - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
|
|
46
50
|
*/
|
|
47
51
|
function ChartsTooltip(props) {
|
|
52
|
+
const themeProps = useThemeProps({
|
|
53
|
+
props,
|
|
54
|
+
name: 'MuiChartsTooltip'
|
|
55
|
+
});
|
|
48
56
|
const {
|
|
49
57
|
trigger = 'axis',
|
|
50
58
|
itemContent,
|
|
51
59
|
axisContent,
|
|
52
60
|
slots,
|
|
53
61
|
slotProps
|
|
54
|
-
} =
|
|
62
|
+
} = themeProps;
|
|
55
63
|
const mousePosition = useMouseTracker();
|
|
56
64
|
const {
|
|
57
65
|
item,
|
|
58
66
|
axis
|
|
59
67
|
} = React.useContext(InteractionContext);
|
|
60
68
|
const displayedData = trigger === 'item' ? item : axis;
|
|
61
|
-
const tooltipHasData =
|
|
69
|
+
const tooltipHasData = getTooltipHasData(trigger, displayedData);
|
|
62
70
|
const popperOpen = mousePosition !== null && tooltipHasData;
|
|
63
71
|
const classes = useUtilityClasses({
|
|
64
|
-
classes:
|
|
72
|
+
classes: themeProps.classes
|
|
65
73
|
});
|
|
66
74
|
const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
|
|
67
75
|
const popperProps = useSlotProps({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '@mui/system/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import {
|
|
3
|
+
import { chartsTooltipClasses } from './chartsTooltipClasses';
|
|
4
4
|
export const ChartsTooltipPaper = styled('div', {
|
|
5
5
|
name: 'MuiChartsTooltip',
|
|
6
6
|
slot: 'Container'
|
|
@@ -45,10 +45,10 @@ export const ChartsTooltipCell = styled('td', {
|
|
|
45
45
|
}) => ({
|
|
46
46
|
verticalAlign: 'middle',
|
|
47
47
|
color: (theme.vars || theme).palette.text.secondary,
|
|
48
|
-
[`&.${
|
|
48
|
+
[`&.${chartsTooltipClasses.labelCell}`]: {
|
|
49
49
|
paddingLeft: theme.spacing(1)
|
|
50
50
|
},
|
|
51
|
-
[`&.${
|
|
51
|
+
[`&.${chartsTooltipClasses.valueCell}`]: {
|
|
52
52
|
paddingLeft: theme.spacing(4),
|
|
53
53
|
color: (theme.vars || theme).palette.text.primary
|
|
54
54
|
},
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import Typography from '@mui/material/Typography';
|
|
5
|
+
import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from './ChartsTooltipTable';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
function DefaultChartsAxisTooltipContent(props) {
|
|
9
|
+
const {
|
|
10
|
+
series,
|
|
11
|
+
axis,
|
|
12
|
+
dataIndex,
|
|
13
|
+
axisValue,
|
|
14
|
+
sx,
|
|
15
|
+
classes
|
|
16
|
+
} = props;
|
|
17
|
+
if (dataIndex == null) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const axisFormatter = axis.valueFormatter ?? (v => v.toLocaleString());
|
|
21
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
22
|
+
sx: sx,
|
|
23
|
+
className: classes.root,
|
|
24
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
25
|
+
className: classes.table,
|
|
26
|
+
children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
|
|
27
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
|
|
28
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
29
|
+
colSpan: 3,
|
|
30
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
31
|
+
children: axisFormatter(axisValue)
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
}), /*#__PURE__*/_jsx("tbody", {
|
|
36
|
+
children: series.map(({
|
|
37
|
+
color,
|
|
38
|
+
id,
|
|
39
|
+
label,
|
|
40
|
+
valueFormatter,
|
|
41
|
+
data
|
|
42
|
+
}) => {
|
|
43
|
+
const formattedValue = valueFormatter(data[dataIndex]);
|
|
44
|
+
if (formattedValue == null) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
48
|
+
className: classes.row,
|
|
49
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
50
|
+
className: clsx(classes.markCell, classes.cell),
|
|
51
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
52
|
+
ownerState: {
|
|
53
|
+
color
|
|
54
|
+
},
|
|
55
|
+
boxShadow: 1,
|
|
56
|
+
className: classes.mark
|
|
57
|
+
})
|
|
58
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
59
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
60
|
+
children: label ? /*#__PURE__*/_jsx(Typography, {
|
|
61
|
+
children: label
|
|
62
|
+
}) : null
|
|
63
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
64
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
65
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
66
|
+
children: formattedValue
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}, id);
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propTypes = {
|
|
76
|
+
// ----------------------------- Warning --------------------------------
|
|
77
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
78
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
79
|
+
// ----------------------------------------------------------------------
|
|
80
|
+
/**
|
|
81
|
+
* The properties of the triggered axis.
|
|
82
|
+
*/
|
|
83
|
+
axis: PropTypes.shape({
|
|
84
|
+
axisId: PropTypes.string,
|
|
85
|
+
classes: PropTypes.object,
|
|
86
|
+
data: PropTypes.array,
|
|
87
|
+
dataKey: PropTypes.string,
|
|
88
|
+
disableLine: PropTypes.bool,
|
|
89
|
+
disableTicks: PropTypes.bool,
|
|
90
|
+
fill: PropTypes.string,
|
|
91
|
+
hideTooltip: PropTypes.bool,
|
|
92
|
+
id: PropTypes.string.isRequired,
|
|
93
|
+
label: PropTypes.string,
|
|
94
|
+
labelFontSize: PropTypes.number,
|
|
95
|
+
labelStyle: PropTypes.object,
|
|
96
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
97
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
98
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
99
|
+
scale: PropTypes.func.isRequired,
|
|
100
|
+
scaleType: PropTypes.oneOf(['time']).isRequired,
|
|
101
|
+
slotProps: PropTypes.object,
|
|
102
|
+
slots: PropTypes.object,
|
|
103
|
+
stroke: PropTypes.string,
|
|
104
|
+
tickFontSize: PropTypes.number,
|
|
105
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
106
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
107
|
+
tickLabelStyle: PropTypes.object,
|
|
108
|
+
tickMaxStep: PropTypes.number,
|
|
109
|
+
tickMinStep: PropTypes.number,
|
|
110
|
+
tickNumber: PropTypes.number.isRequired,
|
|
111
|
+
tickSize: PropTypes.number,
|
|
112
|
+
valueFormatter: PropTypes.func
|
|
113
|
+
}).isRequired,
|
|
114
|
+
/**
|
|
115
|
+
* Data identifying the triggered axis.
|
|
116
|
+
*/
|
|
117
|
+
axisData: PropTypes.shape({
|
|
118
|
+
x: PropTypes.shape({
|
|
119
|
+
index: PropTypes.number,
|
|
120
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
121
|
+
}),
|
|
122
|
+
y: PropTypes.shape({
|
|
123
|
+
index: PropTypes.number,
|
|
124
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
125
|
+
})
|
|
126
|
+
}).isRequired,
|
|
127
|
+
/**
|
|
128
|
+
* The value associated to the current mouse position.
|
|
129
|
+
*/
|
|
130
|
+
axisValue: PropTypes.any.isRequired,
|
|
131
|
+
/**
|
|
132
|
+
* Override or extend the styles applied to the component.
|
|
133
|
+
*/
|
|
134
|
+
classes: PropTypes.object.isRequired,
|
|
135
|
+
/**
|
|
136
|
+
* The index of the data item triggered.
|
|
137
|
+
*/
|
|
138
|
+
dataIndex: PropTypes.number,
|
|
139
|
+
/**
|
|
140
|
+
* The series linked to the triggered axis.
|
|
141
|
+
*/
|
|
142
|
+
series: PropTypes.arrayOf(PropTypes.shape({
|
|
143
|
+
area: PropTypes.bool,
|
|
144
|
+
color: PropTypes.string.isRequired,
|
|
145
|
+
connectNulls: PropTypes.bool,
|
|
146
|
+
curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
147
|
+
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
148
|
+
dataKey: PropTypes.string,
|
|
149
|
+
disableHighlight: PropTypes.bool,
|
|
150
|
+
highlightScope: PropTypes.shape({
|
|
151
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
152
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
153
|
+
}),
|
|
154
|
+
id: PropTypes.string.isRequired,
|
|
155
|
+
label: PropTypes.string,
|
|
156
|
+
showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
157
|
+
stack: PropTypes.string,
|
|
158
|
+
stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
|
|
159
|
+
stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
|
|
160
|
+
type: PropTypes.oneOf(['line']).isRequired,
|
|
161
|
+
valueFormatter: PropTypes.func.isRequired,
|
|
162
|
+
xAxisKey: PropTypes.string,
|
|
163
|
+
yAxisKey: PropTypes.string
|
|
164
|
+
})).isRequired,
|
|
165
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
166
|
+
} : void 0;
|
|
167
|
+
export { DefaultChartsAxisTooltipContent };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
function DefaultChartsItemTooltipContent(props) {
|
|
8
|
+
const {
|
|
9
|
+
series,
|
|
10
|
+
itemData,
|
|
11
|
+
sx,
|
|
12
|
+
classes
|
|
13
|
+
} = props;
|
|
14
|
+
if (itemData.dataIndex === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const {
|
|
18
|
+
displayedLabel,
|
|
19
|
+
color
|
|
20
|
+
} = series.type === 'pie' ? {
|
|
21
|
+
color: series.data[itemData.dataIndex].color,
|
|
22
|
+
displayedLabel: series.data[itemData.dataIndex].label
|
|
23
|
+
} : {
|
|
24
|
+
color: series.color,
|
|
25
|
+
displayedLabel: series.label
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// TODO: Manage to let TS understand series.data and series.valueFormatter are coherent
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
const formattedValue = series.valueFormatter(series.data[itemData.dataIndex]);
|
|
31
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
32
|
+
sx: sx,
|
|
33
|
+
className: classes.root,
|
|
34
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
|
|
35
|
+
className: classes.table,
|
|
36
|
+
children: /*#__PURE__*/_jsx("tbody", {
|
|
37
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
38
|
+
className: classes.row,
|
|
39
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
40
|
+
className: clsx(classes.markCell, classes.cell),
|
|
41
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
42
|
+
ownerState: {
|
|
43
|
+
color
|
|
44
|
+
},
|
|
45
|
+
className: classes.mark
|
|
46
|
+
})
|
|
47
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
48
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
49
|
+
children: displayedLabel
|
|
50
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
51
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
52
|
+
children: formattedValue
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propTypes = {
|
|
60
|
+
// ----------------------------- Warning --------------------------------
|
|
61
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
62
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
63
|
+
// ----------------------------------------------------------------------
|
|
64
|
+
/**
|
|
65
|
+
* Override or extend the styles applied to the component.
|
|
66
|
+
*/
|
|
67
|
+
classes: PropTypes.object.isRequired,
|
|
68
|
+
/**
|
|
69
|
+
* The data used to identify the triggered item.
|
|
70
|
+
*/
|
|
71
|
+
itemData: PropTypes.shape({
|
|
72
|
+
dataIndex: PropTypes.number,
|
|
73
|
+
seriesId: PropTypes.string.isRequired,
|
|
74
|
+
type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
|
|
75
|
+
}).isRequired,
|
|
76
|
+
/**
|
|
77
|
+
* The series linked to the triggered axis.
|
|
78
|
+
*/
|
|
79
|
+
series: PropTypes.shape({
|
|
80
|
+
color: PropTypes.string,
|
|
81
|
+
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
82
|
+
highlightScope: PropTypes.shape({
|
|
83
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
84
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
85
|
+
}),
|
|
86
|
+
id: PropTypes.string.isRequired,
|
|
87
|
+
type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired,
|
|
88
|
+
valueFormatter: PropTypes.func.isRequired
|
|
89
|
+
}).isRequired,
|
|
90
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
91
|
+
} : void 0;
|
|
92
|
+
export { DefaultChartsItemTooltipContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
2
|
+
export function getChartsTooltipUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiChartsTooltip', slot);
|
|
4
|
+
}
|
|
5
|
+
export const chartsTooltipClasses = generateUtilityClasses('MuiChartsTooltip', ['root', 'table', 'row', 'cell', 'mark', 'markCell', 'labelCell', 'valueCell']);
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export * from './ChartsTooltip';
|
|
1
|
+
export * from './ChartsTooltip';
|
|
2
|
+
export * from './chartsTooltipClasses';
|
|
3
|
+
export * from './ChartsAxisTooltipContent';
|
|
4
|
+
export * from './ChartsItemTooltipContent';
|
|
5
|
+
export * from './DefaultChartsAxisTooltipContent';
|
|
6
|
+
export * from './DefaultChartsItemTooltipContent';
|
|
@@ -71,7 +71,7 @@ export function useMouseTracker() {
|
|
|
71
71
|
}, [svgRef]);
|
|
72
72
|
return mousePosition;
|
|
73
73
|
}
|
|
74
|
-
export function
|
|
74
|
+
export function getTooltipHasData(trigger, displayedData) {
|
|
75
75
|
if (trigger === 'item') {
|
|
76
76
|
return displayedData !== null;
|
|
77
77
|
}
|