@mui/x-charts-pro 8.3.1 → 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 +56 -21
- package/CHANGELOG.md +213 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/ChartContainerPro/ChartContainerPro.js +1 -0
- 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/index.d.ts +1 -1
- package/ChartZoomSlider/index.js +4 -4
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +31 -287
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +251 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +92 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +160 -0
- package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
- package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +58 -0
- package/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
- package/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +6 -6
- 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 +6 -23
- package/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/FunnelChart/FunnelChart.plugins.js +9 -0
- package/FunnelChart/FunnelPlot.js +2 -0
- package/FunnelChart/FunnelSection.js +2 -1
- package/FunnelChart/curves/curve.types.d.ts +4 -0
- package/FunnelChart/curves/pyramid.d.ts +3 -1
- package/FunnelChart/curves/pyramid.js +37 -10
- package/FunnelChart/curves/step-pyramid.d.ts +10 -2
- package/FunnelChart/curves/step-pyramid.js +96 -20
- package/FunnelChart/curves/step.d.ts +5 -1
- package/FunnelChart/curves/step.js +20 -2
- package/FunnelChart/funnel.types.d.ts +7 -0
- package/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
- package/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/FunnelChart/useFunnelChartProps.js +3 -1
- package/Heatmap/Heatmap.d.ts +18 -5
- package/Heatmap/Heatmap.js +64 -26
- package/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/Heatmap/Heatmap.plugins.js +2 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +27 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +4 -102
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +5 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +96 -0
- package/Heatmap/HeatmapTooltip/index.d.ts +3 -1
- package/Heatmap/HeatmapTooltip/index.js +11 -0
- package/LineChartPro/LineChartPro.d.ts +13 -5
- package/LineChartPro/LineChartPro.js +56 -21
- 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 +57 -22
- 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 +54 -19
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/esm/ChartContainerPro/ChartContainerPro.js +1 -0
- 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/index.d.ts +1 -1
- package/esm/ChartZoomSlider/index.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +30 -283
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +243 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +85 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +152 -0
- package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
- package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +52 -0
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
- package/esm/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +4 -4
- 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 +6 -23
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/esm/FunnelChart/FunnelChart.plugins.js +3 -0
- package/esm/FunnelChart/FunnelPlot.js +2 -0
- package/esm/FunnelChart/FunnelSection.js +1 -0
- package/esm/FunnelChart/curves/curve.types.d.ts +4 -0
- package/esm/FunnelChart/curves/pyramid.d.ts +3 -1
- package/esm/FunnelChart/curves/pyramid.js +37 -10
- package/esm/FunnelChart/curves/step-pyramid.d.ts +10 -2
- package/esm/FunnelChart/curves/step-pyramid.js +96 -20
- package/esm/FunnelChart/curves/step.d.ts +5 -1
- package/esm/FunnelChart/curves/step.js +20 -2
- package/esm/FunnelChart/funnel.types.d.ts +7 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
- package/esm/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/esm/FunnelChart/useFunnelChartProps.js +3 -1
- package/esm/Heatmap/Heatmap.d.ts +18 -5
- package/esm/Heatmap/Heatmap.js +62 -24
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/esm/Heatmap/Heatmap.plugins.js +2 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +19 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.js +5 -103
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +1 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +89 -0
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +3 -1
- package/esm/Heatmap/HeatmapTooltip/index.js +3 -1
- package/esm/LineChartPro/LineChartPro.d.ts +13 -5
- package/esm/LineChartPro/LineChartPro.js +54 -19
- 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 +55 -20
- 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/useChartProExport/exportImage.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
- 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/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
- 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/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
- package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -92
- package/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
- 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/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -85
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
- 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
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -7,14 +7,17 @@ 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 { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
11
|
+
import { ChartsWrapper } from '@mui/x-charts/internals';
|
|
10
12
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
11
13
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
12
14
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
13
|
-
import {
|
|
15
|
+
import { ChartsLegend, ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
|
|
14
16
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
15
17
|
import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
16
|
-
import { HeatmapTooltip } from "./HeatmapTooltip/
|
|
18
|
+
import { HeatmapTooltip } from "./HeatmapTooltip/index.js";
|
|
17
19
|
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
20
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
18
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
22
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
20
23
|
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
@@ -37,6 +40,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
37
40
|
name: 'MuiHeatmap'
|
|
38
41
|
});
|
|
39
42
|
const {
|
|
43
|
+
apiRef,
|
|
40
44
|
xAxis,
|
|
41
45
|
yAxis,
|
|
42
46
|
zAxis,
|
|
@@ -53,7 +57,8 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
53
57
|
slotProps,
|
|
54
58
|
loading,
|
|
55
59
|
highlightedItem,
|
|
56
|
-
onHighlightChange
|
|
60
|
+
onHighlightChange,
|
|
61
|
+
hideLegend = true
|
|
57
62
|
} = props;
|
|
58
63
|
const id = useId();
|
|
59
64
|
const clipPathId = `${id}-clip-path`;
|
|
@@ -81,9 +86,14 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
81
86
|
color: defaultColorMap
|
|
82
87
|
}
|
|
83
88
|
}], [zAxis]);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
const chartsWrapperProps = {
|
|
90
|
+
sx,
|
|
91
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
92
|
+
legendDirection: props.slotProps?.legend?.direction
|
|
93
|
+
};
|
|
94
|
+
const Tooltip = slots?.tooltip ?? HeatmapTooltip;
|
|
95
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, {
|
|
96
|
+
apiRef: apiRef,
|
|
87
97
|
seriesConfig: seriesConfig,
|
|
88
98
|
series: series.map(s => _extends({
|
|
89
99
|
type: 'heatmap'
|
|
@@ -96,37 +106,60 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
96
106
|
zAxis: zAxisWithDefault,
|
|
97
107
|
colors: colors,
|
|
98
108
|
dataset: dataset,
|
|
99
|
-
sx: sx,
|
|
100
109
|
disableAxisListener: true,
|
|
101
110
|
highlightedItem: highlightedItem,
|
|
102
111
|
onHighlightChange: onHighlightChange,
|
|
103
112
|
onAxisClick: onAxisClick,
|
|
104
113
|
plugins: HEATMAP_PLUGINS,
|
|
105
|
-
children:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
115
|
+
children: [!hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
116
|
+
slots: _extends({}, slots, {
|
|
117
|
+
legend: slots?.legend ?? ContinuousColorLegend
|
|
118
|
+
}),
|
|
119
|
+
slotProps: {
|
|
120
|
+
legend: _extends({
|
|
121
|
+
labelPosition: 'extremes'
|
|
122
|
+
}, slotProps?.legend)
|
|
123
|
+
},
|
|
124
|
+
sx: slotProps?.legend?.direction === 'vertical' ? {
|
|
125
|
+
height: 150
|
|
126
|
+
} : {
|
|
127
|
+
width: '50%'
|
|
128
|
+
}
|
|
129
|
+
}), /*#__PURE__*/_jsxs(ChartsSurface, {
|
|
130
|
+
ref: ref,
|
|
131
|
+
sx: sx,
|
|
132
|
+
children: [/*#__PURE__*/_jsxs("g", {
|
|
133
|
+
clipPath: `url(#${clipPathId})`,
|
|
134
|
+
children: [/*#__PURE__*/_jsx(HeatmapPlot, {
|
|
135
|
+
slots: slots,
|
|
136
|
+
slotProps: slotProps
|
|
137
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
138
|
+
loading: loading,
|
|
139
|
+
slots: slots,
|
|
140
|
+
slotProps: slotProps
|
|
141
|
+
})]
|
|
142
|
+
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
143
|
+
slots: slots,
|
|
144
|
+
slotProps: slotProps
|
|
145
|
+
}), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
146
|
+
id: clipPathId
|
|
147
|
+
}), children]
|
|
148
|
+
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip))]
|
|
149
|
+
}))
|
|
121
150
|
});
|
|
122
151
|
});
|
|
152
|
+
if (process.env.NODE_ENV !== "production") Heatmap.displayName = "Heatmap";
|
|
123
153
|
process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
124
154
|
// ----------------------------- Warning --------------------------------
|
|
125
155
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
126
156
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
127
157
|
// ----------------------------------------------------------------------
|
|
128
158
|
apiRef: PropTypes.shape({
|
|
129
|
-
current: PropTypes.
|
|
159
|
+
current: PropTypes.shape({
|
|
160
|
+
exportAsImage: PropTypes.func.isRequired,
|
|
161
|
+
exportAsPrint: PropTypes.func.isRequired
|
|
162
|
+
})
|
|
130
163
|
}),
|
|
131
164
|
className: PropTypes.string,
|
|
132
165
|
/**
|
|
@@ -149,6 +182,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
149
182
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
150
183
|
*/
|
|
151
184
|
height: PropTypes.number,
|
|
185
|
+
/**
|
|
186
|
+
* If `true`, the legend is not rendered.
|
|
187
|
+
* @default true
|
|
188
|
+
*/
|
|
189
|
+
hideLegend: PropTypes.bool,
|
|
152
190
|
/**
|
|
153
191
|
* The highlighted item.
|
|
154
192
|
* Used when the highlight is controlled.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
-
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export type HeatmapPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
3
4
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginsSignatures>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
|
|
2
|
-
|
|
2
|
+
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export const HEATMAP_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProExport];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
2
|
+
import { getChartsTooltipUtilityClass } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
+
export const useUtilityClasses = props => {
|
|
4
|
+
const {
|
|
5
|
+
classes
|
|
6
|
+
} = props;
|
|
7
|
+
const slots = {
|
|
8
|
+
root: ['root'],
|
|
9
|
+
paper: ['paper'],
|
|
10
|
+
table: ['table'],
|
|
11
|
+
row: ['row'],
|
|
12
|
+
cell: ['cell'],
|
|
13
|
+
mark: ['mark'],
|
|
14
|
+
markContainer: ['markContainer'],
|
|
15
|
+
labelCell: ['labelCell'],
|
|
16
|
+
valueCell: ['valueCell']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
19
|
+
};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
|
|
4
|
-
/**
|
|
5
|
-
* Select the kind of tooltip to display
|
|
6
|
-
* - 'item': Shows data about the item below the mouse.
|
|
7
|
-
* - 'none': Does not display tooltip
|
|
8
|
-
* @default 'item'
|
|
9
|
-
*/
|
|
10
|
-
trigger?: 'item' | 'none';
|
|
11
|
-
}
|
|
2
|
+
import { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
|
|
12
3
|
declare function HeatmapTooltip(props: HeatmapTooltipProps): React.JSX.Element;
|
|
13
4
|
declare namespace HeatmapTooltip {
|
|
14
5
|
var propTypes: any;
|
|
@@ -3,109 +3,11 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
6
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useHeatmapSeriesContext } from "../../hooks/useHeatmapSeries.js";
|
|
13
|
-
import { HeatmapTooltipAxesValue } from "./HeatmapTooltipAxesValue.js";
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
const useUtilityClasses = props => {
|
|
16
|
-
const {
|
|
17
|
-
classes
|
|
18
|
-
} = props;
|
|
19
|
-
const slots = {
|
|
20
|
-
root: ['root'],
|
|
21
|
-
paper: ['paper'],
|
|
22
|
-
table: ['table'],
|
|
23
|
-
row: ['row'],
|
|
24
|
-
cell: ['cell'],
|
|
25
|
-
mark: ['mark'],
|
|
26
|
-
markContainer: ['markContainer'],
|
|
27
|
-
labelCell: ['labelCell'],
|
|
28
|
-
valueCell: ['valueCell']
|
|
29
|
-
};
|
|
30
|
-
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
31
|
-
};
|
|
32
|
-
function DefaultHeatmapTooltipContent(props) {
|
|
33
|
-
const classes = useUtilityClasses(props);
|
|
34
|
-
const xAxis = useXAxis();
|
|
35
|
-
const yAxis = useYAxis();
|
|
36
|
-
const heatmapSeries = useHeatmapSeriesContext();
|
|
37
|
-
const tooltipData = useItemTooltip();
|
|
38
|
-
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const {
|
|
42
|
-
series,
|
|
43
|
-
seriesOrder
|
|
44
|
-
} = heatmapSeries;
|
|
45
|
-
const seriesId = seriesOrder[0];
|
|
46
|
-
const {
|
|
47
|
-
color,
|
|
48
|
-
value,
|
|
49
|
-
identifier,
|
|
50
|
-
markType
|
|
51
|
-
} = tooltipData;
|
|
52
|
-
const [xIndex, yIndex] = value;
|
|
53
|
-
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
54
|
-
location: 'tooltip',
|
|
55
|
-
scale: xAxis.scale
|
|
56
|
-
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
57
|
-
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
58
|
-
location: 'tooltip',
|
|
59
|
-
scale: yAxis.scale
|
|
60
|
-
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
61
|
-
const formattedValue = series[seriesId].valueFormatter(value, {
|
|
62
|
-
dataIndex: identifier.dataIndex
|
|
63
|
-
});
|
|
64
|
-
const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
|
|
65
|
-
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
66
|
-
className: classes.paper,
|
|
67
|
-
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
68
|
-
className: classes.table,
|
|
69
|
-
children: [/*#__PURE__*/_jsxs(HeatmapTooltipAxesValue, {
|
|
70
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
71
|
-
children: formattedX
|
|
72
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
73
|
-
children: formattedY
|
|
74
|
-
})]
|
|
75
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
76
|
-
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
77
|
-
className: classes.row,
|
|
78
|
-
children: [/*#__PURE__*/_jsxs(ChartsTooltipCell, {
|
|
79
|
-
className: clsx(classes.labelCell, classes.cell),
|
|
80
|
-
component: "th",
|
|
81
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
82
|
-
className: classes.markContainer,
|
|
83
|
-
children: /*#__PURE__*/_jsx(ChartsLabelMark, {
|
|
84
|
-
type: markType,
|
|
85
|
-
color: color,
|
|
86
|
-
className: classes.mark
|
|
87
|
-
})
|
|
88
|
-
}), seriesLabel]
|
|
89
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
90
|
-
className: clsx(classes.valueCell, classes.cell),
|
|
91
|
-
component: "td",
|
|
92
|
-
children: formattedValue
|
|
93
|
-
})]
|
|
94
|
-
})
|
|
95
|
-
})]
|
|
96
|
-
})
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltipContent.propTypes = {
|
|
100
|
-
// ----------------------------- Warning --------------------------------
|
|
101
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
103
|
-
// ----------------------------------------------------------------------
|
|
104
|
-
/**
|
|
105
|
-
* Override or extend the styles applied to the component.
|
|
106
|
-
*/
|
|
107
|
-
classes: PropTypes.object
|
|
108
|
-
} : void 0;
|
|
7
|
+
import { ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
|
|
8
|
+
import { HeatmapTooltipContent } from "./HeatmapTooltipContent.js";
|
|
9
|
+
import { useUtilityClasses } from "./HeatmapTooltip.classes.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
109
11
|
function HeatmapTooltip(props) {
|
|
110
12
|
const classes = useUtilityClasses({
|
|
111
13
|
classes: props.classes
|
|
@@ -114,7 +16,7 @@ function HeatmapTooltip(props) {
|
|
|
114
16
|
trigger: "item"
|
|
115
17
|
}, props, {
|
|
116
18
|
classes: classes,
|
|
117
|
-
children: /*#__PURE__*/_jsx(
|
|
19
|
+
children: /*#__PURE__*/_jsx(HeatmapTooltipContent, {
|
|
118
20
|
classes: classes
|
|
119
21
|
})
|
|
120
22
|
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
2
|
+
export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
|
|
3
|
+
/**
|
|
4
|
+
* Select the kind of tooltip to display
|
|
5
|
+
* - 'item': Shows data about the item below the mouse.
|
|
6
|
+
* - 'none': Does not display tooltip
|
|
7
|
+
* @default 'item'
|
|
8
|
+
*/
|
|
9
|
+
trigger?: 'item' | 'none';
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
|
|
3
|
+
export interface HeatmapTooltipContentProps extends Pick<HeatmapTooltipProps, 'classes'> {}
|
|
4
|
+
export declare function HeatmapTooltipContent(props: HeatmapTooltipContentProps): React.JSX.Element | null;
|
|
5
|
+
export declare namespace HeatmapTooltipContent {
|
|
6
|
+
var propTypes: any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
7
|
+
import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
|
|
8
|
+
import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
|
|
9
|
+
import { useHeatmapSeriesContext } from "../../hooks/useHeatmapSeries.js";
|
|
10
|
+
import { HeatmapTooltipAxesValue } from "./HeatmapTooltipAxesValue.js";
|
|
11
|
+
import { useUtilityClasses } from "./HeatmapTooltip.classes.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export function HeatmapTooltipContent(props) {
|
|
14
|
+
const classes = useUtilityClasses(props);
|
|
15
|
+
const xAxis = useXAxis();
|
|
16
|
+
const yAxis = useYAxis();
|
|
17
|
+
const heatmapSeries = useHeatmapSeriesContext();
|
|
18
|
+
const tooltipData = useItemTooltip();
|
|
19
|
+
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const {
|
|
23
|
+
series,
|
|
24
|
+
seriesOrder
|
|
25
|
+
} = heatmapSeries;
|
|
26
|
+
const seriesId = seriesOrder[0];
|
|
27
|
+
const {
|
|
28
|
+
color,
|
|
29
|
+
value,
|
|
30
|
+
identifier,
|
|
31
|
+
markType
|
|
32
|
+
} = tooltipData;
|
|
33
|
+
const [xIndex, yIndex] = value;
|
|
34
|
+
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
35
|
+
location: 'tooltip',
|
|
36
|
+
scale: xAxis.scale
|
|
37
|
+
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
38
|
+
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
39
|
+
location: 'tooltip',
|
|
40
|
+
scale: yAxis.scale
|
|
41
|
+
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
42
|
+
const formattedValue = series[seriesId].valueFormatter(value, {
|
|
43
|
+
dataIndex: identifier.dataIndex
|
|
44
|
+
});
|
|
45
|
+
const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
|
|
46
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
47
|
+
className: classes.paper,
|
|
48
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
49
|
+
className: classes.table,
|
|
50
|
+
children: [/*#__PURE__*/_jsxs(HeatmapTooltipAxesValue, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
52
|
+
children: formattedX
|
|
53
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
54
|
+
children: formattedY
|
|
55
|
+
})]
|
|
56
|
+
}), /*#__PURE__*/_jsx("tbody", {
|
|
57
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
58
|
+
className: classes.row,
|
|
59
|
+
children: [/*#__PURE__*/_jsxs(ChartsTooltipCell, {
|
|
60
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
61
|
+
component: "th",
|
|
62
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: classes.markContainer,
|
|
64
|
+
children: /*#__PURE__*/_jsx(ChartsLabelMark, {
|
|
65
|
+
type: markType,
|
|
66
|
+
color: color,
|
|
67
|
+
className: classes.mark
|
|
68
|
+
})
|
|
69
|
+
}), seriesLabel]
|
|
70
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
71
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
72
|
+
component: "td",
|
|
73
|
+
children: formattedValue
|
|
74
|
+
})]
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
process.env.NODE_ENV !== "production" ? HeatmapTooltipContent.propTypes = {
|
|
81
|
+
// ----------------------------- Warning --------------------------------
|
|
82
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
83
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
84
|
+
// ----------------------------------------------------------------------
|
|
85
|
+
/**
|
|
86
|
+
* Override or extend the styles applied to the component.
|
|
87
|
+
*/
|
|
88
|
+
classes: PropTypes.object
|
|
89
|
+
} : void 0;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { LineChartProps } from '@mui/x-charts/LineChart';
|
|
2
|
+
import { LineChartProps, LineChartSlots, LineChartSlotProps } from '@mui/x-charts/LineChart';
|
|
3
|
+
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
3
4
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
4
5
|
import { LineChartProPluginsSignatures } from "./LineChartPro.plugins.js";
|
|
5
|
-
export interface
|
|
6
|
+
export interface LineChartProSlots extends LineChartSlots, Partial<ChartsSlotsPro> {}
|
|
7
|
+
export interface LineChartProSlotProps extends LineChartSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @default
|
|
10
|
+
* Overridable component slots.
|
|
11
|
+
* @default {}
|
|
9
12
|
*/
|
|
10
|
-
|
|
13
|
+
slots?: LineChartProSlots;
|
|
14
|
+
/**
|
|
15
|
+
* The props used for each component slot.
|
|
16
|
+
* @default {}
|
|
17
|
+
*/
|
|
18
|
+
slotProps?: LineChartProSlotProps;
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* Demos:
|