@mui/x-charts-pro 8.0.0-alpha.0 → 8.0.0-alpha.10
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 +2 -2
- package/BarChartPro/BarChartPro.js +74 -61
- package/CHANGELOG.md +2215 -119
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
- package/ChartContainerPro/ChartContainerPro.js +59 -51
- package/ChartContainerPro/useChartContainerProProps.d.ts +7 -43
- package/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/{context → ChartDataProviderPro}/package.json +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/Heatmap/Heatmap.d.ts +11 -4
- package/Heatmap/Heatmap.js +35 -43
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/HeatmapTooltip.d.ts +9 -0
- package/Heatmap/HeatmapTooltip.js +274 -0
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/heatmapClasses.js +2 -1
- package/Heatmap/index.d.ts +1 -1
- package/Heatmap/index.js +1 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +4 -2
- package/Heatmap/tooltip.d.ts +3 -0
- package/Heatmap/tooltip.js +25 -0
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +80 -82
- package/README.md +3 -3
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +51 -64
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useSeries.d.ts +2 -4
- package/hooks/zoom/index.d.ts +1 -0
- package/hooks/zoom/index.js +1 -0
- package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/index.d.ts +3 -1
- package/index.js +5 -5
- package/internals/plugins/allPlugins.d.ts +11 -0
- package/internals/plugins/allPlugins.js +5 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +3 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/internals/plugins/useChartProZoom/index.js +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +377 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +50 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
- package/internals/utils/releaseInfo.js +2 -2
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +74 -61
- package/modern/ChartContainerPro/ChartContainerPro.js +59 -51
- package/modern/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/modern/Heatmap/Heatmap.js +35 -43
- package/modern/Heatmap/HeatmapItem.js +1 -1
- package/modern/Heatmap/HeatmapTooltip.js +274 -0
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/heatmapClasses.js +2 -1
- package/modern/Heatmap/index.js +1 -1
- package/modern/Heatmap/plugin.js +4 -2
- package/modern/Heatmap/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.js +80 -82
- package/modern/ScatterChartPro/ScatterChartPro.js +51 -64
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/zoom/index.js +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/modern/index.js +5 -5
- package/modern/internals/plugins/allPlugins.js +5 -0
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/modern/internals/plugins/useChartProZoom/index.js +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
- package/modern/internals/utils/releaseInfo.js +2 -2
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +73 -60
- package/node/ChartContainerPro/ChartContainerPro.js +58 -50
- package/node/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -79
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- package/node/Heatmap/Heatmap.js +35 -43
- package/node/Heatmap/HeatmapItem.js +2 -2
- package/node/Heatmap/HeatmapTooltip.js +280 -0
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/heatmapClasses.js +5 -4
- package/node/Heatmap/index.js +4 -4
- package/node/Heatmap/plugin.js +4 -2
- package/node/Heatmap/tooltip.js +31 -0
- package/node/LineChartPro/LineChartPro.js +79 -81
- package/node/ScatterChartPro/ScatterChartPro.js +50 -63
- package/node/hooks/index.js +16 -1
- package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
- package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
- package/node/index.js +34 -12
- package/node/internals/plugins/allPlugins.js +11 -0
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +19 -0
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
- package/node/internals/plugins/useChartProZoom/index.js +38 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.js +310 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +18 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
- package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
- package/node/internals/utils/releaseInfo.js +4 -3
- package/package.json +8 -8
- package/typeOverloads/modules.d.ts +8 -1
- package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
- package/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
- package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -12
- package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/context/CartesianProviderPro/index.d.ts +0 -1
- package/context/CartesianProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -7
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -16
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/context/ZoomProvider/Zoom.types.d.ts +0 -144
- package/context/ZoomProvider/ZoomContext.d.ts +0 -4
- package/context/ZoomProvider/ZoomContext.js +0 -16
- package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
- package/context/ZoomProvider/ZoomProvider.js +0 -56
- package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
- package/context/ZoomProvider/ZoomSetup.js +0 -16
- package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
- package/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/context/ZoomProvider/index.d.ts +0 -3
- package/context/ZoomProvider/index.js +0 -3
- package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
- package/context/ZoomProvider/initializeZoomData.js +0 -13
- package/context/ZoomProvider/useSetupPan.d.ts +0 -1
- package/context/ZoomProvider/useSetupPan.js +0 -106
- package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
- package/context/ZoomProvider/useSetupZoom.js +0 -274
- package/context/ZoomProvider/useZoom.d.ts +0 -7
- package/context/ZoomProvider/useZoom.js +0 -19
- package/context/index.d.ts +0 -3
- package/context/index.js +0 -5
- package/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/modern/context/CartesianProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/modern/context/ZoomProvider/ZoomContext.js +0 -16
- package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
- package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
- package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/modern/context/ZoomProvider/index.js +0 -3
- package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
- package/modern/context/ZoomProvider/useSetupPan.js +0 -106
- package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
- package/modern/context/ZoomProvider/useZoom.js +0 -19
- package/modern/context/index.js +0 -5
- package/node/Heatmap/DefaultHeatmapTooltip.js +0 -105
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
- package/node/context/ZoomProvider/ZoomContext.js +0 -23
- package/node/context/ZoomProvider/ZoomProvider.js +0 -63
- package/node/context/ZoomProvider/ZoomSetup.js +0 -20
- package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
- package/node/context/ZoomProvider/index.js +0 -38
- package/node/context/ZoomProvider/initializeZoomData.js +0 -20
- package/node/context/ZoomProvider/useSetupPan.js +0 -114
- package/node/context/ZoomProvider/useSetupZoom.js +0 -281
- package/node/context/ZoomProvider/useZoom.js +0 -25
- package/node/context/index.js +0 -27
- /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.d.ts +0 -0
- /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
- /package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
3
|
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
4
|
-
import { ChartsTooltipProps
|
|
4
|
+
import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
5
5
|
import { ChartsAxisSlots, ChartsAxisSlotProps, ChartsXAxisProps, ChartsYAxisProps, AxisConfig } from '@mui/x-charts/internals';
|
|
6
6
|
import { ChartsOnAxisClickHandlerProps } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
7
7
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
8
8
|
import { ChartContainerProProps } from '../ChartContainerPro';
|
|
9
9
|
import { HeatmapSeriesType } from '../models/seriesType/heatmap';
|
|
10
|
+
import { HeatmapTooltipProps } from './HeatmapTooltip';
|
|
10
11
|
import { HeatmapItemSlotProps, HeatmapItemSlots } from './HeatmapItem';
|
|
11
|
-
export interface HeatmapSlots extends ChartsAxisSlots,
|
|
12
|
+
export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, HeatmapItemSlots {
|
|
13
|
+
/**
|
|
14
|
+
* Custom component for the tooltip popper.
|
|
15
|
+
* @default ChartsTooltipRoot
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: React.ElementType<HeatmapTooltipProps>;
|
|
12
18
|
}
|
|
13
|
-
export interface HeatmapSlotProps extends ChartsAxisSlotProps,
|
|
19
|
+
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
20
|
+
tooltip?: Partial<HeatmapTooltipProps>;
|
|
14
21
|
}
|
|
15
22
|
export interface HeatmapProps extends Omit<ChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
16
23
|
/**
|
|
@@ -34,7 +41,7 @@ export interface HeatmapProps extends Omit<ChartContainerProProps, 'series' | 'p
|
|
|
34
41
|
* The configuration of the tooltip.
|
|
35
42
|
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
36
43
|
*/
|
|
37
|
-
tooltip?: ChartsTooltipProps
|
|
44
|
+
tooltip?: ChartsTooltipProps;
|
|
38
45
|
/**
|
|
39
46
|
* Overridable component slots.
|
|
40
47
|
* @default {}
|
package/Heatmap/Heatmap.js
CHANGED
|
@@ -7,17 +7,19 @@ import { useThemeProps } from '@mui/material/styles';
|
|
|
7
7
|
import useId from '@mui/utils/useId';
|
|
8
8
|
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
9
9
|
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
10
|
-
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
11
10
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
12
11
|
import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
13
12
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
14
13
|
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
15
14
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
16
15
|
import { plugin as heatmapPlugin } from "./plugin.js";
|
|
17
|
-
import {
|
|
16
|
+
import { HeatmapTooltip } from "./HeatmapTooltip.js";
|
|
18
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
20
19
|
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
20
|
+
const seriesConfig = {
|
|
21
|
+
heatmap: heatmapPlugin
|
|
22
|
+
};
|
|
21
23
|
const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
22
24
|
const props = useThemeProps({
|
|
23
25
|
props: inProps,
|
|
@@ -34,7 +36,6 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
34
36
|
colors,
|
|
35
37
|
dataset,
|
|
36
38
|
sx,
|
|
37
|
-
tooltip,
|
|
38
39
|
topAxis,
|
|
39
40
|
leftAxis,
|
|
40
41
|
rightAxis,
|
|
@@ -65,9 +66,10 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
65
66
|
color: defaultColorMap
|
|
66
67
|
}
|
|
67
68
|
}], [zAxis]);
|
|
69
|
+
const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
|
|
68
70
|
return /*#__PURE__*/_jsxs(ChartContainerPro, {
|
|
69
71
|
ref: ref,
|
|
70
|
-
|
|
72
|
+
seriesConfig: seriesConfig,
|
|
71
73
|
series: series.map(s => _extends({
|
|
72
74
|
type: 'heatmap'
|
|
73
75
|
}, s)),
|
|
@@ -102,14 +104,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
102
104
|
bottomAxis: bottomAxis,
|
|
103
105
|
slots: slots,
|
|
104
106
|
slotProps: slotProps
|
|
105
|
-
}), !loading && /*#__PURE__*/_jsx(
|
|
106
|
-
trigger: "item"
|
|
107
|
-
}, tooltip, {
|
|
108
|
-
slots: _extends({
|
|
109
|
-
itemContent: DefaultHeatmapTooltip
|
|
110
|
-
}, slots),
|
|
111
|
-
slotProps: slotProps
|
|
112
|
-
})), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
107
|
+
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
113
108
|
id: clipPathId
|
|
114
109
|
}), children]
|
|
115
110
|
});
|
|
@@ -119,6 +114,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
119
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
120
115
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
121
116
|
// ----------------------------------------------------------------------
|
|
117
|
+
apiRef: PropTypes.shape({
|
|
118
|
+
current: PropTypes.shape({
|
|
119
|
+
setZoomData: PropTypes.func.isRequired
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
122
|
/**
|
|
123
123
|
* Indicate which axis to display the bottom of the charts.
|
|
124
124
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
@@ -148,12 +148,26 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
148
148
|
*/
|
|
149
149
|
height: PropTypes.number,
|
|
150
150
|
/**
|
|
151
|
-
* The
|
|
151
|
+
* The highlighted item.
|
|
152
|
+
* Used when the highlight is controlled.
|
|
152
153
|
*/
|
|
153
154
|
highlightedItem: PropTypes.shape({
|
|
154
155
|
dataIndex: PropTypes.number,
|
|
155
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
156
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
156
157
|
}),
|
|
158
|
+
/**
|
|
159
|
+
* This prop is used to help implement the accessibility logic.
|
|
160
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
161
|
+
*/
|
|
162
|
+
id: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* The list of zoom data related to each axis.
|
|
165
|
+
*/
|
|
166
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
167
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
168
|
+
end: PropTypes.number.isRequired,
|
|
169
|
+
start: PropTypes.number.isRequired
|
|
170
|
+
})),
|
|
157
171
|
/**
|
|
158
172
|
* Indicate which axis to display the left of the charts.
|
|
159
173
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -169,7 +183,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
169
183
|
* The margin between the SVG and the drawing area.
|
|
170
184
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
171
185
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
172
|
-
* @default object Depends on the charts type.
|
|
173
186
|
*/
|
|
174
187
|
margin: PropTypes.shape({
|
|
175
188
|
bottom: PropTypes.number,
|
|
@@ -190,16 +203,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
190
203
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
191
204
|
*/
|
|
192
205
|
onHighlightChange: PropTypes.func,
|
|
193
|
-
/**
|
|
194
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
195
|
-
* before it renders for the first time.
|
|
196
|
-
*
|
|
197
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
198
|
-
* the first render, like when used inside a grid.
|
|
199
|
-
*
|
|
200
|
-
* @default false
|
|
201
|
-
*/
|
|
202
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
203
206
|
/**
|
|
204
207
|
* Indicate which axis to display the right of the charts.
|
|
205
208
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -211,6 +214,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
211
214
|
* An array of [[HeatmapSeriesType]] objects.
|
|
212
215
|
*/
|
|
213
216
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
217
|
+
/**
|
|
218
|
+
* The configuration helpers used to compute attributes according to the serries type.
|
|
219
|
+
* @ignore Unstable props for internal usage.
|
|
220
|
+
*/
|
|
221
|
+
seriesConfig: PropTypes.object,
|
|
214
222
|
/**
|
|
215
223
|
* The props used for each component slot.
|
|
216
224
|
* @default {}
|
|
@@ -222,31 +230,19 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
222
230
|
*/
|
|
223
231
|
slots: PropTypes.object,
|
|
224
232
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
233
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
225
234
|
title: PropTypes.string,
|
|
226
235
|
/**
|
|
227
236
|
* The configuration of the tooltip.
|
|
228
237
|
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
229
238
|
*/
|
|
230
|
-
tooltip: PropTypes.
|
|
231
|
-
axisContent: PropTypes.elementType,
|
|
232
|
-
classes: PropTypes.object,
|
|
233
|
-
itemContent: PropTypes.elementType,
|
|
234
|
-
slotProps: PropTypes.object,
|
|
235
|
-
slots: PropTypes.object,
|
|
236
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
237
|
-
}),
|
|
239
|
+
tooltip: PropTypes.object,
|
|
238
240
|
/**
|
|
239
241
|
* Indicate which axis to display the top of the charts.
|
|
240
242
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
241
243
|
* @default null
|
|
242
244
|
*/
|
|
243
245
|
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
244
|
-
viewBox: PropTypes.shape({
|
|
245
|
-
height: PropTypes.number,
|
|
246
|
-
width: PropTypes.number,
|
|
247
|
-
x: PropTypes.number,
|
|
248
|
-
y: PropTypes.number
|
|
249
|
-
}),
|
|
250
246
|
/**
|
|
251
247
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
252
248
|
*/
|
|
@@ -284,7 +280,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
284
280
|
hideTooltip: PropTypes.bool,
|
|
285
281
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
286
282
|
label: PropTypes.string,
|
|
287
|
-
labelFontSize: PropTypes.number,
|
|
288
283
|
labelStyle: PropTypes.object,
|
|
289
284
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
290
285
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -295,7 +290,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
295
290
|
slots: PropTypes.object,
|
|
296
291
|
stroke: PropTypes.string,
|
|
297
292
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
298
|
-
tickFontSize: PropTypes.number,
|
|
299
293
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
300
294
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
301
295
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -349,7 +343,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
349
343
|
hideTooltip: PropTypes.bool,
|
|
350
344
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
351
345
|
label: PropTypes.string,
|
|
352
|
-
labelFontSize: PropTypes.number,
|
|
353
346
|
labelStyle: PropTypes.object,
|
|
354
347
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
355
348
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -360,7 +353,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
360
353
|
slots: PropTypes.object,
|
|
361
354
|
stroke: PropTypes.string,
|
|
362
355
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
363
|
-
tickFontSize: PropTypes.number,
|
|
364
356
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
365
357
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
366
358
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
package/Heatmap/HeatmapItem.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
-
import { useItemHighlighted } from '@mui/x-charts/
|
|
9
|
+
import { useItemHighlighted } from '@mui/x-charts/hooks';
|
|
10
10
|
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
11
11
|
import { getHeatmapUtilityClass } from "./heatmapClasses.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
+
export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
|
|
4
|
+
}
|
|
5
|
+
declare function HeatmapTooltip(props: HeatmapTooltipProps): React.JSX.Element;
|
|
6
|
+
declare namespace HeatmapTooltip {
|
|
7
|
+
var propTypes: any;
|
|
8
|
+
}
|
|
9
|
+
export { HeatmapTooltip };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
8
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip, getChartsTooltipUtilityClass, ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
|
|
10
|
+
import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
|
|
11
|
+
import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
|
|
12
|
+
import { useHeatmapSeries } from "../hooks/useSeries.js";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const useUtilityClasses = ownerState => {
|
|
15
|
+
const {
|
|
16
|
+
classes
|
|
17
|
+
} = ownerState;
|
|
18
|
+
const slots = {
|
|
19
|
+
root: ['root'],
|
|
20
|
+
paper: ['paper'],
|
|
21
|
+
table: ['table'],
|
|
22
|
+
row: ['row'],
|
|
23
|
+
cell: ['cell'],
|
|
24
|
+
mark: ['mark'],
|
|
25
|
+
markCell: ['markCell'],
|
|
26
|
+
labelCell: ['labelCell'],
|
|
27
|
+
valueCell: ['valueCell']
|
|
28
|
+
};
|
|
29
|
+
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
30
|
+
};
|
|
31
|
+
function DefaultHeatmapTooltipContent(props) {
|
|
32
|
+
const {
|
|
33
|
+
classes
|
|
34
|
+
} = props;
|
|
35
|
+
const xAxis = useXAxis();
|
|
36
|
+
const yAxis = useYAxis();
|
|
37
|
+
const heatmapSeries = useHeatmapSeries();
|
|
38
|
+
const tooltipData = useItemTooltip();
|
|
39
|
+
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const {
|
|
43
|
+
series,
|
|
44
|
+
seriesOrder
|
|
45
|
+
} = heatmapSeries;
|
|
46
|
+
const seriesId = seriesOrder[0];
|
|
47
|
+
const {
|
|
48
|
+
color,
|
|
49
|
+
value,
|
|
50
|
+
identifier,
|
|
51
|
+
markType
|
|
52
|
+
} = tooltipData;
|
|
53
|
+
const [xIndex, yIndex] = value;
|
|
54
|
+
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
55
|
+
location: 'tooltip'
|
|
56
|
+
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
57
|
+
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
58
|
+
location: 'tooltip'
|
|
59
|
+
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
60
|
+
const formattedValue = series[seriesId].valueFormatter(value, {
|
|
61
|
+
dataIndex: identifier.dataIndex
|
|
62
|
+
});
|
|
63
|
+
const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
|
|
64
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
65
|
+
className: classes?.paper,
|
|
66
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
67
|
+
className: classes?.table,
|
|
68
|
+
children: [/*#__PURE__*/_jsx("thead", {
|
|
69
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
70
|
+
className: classes?.row,
|
|
71
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
72
|
+
className: classes?.cell,
|
|
73
|
+
children: formattedX
|
|
74
|
+
}), formattedX && formattedY && /*#__PURE__*/_jsx(ChartsTooltipCell, {}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
75
|
+
className: classes?.cell,
|
|
76
|
+
children: formattedY
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
}), /*#__PURE__*/_jsx("tbody", {
|
|
80
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
81
|
+
className: classes?.row,
|
|
82
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
83
|
+
className: clsx(classes?.markCell, classes?.cell),
|
|
84
|
+
children: /*#__PURE__*/_jsx(ChartsLabelMark, {
|
|
85
|
+
type: markType,
|
|
86
|
+
color: color,
|
|
87
|
+
className: classes?.mark
|
|
88
|
+
})
|
|
89
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
90
|
+
className: clsx(classes?.labelCell, classes?.cell),
|
|
91
|
+
children: seriesLabel
|
|
92
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
93
|
+
className: clsx(classes?.valueCell, classes?.cell),
|
|
94
|
+
children: formattedValue
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltipContent.propTypes = {
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* Override or extend the styles applied to the component.
|
|
108
|
+
*/
|
|
109
|
+
classes: PropTypes.object
|
|
110
|
+
} : void 0;
|
|
111
|
+
function HeatmapTooltip(props) {
|
|
112
|
+
const classes = useUtilityClasses({
|
|
113
|
+
classes: props.classes
|
|
114
|
+
});
|
|
115
|
+
return /*#__PURE__*/_jsx(ChartsTooltipContainer, _extends({}, props, {
|
|
116
|
+
classes: classes,
|
|
117
|
+
trigger: "item",
|
|
118
|
+
children: /*#__PURE__*/_jsx(DefaultHeatmapTooltipContent, {
|
|
119
|
+
classes: classes
|
|
120
|
+
})
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
124
|
+
// ----------------------------- Warning --------------------------------
|
|
125
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
126
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
127
|
+
// ----------------------------------------------------------------------
|
|
128
|
+
/**
|
|
129
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
130
|
+
* or a function that returns either.
|
|
131
|
+
* It's used to set the position of the popper.
|
|
132
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
133
|
+
*/
|
|
134
|
+
anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
|
|
135
|
+
/**
|
|
136
|
+
* Override or extend the styles applied to the component.
|
|
137
|
+
*/
|
|
138
|
+
classes: PropTypes.object,
|
|
139
|
+
/**
|
|
140
|
+
* The component used for the root node.
|
|
141
|
+
* Either a string to use a HTML element or a component.
|
|
142
|
+
*/
|
|
143
|
+
component: PropTypes.elementType,
|
|
144
|
+
/**
|
|
145
|
+
* The components used for each slot inside the Popper.
|
|
146
|
+
* Either a string to use a HTML element or a component.
|
|
147
|
+
* @default {}
|
|
148
|
+
*/
|
|
149
|
+
components: PropTypes.shape({
|
|
150
|
+
Root: PropTypes.elementType
|
|
151
|
+
}),
|
|
152
|
+
/**
|
|
153
|
+
* The props used for each slot inside the Popper.
|
|
154
|
+
* @default {}
|
|
155
|
+
*/
|
|
156
|
+
componentsProps: PropTypes.shape({
|
|
157
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
158
|
+
}),
|
|
159
|
+
/**
|
|
160
|
+
* An HTML element or function that returns one.
|
|
161
|
+
* The `container` will have the portal children appended to it.
|
|
162
|
+
*
|
|
163
|
+
* You can also provide a callback, which is called in a React layout effect.
|
|
164
|
+
* This lets you set the container from a ref, and also makes server-side rendering possible.
|
|
165
|
+
*
|
|
166
|
+
* By default, it uses the body of the top-level document object,
|
|
167
|
+
* so it's simply `document.body` most of the time.
|
|
168
|
+
*/
|
|
169
|
+
container: PropTypes.oneOfType([(props, propName) => {
|
|
170
|
+
if (props[propName] == null) {
|
|
171
|
+
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
172
|
+
}
|
|
173
|
+
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
174
|
+
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}, PropTypes.func]),
|
|
178
|
+
/**
|
|
179
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disablePortal: PropTypes.bool,
|
|
183
|
+
/**
|
|
184
|
+
* Always keep the children in the DOM.
|
|
185
|
+
* This prop can be useful in SEO situation or
|
|
186
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
187
|
+
* @default false
|
|
188
|
+
*/
|
|
189
|
+
keepMounted: PropTypes.bool,
|
|
190
|
+
/**
|
|
191
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
192
|
+
* most of its features are fully encapsulated "modifiers".
|
|
193
|
+
*
|
|
194
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
195
|
+
* compute the position of the popper.
|
|
196
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
197
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
198
|
+
*/
|
|
199
|
+
modifiers: PropTypes.arrayOf(PropTypes.shape({
|
|
200
|
+
data: PropTypes.object,
|
|
201
|
+
effect: PropTypes.func,
|
|
202
|
+
enabled: PropTypes.bool,
|
|
203
|
+
fn: PropTypes.func,
|
|
204
|
+
name: PropTypes.any,
|
|
205
|
+
options: PropTypes.object,
|
|
206
|
+
phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
|
|
207
|
+
requires: PropTypes.arrayOf(PropTypes.string),
|
|
208
|
+
requiresIfExists: PropTypes.arrayOf(PropTypes.string)
|
|
209
|
+
})),
|
|
210
|
+
/**
|
|
211
|
+
* If `true`, the component is shown.
|
|
212
|
+
*/
|
|
213
|
+
open: PropTypes.bool,
|
|
214
|
+
/**
|
|
215
|
+
* Popper placement.
|
|
216
|
+
* @default 'bottom'
|
|
217
|
+
*/
|
|
218
|
+
placement: PropTypes.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']),
|
|
219
|
+
/**
|
|
220
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
221
|
+
* @default {}
|
|
222
|
+
*/
|
|
223
|
+
popperOptions: PropTypes.shape({
|
|
224
|
+
modifiers: PropTypes.array,
|
|
225
|
+
onFirstUpdate: PropTypes.func,
|
|
226
|
+
placement: PropTypes.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']),
|
|
227
|
+
strategy: PropTypes.oneOf(['absolute', 'fixed'])
|
|
228
|
+
}),
|
|
229
|
+
/**
|
|
230
|
+
* A ref that points to the used popper instance.
|
|
231
|
+
*/
|
|
232
|
+
popperRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
233
|
+
current: PropTypes.shape({
|
|
234
|
+
destroy: PropTypes.func.isRequired,
|
|
235
|
+
forceUpdate: PropTypes.func.isRequired,
|
|
236
|
+
setOptions: PropTypes.func.isRequired,
|
|
237
|
+
state: PropTypes.shape({
|
|
238
|
+
attributes: PropTypes.object.isRequired,
|
|
239
|
+
elements: PropTypes.object.isRequired,
|
|
240
|
+
modifiersData: PropTypes.object.isRequired,
|
|
241
|
+
options: PropTypes.object.isRequired,
|
|
242
|
+
orderedModifiers: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
243
|
+
placement: PropTypes.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,
|
|
244
|
+
rects: PropTypes.object.isRequired,
|
|
245
|
+
reset: PropTypes.bool.isRequired,
|
|
246
|
+
scrollParents: PropTypes.object.isRequired,
|
|
247
|
+
strategy: PropTypes.oneOf(['absolute', 'fixed']).isRequired,
|
|
248
|
+
styles: PropTypes.object.isRequired
|
|
249
|
+
}).isRequired,
|
|
250
|
+
update: PropTypes.func.isRequired
|
|
251
|
+
})
|
|
252
|
+
})]),
|
|
253
|
+
/**
|
|
254
|
+
* The props used for each slot inside the Popper.
|
|
255
|
+
* @default {}
|
|
256
|
+
*/
|
|
257
|
+
slotProps: PropTypes.object,
|
|
258
|
+
/**
|
|
259
|
+
* The components used for each slot inside the Popper.
|
|
260
|
+
* Either a string to use a HTML element or a component.
|
|
261
|
+
* @default {}
|
|
262
|
+
*/
|
|
263
|
+
slots: PropTypes.object,
|
|
264
|
+
/**
|
|
265
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
266
|
+
*/
|
|
267
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
268
|
+
/**
|
|
269
|
+
* Help supporting a react-transition-group/Transition component.
|
|
270
|
+
* @default false
|
|
271
|
+
*/
|
|
272
|
+
transition: PropTypes.bool
|
|
273
|
+
} : void 0;
|
|
274
|
+
export { HeatmapTooltip };
|
package/Heatmap/extremums.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getBaseExtremum:
|
|
1
|
+
import { CartesianExtremumGetter } from '@mui/x-charts/internals';
|
|
2
|
+
export declare const getBaseExtremum: CartesianExtremumGetter<'heatmap'>;
|
package/Heatmap/formatter.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const formatter:
|
|
1
|
+
import { SeriesProcessor } from '@mui/x-charts/internals';
|
|
2
|
+
declare const formatter: SeriesProcessor<'heatmap'>;
|
|
3
3
|
export default formatter;
|
package/Heatmap/formatter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import
|
|
2
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
4
|
export function getHeatmapUtilityClass(slot) {
|
|
4
5
|
// Those should be common to all charts
|
|
5
6
|
if (['highlighted', 'faded'].includes(slot)) {
|
package/Heatmap/index.d.ts
CHANGED
package/Heatmap/index.js
CHANGED
package/Heatmap/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const plugin:
|
|
1
|
+
import { ChartSeriesTypeConfig } from '@mui/x-charts/internals';
|
|
2
|
+
export declare const plugin: ChartSeriesTypeConfig<'heatmap'>;
|
package/Heatmap/plugin.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getBaseExtremum } from "./extremums.js";
|
|
2
2
|
import formatter from "./formatter.js";
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
|
+
import tooltipGetter from "./tooltip.js";
|
|
4
5
|
export const plugin = {
|
|
5
|
-
|
|
6
|
-
seriesFormatter: formatter,
|
|
6
|
+
seriesProcessor: formatter,
|
|
7
7
|
colorProcessor: getColor,
|
|
8
|
+
legendGetter: () => [],
|
|
9
|
+
tooltipGetter,
|
|
8
10
|
xExtremumGetter: getBaseExtremum,
|
|
9
11
|
yExtremumGetter: getBaseExtremum
|
|
10
12
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
2
|
+
const tooltipGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
series,
|
|
5
|
+
getColor,
|
|
6
|
+
identifier
|
|
7
|
+
} = params;
|
|
8
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const label = getLabel(series.label, 'tooltip');
|
|
12
|
+
const value = series.data[identifier.dataIndex];
|
|
13
|
+
const formattedValue = series.valueFormatter(value, {
|
|
14
|
+
dataIndex: identifier.dataIndex
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
identifier,
|
|
18
|
+
color: getColor(identifier.dataIndex),
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
formattedValue,
|
|
22
|
+
markType: series.labelMarkType
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default tooltipGetter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LineChartProps } from '@mui/x-charts/LineChart';
|
|
3
|
-
import {
|
|
4
|
-
export interface LineChartProProps extends LineChartProps,
|
|
3
|
+
import { ChartContainerProProps } from '../ChartContainerPro';
|
|
4
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef'>, Omit<ChartContainerProProps<'line'>, 'series' | 'plugins' | 'seriesConfig'> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Demos:
|