@mui/x-charts-pro 8.0.0-beta.2 → 8.0.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.js +788 -9
- package/CHANGELOG.md +423 -96
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +27 -22
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
- package/FunnelChart/FunnelChart.js +73 -4
- package/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/FunnelChart/funnelSectionClasses.js +1 -1
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/useFunnelChartProps.js +3 -3
- package/Heatmap/Heatmap.d.ts +1 -1
- package/Heatmap/Heatmap.js +4 -3
- package/Heatmap/{HeatmapTooltip.js → HeatmapTooltip/HeatmapTooltip.js} +30 -34
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +26 -0
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -0
- package/Heatmap/HeatmapTooltip/index.js +16 -0
- package/Heatmap/heatmapClasses.d.ts +5 -0
- package/Heatmap/heatmapClasses.js +1 -1
- package/Heatmap/index.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +788 -9
- package/ScatterChartPro/ScatterChartPro.js +788 -9
- package/esm/BarChartPro/BarChartPro.js +788 -9
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +28 -23
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
- package/esm/FunnelChart/FunnelChart.js +73 -4
- package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/esm/FunnelChart/funnelSectionClasses.js +1 -1
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.js +3 -3
- package/esm/Heatmap/Heatmap.d.ts +1 -1
- package/esm/Heatmap/Heatmap.js +4 -3
- package/{modern/Heatmap → esm/Heatmap/HeatmapTooltip}/HeatmapTooltip.js +30 -34
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +22 -0
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -0
- package/esm/Heatmap/HeatmapTooltip/index.js +1 -0
- package/esm/Heatmap/heatmapClasses.d.ts +5 -0
- package/esm/Heatmap/heatmapClasses.js +1 -1
- package/esm/Heatmap/index.d.ts +1 -1
- package/esm/Heatmap/index.js +1 -1
- package/esm/LineChartPro/LineChartPro.js +788 -9
- package/esm/ScatterChartPro/ScatterChartPro.js +788 -9
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +28 -35
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/index.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +28 -34
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/package.json +9 -19
- package/esm/Heatmap/HeatmapTooltip.js +0 -288
- package/esm/internals/utils/releaseInfo.d.ts +0 -1
- package/esm/internals/utils/releaseInfo.js +0 -13
- package/internals/utils/releaseInfo.d.ts +0 -1
- package/internals/utils/releaseInfo.js +0 -21
- package/modern/BarChartPro/BarChartPro.d.ts +0 -18
- package/modern/BarChartPro/BarChartPro.js +0 -404
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
- package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
- package/modern/BarChartPro/index.d.ts +0 -1
- package/modern/BarChartPro/index.js +0 -1
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
- package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
- package/modern/ChartContainerPro/index.d.ts +0 -2
- package/modern/ChartContainerPro/index.js +0 -2
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
- package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
- package/modern/ChartDataProviderPro/index.d.ts +0 -2
- package/modern/ChartDataProviderPro/index.js +0 -2
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
- package/modern/FunnelChart/FunnelChart.d.ts +0 -37
- package/modern/FunnelChart/FunnelChart.js +0 -212
- package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
- package/modern/FunnelChart/FunnelPlot.js +0 -184
- package/modern/FunnelChart/FunnelSection.d.ts +0 -15
- package/modern/FunnelChart/FunnelSection.js +0 -56
- package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
- package/modern/FunnelChart/categoryAxis.types.js +0 -1
- package/modern/FunnelChart/funnel.types.d.ts +0 -124
- package/modern/FunnelChart/funnel.types.js +0 -1
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
- package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
- package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
- package/modern/FunnelChart/funnelSectionClasses.js +0 -20
- package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
- package/modern/FunnelChart/funnelSlots.types.js +0 -1
- package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
- package/modern/FunnelChart/funnelStepCurve.js +0 -67
- package/modern/FunnelChart/index.d.ts +0 -7
- package/modern/FunnelChart/index.js +0 -5
- package/modern/FunnelChart/labelUtils.d.ts +0 -42
- package/modern/FunnelChart/labelUtils.js +0 -166
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
- package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
- package/modern/FunnelChart/seriesConfig/index.js +0 -15
- package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/legend.js +0 -25
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
- package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
- package/modern/FunnelChart/useFunnelChartProps.js +0 -161
- package/modern/Heatmap/Heatmap.d.ts +0 -57
- package/modern/Heatmap/Heatmap.js +0 -387
- package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
- package/modern/Heatmap/Heatmap.plugins.js +0 -2
- package/modern/Heatmap/HeatmapItem.d.ts +0 -49
- package/modern/Heatmap/HeatmapItem.js +0 -106
- package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
- package/modern/Heatmap/HeatmapPlot.js +0 -59
- package/modern/Heatmap/HeatmapTooltip.d.ts +0 -16
- package/modern/Heatmap/heatmapClasses.d.ts +0 -11
- package/modern/Heatmap/heatmapClasses.js +0 -14
- package/modern/Heatmap/index.d.ts +0 -4
- package/modern/Heatmap/index.js +0 -4
- package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/extremums.js +0 -8
- package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getColor.js +0 -15
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
- package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/index.js +0 -14
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
- package/modern/LineChartPro/LineChartPro.d.ts +0 -17
- package/modern/LineChartPro/LineChartPro.js +0 -401
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
- package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
- package/modern/LineChartPro/index.d.ts +0 -1
- package/modern/LineChartPro/index.js +0 -1
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
- package/modern/ScatterChartPro/ScatterChartPro.js +0 -395
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
- package/modern/ScatterChartPro/index.d.ts +0 -1
- package/modern/ScatterChartPro/index.js +0 -1
- package/modern/hooks/index.d.ts +0 -2
- package/modern/hooks/index.js +0 -2
- package/modern/hooks/useFunnelSeries.d.ts +0 -33
- package/modern/hooks/useFunnelSeries.js +0 -42
- package/modern/hooks/useHeatmapSeries.d.ts +0 -33
- package/modern/hooks/useHeatmapSeries.js +0 -42
- package/modern/hooks/zoom/index.d.ts +0 -1
- package/modern/hooks/zoom/index.js +0 -1
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
- package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
- package/modern/index.d.ts +0 -34
- package/modern/index.js +0 -45
- package/modern/internals/plugins/allPlugins.d.ts +0 -8
- package/modern/internals/plugins/allPlugins.js +0 -6
- package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/index.js +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
- package/modern/internals/utils/releaseInfo.d.ts +0 -1
- package/modern/internals/utils/releaseInfo.js +0 -13
- package/modern/models/index.d.ts +0 -2
- package/modern/models/index.js +0 -2
- package/modern/models/seriesType/heatmap.d.ts +0 -28
- package/modern/models/seriesType/heatmap.js +0 -1
- package/modern/models/seriesType/index.d.ts +0 -1
- package/modern/models/seriesType/index.js +0 -1
- package/modern/package.json +0 -1
- package/modern/themeAugmentation/components.d.ts +0 -23
- package/modern/themeAugmentation/index.d.ts +0 -4
- package/modern/themeAugmentation/index.js +0 -0
- package/modern/themeAugmentation/overrides.d.ts +0 -11
- package/modern/themeAugmentation/props.d.ts +0 -20
- package/modern/typeOverloads/index.d.ts +0 -1
- package/modern/typeOverloads/index.js +0 -1
- package/modern/typeOverloads/modules.d.ts +0 -33
- package/modern/typeOverloads/modules.js +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- /package/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
- /package/esm/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["categoryAxis", "series", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "onItemClick", "highlightedItem", "onHighlightChange", "className", "hideLegend", "axisHighlight", "apiRef"];
|
|
6
|
-
import { DEFAULT_MARGINS, DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
7
|
-
import useId from '@mui/utils/useId';
|
|
8
|
-
import { defaultizeMargin } from '@mui/x-charts/internals';
|
|
9
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
10
|
-
function getCategoryAxisConfig(categoryAxis, series, isHorizontal, direction) {
|
|
11
|
-
const maxSeriesLength = Math.max(...series.map(s => (s.data ?? []).length), 0);
|
|
12
|
-
const maxSeriesValue = Array.from({
|
|
13
|
-
length: maxSeriesLength
|
|
14
|
-
}, (_, index) => series.reduce((a, s) => a + (s.data?.[index]?.value ?? 0), 0));
|
|
15
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
-
if ((categoryAxis?.position === 'left' || categoryAxis?.position === 'right') && isHorizontal || (categoryAxis?.position === 'top' || categoryAxis?.position === 'bottom') && !isHorizontal) {
|
|
17
|
-
warnOnce([`MUI X: the categoryAxis position is set to '${categoryAxis.position}' but the series layout is ${isHorizontal ? 'horizontal' : 'vertical'}.`, `Ensure that the categoryAxis position is set to '${isHorizontal ? 'top' : 'left'}' or '${isHorizontal ? 'bottom' : 'right'}' for ${isHorizontal ? 'horizontal' : 'vertical'} layout.\n`], 'warning');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const side = isHorizontal ? 'bottom' : 'left';
|
|
21
|
-
const categoryValues = _extends({
|
|
22
|
-
id: direction === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY
|
|
23
|
-
}, categoryAxis, categoryAxis?.size ? {
|
|
24
|
-
[isHorizontal ? 'height' : 'width']: categoryAxis.size
|
|
25
|
-
} : {}, {
|
|
26
|
-
position: categoryAxis?.position ?? (categoryAxis?.categories ? side : 'none')
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// If the scaleType is not defined or is 'band', our job is simple.
|
|
30
|
-
if (!categoryAxis?.scaleType || categoryAxis.scaleType === 'band') {
|
|
31
|
-
return _extends({
|
|
32
|
-
scaleType: 'band',
|
|
33
|
-
categoryGapRatio: 0,
|
|
34
|
-
// Use the categories as the domain if they are defined.
|
|
35
|
-
data: categoryAxis?.categories ? categoryAxis.categories :
|
|
36
|
-
// Otherwise we just need random data to create the band scale.
|
|
37
|
-
Array.from({
|
|
38
|
-
length: maxSeriesLength
|
|
39
|
-
}, (_, index) => index),
|
|
40
|
-
tickLabelPlacement: 'middle'
|
|
41
|
-
}, categoryValues);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// If the scaleType is other than 'band', we have to do some magic.
|
|
45
|
-
// First we need to calculate the tick values additively and in reverse order.
|
|
46
|
-
const tickValues = [...maxSeriesValue.toReversed().map((_, i, arr) => arr.slice(0, i).reduce((a, value) => a + value, 0)),
|
|
47
|
-
// We add the total value of the series as the last tick value
|
|
48
|
-
maxSeriesValue.reduce((a, value) => a + value, 0)];
|
|
49
|
-
return _extends({
|
|
50
|
-
scaleType: categoryAxis.scaleType,
|
|
51
|
-
domainLimit: 'strict',
|
|
52
|
-
tickLabelPlacement: 'middle',
|
|
53
|
-
tickInterval: tickValues,
|
|
54
|
-
// No need to show the first tick label
|
|
55
|
-
tickLabelInterval: (_, i) => i !== 0,
|
|
56
|
-
// We trick the valueFormatter to show the category values.
|
|
57
|
-
// By using the index of the tickValues array we can get the category value.
|
|
58
|
-
valueFormatter: value => `${categoryAxis.categories?.toReversed()[tickValues.findIndex(v => v === value) - 1]}`
|
|
59
|
-
}, categoryValues);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* A helper function that extracts FunnelChartProps from the input props
|
|
64
|
-
* and returns an object with props for the children components of FunnelChart.
|
|
65
|
-
*
|
|
66
|
-
* @param props The input props for FunnelChart
|
|
67
|
-
* @returns An object with props for the children components of FunnelChart
|
|
68
|
-
*/
|
|
69
|
-
export const useFunnelChartProps = props => {
|
|
70
|
-
const {
|
|
71
|
-
categoryAxis,
|
|
72
|
-
series,
|
|
73
|
-
width,
|
|
74
|
-
height,
|
|
75
|
-
margin: marginProps,
|
|
76
|
-
colors,
|
|
77
|
-
sx,
|
|
78
|
-
children,
|
|
79
|
-
slots,
|
|
80
|
-
slotProps,
|
|
81
|
-
loading,
|
|
82
|
-
onItemClick,
|
|
83
|
-
highlightedItem,
|
|
84
|
-
onHighlightChange,
|
|
85
|
-
className,
|
|
86
|
-
axisHighlight,
|
|
87
|
-
apiRef
|
|
88
|
-
} = props,
|
|
89
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
90
|
-
const margin = defaultizeMargin(marginProps, DEFAULT_MARGINS);
|
|
91
|
-
const id = useId();
|
|
92
|
-
const clipPathId = `${id}-clip-path`;
|
|
93
|
-
const isHorizontal = series.some(s => s.layout === 'horizontal');
|
|
94
|
-
const valueAxisConfig = {
|
|
95
|
-
id: isHorizontal ? DEFAULT_Y_AXIS_KEY : DEFAULT_X_AXIS_KEY,
|
|
96
|
-
scaleType: 'linear',
|
|
97
|
-
domainLimit: 'strict',
|
|
98
|
-
position: 'none'
|
|
99
|
-
};
|
|
100
|
-
const xAxis = isHorizontal ? getCategoryAxisConfig(categoryAxis, series, isHorizontal, 'x') : valueAxisConfig;
|
|
101
|
-
const yAxis = isHorizontal ? valueAxisConfig : getCategoryAxisConfig(categoryAxis, series, isHorizontal, 'y');
|
|
102
|
-
const chartContainerProps = _extends({}, rest, {
|
|
103
|
-
series: series.map(s => _extends({
|
|
104
|
-
type: 'funnel',
|
|
105
|
-
layout: isHorizontal ? 'horizontal' : 'vertical'
|
|
106
|
-
}, s)),
|
|
107
|
-
width,
|
|
108
|
-
height,
|
|
109
|
-
margin,
|
|
110
|
-
colors,
|
|
111
|
-
xAxis: [xAxis],
|
|
112
|
-
yAxis: [yAxis],
|
|
113
|
-
sx,
|
|
114
|
-
highlightedItem,
|
|
115
|
-
onHighlightChange,
|
|
116
|
-
className,
|
|
117
|
-
apiRef
|
|
118
|
-
});
|
|
119
|
-
const funnelPlotProps = {
|
|
120
|
-
onItemClick,
|
|
121
|
-
slots,
|
|
122
|
-
slotProps
|
|
123
|
-
};
|
|
124
|
-
const overlayProps = {
|
|
125
|
-
slots,
|
|
126
|
-
slotProps,
|
|
127
|
-
loading
|
|
128
|
-
};
|
|
129
|
-
const chartsAxisProps = {
|
|
130
|
-
slots,
|
|
131
|
-
slotProps
|
|
132
|
-
};
|
|
133
|
-
const legendProps = {
|
|
134
|
-
slots,
|
|
135
|
-
slotProps
|
|
136
|
-
};
|
|
137
|
-
const clipPathGroupProps = {
|
|
138
|
-
clipPath: `url(#${clipPathId})`
|
|
139
|
-
};
|
|
140
|
-
const clipPathProps = {
|
|
141
|
-
id: clipPathId
|
|
142
|
-
};
|
|
143
|
-
const chartsWrapperProps = {
|
|
144
|
-
sx,
|
|
145
|
-
legendPosition: props.slotProps?.legend?.position,
|
|
146
|
-
legendDirection: props.slotProps?.legend?.direction
|
|
147
|
-
};
|
|
148
|
-
const axisHighlightProps = _extends({}, axisHighlight);
|
|
149
|
-
return {
|
|
150
|
-
chartContainerProps,
|
|
151
|
-
funnelPlotProps,
|
|
152
|
-
overlayProps,
|
|
153
|
-
chartsAxisProps,
|
|
154
|
-
legendProps,
|
|
155
|
-
clipPathGroupProps,
|
|
156
|
-
clipPathProps,
|
|
157
|
-
chartsWrapperProps,
|
|
158
|
-
axisHighlightProps,
|
|
159
|
-
children
|
|
160
|
-
};
|
|
161
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
-
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
4
|
-
import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
5
|
-
import { ChartsAxisSlots, ChartsAxisSlotProps, ChartsXAxisProps, ChartsYAxisProps, AxisConfig } from '@mui/x-charts/internals';
|
|
6
|
-
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
7
|
-
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
|
-
import { HeatmapSeriesType } from "../models/seriesType/heatmap.js";
|
|
9
|
-
import { HeatmapTooltipProps } from "./HeatmapTooltip.js";
|
|
10
|
-
import { HeatmapItemSlotProps, HeatmapItemSlots } from "./HeatmapItem.js";
|
|
11
|
-
import { HeatmapPluginsSignatures } from "./Heatmap.plugins.js";
|
|
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>;
|
|
18
|
-
}
|
|
19
|
-
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
20
|
-
tooltip?: Partial<HeatmapTooltipProps>;
|
|
21
|
-
}
|
|
22
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
23
|
-
/**
|
|
24
|
-
* The configuration of the x-axes.
|
|
25
|
-
* If not provided, a default axis config is used.
|
|
26
|
-
* An array of [[AxisConfig]] objects.
|
|
27
|
-
*/
|
|
28
|
-
xAxis: Readonly<MakeOptional<AxisConfig<'band', any, ChartsXAxisProps>, 'id' | 'scaleType'>[]>;
|
|
29
|
-
/**
|
|
30
|
-
* The configuration of the y-axes.
|
|
31
|
-
* If not provided, a default axis config is used.
|
|
32
|
-
* An array of [[AxisConfig]] objects.
|
|
33
|
-
*/
|
|
34
|
-
yAxis: Readonly<MakeOptional<AxisConfig<'band', any, ChartsYAxisProps>, 'id' | 'scaleType'>[]>;
|
|
35
|
-
/**
|
|
36
|
-
* The series to display in the bar chart.
|
|
37
|
-
* An array of [[HeatmapSeriesType]] objects.
|
|
38
|
-
*/
|
|
39
|
-
series: Readonly<MakeOptional<HeatmapSeriesType, 'type'>[]>;
|
|
40
|
-
/**
|
|
41
|
-
* The configuration of the tooltip.
|
|
42
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
43
|
-
*/
|
|
44
|
-
tooltip?: ChartsTooltipProps;
|
|
45
|
-
/**
|
|
46
|
-
* Overridable component slots.
|
|
47
|
-
* @default {}
|
|
48
|
-
*/
|
|
49
|
-
slots?: HeatmapSlots;
|
|
50
|
-
/**
|
|
51
|
-
* The props used for each component slot.
|
|
52
|
-
* @default {}
|
|
53
|
-
*/
|
|
54
|
-
slotProps?: HeatmapSlotProps;
|
|
55
|
-
}
|
|
56
|
-
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<SVGSVGElement>>;
|
|
57
|
-
export { Heatmap };
|
|
@@ -1,387 +0,0 @@
|
|
|
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 { useThemeProps } from '@mui/material/styles';
|
|
7
|
-
import useId from '@mui/utils/useId';
|
|
8
|
-
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
9
|
-
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
10
|
-
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
11
|
-
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
12
|
-
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
13
|
-
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
14
|
-
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
15
|
-
import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
16
|
-
import { HeatmapTooltip } from "./HeatmapTooltip.js";
|
|
17
|
-
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
20
|
-
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
21
|
-
const seriesConfig = {
|
|
22
|
-
heatmap: heatmapSeriesConfig
|
|
23
|
-
};
|
|
24
|
-
function getDefaultDataForAxis(series, dimension) {
|
|
25
|
-
if (series?.[0]?.data === undefined || series[0].data.length === 0) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
return Array.from({
|
|
29
|
-
length: Math.max(...series[0].data.map(dataPoint => dataPoint[dimension])) + 1
|
|
30
|
-
}, (_, index) => index);
|
|
31
|
-
}
|
|
32
|
-
const getDefaultDataForXAxis = series => getDefaultDataForAxis(series, 0);
|
|
33
|
-
const getDefaultDataForYAxis = series => getDefaultDataForAxis(series, 1);
|
|
34
|
-
const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
35
|
-
const props = useThemeProps({
|
|
36
|
-
props: inProps,
|
|
37
|
-
name: 'MuiHeatmap'
|
|
38
|
-
});
|
|
39
|
-
const {
|
|
40
|
-
xAxis,
|
|
41
|
-
yAxis,
|
|
42
|
-
zAxis,
|
|
43
|
-
series,
|
|
44
|
-
width,
|
|
45
|
-
height,
|
|
46
|
-
margin,
|
|
47
|
-
colors,
|
|
48
|
-
dataset,
|
|
49
|
-
sx,
|
|
50
|
-
onAxisClick,
|
|
51
|
-
children,
|
|
52
|
-
slots,
|
|
53
|
-
slotProps,
|
|
54
|
-
loading,
|
|
55
|
-
highlightedItem,
|
|
56
|
-
onHighlightChange
|
|
57
|
-
} = props;
|
|
58
|
-
const id = useId();
|
|
59
|
-
const clipPathId = `${id}-clip-path`;
|
|
60
|
-
const xAxisWithDefault = React.useMemo(() => (xAxis && xAxis.length > 0 ? xAxis : [{
|
|
61
|
-
id: DEFAULT_X_AXIS_KEY
|
|
62
|
-
}]).map(axis => _extends({
|
|
63
|
-
scaleType: 'band',
|
|
64
|
-
categoryGapRatio: 0
|
|
65
|
-
}, axis, {
|
|
66
|
-
data: axis.data ?? getDefaultDataForXAxis(series)
|
|
67
|
-
})), [series, xAxis]);
|
|
68
|
-
const yAxisWithDefault = React.useMemo(() => (yAxis && yAxis.length > 0 ? yAxis : [{
|
|
69
|
-
id: DEFAULT_Y_AXIS_KEY
|
|
70
|
-
}]).map(axis => _extends({
|
|
71
|
-
scaleType: 'band',
|
|
72
|
-
categoryGapRatio: 0
|
|
73
|
-
}, axis, {
|
|
74
|
-
data: axis.data ?? getDefaultDataForYAxis(series)
|
|
75
|
-
})), [series, yAxis]);
|
|
76
|
-
const zAxisWithDefault = React.useMemo(() => zAxis ?? [{
|
|
77
|
-
colorMap: {
|
|
78
|
-
type: 'continuous',
|
|
79
|
-
min: 0,
|
|
80
|
-
max: 100,
|
|
81
|
-
color: defaultColorMap
|
|
82
|
-
}
|
|
83
|
-
}], [zAxis]);
|
|
84
|
-
const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
|
|
85
|
-
return /*#__PURE__*/_jsxs(ChartContainerPro, {
|
|
86
|
-
ref: ref,
|
|
87
|
-
seriesConfig: seriesConfig,
|
|
88
|
-
series: series.map(s => _extends({
|
|
89
|
-
type: 'heatmap'
|
|
90
|
-
}, s)),
|
|
91
|
-
width: width,
|
|
92
|
-
height: height,
|
|
93
|
-
margin: margin,
|
|
94
|
-
xAxis: xAxisWithDefault,
|
|
95
|
-
yAxis: yAxisWithDefault,
|
|
96
|
-
zAxis: zAxisWithDefault,
|
|
97
|
-
colors: colors,
|
|
98
|
-
dataset: dataset,
|
|
99
|
-
sx: sx,
|
|
100
|
-
disableAxisListener: true,
|
|
101
|
-
highlightedItem: highlightedItem,
|
|
102
|
-
onHighlightChange: onHighlightChange,
|
|
103
|
-
onAxisClick: onAxisClick,
|
|
104
|
-
plugins: HEATMAP_PLUGINS,
|
|
105
|
-
children: [/*#__PURE__*/_jsxs("g", {
|
|
106
|
-
clipPath: `url(#${clipPathId})`,
|
|
107
|
-
children: [/*#__PURE__*/_jsx(HeatmapPlot, {
|
|
108
|
-
slots: slots,
|
|
109
|
-
slotProps: slotProps
|
|
110
|
-
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
111
|
-
loading: loading,
|
|
112
|
-
slots: slots,
|
|
113
|
-
slotProps: slotProps
|
|
114
|
-
})]
|
|
115
|
-
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
116
|
-
slots: slots,
|
|
117
|
-
slotProps: slotProps
|
|
118
|
-
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
119
|
-
id: clipPathId
|
|
120
|
-
}), children]
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
process.env.NODE_ENV !== "production" ? Heatmap.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
|
-
apiRef: PropTypes.shape({
|
|
129
|
-
current: PropTypes.object
|
|
130
|
-
}),
|
|
131
|
-
children: PropTypes.node,
|
|
132
|
-
className: PropTypes.string,
|
|
133
|
-
/**
|
|
134
|
-
* Color palette used to colorize multiple series.
|
|
135
|
-
* @default rainbowSurgePalette
|
|
136
|
-
*/
|
|
137
|
-
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
138
|
-
/**
|
|
139
|
-
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
140
|
-
*/
|
|
141
|
-
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
142
|
-
desc: PropTypes.string,
|
|
143
|
-
/**
|
|
144
|
-
* If `true`, the charts will not listen to the mouse move event.
|
|
145
|
-
* It might break interactive features, but will improve performance.
|
|
146
|
-
* @default false
|
|
147
|
-
*/
|
|
148
|
-
disableAxisListener: PropTypes.bool,
|
|
149
|
-
/**
|
|
150
|
-
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
151
|
-
*/
|
|
152
|
-
height: PropTypes.number,
|
|
153
|
-
/**
|
|
154
|
-
* The highlighted item.
|
|
155
|
-
* Used when the highlight is controlled.
|
|
156
|
-
*/
|
|
157
|
-
highlightedItem: PropTypes.shape({
|
|
158
|
-
dataIndex: PropTypes.number,
|
|
159
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
160
|
-
}),
|
|
161
|
-
/**
|
|
162
|
-
* This prop is used to help implement the accessibility logic.
|
|
163
|
-
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
164
|
-
*/
|
|
165
|
-
id: PropTypes.string,
|
|
166
|
-
/**
|
|
167
|
-
* If `true`, a loading overlay is displayed.
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
loading: PropTypes.bool,
|
|
171
|
-
/**
|
|
172
|
-
* The margin between the SVG and the drawing area.
|
|
173
|
-
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
174
|
-
*
|
|
175
|
-
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
176
|
-
*/
|
|
177
|
-
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
178
|
-
bottom: PropTypes.number,
|
|
179
|
-
left: PropTypes.number,
|
|
180
|
-
right: PropTypes.number,
|
|
181
|
-
top: PropTypes.number
|
|
182
|
-
})]),
|
|
183
|
-
/**
|
|
184
|
-
* The function called for onClick events.
|
|
185
|
-
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
186
|
-
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
187
|
-
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
188
|
-
*/
|
|
189
|
-
onAxisClick: PropTypes.func,
|
|
190
|
-
/**
|
|
191
|
-
* The callback fired when the highlighted item changes.
|
|
192
|
-
*
|
|
193
|
-
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
194
|
-
*/
|
|
195
|
-
onHighlightChange: PropTypes.func,
|
|
196
|
-
/**
|
|
197
|
-
* The series to display in the bar chart.
|
|
198
|
-
* An array of [[HeatmapSeriesType]] objects.
|
|
199
|
-
*/
|
|
200
|
-
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
201
|
-
/**
|
|
202
|
-
* The configuration helpers used to compute attributes according to the serries type.
|
|
203
|
-
* @ignore Unstable props for internal usage.
|
|
204
|
-
*/
|
|
205
|
-
seriesConfig: PropTypes.object,
|
|
206
|
-
/**
|
|
207
|
-
* The props used for each component slot.
|
|
208
|
-
* @default {}
|
|
209
|
-
*/
|
|
210
|
-
slotProps: PropTypes.object,
|
|
211
|
-
/**
|
|
212
|
-
* Overridable component slots.
|
|
213
|
-
* @default {}
|
|
214
|
-
*/
|
|
215
|
-
slots: PropTypes.object,
|
|
216
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
217
|
-
theme: PropTypes.oneOf(['dark', 'light']),
|
|
218
|
-
title: PropTypes.string,
|
|
219
|
-
/**
|
|
220
|
-
* The configuration of the tooltip.
|
|
221
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
222
|
-
*/
|
|
223
|
-
tooltip: PropTypes.object,
|
|
224
|
-
/**
|
|
225
|
-
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
226
|
-
*/
|
|
227
|
-
width: PropTypes.number,
|
|
228
|
-
/**
|
|
229
|
-
* The configuration of the x-axes.
|
|
230
|
-
* If not provided, a default axis config is used.
|
|
231
|
-
* An array of [[AxisConfig]] objects.
|
|
232
|
-
*/
|
|
233
|
-
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
234
|
-
axis: PropTypes.oneOf(['x']),
|
|
235
|
-
barGapRatio: PropTypes.number,
|
|
236
|
-
categoryGapRatio: PropTypes.number,
|
|
237
|
-
classes: PropTypes.object,
|
|
238
|
-
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
239
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
240
|
-
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
241
|
-
unknownColor: PropTypes.string,
|
|
242
|
-
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
243
|
-
}), PropTypes.shape({
|
|
244
|
-
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
245
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
246
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
247
|
-
type: PropTypes.oneOf(['continuous']).isRequired
|
|
248
|
-
}), PropTypes.shape({
|
|
249
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
250
|
-
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
251
|
-
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
252
|
-
})]),
|
|
253
|
-
data: PropTypes.array,
|
|
254
|
-
dataKey: PropTypes.string,
|
|
255
|
-
disableLine: PropTypes.bool,
|
|
256
|
-
disableTicks: PropTypes.bool,
|
|
257
|
-
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
258
|
-
fill: PropTypes.string,
|
|
259
|
-
height: PropTypes.number,
|
|
260
|
-
hideTooltip: PropTypes.bool,
|
|
261
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
262
|
-
label: PropTypes.string,
|
|
263
|
-
labelStyle: PropTypes.object,
|
|
264
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
265
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
266
|
-
offset: PropTypes.number,
|
|
267
|
-
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
268
|
-
reverse: PropTypes.bool,
|
|
269
|
-
scaleType: PropTypes.oneOf(['band']),
|
|
270
|
-
slotProps: PropTypes.object,
|
|
271
|
-
slots: PropTypes.object,
|
|
272
|
-
stroke: PropTypes.string,
|
|
273
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
274
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
275
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
276
|
-
tickLabelMinGap: PropTypes.number,
|
|
277
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
278
|
-
tickLabelStyle: PropTypes.object,
|
|
279
|
-
tickMaxStep: PropTypes.number,
|
|
280
|
-
tickMinStep: PropTypes.number,
|
|
281
|
-
tickNumber: PropTypes.number,
|
|
282
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
283
|
-
tickSize: PropTypes.number,
|
|
284
|
-
valueFormatter: PropTypes.func,
|
|
285
|
-
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
286
|
-
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
287
|
-
maxEnd: PropTypes.number,
|
|
288
|
-
maxSpan: PropTypes.number,
|
|
289
|
-
minSpan: PropTypes.number,
|
|
290
|
-
minStart: PropTypes.number,
|
|
291
|
-
panning: PropTypes.bool,
|
|
292
|
-
step: PropTypes.number
|
|
293
|
-
}), PropTypes.bool])
|
|
294
|
-
})).isRequired,
|
|
295
|
-
/**
|
|
296
|
-
* The configuration of the y-axes.
|
|
297
|
-
* If not provided, a default axis config is used.
|
|
298
|
-
* An array of [[AxisConfig]] objects.
|
|
299
|
-
*/
|
|
300
|
-
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
301
|
-
axis: PropTypes.oneOf(['y']),
|
|
302
|
-
barGapRatio: PropTypes.number,
|
|
303
|
-
categoryGapRatio: PropTypes.number,
|
|
304
|
-
classes: PropTypes.object,
|
|
305
|
-
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
306
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
307
|
-
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
308
|
-
unknownColor: PropTypes.string,
|
|
309
|
-
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
310
|
-
}), PropTypes.shape({
|
|
311
|
-
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
312
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
313
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
314
|
-
type: PropTypes.oneOf(['continuous']).isRequired
|
|
315
|
-
}), PropTypes.shape({
|
|
316
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
317
|
-
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
318
|
-
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
319
|
-
})]),
|
|
320
|
-
data: PropTypes.array,
|
|
321
|
-
dataKey: PropTypes.string,
|
|
322
|
-
disableLine: PropTypes.bool,
|
|
323
|
-
disableTicks: PropTypes.bool,
|
|
324
|
-
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
325
|
-
fill: PropTypes.string,
|
|
326
|
-
hideTooltip: PropTypes.bool,
|
|
327
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
328
|
-
label: PropTypes.string,
|
|
329
|
-
labelStyle: PropTypes.object,
|
|
330
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
331
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
332
|
-
offset: PropTypes.number,
|
|
333
|
-
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
334
|
-
reverse: PropTypes.bool,
|
|
335
|
-
scaleType: PropTypes.oneOf(['band']),
|
|
336
|
-
slotProps: PropTypes.object,
|
|
337
|
-
slots: PropTypes.object,
|
|
338
|
-
stroke: PropTypes.string,
|
|
339
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
340
|
-
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
341
|
-
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
342
|
-
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
343
|
-
tickLabelStyle: PropTypes.object,
|
|
344
|
-
tickMaxStep: PropTypes.number,
|
|
345
|
-
tickMinStep: PropTypes.number,
|
|
346
|
-
tickNumber: PropTypes.number,
|
|
347
|
-
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
348
|
-
tickSize: PropTypes.number,
|
|
349
|
-
valueFormatter: PropTypes.func,
|
|
350
|
-
width: PropTypes.number,
|
|
351
|
-
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
352
|
-
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
353
|
-
maxEnd: PropTypes.number,
|
|
354
|
-
maxSpan: PropTypes.number,
|
|
355
|
-
minSpan: PropTypes.number,
|
|
356
|
-
minStart: PropTypes.number,
|
|
357
|
-
panning: PropTypes.bool,
|
|
358
|
-
step: PropTypes.number
|
|
359
|
-
}), PropTypes.bool])
|
|
360
|
-
})).isRequired,
|
|
361
|
-
/**
|
|
362
|
-
* The configuration of the z-axes.
|
|
363
|
-
*/
|
|
364
|
-
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
365
|
-
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
366
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
367
|
-
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
368
|
-
unknownColor: PropTypes.string,
|
|
369
|
-
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
370
|
-
}), PropTypes.shape({
|
|
371
|
-
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
372
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
373
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
374
|
-
type: PropTypes.oneOf(['continuous']).isRequired
|
|
375
|
-
}), PropTypes.shape({
|
|
376
|
-
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
377
|
-
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
378
|
-
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
379
|
-
})]),
|
|
380
|
-
data: PropTypes.array,
|
|
381
|
-
dataKey: PropTypes.string,
|
|
382
|
-
id: PropTypes.string,
|
|
383
|
-
max: PropTypes.number,
|
|
384
|
-
min: PropTypes.number
|
|
385
|
-
}))
|
|
386
|
-
} : void 0;
|
|
387
|
-
export { Heatmap };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
-
export type HeatmapPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartInteractionSignature, UseChartHighlightSignature];
|
|
3
|
-
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginsSignatures>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import { HeatmapClasses } from "./heatmapClasses.js";
|
|
4
|
-
export interface HeatmapItemSlots {
|
|
5
|
-
/**
|
|
6
|
-
* The component that renders the heatmap cell.
|
|
7
|
-
* @default HeatmapCell
|
|
8
|
-
*/
|
|
9
|
-
cell?: React.ElementType;
|
|
10
|
-
}
|
|
11
|
-
export interface HeatmapItemSlotProps {
|
|
12
|
-
cell?: Partial<React.ComponentPropsWithRef<'rect'>>;
|
|
13
|
-
}
|
|
14
|
-
export interface HeatmapItemProps {
|
|
15
|
-
dataIndex: number;
|
|
16
|
-
seriesId: SeriesId;
|
|
17
|
-
value: number;
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
color: string;
|
|
23
|
-
/**
|
|
24
|
-
* The props used for each component slot.
|
|
25
|
-
* @default {}
|
|
26
|
-
*/
|
|
27
|
-
slotProps?: HeatmapItemSlotProps;
|
|
28
|
-
/**
|
|
29
|
-
* Overridable component slots.
|
|
30
|
-
* @default {}
|
|
31
|
-
*/
|
|
32
|
-
slots?: HeatmapItemSlots;
|
|
33
|
-
}
|
|
34
|
-
export interface HeatmapItemOwnerState {
|
|
35
|
-
seriesId: SeriesId;
|
|
36
|
-
dataIndex: number;
|
|
37
|
-
color: string;
|
|
38
|
-
isFaded: boolean;
|
|
39
|
-
isHighlighted: boolean;
|
|
40
|
-
classes?: Partial<HeatmapClasses>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @ignore - internal component.
|
|
44
|
-
*/
|
|
45
|
-
declare function HeatmapItem(props: HeatmapItemProps): React.JSX.Element;
|
|
46
|
-
declare namespace HeatmapItem {
|
|
47
|
-
var propTypes: any;
|
|
48
|
-
}
|
|
49
|
-
export { HeatmapItem };
|