@mui/x-charts-pro 8.4.0 → 8.5.0
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 +13 -5
- package/BarChartPro/BarChartPro.js +19 -1
- package/CHANGELOG.md +103 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/ChartContainerPro/ChartProApi.d.ts +26 -0
- package/ChartContainerPro/ChartProApi.js +5 -0
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +11 -0
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +19 -3
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +25 -315
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +251 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +160 -0
- package/ChartZoomSlider/internals/constants.d.ts +5 -0
- package/ChartZoomSlider/internals/constants.js +11 -0
- package/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
- package/ChartZoomSlider/internals/zoom-utils.js +48 -0
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +42 -8
- package/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
- package/ChartsToolbarPro/ChartsToolbarZoomInButton.js +56 -0
- package/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
- package/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +56 -0
- package/ChartsToolbarPro/index.d.ts +3 -1
- package/ChartsToolbarPro/index.js +22 -0
- package/FunnelChart/FunnelChart.d.ts +2 -1
- package/FunnelChart/FunnelChart.js +2 -20
- package/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/FunnelChart/FunnelChart.plugins.js +9 -0
- package/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/FunnelChart/useFunnelChartProps.js +3 -1
- package/Heatmap/Heatmap.d.ts +17 -4
- package/Heatmap/Heatmap.js +56 -22
- package/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/Heatmap/Heatmap.plugins.js +2 -1
- package/LineChartPro/LineChartPro.d.ts +13 -5
- package/LineChartPro/LineChartPro.js +19 -1
- package/RadarChartPro/RadarChartPro.d.ts +15 -0
- package/RadarChartPro/RadarChartPro.js +202 -0
- package/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
- package/RadarChartPro/RadarChartPro.plugins.js +9 -0
- package/RadarChartPro/index.d.ts +1 -0
- package/RadarChartPro/index.js +16 -0
- package/ScatterChartPro/ScatterChartPro.d.ts +13 -5
- package/ScatterChartPro/ScatterChartPro.js +19 -1
- package/context/index.d.ts +1 -0
- package/context/index.js +16 -0
- package/context/useChartApiContext.d.ts +9 -0
- package/context/useChartApiContext.js +17 -0
- package/esm/BarChartPro/BarChartPro.d.ts +13 -5
- package/esm/BarChartPro/BarChartPro.js +19 -1
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/esm/ChartContainerPro/ChartProApi.d.ts +26 -0
- package/esm/ChartContainerPro/ChartProApi.js +1 -0
- package/esm/ChartContainerPro/index.d.ts +2 -1
- package/esm/ChartContainerPro/index.js +2 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +20 -4
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +19 -306
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +243 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +152 -0
- package/esm/ChartZoomSlider/internals/constants.d.ts +5 -0
- package/esm/ChartZoomSlider/internals/constants.js +5 -0
- package/esm/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/zoom-utils.js +40 -0
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +42 -9
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.js +50 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +50 -0
- package/esm/ChartsToolbarPro/index.d.ts +3 -1
- package/esm/ChartsToolbarPro/index.js +3 -1
- package/esm/FunnelChart/FunnelChart.d.ts +2 -1
- package/esm/FunnelChart/FunnelChart.js +2 -20
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/esm/FunnelChart/FunnelChart.plugins.js +3 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/esm/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/esm/FunnelChart/useFunnelChartProps.js +3 -1
- package/esm/Heatmap/Heatmap.d.ts +17 -4
- package/esm/Heatmap/Heatmap.js +56 -22
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/esm/Heatmap/Heatmap.plugins.js +2 -1
- package/esm/LineChartPro/LineChartPro.d.ts +13 -5
- package/esm/LineChartPro/LineChartPro.js +19 -1
- package/esm/RadarChartPro/RadarChartPro.d.ts +15 -0
- package/esm/RadarChartPro/RadarChartPro.js +195 -0
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
- package/esm/RadarChartPro/RadarChartPro.plugins.js +3 -0
- package/esm/RadarChartPro/index.d.ts +1 -0
- package/esm/RadarChartPro/index.js +1 -0
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +13 -5
- package/esm/ScatterChartPro/ScatterChartPro.js +19 -1
- package/esm/context/index.d.ts +1 -0
- package/esm/context/index.js +1 -0
- package/esm/context/useChartApiContext.d.ts +9 -0
- package/esm/context/useChartApiContext.js +11 -0
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/internals/material/index.d.ts +1 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +10 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +15 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
- package/esm/models/index.d.ts +1 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +21 -10
- package/index.d.ts +2 -1
- package/index.js +12 -1
- package/internals/material/index.d.ts +1 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +10 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +16 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
- package/models/index.d.ts +1 -1
- package/package.json +5 -5
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -36
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -36
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -29
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -29
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["axisId", "axisDirection", "reverse", "onSelectStart", "onSelectEnd"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useChartContext, getSVGPoint, selectorChartAxisZoomOptionsLookup, useStore } from '@mui/x-charts/internals';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
8
|
+
import { shouldForwardProp } from '@mui/system';
|
|
9
|
+
import { calculateZoomEnd, calculateZoomFromPoint, calculateZoomStart } from "./zoom-utils.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const ZoomSliderTrack = styled('rect', {
|
|
12
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'axisDirection' && prop !== 'isSelecting'
|
|
13
|
+
})(({
|
|
14
|
+
theme
|
|
15
|
+
}) => ({
|
|
16
|
+
fill: theme.palette.mode === 'dark' ? (theme.vars || theme).palette.grey[800] : (theme.vars || theme).palette.grey[300],
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
variants: [{
|
|
19
|
+
props: {
|
|
20
|
+
axisDirection: 'x',
|
|
21
|
+
isSelecting: true
|
|
22
|
+
},
|
|
23
|
+
style: {
|
|
24
|
+
cursor: 'ew-resize'
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
props: {
|
|
28
|
+
axisDirection: 'y',
|
|
29
|
+
isSelecting: true
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
cursor: 'ns-resize'
|
|
33
|
+
}
|
|
34
|
+
}]
|
|
35
|
+
}));
|
|
36
|
+
export function ChartAxisZoomSliderTrack(_ref) {
|
|
37
|
+
let {
|
|
38
|
+
axisId,
|
|
39
|
+
axisDirection,
|
|
40
|
+
onSelectStart,
|
|
41
|
+
onSelectEnd
|
|
42
|
+
} = _ref,
|
|
43
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
44
|
+
const ref = React.useRef(null);
|
|
45
|
+
const {
|
|
46
|
+
instance,
|
|
47
|
+
svgRef
|
|
48
|
+
} = useChartContext();
|
|
49
|
+
const store = useStore();
|
|
50
|
+
const [isSelecting, setIsSelecting] = React.useState(false);
|
|
51
|
+
const onPointerDown = function onPointerDown(event) {
|
|
52
|
+
const rect = ref.current;
|
|
53
|
+
const element = svgRef.current;
|
|
54
|
+
if (!rect || !element) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const pointerDownPoint = getSVGPoint(element, event);
|
|
58
|
+
let zoomFromPointerDown = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerDownPoint);
|
|
59
|
+
if (zoomFromPointerDown === null) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const {
|
|
63
|
+
minStart,
|
|
64
|
+
maxEnd
|
|
65
|
+
} = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
66
|
+
|
|
67
|
+
// Ensure the zoomFromPointerDown is within the min and max range
|
|
68
|
+
zoomFromPointerDown = Math.max(Math.min(zoomFromPointerDown, maxEnd), minStart);
|
|
69
|
+
let pointerMoved = false;
|
|
70
|
+
const onPointerMove = rafThrottle(function onPointerMove(pointerMoveEvent) {
|
|
71
|
+
const pointerMovePoint = getSVGPoint(element, pointerMoveEvent);
|
|
72
|
+
const zoomFromPointerMove = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerMovePoint);
|
|
73
|
+
if (zoomFromPointerMove === null) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
pointerMoved = true;
|
|
77
|
+
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
78
|
+
instance.setAxisZoomData(axisId, prevZoomData => {
|
|
79
|
+
if (zoomFromPointerMove > zoomFromPointerDown) {
|
|
80
|
+
const end = calculateZoomEnd(zoomFromPointerMove, _extends({}, prevZoomData, {
|
|
81
|
+
start: zoomFromPointerDown
|
|
82
|
+
}), zoomOptions);
|
|
83
|
+
|
|
84
|
+
/* If the starting point is too close to the end that minSpan wouldn't be respected, we need to update the
|
|
85
|
+
* start point. */
|
|
86
|
+
const start = calculateZoomStart(zoomFromPointerDown, _extends({}, prevZoomData, {
|
|
87
|
+
start: zoomFromPointerDown,
|
|
88
|
+
end
|
|
89
|
+
}), zoomOptions);
|
|
90
|
+
return _extends({}, prevZoomData, {
|
|
91
|
+
start,
|
|
92
|
+
end
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const start = calculateZoomStart(zoomFromPointerMove, _extends({}, prevZoomData, {
|
|
96
|
+
end: zoomFromPointerDown
|
|
97
|
+
}), zoomOptions);
|
|
98
|
+
|
|
99
|
+
/* If the starting point is too close to the start that minSpan wouldn't be respected, we need to update the
|
|
100
|
+
* start point. */
|
|
101
|
+
const end = calculateZoomEnd(zoomFromPointerDown, _extends({}, prevZoomData, {
|
|
102
|
+
start,
|
|
103
|
+
end: zoomFromPointerDown
|
|
104
|
+
}), zoomOptions);
|
|
105
|
+
return _extends({}, prevZoomData, {
|
|
106
|
+
start,
|
|
107
|
+
end
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
const onPointerUp = function onPointerUp(pointerUpEvent) {
|
|
112
|
+
rect.releasePointerCapture(pointerUpEvent.pointerId);
|
|
113
|
+
rect.removeEventListener('pointermove', onPointerMove);
|
|
114
|
+
document.removeEventListener('pointerup', onPointerUp);
|
|
115
|
+
setIsSelecting(false);
|
|
116
|
+
onSelectEnd?.();
|
|
117
|
+
if (pointerMoved) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// If the pointer didn't move, we still need to respect the zoom constraints (minSpan, etc.)
|
|
122
|
+
// In that case, we assume the start to be the pointerZoom and calculate the end.
|
|
123
|
+
const pointerUpPoint = getSVGPoint(element, pointerUpEvent);
|
|
124
|
+
const zoomFromPointerUp = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerUpPoint);
|
|
125
|
+
if (zoomFromPointerUp === null) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
129
|
+
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
130
|
+
start: zoomFromPointerUp,
|
|
131
|
+
end: calculateZoomEnd(zoomFromPointerUp, prev, zoomOptions)
|
|
132
|
+
}));
|
|
133
|
+
};
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
event.stopPropagation();
|
|
136
|
+
rect.setPointerCapture(event.pointerId);
|
|
137
|
+
document.addEventListener('pointerup', onPointerUp);
|
|
138
|
+
rect.addEventListener('pointermove', onPointerMove);
|
|
139
|
+
onSelectStart?.();
|
|
140
|
+
setIsSelecting(true);
|
|
141
|
+
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
142
|
+
start: zoomFromPointerDown,
|
|
143
|
+
end: zoomFromPointerDown
|
|
144
|
+
}));
|
|
145
|
+
};
|
|
146
|
+
return /*#__PURE__*/_jsx(ZoomSliderTrack, _extends({
|
|
147
|
+
ref: ref,
|
|
148
|
+
onPointerDown: onPointerDown,
|
|
149
|
+
axisDirection: axisDirection,
|
|
150
|
+
isSelecting: isSelecting
|
|
151
|
+
}, other));
|
|
152
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const ZOOM_SLIDER_TRACK_SIZE = 8;
|
|
2
|
+
export const ZOOM_SLIDER_ACTIVE_TRACK_SIZE = 10;
|
|
3
|
+
export const ZOOM_SLIDER_THUMB_HEIGHT = 20;
|
|
4
|
+
export const ZOOM_SLIDER_THUMB_WIDTH = 10;
|
|
5
|
+
export const ZOOM_SLIDER_SIZE = Math.max(ZOOM_SLIDER_TRACK_SIZE, ZOOM_SLIDER_ACTIVE_TRACK_SIZE, ZOOM_SLIDER_THUMB_HEIGHT, ZOOM_SLIDER_THUMB_WIDTH);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AxisId, ChartState, DefaultizedZoomOptions, ZoomData } from '@mui/x-charts/internals';
|
|
2
|
+
export declare function calculateZoomFromPoint(state: ChartState<any>, axisId: AxisId, point: DOMPoint): number | null;
|
|
3
|
+
export declare function calculateZoomStart(newStart: number, currentZoom: ZoomData, options: Pick<DefaultizedZoomOptions, 'minStart' | 'minSpan' | 'maxSpan'>): number;
|
|
4
|
+
export declare function calculateZoomEnd(newEnd: number, currentZoom: ZoomData, options: Pick<DefaultizedZoomOptions, 'maxEnd' | 'minSpan' | 'maxSpan'>): number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { selectorChartDrawingArea, selectorChartRawAxis } from '@mui/x-charts/internals';
|
|
2
|
+
export function calculateZoomFromPoint(state, axisId, point) {
|
|
3
|
+
const {
|
|
4
|
+
left,
|
|
5
|
+
top,
|
|
6
|
+
height,
|
|
7
|
+
width
|
|
8
|
+
} = selectorChartDrawingArea(state);
|
|
9
|
+
const axis = selectorChartRawAxis(state, axisId);
|
|
10
|
+
if (!axis) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const axisDirection = axis.position === 'right' || axis.position === 'left' ? 'y' : 'x';
|
|
14
|
+
let pointerZoom;
|
|
15
|
+
if (axisDirection === 'x') {
|
|
16
|
+
pointerZoom = (point.x - left) / width * 100;
|
|
17
|
+
} else {
|
|
18
|
+
pointerZoom = (top + height - point.y) / height * 100;
|
|
19
|
+
}
|
|
20
|
+
if (axis.reverse) {
|
|
21
|
+
pointerZoom = 100 - pointerZoom;
|
|
22
|
+
}
|
|
23
|
+
return pointerZoom;
|
|
24
|
+
}
|
|
25
|
+
export function calculateZoomStart(newStart, currentZoom, options) {
|
|
26
|
+
const {
|
|
27
|
+
minStart,
|
|
28
|
+
minSpan,
|
|
29
|
+
maxSpan
|
|
30
|
+
} = options;
|
|
31
|
+
return Math.max(minStart, currentZoom.end - maxSpan, Math.min(currentZoom.end - minSpan, newStart));
|
|
32
|
+
}
|
|
33
|
+
export function calculateZoomEnd(newEnd, currentZoom, options) {
|
|
34
|
+
const {
|
|
35
|
+
maxEnd,
|
|
36
|
+
minSpan,
|
|
37
|
+
maxSpan
|
|
38
|
+
} = options;
|
|
39
|
+
return Math.min(maxEnd, currentZoom.start + maxSpan, Math.max(currentZoom.start + minSpan, newEnd));
|
|
40
|
+
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { ChartsToolbarProps } from '@mui/x-charts/Toolbar';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The chart toolbar component for the pro package.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ChartsToolbarPro(props: React.PropsWithChildren<ChartsToolbarProps>): React.JSX.Element | null;
|
|
7
|
+
export declare namespace ChartsToolbarPro {
|
|
8
|
+
var propTypes: any;
|
|
9
|
+
}
|
|
@@ -1,24 +1,57 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { Toolbar } from '@mui/x-charts/Toolbar';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { useChartContext, useSelector } from '@mui/x-charts/internals';
|
|
5
|
+
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
6
|
+
import { useChartsLocalization } from '@mui/x-charts/hooks';
|
|
4
7
|
import { selectorChartZoomIsEnabled } from "../internals/plugins/useChartProZoom/index.js";
|
|
5
|
-
import { ChartsToolbarZoomInButton } from "./
|
|
6
|
-
import { ChartsToolbarZoomOutButton } from "./
|
|
8
|
+
import { ChartsToolbarZoomInButton } from "./ChartsToolbarZoomInButton.js";
|
|
9
|
+
import { ChartsToolbarZoomOutButton } from "./ChartsToolbarZoomOutButton.js";
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The chart toolbar component for the pro package.
|
|
13
|
+
*/
|
|
14
|
+
export function ChartsToolbarPro(props) {
|
|
15
|
+
const {
|
|
16
|
+
slots,
|
|
17
|
+
slotProps
|
|
18
|
+
} = useChartsSlots();
|
|
9
19
|
const {
|
|
10
20
|
store
|
|
11
21
|
} = useChartContext();
|
|
22
|
+
const {
|
|
23
|
+
localeText
|
|
24
|
+
} = useChartsLocalization();
|
|
12
25
|
const isZoomEnabled = useSelector(store, selectorChartZoomIsEnabled);
|
|
13
26
|
const children = [];
|
|
14
27
|
if (isZoomEnabled) {
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
const Tooltip = slots.baseTooltip;
|
|
29
|
+
const ZoomOutIcon = slots.zoomOutIcon;
|
|
30
|
+
const ZoomInIcon = slots.zoomInIcon;
|
|
31
|
+
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
32
|
+
title: localeText.zoomIn,
|
|
33
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomInButton, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(ZoomInIcon, _extends({}, slotProps.zoomInIcon))
|
|
35
|
+
})
|
|
36
|
+
}), "zoom-in"));
|
|
37
|
+
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
38
|
+
title: localeText.zoomOut,
|
|
39
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomOutButton, {
|
|
40
|
+
children: /*#__PURE__*/_jsx(ZoomOutIcon, _extends({}, slotProps.zoomOutIcon))
|
|
41
|
+
})
|
|
42
|
+
}), "zoom-out"));
|
|
17
43
|
}
|
|
18
44
|
if (children.length === 0) {
|
|
19
45
|
return null;
|
|
20
46
|
}
|
|
21
|
-
return /*#__PURE__*/_jsx(Toolbar, {
|
|
47
|
+
return /*#__PURE__*/_jsx(Toolbar, _extends({}, props, {
|
|
22
48
|
children: children
|
|
23
|
-
});
|
|
24
|
-
}
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarPro.propTypes = {
|
|
52
|
+
// ----------------------------- Warning --------------------------------
|
|
53
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
55
|
+
// ----------------------------------------------------------------------
|
|
56
|
+
className: PropTypes.string
|
|
57
|
+
} : void 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
+
interface ChartsToolbarZoomInButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* A function to customize the rendering of the component.
|
|
7
|
+
*/
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseIconButton']>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The zoom-in button for the chart toolbar.
|
|
12
|
+
*/
|
|
13
|
+
declare const ChartsToolbarZoomInButton: React.ForwardRefExoticComponent<ChartsToolbarZoomInButtonProps & {
|
|
14
|
+
children?: React.ReactNode | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export { ChartsToolbarZoomInButton };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["render"];
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { useChartContext, useChartsSlots, useSelector } from '@mui/x-charts/internals';
|
|
9
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
|
+
import { selectorChartCanZoomIn } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* The zoom-in button for the chart toolbar.
|
|
14
|
+
*/
|
|
15
|
+
const ChartsToolbarZoomInButton = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomInButton(_ref, ref) {
|
|
16
|
+
let {
|
|
17
|
+
render
|
|
18
|
+
} = _ref,
|
|
19
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
|
+
const {
|
|
21
|
+
slots,
|
|
22
|
+
slotProps
|
|
23
|
+
} = useChartsSlots();
|
|
24
|
+
const {
|
|
25
|
+
instance,
|
|
26
|
+
store
|
|
27
|
+
} = useChartContext();
|
|
28
|
+
const disabled = useSelector(store, selectorChartCanZoomIn);
|
|
29
|
+
const element = useComponentRenderer(slots.baseIconButton, render, _extends({}, slotProps?.baseIconButton, {
|
|
30
|
+
onClick: () => instance.zoomIn(),
|
|
31
|
+
disabled
|
|
32
|
+
}, other, {
|
|
33
|
+
ref
|
|
34
|
+
}));
|
|
35
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
36
|
+
children: element
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomInButton.displayName = "ChartsToolbarZoomInButton";
|
|
40
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInButton.propTypes = {
|
|
41
|
+
// ----------------------------- Warning --------------------------------
|
|
42
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
43
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
44
|
+
// ----------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* A function to customize the rendering of the component.
|
|
47
|
+
*/
|
|
48
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
49
|
+
} : void 0;
|
|
50
|
+
export { ChartsToolbarZoomInButton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
+
interface ChartsToolbarZoomOutButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* A function to customize the rendering of the component.
|
|
7
|
+
*/
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseIconButton']>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The zoom-out button for the chart toolbar.
|
|
12
|
+
*/
|
|
13
|
+
declare const ChartsToolbarZoomOutButton: React.ForwardRefExoticComponent<ChartsToolbarZoomOutButtonProps & {
|
|
14
|
+
children?: React.ReactNode | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export { ChartsToolbarZoomOutButton };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["render"];
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { useChartContext, useChartsSlots, useSelector } from '@mui/x-charts/internals';
|
|
9
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
|
+
import { selectorChartCanZoomOut } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* The zoom-out button for the chart toolbar.
|
|
14
|
+
*/
|
|
15
|
+
const ChartsToolbarZoomOutButton = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomOutButton(_ref, ref) {
|
|
16
|
+
let {
|
|
17
|
+
render
|
|
18
|
+
} = _ref,
|
|
19
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
|
+
const {
|
|
21
|
+
slots,
|
|
22
|
+
slotProps
|
|
23
|
+
} = useChartsSlots();
|
|
24
|
+
const {
|
|
25
|
+
instance,
|
|
26
|
+
store
|
|
27
|
+
} = useChartContext();
|
|
28
|
+
const disabled = useSelector(store, selectorChartCanZoomOut);
|
|
29
|
+
const element = useComponentRenderer(slots.baseIconButton, render, _extends({}, slotProps?.baseIconButton, {
|
|
30
|
+
onClick: () => instance.zoomOut(),
|
|
31
|
+
disabled
|
|
32
|
+
}, other, {
|
|
33
|
+
ref
|
|
34
|
+
}));
|
|
35
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
36
|
+
children: element
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomOutButton.displayName = "ChartsToolbarZoomOutButton";
|
|
40
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomOutButton.propTypes = {
|
|
41
|
+
// ----------------------------- Warning --------------------------------
|
|
42
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
43
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
44
|
+
// ----------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* A function to customize the rendering of the component.
|
|
47
|
+
*/
|
|
48
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
49
|
+
} : void 0;
|
|
50
|
+
export { ChartsToolbarZoomOutButton };
|
|
@@ -7,7 +7,8 @@ import { FunnelSeriesType } from "./funnel.types.js";
|
|
|
7
7
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
8
|
import { FunnelChartSlotExtension } from "./funnelSlots.types.js";
|
|
9
9
|
import { CategoryAxis } from "./categoryAxis.types.js";
|
|
10
|
-
|
|
10
|
+
import { FunnelChartPluginsSignatures } from "./FunnelChart.plugins.js";
|
|
11
|
+
export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel', FunnelChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'zoom' | 'onZoomChange' | 'dataset' | 'yAxis' | 'xAxis' | 'rotationAxis' | 'radiusAxis' | 'slots' | 'slotProps'>, Omit<FunnelPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, FunnelChartSlotExtension {
|
|
11
12
|
/**
|
|
12
13
|
* The series to display in the funnel chart.
|
|
13
14
|
* An array of [[FunnelSeriesType]] objects.
|
|
@@ -60,8 +60,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
60
60
|
apiRef: PropTypes.shape({
|
|
61
61
|
current: PropTypes.shape({
|
|
62
62
|
exportAsImage: PropTypes.func.isRequired,
|
|
63
|
-
exportAsPrint: PropTypes.func.isRequired
|
|
64
|
-
setZoomData: PropTypes.func.isRequired
|
|
63
|
+
exportAsPrint: PropTypes.func.isRequired
|
|
65
64
|
})
|
|
66
65
|
}),
|
|
67
66
|
/**
|
|
@@ -200,15 +199,6 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
200
199
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
201
200
|
*/
|
|
202
201
|
id: PropTypes.string,
|
|
203
|
-
/**
|
|
204
|
-
* The list of zoom data related to each axis.
|
|
205
|
-
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
206
|
-
*/
|
|
207
|
-
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
208
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
209
|
-
end: PropTypes.number.isRequired,
|
|
210
|
-
start: PropTypes.number.isRequired
|
|
211
|
-
})),
|
|
212
202
|
/**
|
|
213
203
|
* If `true`, a loading overlay is displayed.
|
|
214
204
|
* @default false
|
|
@@ -275,14 +265,6 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
275
265
|
/**
|
|
276
266
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
277
267
|
*/
|
|
278
|
-
width: PropTypes.number
|
|
279
|
-
/**
|
|
280
|
-
* The list of zoom data related to each axis.
|
|
281
|
-
*/
|
|
282
|
-
zoomData: PropTypes.arrayOf(PropTypes.shape({
|
|
283
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
284
|
-
end: PropTypes.number.isRequired,
|
|
285
|
-
start: PropTypes.number.isRequired
|
|
286
|
-
}))
|
|
268
|
+
width: PropTypes.number
|
|
287
269
|
} : void 0;
|
|
288
270
|
export { FunnelChart };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export type FunnelChartPluginsSignatures = [UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
|
+
export declare const FUNNEL_CHART_PLUGINS: ConvertSignaturesIntoPlugins<FunnelChartPluginsSignatures>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { useChartCartesianAxis, useChartHighlight, useChartInteraction } from '@mui/x-charts/internals';
|
|
2
|
+
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export const FUNNEL_CHART_PLUGINS = [useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProExport];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
2
2
|
import { ChartsTooltipSlotProps, ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
-
import { ChartsAxisSlotProps, ChartsAxisSlots } from '@mui/x-charts/internals';
|
|
3
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots, ChartsSlotProps, ChartsSlots } from '@mui/x-charts/internals';
|
|
4
4
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
5
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
|
|
5
6
|
import { FunnelPlotSlotProps, FunnelPlotSlots } from "./funnelPlotSlots.types.js";
|
|
6
|
-
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots, ChartsAxisSlots {}
|
|
7
|
-
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps {}
|
|
7
|
+
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots, ChartsAxisSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
8
|
+
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
8
9
|
export interface FunnelChartSlotExtension {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|
|
@@ -3,6 +3,7 @@ import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
|
3
3
|
import { ChartsLegendSlotExtension } from '@mui/x-charts/ChartsLegend';
|
|
4
4
|
import { ChartsWrapperProps } from '@mui/x-charts/internals';
|
|
5
5
|
import { ChartsAxisHighlightProps } from '@mui/x-charts/ChartsAxisHighlight';
|
|
6
|
+
import { FunnelChartPluginsSignatures } from "./FunnelChart.plugins.js";
|
|
6
7
|
import { FunnelPlotProps } from "./FunnelPlot.js";
|
|
7
8
|
import type { FunnelChartProps } from "./FunnelChart.js";
|
|
8
9
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
@@ -14,7 +15,7 @@ import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
14
15
|
* @returns An object with props for the children components of FunnelChart
|
|
15
16
|
*/
|
|
16
17
|
export declare const useFunnelChartProps: (props: FunnelChartProps) => {
|
|
17
|
-
chartContainerProps: ChartContainerProProps<"funnel">;
|
|
18
|
+
chartContainerProps: ChartContainerProProps<"funnel", FunnelChartPluginsSignatures>;
|
|
18
19
|
funnelPlotProps: FunnelPlotProps;
|
|
19
20
|
overlayProps: ChartsOverlayProps;
|
|
20
21
|
chartsAxisProps: ChartsAxisProps;
|
|
@@ -7,6 +7,7 @@ import { DEFAULT_MARGINS, DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-
|
|
|
7
7
|
import { defaultizeMargin } from '@mui/x-charts/internals';
|
|
8
8
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
9
9
|
import { strawberrySkyPalette } from '@mui/x-charts/colorPalettes';
|
|
10
|
+
import { FUNNEL_CHART_PLUGINS } from "./FunnelChart.plugins.js";
|
|
10
11
|
function getCategoryAxisConfig(categoryAxis, series, isHorizontal, direction) {
|
|
11
12
|
const maxSeriesLength = Math.max(...series.map(s => (s.data ?? []).length), 0);
|
|
12
13
|
const maxSeriesValue = Array.from({
|
|
@@ -113,7 +114,8 @@ export const useFunnelChartProps = props => {
|
|
|
113
114
|
highlightedItem,
|
|
114
115
|
onHighlightChange,
|
|
115
116
|
className,
|
|
116
|
-
apiRef
|
|
117
|
+
apiRef,
|
|
118
|
+
plugins: FUNNEL_CHART_PLUGINS
|
|
117
119
|
});
|
|
118
120
|
const funnelPlotProps = {
|
|
119
121
|
gap,
|
package/esm/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -4,22 +4,30 @@ import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
|
4
4
|
import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
5
5
|
import { ChartsAxisSlots, ChartsAxisSlotProps, XAxis, YAxis } from '@mui/x-charts/internals';
|
|
6
6
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
7
|
+
import { ChartsLegendSlotProps, ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
8
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
|
|
9
|
+
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
7
10
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
11
|
import { HeatmapSeriesType } from "../models/seriesType/heatmap.js";
|
|
9
12
|
import { HeatmapTooltipProps } from "./HeatmapTooltip/index.js";
|
|
10
13
|
import { HeatmapItemSlotProps, HeatmapItemSlots } from "./HeatmapItem.js";
|
|
11
14
|
import { HeatmapPluginsSignatures } from "./Heatmap.plugins.js";
|
|
12
|
-
export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, HeatmapItemSlots {
|
|
15
|
+
export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, HeatmapItemSlots, ChartsToolbarSlots, Partial<ChartsSlotsPro> {
|
|
13
16
|
/**
|
|
14
|
-
* Custom component for the tooltip
|
|
17
|
+
* Custom component for the tooltip.
|
|
15
18
|
* @default ChartsTooltipRoot
|
|
16
19
|
*/
|
|
17
20
|
tooltip?: React.ElementType<HeatmapTooltipProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Custom component for the legend.
|
|
23
|
+
* @default ContinuousColorLegendProps
|
|
24
|
+
*/
|
|
25
|
+
legend?: ChartsLegendSlots['legend'];
|
|
18
26
|
}
|
|
19
|
-
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
27
|
+
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps, ChartsLegendSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotPropsPro> {
|
|
20
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
21
29
|
}
|
|
22
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
30
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
23
31
|
/**
|
|
24
32
|
* The configuration of the x-axes.
|
|
25
33
|
* If not provided, a default axis config is used.
|
|
@@ -42,6 +50,11 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
42
50
|
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
43
51
|
*/
|
|
44
52
|
tooltip?: ChartsTooltipProps;
|
|
53
|
+
/**
|
|
54
|
+
* If `true`, the legend is not rendered.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
hideLegend?: boolean;
|
|
45
58
|
/**
|
|
46
59
|
* Overridable component slots.
|
|
47
60
|
* @default {}
|