@mui/x-charts-pro 7.22.3 → 8.0.0-alpha.1
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/BarChartPro/BarChartPro.d.ts +1 -1
- package/BarChartPro/BarChartPro.js +9 -59
- package/CHANGELOG.md +348 -12
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/ChartContainerPro/ChartContainerPro.js +21 -47
- package/ChartContainerPro/useChartContainerProProps.d.ts +6 -14
- package/ChartContainerPro/useChartContainerProProps.js +11 -25
- package/Heatmap/Heatmap.d.ts +16 -8
- package/Heatmap/Heatmap.js +6 -37
- package/Heatmap/HeatmapTooltip.d.ts +9 -0
- package/Heatmap/HeatmapTooltip.js +294 -0
- package/Heatmap/index.d.ts +1 -1
- package/Heatmap/index.js +1 -1
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +9 -60
- package/README.md +4 -4
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +9 -60
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +10 -0
- package/{modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +50 -33
- package/context/ChartDataProviderPro/index.d.ts +1 -0
- package/context/ChartDataProviderPro/index.js +1 -0
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +14 -0
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
- package/context/ZoomProvider/ZoomProvider.js +1 -0
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/internals/utils/releaseInfo.js +1 -1
- package/models/seriesType/heatmap.d.ts +2 -1
- package/modern/BarChartPro/BarChartPro.js +9 -59
- package/modern/ChartContainerPro/ChartContainerPro.js +21 -47
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -25
- package/modern/Heatmap/Heatmap.js +6 -37
- package/modern/Heatmap/HeatmapTooltip.js +294 -0
- package/modern/Heatmap/index.js +1 -1
- package/modern/LineChartPro/LineChartPro.js +9 -60
- package/modern/ScatterChartPro/ScatterChartPro.js +9 -60
- package/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → modern/context/ChartDataProviderPro/ChartDataProviderPro.js} +50 -33
- package/modern/context/ChartDataProviderPro/index.js +1 -0
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
- package/modern/context/ZoomProvider/ZoomProvider.js +1 -0
- package/modern/index.js +1 -2
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/BarChartPro/BarChartPro.js +9 -59
- package/node/ChartContainerPro/ChartContainerPro.js +20 -46
- package/node/ChartContainerPro/useChartContainerProProps.js +11 -25
- package/node/Heatmap/Heatmap.js +6 -37
- package/node/Heatmap/HeatmapTooltip.js +300 -0
- package/node/Heatmap/index.js +4 -4
- package/node/LineChartPro/LineChartPro.js +9 -60
- package/node/ScatterChartPro/ScatterChartPro.js +9 -60
- package/node/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +48 -31
- package/node/context/ChartDataProviderPro/index.js +16 -0
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +50 -0
- package/node/context/ZoomProvider/ZoomProvider.js +1 -0
- package/node/index.js +1 -12
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +8 -8
- package/typeOverloads/modules.d.ts +1 -1
- package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
- package/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.d.ts +0 -7
- package/ResponsiveChartContainerPro/index.d.ts +0 -1
- package/ResponsiveChartContainerPro/index.js +0 -1
- package/ResponsiveChartContainerPro/package.json +0 -6
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +0 -42
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
- package/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/modern/ResponsiveChartContainerPro/index.js +0 -1
- package/modern/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
- package/node/Heatmap/DefaultHeatmapTooltip.js +0 -105
- package/node/ResponsiveChartContainerPro/index.js +0 -16
- package/node/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -34
|
@@ -10,49 +10,29 @@ exports.ChartContainerPro = void 0;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var
|
|
14
|
-
var _context = require("@mui/x-charts/context");
|
|
13
|
+
var _Watermark = require("@mui/x-license/Watermark");
|
|
15
14
|
var _internals = require("@mui/x-charts/internals");
|
|
16
|
-
var
|
|
15
|
+
var _xCharts = require("@mui/x-charts");
|
|
17
16
|
var _releaseInfo = require("../internals/utils/releaseInfo");
|
|
18
|
-
var
|
|
19
|
-
var _ZoomProvider = require("../context/ZoomProvider");
|
|
17
|
+
var _ChartDataProviderPro = require("../context/ChartDataProviderPro");
|
|
20
18
|
var _useChartContainerProProps = require("./useChartContainerProProps");
|
|
21
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
20
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
23
|
-
const ChartContainerPro = exports.ChartContainerPro = /*#__PURE__*/React.forwardRef(function
|
|
21
|
+
const ChartContainerPro = exports.ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainerPro(props, ref) {
|
|
24
22
|
const {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
highlightedProviderProps,
|
|
30
|
-
cartesianProviderProps,
|
|
31
|
-
chartsSurfaceProps,
|
|
32
|
-
pluginProviderProps,
|
|
33
|
-
animationProviderProps,
|
|
34
|
-
children
|
|
23
|
+
chartDataProviderProProps,
|
|
24
|
+
children,
|
|
25
|
+
resizableContainerProps,
|
|
26
|
+
chartsSurfaceProps
|
|
35
27
|
} = (0, _useChartContainerProProps.useChartContainerProProps)(props, ref);
|
|
36
|
-
(0,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.InteractionProvider, {
|
|
45
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, (0, _extends2.default)({}, highlightedProviderProps, {
|
|
46
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
47
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.ChartsAxesGradients, {}), children]
|
|
48
|
-
}))
|
|
49
|
-
}))
|
|
50
|
-
})
|
|
51
|
-
}))
|
|
52
|
-
}))
|
|
53
|
-
}))
|
|
54
|
-
}))
|
|
55
|
-
}))
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
29
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ResizableContainer, (0, _extends2.default)({}, resizableContainerProps, {
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xCharts.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
31
|
+
children: children
|
|
32
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
|
|
33
|
+
packageName: "x-charts-pro",
|
|
34
|
+
releaseInfo: releaseInfo
|
|
35
|
+
})]
|
|
56
36
|
}))
|
|
57
37
|
}));
|
|
58
38
|
});
|
|
@@ -80,9 +60,9 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
80
60
|
*/
|
|
81
61
|
disableAxisListener: _propTypes.default.bool,
|
|
82
62
|
/**
|
|
83
|
-
* The height of the chart in px.
|
|
63
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
84
64
|
*/
|
|
85
|
-
height: _propTypes.default.number
|
|
65
|
+
height: _propTypes.default.number,
|
|
86
66
|
/**
|
|
87
67
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
88
68
|
*/
|
|
@@ -132,16 +112,10 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
132
112
|
skipAnimation: _propTypes.default.bool,
|
|
133
113
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
134
114
|
title: _propTypes.default.string,
|
|
135
|
-
viewBox: _propTypes.default.shape({
|
|
136
|
-
height: _propTypes.default.number,
|
|
137
|
-
width: _propTypes.default.number,
|
|
138
|
-
x: _propTypes.default.number,
|
|
139
|
-
y: _propTypes.default.number
|
|
140
|
-
}),
|
|
141
115
|
/**
|
|
142
|
-
* The width of the chart in px.
|
|
116
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
143
117
|
*/
|
|
144
|
-
width: _propTypes.default.number
|
|
118
|
+
width: _propTypes.default.number,
|
|
145
119
|
/**
|
|
146
120
|
* The configuration of the x-axes.
|
|
147
121
|
* If not provided, a default axis config is used.
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.useChartContainerProProps = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
11
|
var _internals = require("@mui/x-charts/internals");
|
|
11
12
|
const _excluded = ["zoom", "onZoomChange"];
|
|
@@ -15,36 +16,21 @@ const useChartContainerProProps = (props, ref) => {
|
|
|
15
16
|
onZoomChange
|
|
16
17
|
} = props,
|
|
17
18
|
baseProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
19
|
+
const chartDataProviderProProps = {
|
|
20
|
+
zoom,
|
|
21
|
+
onZoomChange
|
|
22
|
+
};
|
|
18
23
|
const {
|
|
19
|
-
|
|
20
|
-
drawingProviderProps,
|
|
21
|
-
seriesProviderProps,
|
|
22
|
-
cartesianProviderProps,
|
|
23
|
-
zAxisContextProps,
|
|
24
|
-
highlightedProviderProps,
|
|
24
|
+
chartDataProviderProps,
|
|
25
25
|
chartsSurfaceProps,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
xAxis,
|
|
29
|
-
yAxis
|
|
26
|
+
resizableContainerProps,
|
|
27
|
+
children
|
|
30
28
|
} = (0, _internals.useChartContainerProps)(baseProps, ref);
|
|
31
|
-
const zoomProviderProps = {
|
|
32
|
-
zoom,
|
|
33
|
-
onZoomChange,
|
|
34
|
-
xAxis,
|
|
35
|
-
yAxis
|
|
36
|
-
};
|
|
37
29
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
drawingProviderProps,
|
|
41
|
-
pluginProviderProps,
|
|
42
|
-
seriesProviderProps,
|
|
43
|
-
cartesianProviderProps,
|
|
44
|
-
zAxisContextProps,
|
|
45
|
-
highlightedProviderProps,
|
|
30
|
+
chartDataProviderProProps: (0, _extends2.default)({}, chartDataProviderProps, chartDataProviderProProps),
|
|
31
|
+
resizableContainerProps,
|
|
46
32
|
chartsSurfaceProps,
|
|
47
|
-
|
|
33
|
+
children
|
|
48
34
|
};
|
|
49
35
|
};
|
|
50
36
|
exports.useChartContainerProProps = useChartContainerProProps;
|
package/node/Heatmap/Heatmap.js
CHANGED
|
@@ -14,14 +14,13 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
15
15
|
var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
|
|
16
16
|
var _ChartsAxis = require("@mui/x-charts/ChartsAxis");
|
|
17
|
-
var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
|
|
18
17
|
var _ChartsClipPath = require("@mui/x-charts/ChartsClipPath");
|
|
19
18
|
var _ChartsOnAxisClickHandler = require("@mui/x-charts/ChartsOnAxisClickHandler");
|
|
20
19
|
var _ChartsOverlay = require("@mui/x-charts/ChartsOverlay");
|
|
21
|
-
var
|
|
20
|
+
var _ChartContainerPro = require("../ChartContainerPro");
|
|
22
21
|
var _HeatmapPlot = require("./HeatmapPlot");
|
|
23
22
|
var _plugin = require("./plugin");
|
|
24
|
-
var
|
|
23
|
+
var _HeatmapTooltip = require("./HeatmapTooltip");
|
|
25
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
25
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
27
26
|
const defaultColorMap = (0, _d3Interpolate.interpolateRgbBasis)(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
@@ -41,7 +40,6 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
|
|
|
41
40
|
colors,
|
|
42
41
|
dataset,
|
|
43
42
|
sx,
|
|
44
|
-
tooltip,
|
|
45
43
|
topAxis,
|
|
46
44
|
leftAxis,
|
|
47
45
|
rightAxis,
|
|
@@ -72,7 +70,8 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
|
|
|
72
70
|
color: defaultColorMap
|
|
73
71
|
}
|
|
74
72
|
}], [zAxis]);
|
|
75
|
-
|
|
73
|
+
const Tooltip = props.slots?.tooltip ?? _HeatmapTooltip.HeatmapTooltip;
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartContainerPro.ChartContainerPro, {
|
|
76
75
|
ref: ref,
|
|
77
76
|
plugins: [_plugin.plugin],
|
|
78
77
|
series: series.map(s => (0, _extends2.default)({
|
|
@@ -109,14 +108,7 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
|
|
|
109
108
|
bottomAxis: bottomAxis,
|
|
110
109
|
slots: slots,
|
|
111
110
|
slotProps: slotProps
|
|
112
|
-
}), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
113
|
-
trigger: "item"
|
|
114
|
-
}, tooltip, {
|
|
115
|
-
slots: (0, _extends2.default)({
|
|
116
|
-
itemContent: _DefaultHeatmapTooltip.DefaultHeatmapTooltip
|
|
117
|
-
}, slots),
|
|
118
|
-
slotProps: slotProps
|
|
119
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
111
|
+
}), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, slotProps?.tooltip)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
120
112
|
id: clipPathId
|
|
121
113
|
}), children]
|
|
122
114
|
});
|
|
@@ -197,16 +189,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
197
189
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
198
190
|
*/
|
|
199
191
|
onHighlightChange: _propTypes.default.func,
|
|
200
|
-
/**
|
|
201
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
202
|
-
* before it renders for the first time.
|
|
203
|
-
*
|
|
204
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
205
|
-
* the first render, like when used inside a grid.
|
|
206
|
-
*
|
|
207
|
-
* @default false
|
|
208
|
-
*/
|
|
209
|
-
resolveSizeBeforeRender: _propTypes.default.bool,
|
|
210
192
|
/**
|
|
211
193
|
* Indicate which axis to display the right of the charts.
|
|
212
194
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -234,26 +216,13 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
234
216
|
* The configuration of the tooltip.
|
|
235
217
|
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
236
218
|
*/
|
|
237
|
-
tooltip: _propTypes.default.
|
|
238
|
-
axisContent: _propTypes.default.elementType,
|
|
239
|
-
classes: _propTypes.default.object,
|
|
240
|
-
itemContent: _propTypes.default.elementType,
|
|
241
|
-
slotProps: _propTypes.default.object,
|
|
242
|
-
slots: _propTypes.default.object,
|
|
243
|
-
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
244
|
-
}),
|
|
219
|
+
tooltip: _propTypes.default.object,
|
|
245
220
|
/**
|
|
246
221
|
* Indicate which axis to display the top of the charts.
|
|
247
222
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
248
223
|
* @default null
|
|
249
224
|
*/
|
|
250
225
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
251
|
-
viewBox: _propTypes.default.shape({
|
|
252
|
-
height: _propTypes.default.number,
|
|
253
|
-
width: _propTypes.default.number,
|
|
254
|
-
x: _propTypes.default.number,
|
|
255
|
-
y: _propTypes.default.number
|
|
256
|
-
}),
|
|
257
226
|
/**
|
|
258
227
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
259
228
|
*/
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.HeatmapTooltip = HeatmapTooltip;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
|
|
16
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
17
|
+
var _internals = require("@mui/x-charts/internals");
|
|
18
|
+
var _useSeries = require("../hooks/useSeries");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const useUtilityClasses = ownerState => {
|
|
21
|
+
const {
|
|
22
|
+
classes
|
|
23
|
+
} = ownerState;
|
|
24
|
+
const slots = {
|
|
25
|
+
root: ['root'],
|
|
26
|
+
paper: ['paper'],
|
|
27
|
+
table: ['table'],
|
|
28
|
+
row: ['row'],
|
|
29
|
+
cell: ['cell'],
|
|
30
|
+
mark: ['mark'],
|
|
31
|
+
markCell: ['markCell'],
|
|
32
|
+
labelCell: ['labelCell'],
|
|
33
|
+
valueCell: ['valueCell']
|
|
34
|
+
};
|
|
35
|
+
return (0, _composeClasses.default)(slots, _ChartsTooltip.getChartsTooltipUtilityClass, classes);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @ignore - internal component.
|
|
40
|
+
*/
|
|
41
|
+
function DefaultHeatmapTooltipContent(props) {
|
|
42
|
+
const {
|
|
43
|
+
classes
|
|
44
|
+
} = props;
|
|
45
|
+
const xAxis = (0, _hooks.useXAxis)();
|
|
46
|
+
const yAxis = (0, _hooks.useYAxis)();
|
|
47
|
+
const heatmapSeries = (0, _useSeries.useHeatmapSeries)();
|
|
48
|
+
const tooltipData = (0, _ChartsTooltip.useItemTooltip)();
|
|
49
|
+
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const {
|
|
53
|
+
series,
|
|
54
|
+
seriesOrder
|
|
55
|
+
} = heatmapSeries;
|
|
56
|
+
const seriesId = seriesOrder[0];
|
|
57
|
+
const {
|
|
58
|
+
color,
|
|
59
|
+
value,
|
|
60
|
+
identifier
|
|
61
|
+
} = tooltipData;
|
|
62
|
+
const [xIndex, yIndex] = value;
|
|
63
|
+
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
64
|
+
location: 'tooltip'
|
|
65
|
+
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
66
|
+
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
67
|
+
location: 'tooltip'
|
|
68
|
+
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
69
|
+
const formattedValue = series[seriesId].valueFormatter(value, {
|
|
70
|
+
dataIndex: identifier.dataIndex
|
|
71
|
+
});
|
|
72
|
+
const seriesLabel = (0, _internals.getLabel)(series[seriesId].label, 'tooltip');
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipPaper, {
|
|
74
|
+
className: classes?.paper,
|
|
75
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipTable, {
|
|
76
|
+
className: classes?.table,
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
78
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipRow, {
|
|
79
|
+
className: classes?.row,
|
|
80
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
|
|
81
|
+
className: classes?.cell,
|
|
82
|
+
children: formattedX
|
|
83
|
+
}), formattedX && formattedY && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
|
|
84
|
+
className: classes?.cell,
|
|
85
|
+
children: formattedY
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipRow, {
|
|
90
|
+
className: classes?.row,
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
|
|
92
|
+
className: (0, _clsx.default)(classes?.markCell, classes?.cell),
|
|
93
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipMark, {
|
|
94
|
+
color: color,
|
|
95
|
+
className: classes?.mark
|
|
96
|
+
})
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
|
|
98
|
+
className: (0, _clsx.default)(classes?.labelCell, classes?.cell),
|
|
99
|
+
children: seriesLabel
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
|
|
101
|
+
className: (0, _clsx.default)(classes?.valueCell, classes?.cell),
|
|
102
|
+
children: formattedValue
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltipContent.propTypes = {
|
|
110
|
+
// ----------------------------- Warning --------------------------------
|
|
111
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
112
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
113
|
+
// ----------------------------------------------------------------------
|
|
114
|
+
/**
|
|
115
|
+
* Override or extend the styles applied to the component.
|
|
116
|
+
*/
|
|
117
|
+
classes: _propTypes.default.object
|
|
118
|
+
} : void 0;
|
|
119
|
+
function HeatmapTooltip(props) {
|
|
120
|
+
const classes = useUtilityClasses({
|
|
121
|
+
classes: props.classes
|
|
122
|
+
});
|
|
123
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipContainer, (0, _extends2.default)({}, props, {
|
|
124
|
+
classes: classes,
|
|
125
|
+
trigger: "item",
|
|
126
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultHeatmapTooltipContent, {
|
|
127
|
+
classes: classes
|
|
128
|
+
})
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
132
|
+
// ----------------------------- Warning --------------------------------
|
|
133
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
134
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
135
|
+
// ----------------------------------------------------------------------
|
|
136
|
+
/**
|
|
137
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
138
|
+
* or a function that returns either.
|
|
139
|
+
* It's used to set the position of the popper.
|
|
140
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
141
|
+
*/
|
|
142
|
+
anchorEl: _propTypes.default.oneOfType([(props, propName) => {
|
|
143
|
+
if (props[propName] == null) {
|
|
144
|
+
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
145
|
+
}
|
|
146
|
+
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
147
|
+
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}, _propTypes.default.func, _propTypes.default.shape({
|
|
151
|
+
contextElement: (props, propName) => {
|
|
152
|
+
if (props[propName] == null) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
156
|
+
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
157
|
+
}
|
|
158
|
+
return null;
|
|
159
|
+
},
|
|
160
|
+
getBoundingClientRect: _propTypes.default.func.isRequired
|
|
161
|
+
})]),
|
|
162
|
+
/**
|
|
163
|
+
* Override or extend the styles applied to the component.
|
|
164
|
+
*/
|
|
165
|
+
classes: _propTypes.default.object,
|
|
166
|
+
/**
|
|
167
|
+
* The component used for the root node.
|
|
168
|
+
* Either a string to use a HTML element or a component.
|
|
169
|
+
*/
|
|
170
|
+
component: _propTypes.default.elementType,
|
|
171
|
+
/**
|
|
172
|
+
* The components used for each slot inside the Popper.
|
|
173
|
+
* Either a string to use a HTML element or a component.
|
|
174
|
+
* @default {}
|
|
175
|
+
*/
|
|
176
|
+
components: _propTypes.default.shape({
|
|
177
|
+
Root: _propTypes.default.elementType
|
|
178
|
+
}),
|
|
179
|
+
/**
|
|
180
|
+
* The props used for each slot inside the Popper.
|
|
181
|
+
* @default {}
|
|
182
|
+
*/
|
|
183
|
+
componentsProps: _propTypes.default.shape({
|
|
184
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
185
|
+
}),
|
|
186
|
+
/**
|
|
187
|
+
* An HTML element or function that returns one.
|
|
188
|
+
* The `container` will have the portal children appended to it.
|
|
189
|
+
*
|
|
190
|
+
* You can also provide a callback, which is called in a React layout effect.
|
|
191
|
+
* This lets you set the container from a ref, and also makes server-side rendering possible.
|
|
192
|
+
*
|
|
193
|
+
* By default, it uses the body of the top-level document object,
|
|
194
|
+
* so it's simply `document.body` most of the time.
|
|
195
|
+
*/
|
|
196
|
+
container: _propTypes.default.oneOfType([(props, propName) => {
|
|
197
|
+
if (props[propName] == null) {
|
|
198
|
+
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
199
|
+
}
|
|
200
|
+
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
201
|
+
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}, _propTypes.default.func]),
|
|
205
|
+
/**
|
|
206
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
disablePortal: _propTypes.default.bool,
|
|
210
|
+
/**
|
|
211
|
+
* Always keep the children in the DOM.
|
|
212
|
+
* This prop can be useful in SEO situation or
|
|
213
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
keepMounted: _propTypes.default.bool,
|
|
217
|
+
/**
|
|
218
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
219
|
+
* most of its features are fully encapsulated "modifiers".
|
|
220
|
+
*
|
|
221
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
222
|
+
* compute the position of the popper.
|
|
223
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
224
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
225
|
+
*/
|
|
226
|
+
modifiers: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
227
|
+
data: _propTypes.default.object,
|
|
228
|
+
effect: _propTypes.default.func,
|
|
229
|
+
enabled: _propTypes.default.bool,
|
|
230
|
+
fn: _propTypes.default.func,
|
|
231
|
+
name: _propTypes.default.any,
|
|
232
|
+
options: _propTypes.default.object,
|
|
233
|
+
phase: _propTypes.default.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
|
|
234
|
+
requires: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
235
|
+
requiresIfExists: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
236
|
+
})),
|
|
237
|
+
/**
|
|
238
|
+
* If `true`, the component is shown.
|
|
239
|
+
*/
|
|
240
|
+
open: _propTypes.default.bool,
|
|
241
|
+
/**
|
|
242
|
+
* Popper placement.
|
|
243
|
+
* @default 'bottom'
|
|
244
|
+
*/
|
|
245
|
+
placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
246
|
+
/**
|
|
247
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
248
|
+
* @default {}
|
|
249
|
+
*/
|
|
250
|
+
popperOptions: _propTypes.default.shape({
|
|
251
|
+
modifiers: _propTypes.default.array,
|
|
252
|
+
onFirstUpdate: _propTypes.default.func,
|
|
253
|
+
placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
254
|
+
strategy: _propTypes.default.oneOf(['absolute', 'fixed'])
|
|
255
|
+
}),
|
|
256
|
+
/**
|
|
257
|
+
* A ref that points to the used popper instance.
|
|
258
|
+
*/
|
|
259
|
+
popperRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
260
|
+
current: _propTypes.default.shape({
|
|
261
|
+
destroy: _propTypes.default.func.isRequired,
|
|
262
|
+
forceUpdate: _propTypes.default.func.isRequired,
|
|
263
|
+
setOptions: _propTypes.default.func.isRequired,
|
|
264
|
+
state: _propTypes.default.shape({
|
|
265
|
+
attributes: _propTypes.default.object.isRequired,
|
|
266
|
+
elements: _propTypes.default.object.isRequired,
|
|
267
|
+
modifiersData: _propTypes.default.object.isRequired,
|
|
268
|
+
options: _propTypes.default.object.isRequired,
|
|
269
|
+
orderedModifiers: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
270
|
+
placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']).isRequired,
|
|
271
|
+
rects: _propTypes.default.object.isRequired,
|
|
272
|
+
reset: _propTypes.default.bool.isRequired,
|
|
273
|
+
scrollParents: _propTypes.default.object.isRequired,
|
|
274
|
+
strategy: _propTypes.default.oneOf(['absolute', 'fixed']).isRequired,
|
|
275
|
+
styles: _propTypes.default.object.isRequired
|
|
276
|
+
}).isRequired,
|
|
277
|
+
update: _propTypes.default.func.isRequired
|
|
278
|
+
})
|
|
279
|
+
})]),
|
|
280
|
+
/**
|
|
281
|
+
* The props used for each slot inside the Popper.
|
|
282
|
+
* @default {}
|
|
283
|
+
*/
|
|
284
|
+
slotProps: _propTypes.default.object,
|
|
285
|
+
/**
|
|
286
|
+
* The components used for each slot inside the Popper.
|
|
287
|
+
* Either a string to use a HTML element or a component.
|
|
288
|
+
* @default {}
|
|
289
|
+
*/
|
|
290
|
+
slots: _propTypes.default.object,
|
|
291
|
+
/**
|
|
292
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
293
|
+
*/
|
|
294
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
295
|
+
/**
|
|
296
|
+
* Help supporting a react-transition-group/Transition component.
|
|
297
|
+
* @default false
|
|
298
|
+
*/
|
|
299
|
+
transition: _propTypes.default.bool
|
|
300
|
+
} : void 0;
|
package/node/Heatmap/index.js
CHANGED
|
@@ -21,15 +21,15 @@ Object.defineProperty(exports, "HeatmapPlot", {
|
|
|
21
21
|
});
|
|
22
22
|
var _Heatmap = require("./Heatmap");
|
|
23
23
|
var _HeatmapPlot = require("./HeatmapPlot");
|
|
24
|
-
var
|
|
25
|
-
Object.keys(
|
|
24
|
+
var _HeatmapTooltip = require("./HeatmapTooltip");
|
|
25
|
+
Object.keys(_HeatmapTooltip).forEach(function (key) {
|
|
26
26
|
if (key === "default" || key === "__esModule") return;
|
|
27
27
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
28
|
-
if (key in exports && exports[key] ===
|
|
28
|
+
if (key in exports && exports[key] === _HeatmapTooltip[key]) return;
|
|
29
29
|
Object.defineProperty(exports, key, {
|
|
30
30
|
enumerable: true,
|
|
31
31
|
get: function () {
|
|
32
|
-
return
|
|
32
|
+
return _HeatmapTooltip[key];
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
});
|