@mui/x-charts-pro 9.0.0-alpha.2 → 9.0.0-alpha.4
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.mts +2 -2
- package/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +43 -10
- package/BarChartPro/BarChartPro.mjs +43 -10
- package/CHANGELOG.md +246 -1
- package/ChartsContainerPro/ChartsContainerPro.d.mts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.d.ts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.js +2 -2
- package/ChartsContainerPro/ChartsContainerPro.mjs +2 -2
- package/ChartsContainerPro/useChartsContainerProProps.d.mts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.js +3 -3
- package/ChartsContainerPro/useChartsContainerProProps.mjs +3 -3
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.mts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +8 -11
- package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +8 -11
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.mts +1 -1
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.mjs +2 -2
- package/ChartsToolbarPro/index.d.mts +2 -1
- package/ChartsToolbarPro/index.d.ts +2 -1
- package/ChartsToolbarPro/index.mjs +2 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.mjs +2 -2
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.mjs +2 -2
- package/FunnelChart/FunnelChart.d.mts +2 -2
- package/FunnelChart/FunnelChart.d.ts +2 -2
- package/FunnelChart/FunnelChart.js +23 -8
- package/FunnelChart/FunnelChart.mjs +23 -8
- package/FunnelChart/FunnelPlot.js +8 -3
- package/FunnelChart/FunnelPlot.mjs +8 -3
- package/FunnelChart/FunnelSection.d.mts +3 -3
- package/FunnelChart/FunnelSection.d.ts +3 -3
- package/FunnelChart/FunnelSection.js +8 -9
- package/FunnelChart/FunnelSection.mjs +8 -9
- package/FunnelChart/FunnelSectionLabel.d.mts +9 -3
- package/FunnelChart/FunnelSectionLabel.d.ts +9 -3
- package/FunnelChart/FunnelSectionLabel.js +15 -6
- package/FunnelChart/FunnelSectionLabel.mjs +15 -6
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.mts +3 -3
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +3 -3
- package/FunnelChart/funnelClasses.d.mts +29 -0
- package/FunnelChart/funnelClasses.d.ts +29 -0
- package/FunnelChart/funnelClasses.js +29 -0
- package/FunnelChart/funnelClasses.mjs +19 -0
- package/FunnelChart/index.d.mts +2 -2
- package/FunnelChart/index.d.ts +2 -2
- package/FunnelChart/index.js +4 -4
- package/FunnelChart/index.mjs +1 -1
- package/FunnelChart/seriesConfig/legend.js +0 -2
- package/FunnelChart/seriesConfig/legend.mjs +0 -2
- package/FunnelChart/useFunnelChartProps.d.mts +2 -2
- package/FunnelChart/useFunnelChartProps.d.ts +2 -2
- package/FunnelChart/useFunnelChartProps.js +2 -2
- package/FunnelChart/useFunnelChartProps.mjs +2 -2
- package/Heatmap/Heatmap.d.mts +2 -11
- package/Heatmap/Heatmap.d.ts +2 -11
- package/Heatmap/Heatmap.js +25 -19
- package/Heatmap/Heatmap.mjs +25 -19
- package/Heatmap/HeatmapCell.d.mts +33 -0
- package/Heatmap/HeatmapCell.d.ts +33 -0
- package/Heatmap/HeatmapCell.js +62 -0
- package/Heatmap/HeatmapCell.mjs +55 -0
- package/Heatmap/HeatmapItem.d.mts +1 -9
- package/Heatmap/HeatmapItem.d.ts +1 -9
- package/Heatmap/HeatmapItem.js +5 -23
- package/Heatmap/HeatmapItem.mjs +5 -23
- package/Heatmap/HeatmapSVGPlot.js +14 -7
- package/Heatmap/HeatmapSVGPlot.mjs +15 -8
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +2 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.mjs +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +16 -13
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +16 -13
- package/Heatmap/heatmapClasses.d.mts +6 -1
- package/Heatmap/heatmapClasses.d.ts +6 -1
- package/Heatmap/heatmapClasses.js +18 -3
- package/Heatmap/heatmapClasses.mjs +16 -2
- package/Heatmap/index.d.mts +4 -2
- package/Heatmap/index.d.ts +4 -2
- package/Heatmap/index.js +17 -13
- package/Heatmap/index.mjs +2 -1
- package/Heatmap/seriesConfig/getColor.js +5 -3
- package/Heatmap/seriesConfig/getColor.mjs +5 -3
- package/Heatmap/seriesConfig/getItemAtPosition.d.mts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.js +3 -11
- package/Heatmap/seriesConfig/getItemAtPosition.mjs +3 -11
- package/Heatmap/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.js +15 -0
- package/Heatmap/seriesConfig/identifierCleaner.mjs +9 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.js +11 -0
- package/Heatmap/seriesConfig/identifierSerializer.mjs +5 -0
- package/Heatmap/seriesConfig/index.js +4 -2
- package/Heatmap/seriesConfig/index.mjs +5 -3
- package/Heatmap/seriesConfig/keyboardFocusHandler.js +6 -19
- package/Heatmap/seriesConfig/keyboardFocusHandler.mjs +6 -19
- package/Heatmap/seriesConfig/seriesProcessor.js +8 -3
- package/Heatmap/seriesConfig/seriesProcessor.mjs +8 -3
- package/Heatmap/seriesConfig/tooltip.js +7 -6
- package/Heatmap/seriesConfig/tooltip.mjs +7 -6
- package/Heatmap/seriesConfig/tooltipPosition.js +3 -4
- package/Heatmap/seriesConfig/tooltipPosition.mjs +3 -4
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.mjs +1 -1
- package/Heatmap/useHeatmapProps.d.mts +2 -2
- package/Heatmap/useHeatmapProps.d.ts +2 -2
- package/Heatmap/useHeatmapProps.js +4 -6
- package/Heatmap/useHeatmapProps.mjs +4 -6
- package/LineChartPro/LineChartPro.d.mts +2 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +40 -13
- package/LineChartPro/LineChartPro.mjs +40 -13
- package/PieChartPro/PieChartPro.d.mts +2 -2
- package/PieChartPro/PieChartPro.d.ts +2 -2
- package/PieChartPro/PieChartPro.js +22 -7
- package/PieChartPro/PieChartPro.mjs +22 -7
- package/RadarChartPro/RadarChartPro.d.mts +1 -1
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +20 -2
- package/RadarChartPro/RadarChartPro.mjs +20 -2
- package/SankeyChart/SankeyChart.d.mts +2 -2
- package/SankeyChart/SankeyChart.d.ts +2 -2
- package/SankeyChart/SankeyChart.js +21 -12
- package/SankeyChart/SankeyChart.mjs +21 -12
- package/SankeyChart/SankeyDataProvider.d.mts +2 -2
- package/SankeyChart/SankeyDataProvider.d.ts +2 -2
- package/SankeyChart/SankeyDataProvider.js +2 -2
- package/SankeyChart/SankeyDataProvider.mjs +2 -2
- package/SankeyChart/SankeyLinkElement.js +7 -3
- package/SankeyChart/SankeyLinkElement.mjs +8 -4
- package/SankeyChart/SankeyLinkLabel.js +3 -0
- package/SankeyChart/SankeyLinkLabel.mjs +3 -0
- package/SankeyChart/SankeyLinkLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.js +1 -1
- package/SankeyChart/SankeyLinkLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyLinkPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkPlot.js +1 -1
- package/SankeyChart/SankeyLinkPlot.mjs +1 -1
- package/SankeyChart/SankeyNodeElement.d.mts +1 -1
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +20 -18
- package/SankeyChart/SankeyNodeElement.mjs +21 -19
- package/SankeyChart/SankeyNodeLabel.js +3 -0
- package/SankeyChart/SankeyNodeLabel.mjs +3 -0
- package/SankeyChart/SankeyNodeLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.js +1 -1
- package/SankeyChart/SankeyNodeLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyNodePlot.d.mts +2 -2
- package/SankeyChart/SankeyNodePlot.d.ts +2 -2
- package/SankeyChart/SankeyNodePlot.js +1 -1
- package/SankeyChart/SankeyNodePlot.mjs +1 -1
- package/SankeyChart/SankeyPlot.d.mts +2 -2
- package/SankeyChart/SankeyPlot.d.ts +2 -2
- package/SankeyChart/SankeyPlot.js +3 -3
- package/SankeyChart/SankeyPlot.mjs +3 -3
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.js +2 -2
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.mjs +1 -1
- package/SankeyChart/index.d.mts +2 -1
- package/SankeyChart/index.d.ts +2 -1
- package/SankeyChart/index.js +3 -3
- package/SankeyChart/index.mjs +1 -1
- package/SankeyChart/sankeyClasses.d.mts +15 -6
- package/SankeyChart/sankeyClasses.d.ts +15 -6
- package/SankeyChart/sankeyClasses.js +12 -8
- package/SankeyChart/sankeyClasses.mjs +10 -6
- package/SankeyChart/sankeyHighlightHooks.d.mts +2 -2
- package/SankeyChart/sankeyHighlightHooks.d.ts +2 -2
- package/SankeyChart/sankeyHighlightHooks.js +2 -10
- package/SankeyChart/sankeyHighlightHooks.mjs +3 -11
- package/SankeyChart/useSankeyChartProps.d.mts +2 -2
- package/SankeyChart/useSankeyChartProps.d.ts +2 -2
- package/SankeyChart/useSankeyChartProps.js +2 -2
- package/SankeyChart/useSankeyChartProps.mjs +2 -2
- package/ScatterChartPro/ScatterChartPro.d.mts +2 -2
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +62 -17
- package/ScatterChartPro/ScatterChartPro.mjs +62 -17
- package/context/useChartProApiContext.d.mts +1 -1
- package/context/useChartProApiContext.d.ts +1 -1
- package/context/useChartProApiContext.js +1 -1
- package/context/useChartProApiContext.mjs +1 -1
- package/index.d.mts +0 -4
- package/index.d.ts +0 -4
- package/index.js +2 -34
- package/index.mjs +1 -4
- package/internals/ChartsWatermark.d.mts +2 -2
- package/internals/ChartsWatermark.d.ts +2 -2
- package/internals/ChartsWatermark.js +5 -8
- package/internals/ChartsWatermark.mjs +3 -6
- package/internals/index.d.mts +0 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -8
- package/internals/index.mjs +0 -1
- package/internals/plugins/allPlugins.d.mts +4 -4
- package/internals/plugins/allPlugins.d.ts +4 -4
- package/internals/plugins/useChartProExport/common.js +4 -8
- package/internals/plugins/useChartProExport/common.mjs +4 -8
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProExport/exportImage.mjs +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.mts +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +16 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.mjs +16 -1
- package/models/seriesType/heatmap.d.mts +36 -9
- package/models/seriesType/heatmap.d.ts +36 -9
- package/models/seriesType/heatmap.js +28 -1
- package/models/seriesType/heatmap.mjs +25 -1
- package/package.json +5 -61
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.mts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +4 -4
- package/plugins/selectors/useChartHeatmapPosition.selectors.mjs +4 -4
- package/themeAugmentation/components.d.mts +19 -1
- package/themeAugmentation/components.d.ts +19 -1
- package/themeAugmentation/overrides.d.mts +5 -2
- package/themeAugmentation/overrides.d.ts +5 -2
- package/themeAugmentation/props.d.mts +8 -0
- package/themeAugmentation/props.d.ts +8 -0
- package/typeOverloads/modules.d.mts +2 -2
- package/typeOverloads/modules.d.ts +2 -2
- package/ChartContainer/index.d.mts +0 -1
- package/ChartContainer/index.d.ts +0 -1
- package/ChartContainer/index.js +0 -16
- package/ChartContainer/index.mjs +0 -2
- package/ChartContainerPro/ChartContainerPro.d.mts +0 -21
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -21
- package/ChartContainerPro/ChartContainerPro.js +0 -24
- package/ChartContainerPro/ChartContainerPro.mjs +0 -20
- package/ChartContainerPro/index.d.mts +0 -9
- package/ChartContainerPro/index.d.ts +0 -9
- package/ChartContainerPro/index.js +0 -17
- package/ChartContainerPro/index.mjs +0 -6
- package/ChartContainerPro/useChartContainerProProps.d.mts +0 -12
- package/ChartContainerPro/useChartContainerProProps.d.ts +0 -12
- package/ChartContainerPro/useChartContainerProProps.js +0 -19
- package/ChartContainerPro/useChartContainerProProps.mjs +0 -14
- package/ChartDataProvider/index.d.mts +0 -1
- package/ChartDataProvider/index.d.ts +0 -1
- package/ChartDataProvider/index.js +0 -16
- package/ChartDataProvider/index.mjs +0 -2
- package/ChartDataProviderPro/ChartDataProviderPro.d.mts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.js +0 -30
- package/ChartDataProviderPro/ChartDataProviderPro.mjs +0 -21
- package/ChartDataProviderPro/index.d.mts +0 -2
- package/ChartDataProviderPro/index.d.ts +0 -2
- package/ChartDataProviderPro/index.js +0 -13
- package/ChartDataProviderPro/index.mjs +0 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.d.mts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -12
- package/ChartDataProviderPro/useChartDataProviderProProps.mjs +0 -8
- package/FunnelChart/funnelSectionClasses.d.mts +0 -30
- package/FunnelChart/funnelSectionClasses.d.ts +0 -30
- package/FunnelChart/funnelSectionClasses.js +0 -44
- package/FunnelChart/funnelSectionClasses.mjs +0 -35
- package/Heatmap/internals/HeatmapCell.d.mts +0 -21
- package/Heatmap/internals/HeatmapCell.d.ts +0 -21
- package/Heatmap/internals/HeatmapCell.js +0 -18
- package/Heatmap/internals/HeatmapCell.mjs +0 -12
- package/tests/constants.js +0 -7
- package/tests/constants.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import composeClasses from '@mui/utils/composeClasses';
|
|
2
|
-
import { getChartsTooltipUtilityClass } from '@mui/x-charts/
|
|
2
|
+
import { getChartsTooltipUtilityClass } from '@mui/x-charts/internals';
|
|
3
3
|
export const useUtilityClasses = props => {
|
|
4
4
|
const {
|
|
5
5
|
classes
|
|
@@ -21,21 +21,23 @@ function HeatmapTooltipContent(props) {
|
|
|
21
21
|
const yAxis = (0, _hooks.useYAxis)();
|
|
22
22
|
const heatmapSeries = (0, _useHeatmapSeries.useHeatmapSeriesContext)();
|
|
23
23
|
const tooltipData = (0, _ChartsTooltip.useItemTooltip)();
|
|
24
|
-
|
|
25
|
-
if (!tooltipData || dataIndex === undefined || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
24
|
+
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
28
|
-
const {
|
|
29
|
-
series,
|
|
30
|
-
seriesOrder
|
|
31
|
-
} = heatmapSeries;
|
|
32
|
-
const seriesId = seriesOrder[0];
|
|
33
27
|
const {
|
|
34
28
|
color,
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
markType,
|
|
30
|
+
identifier
|
|
37
31
|
} = tooltipData;
|
|
38
|
-
const
|
|
32
|
+
const thisSeries = heatmapSeries.series[heatmapSeries.seriesOrder[0]];
|
|
33
|
+
const value = thisSeries.heatmapData.getValue(identifier.xIndex, identifier.yIndex) ?? null;
|
|
34
|
+
if (value === null) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const {
|
|
38
|
+
xIndex,
|
|
39
|
+
yIndex
|
|
40
|
+
} = identifier;
|
|
39
41
|
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
40
42
|
location: 'tooltip',
|
|
41
43
|
scale: xAxis.scale
|
|
@@ -44,10 +46,11 @@ function HeatmapTooltipContent(props) {
|
|
|
44
46
|
location: 'tooltip',
|
|
45
47
|
scale: yAxis.scale
|
|
46
48
|
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
47
|
-
const formattedValue =
|
|
48
|
-
|
|
49
|
+
const formattedValue = thisSeries.valueFormatter(value, {
|
|
50
|
+
xIndex,
|
|
51
|
+
yIndex
|
|
49
52
|
});
|
|
50
|
-
const seriesLabel = (0, _internals.getLabel)(
|
|
53
|
+
const seriesLabel = (0, _internals.getLabel)(thisSeries.label, 'tooltip');
|
|
51
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipPaper, {
|
|
52
55
|
className: classes.paper,
|
|
53
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipTable, {
|
|
@@ -15,21 +15,23 @@ export function HeatmapTooltipContent(props) {
|
|
|
15
15
|
const yAxis = useYAxis();
|
|
16
16
|
const heatmapSeries = useHeatmapSeriesContext();
|
|
17
17
|
const tooltipData = useItemTooltip();
|
|
18
|
-
|
|
19
|
-
if (!tooltipData || dataIndex === undefined || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
18
|
+
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
|
-
const {
|
|
23
|
-
series,
|
|
24
|
-
seriesOrder
|
|
25
|
-
} = heatmapSeries;
|
|
26
|
-
const seriesId = seriesOrder[0];
|
|
27
21
|
const {
|
|
28
22
|
color,
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
markType,
|
|
24
|
+
identifier
|
|
31
25
|
} = tooltipData;
|
|
32
|
-
const
|
|
26
|
+
const thisSeries = heatmapSeries.series[heatmapSeries.seriesOrder[0]];
|
|
27
|
+
const value = thisSeries.heatmapData.getValue(identifier.xIndex, identifier.yIndex) ?? null;
|
|
28
|
+
if (value === null) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const {
|
|
32
|
+
xIndex,
|
|
33
|
+
yIndex
|
|
34
|
+
} = identifier;
|
|
33
35
|
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
34
36
|
location: 'tooltip',
|
|
35
37
|
scale: xAxis.scale
|
|
@@ -38,10 +40,11 @@ export function HeatmapTooltipContent(props) {
|
|
|
38
40
|
location: 'tooltip',
|
|
39
41
|
scale: yAxis.scale
|
|
40
42
|
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
41
|
-
const formattedValue =
|
|
42
|
-
|
|
43
|
+
const formattedValue = thisSeries.valueFormatter(value, {
|
|
44
|
+
xIndex,
|
|
45
|
+
yIndex
|
|
43
46
|
});
|
|
44
|
-
const seriesLabel = getLabel(
|
|
47
|
+
const seriesLabel = getLabel(thisSeries.label, 'tooltip');
|
|
45
48
|
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
46
49
|
className: classes.paper,
|
|
47
50
|
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { HeatmapCellOwnerState } from "./HeatmapCell.mjs";
|
|
1
2
|
export interface HeatmapClasses {
|
|
3
|
+
/** Styles applied to the heatmap plot root element. */
|
|
4
|
+
root: string;
|
|
2
5
|
/** Styles applied to the heatmap cells. */
|
|
3
6
|
cell: string;
|
|
4
7
|
/**
|
|
@@ -14,9 +17,11 @@ export interface HeatmapClasses {
|
|
|
14
17
|
/**
|
|
15
18
|
* Styles applied to the root element for a specified series.
|
|
16
19
|
* Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`.
|
|
20
|
+
* @deprecated Use `[data-series="${seriesId}"]` selector instead.
|
|
17
21
|
*/
|
|
18
22
|
series: string;
|
|
19
23
|
}
|
|
20
24
|
export type HeatmapClassKey = keyof HeatmapClasses;
|
|
21
25
|
export declare function getHeatmapUtilityClass(slot: string): string;
|
|
22
|
-
export declare const heatmapClasses: HeatmapClasses;
|
|
26
|
+
export declare const heatmapClasses: HeatmapClasses;
|
|
27
|
+
export declare const useUtilityClasses: (ownerState: HeatmapCellOwnerState) => Record<"cell" | "root", string>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { HeatmapCellOwnerState } from "./HeatmapCell.js";
|
|
1
2
|
export interface HeatmapClasses {
|
|
3
|
+
/** Styles applied to the heatmap plot root element. */
|
|
4
|
+
root: string;
|
|
2
5
|
/** Styles applied to the heatmap cells. */
|
|
3
6
|
cell: string;
|
|
4
7
|
/**
|
|
@@ -14,9 +17,11 @@ export interface HeatmapClasses {
|
|
|
14
17
|
/**
|
|
15
18
|
* Styles applied to the root element for a specified series.
|
|
16
19
|
* Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`.
|
|
20
|
+
* @deprecated Use `[data-series="${seriesId}"]` selector instead.
|
|
17
21
|
*/
|
|
18
22
|
series: string;
|
|
19
23
|
}
|
|
20
24
|
export type HeatmapClassKey = keyof HeatmapClasses;
|
|
21
25
|
export declare function getHeatmapUtilityClass(slot: string): string;
|
|
22
|
-
export declare const heatmapClasses: HeatmapClasses;
|
|
26
|
+
export declare const heatmapClasses: HeatmapClasses;
|
|
27
|
+
export declare const useUtilityClasses: (ownerState: HeatmapCellOwnerState) => Record<"cell" | "root", string>;
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getHeatmapUtilityClass = getHeatmapUtilityClass;
|
|
8
|
-
exports.heatmapClasses = void 0;
|
|
8
|
+
exports.useUtilityClasses = exports.heatmapClasses = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
11
12
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
12
13
|
function getHeatmapUtilityClass(slot) {
|
|
13
14
|
// Those should be common to all charts
|
|
@@ -16,7 +17,21 @@ function getHeatmapUtilityClass(slot) {
|
|
|
16
17
|
}
|
|
17
18
|
return (0, _generateUtilityClass.default)('MuiHeatmap', slot);
|
|
18
19
|
}
|
|
19
|
-
const heatmapClasses = exports.heatmapClasses = (0, _extends2.default)({}, (0, _generateUtilityClasses.default)('MuiHeatmap', ['cell', 'series']), {
|
|
20
|
+
const heatmapClasses = exports.heatmapClasses = (0, _extends2.default)({}, (0, _generateUtilityClasses.default)('MuiHeatmap', ['root', 'cell', 'series']), {
|
|
20
21
|
highlighted: 'Charts-highlighted',
|
|
21
22
|
faded: 'Charts-faded'
|
|
22
|
-
});
|
|
23
|
+
});
|
|
24
|
+
const useUtilityClasses = ownerState => {
|
|
25
|
+
const {
|
|
26
|
+
classes,
|
|
27
|
+
seriesId,
|
|
28
|
+
isFaded,
|
|
29
|
+
isHighlighted
|
|
30
|
+
} = ownerState;
|
|
31
|
+
const slots = {
|
|
32
|
+
root: ['root'],
|
|
33
|
+
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
34
|
+
};
|
|
35
|
+
return (0, _composeClasses.default)(slots, getHeatmapUtilityClass, classes);
|
|
36
|
+
};
|
|
37
|
+
exports.useUtilityClasses = useUtilityClasses;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
3
4
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
4
5
|
export function getHeatmapUtilityClass(slot) {
|
|
5
6
|
// Those should be common to all charts
|
|
@@ -8,7 +9,20 @@ export function getHeatmapUtilityClass(slot) {
|
|
|
8
9
|
}
|
|
9
10
|
return generateUtilityClass('MuiHeatmap', slot);
|
|
10
11
|
}
|
|
11
|
-
export const heatmapClasses = _extends({}, generateUtilityClasses('MuiHeatmap', ['cell', 'series']), {
|
|
12
|
+
export const heatmapClasses = _extends({}, generateUtilityClasses('MuiHeatmap', ['root', 'cell', 'series']), {
|
|
12
13
|
highlighted: 'Charts-highlighted',
|
|
13
14
|
faded: 'Charts-faded'
|
|
14
|
-
});
|
|
15
|
+
});
|
|
16
|
+
export const useUtilityClasses = ownerState => {
|
|
17
|
+
const {
|
|
18
|
+
classes,
|
|
19
|
+
seriesId,
|
|
20
|
+
isFaded,
|
|
21
|
+
isHighlighted
|
|
22
|
+
} = ownerState;
|
|
23
|
+
const slots = {
|
|
24
|
+
root: ['root'],
|
|
25
|
+
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
26
|
+
};
|
|
27
|
+
return composeClasses(slots, getHeatmapUtilityClass, classes);
|
|
28
|
+
};
|
package/Heatmap/index.d.mts
CHANGED
|
@@ -3,7 +3,9 @@ export type { HeatmapSeries, HeatmapProps, HeatmapSlots, HeatmapSlotProps } from
|
|
|
3
3
|
export { HeatmapPlot, type HeatmapPlotProps } from "./HeatmapPlot.mjs";
|
|
4
4
|
export type { HeatmapPlotSlots, HeatmapPlotSlotProps } from "./Heatmap.types.mjs";
|
|
5
5
|
export * from "./FocusedHeatmapCell.mjs";
|
|
6
|
-
export
|
|
6
|
+
export { HeatmapCell } from "./HeatmapCell.mjs";
|
|
7
|
+
export type { HeatmapCellProps, HeatmapCellOwnerState } from "./HeatmapCell.mjs";
|
|
7
8
|
export * from "./HeatmapTooltip/index.mjs";
|
|
8
9
|
export * from "./Heatmap.plugins.mjs";
|
|
9
|
-
export
|
|
10
|
+
export { heatmapClasses } from "./heatmapClasses.mjs";
|
|
11
|
+
export type { HeatmapClasses, HeatmapClassKey } from "./heatmapClasses.mjs";
|
package/Heatmap/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export type { HeatmapSeries, HeatmapProps, HeatmapSlots, HeatmapSlotProps } from
|
|
|
3
3
|
export { HeatmapPlot, type HeatmapPlotProps } from "./HeatmapPlot.js";
|
|
4
4
|
export type { HeatmapPlotSlots, HeatmapPlotSlotProps } from "./Heatmap.types.js";
|
|
5
5
|
export * from "./FocusedHeatmapCell.js";
|
|
6
|
-
export
|
|
6
|
+
export { HeatmapCell } from "./HeatmapCell.js";
|
|
7
|
+
export type { HeatmapCellProps, HeatmapCellOwnerState } from "./HeatmapCell.js";
|
|
7
8
|
export * from "./HeatmapTooltip/index.js";
|
|
8
9
|
export * from "./Heatmap.plugins.js";
|
|
9
|
-
export
|
|
10
|
+
export { heatmapClasses } from "./heatmapClasses.js";
|
|
11
|
+
export type { HeatmapClasses, HeatmapClassKey } from "./heatmapClasses.js";
|
package/Heatmap/index.js
CHANGED
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Heatmap: true,
|
|
8
|
-
HeatmapPlot: true
|
|
8
|
+
HeatmapPlot: true,
|
|
9
|
+
HeatmapCell: true,
|
|
10
|
+
heatmapClasses: true
|
|
9
11
|
};
|
|
10
12
|
Object.defineProperty(exports, "Heatmap", {
|
|
11
13
|
enumerable: true,
|
|
@@ -13,12 +15,24 @@ Object.defineProperty(exports, "Heatmap", {
|
|
|
13
15
|
return _Heatmap.Heatmap;
|
|
14
16
|
}
|
|
15
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "HeatmapCell", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _HeatmapCell.HeatmapCell;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
16
24
|
Object.defineProperty(exports, "HeatmapPlot", {
|
|
17
25
|
enumerable: true,
|
|
18
26
|
get: function () {
|
|
19
27
|
return _HeatmapPlot.HeatmapPlot;
|
|
20
28
|
}
|
|
21
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "heatmapClasses", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _heatmapClasses.heatmapClasses;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
22
36
|
var _Heatmap = require("./Heatmap");
|
|
23
37
|
var _HeatmapPlot = require("./HeatmapPlot");
|
|
24
38
|
var _FocusedHeatmapCell = require("./FocusedHeatmapCell");
|
|
@@ -33,6 +47,7 @@ Object.keys(_FocusedHeatmapCell).forEach(function (key) {
|
|
|
33
47
|
}
|
|
34
48
|
});
|
|
35
49
|
});
|
|
50
|
+
var _HeatmapCell = require("./HeatmapCell");
|
|
36
51
|
var _HeatmapTooltip = require("./HeatmapTooltip");
|
|
37
52
|
Object.keys(_HeatmapTooltip).forEach(function (key) {
|
|
38
53
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -57,15 +72,4 @@ Object.keys(_Heatmap2).forEach(function (key) {
|
|
|
57
72
|
}
|
|
58
73
|
});
|
|
59
74
|
});
|
|
60
|
-
var _heatmapClasses = require("./heatmapClasses");
|
|
61
|
-
Object.keys(_heatmapClasses).forEach(function (key) {
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
-
if (key in exports && exports[key] === _heatmapClasses[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _heatmapClasses[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
75
|
+
var _heatmapClasses = require("./heatmapClasses");
|
package/Heatmap/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Heatmap } from "./Heatmap.mjs";
|
|
2
2
|
export { HeatmapPlot } from "./HeatmapPlot.mjs";
|
|
3
3
|
export * from "./FocusedHeatmapCell.mjs";
|
|
4
|
+
export { HeatmapCell } from "./HeatmapCell.mjs";
|
|
4
5
|
export * from "./HeatmapTooltip/index.mjs";
|
|
5
6
|
export * from "./Heatmap.plugins.mjs";
|
|
6
|
-
export
|
|
7
|
+
export { heatmapClasses } from "./heatmapClasses.mjs";
|
|
@@ -7,9 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
8
8
|
const zColorScale = zAxis?.colorScale;
|
|
9
9
|
if (zColorScale) {
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
return value => {
|
|
11
|
+
if (value === null) {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
const color = zColorScale(value);
|
|
13
15
|
if (color === null) {
|
|
14
16
|
return '';
|
|
15
17
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
2
2
|
const zColorScale = zAxis?.colorScale;
|
|
3
3
|
if (zColorScale) {
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
return value => {
|
|
5
|
+
if (value === null) {
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
const color = zColorScale(value);
|
|
7
9
|
if (color === null) {
|
|
8
10
|
return '';
|
|
9
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartState, UseChartCartesianAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SeriesItemIdentifierWithData } from '@mui/x-charts/models';
|
|
3
3
|
export default function getItemAtPosition(state: ChartState<[UseChartCartesianAxisSignature]>, point: {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
|
-
}):
|
|
6
|
+
}): SeriesItemIdentifierWithData<'heatmap'> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartState, UseChartCartesianAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SeriesItemIdentifierWithData } from '@mui/x-charts/models';
|
|
3
3
|
export default function getItemAtPosition(state: ChartState<[UseChartCartesianAxisSignature]>, point: {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
|
-
}):
|
|
6
|
+
}): SeriesItemIdentifierWithData<'heatmap'> | undefined;
|
|
@@ -26,20 +26,12 @@ function getItemAtPosition(state, point) {
|
|
|
26
26
|
if (xIndex === -1 || yIndex === -1) {
|
|
27
27
|
return undefined;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
if (dataIndex === -1) {
|
|
31
|
-
return {
|
|
32
|
-
type: 'heatmap',
|
|
33
|
-
seriesId,
|
|
34
|
-
xIndex,
|
|
35
|
-
yIndex
|
|
36
|
-
};
|
|
37
|
-
}
|
|
29
|
+
const value = series?.series[series.seriesOrder[0]].heatmapData.getValue(xIndex, yIndex) ?? null;
|
|
38
30
|
return {
|
|
39
31
|
type: 'heatmap',
|
|
40
32
|
seriesId,
|
|
41
|
-
dataIndex,
|
|
42
33
|
xIndex,
|
|
43
|
-
yIndex
|
|
34
|
+
yIndex,
|
|
35
|
+
value
|
|
44
36
|
};
|
|
45
37
|
}
|
|
@@ -20,20 +20,12 @@ export default function getItemAtPosition(state, point) {
|
|
|
20
20
|
if (xIndex === -1 || yIndex === -1) {
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
if (dataIndex === -1) {
|
|
25
|
-
return {
|
|
26
|
-
type: 'heatmap',
|
|
27
|
-
seriesId,
|
|
28
|
-
xIndex,
|
|
29
|
-
yIndex
|
|
30
|
-
};
|
|
31
|
-
}
|
|
23
|
+
const value = series?.series[series.seriesOrder[0]].heatmapData.getValue(xIndex, yIndex) ?? null;
|
|
32
24
|
return {
|
|
33
25
|
type: 'heatmap',
|
|
34
26
|
seriesId,
|
|
35
|
-
dataIndex,
|
|
36
27
|
xIndex,
|
|
37
|
-
yIndex
|
|
28
|
+
yIndex,
|
|
29
|
+
value
|
|
38
30
|
};
|
|
39
31
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const identifierCleaner = identifier => {
|
|
8
|
+
return {
|
|
9
|
+
type: identifier.type,
|
|
10
|
+
seriesId: identifier.seriesId,
|
|
11
|
+
xIndex: identifier.xIndex,
|
|
12
|
+
yIndex: identifier.yIndex
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
var _default = exports.default = identifierCleaner;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const identifierSerializer = identifier => {
|
|
9
|
+
return `${(0, _internals.typeSerializer)(identifier.type)}${(0, _internals.seriesIdSerializer)(identifier.seriesId)}X(${identifier.xIndex})Y(${identifier.yIndex})`;
|
|
10
|
+
};
|
|
11
|
+
var _default = exports.default = identifierSerializer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { typeSerializer, seriesIdSerializer } from '@mui/x-charts/internals';
|
|
2
|
+
const identifierSerializer = identifier => {
|
|
3
|
+
return `${typeSerializer(identifier.type)}${seriesIdSerializer(identifier.seriesId)}X(${identifier.xIndex})Y(${identifier.yIndex})`;
|
|
4
|
+
};
|
|
5
|
+
export default identifierSerializer;
|
|
@@ -15,6 +15,8 @@ var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
|
15
15
|
var _getItemAtPosition = _interopRequireDefault(require("./getItemAtPosition"));
|
|
16
16
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
17
17
|
var _highlight = require("./highlight");
|
|
18
|
+
var _identifierSerializer = _interopRequireDefault(require("./identifierSerializer"));
|
|
19
|
+
var _identifierCleaner = _interopRequireDefault(require("./identifierCleaner"));
|
|
18
20
|
_internals.cartesianSeriesTypes.addType('heatmap');
|
|
19
21
|
const heatmapSeriesConfig = exports.heatmapSeriesConfig = {
|
|
20
22
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -25,8 +27,8 @@ const heatmapSeriesConfig = exports.heatmapSeriesConfig = {
|
|
|
25
27
|
xExtremumGetter: _extremums.getBaseExtremum,
|
|
26
28
|
yExtremumGetter: _extremums.getBaseExtremum,
|
|
27
29
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
28
|
-
identifierSerializer:
|
|
29
|
-
identifierCleaner:
|
|
30
|
+
identifierSerializer: _identifierSerializer.default,
|
|
31
|
+
identifierCleaner: _identifierCleaner.default,
|
|
30
32
|
getItemAtPosition: _getItemAtPosition.default,
|
|
31
33
|
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
32
34
|
isHighlightedCreator: _highlight.createIsHighlighted,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cartesianSeriesTypes
|
|
1
|
+
import { cartesianSeriesTypes } from '@mui/x-charts/internals';
|
|
2
2
|
import { getBaseExtremum } from "./extremums.mjs";
|
|
3
3
|
import seriesProcessor from "./seriesProcessor.mjs";
|
|
4
4
|
import getColor from "./getColor.mjs";
|
|
@@ -8,6 +8,8 @@ import tooltipItemPositionGetter from "./tooltipPosition.mjs";
|
|
|
8
8
|
import getItemAtPosition from "./getItemAtPosition.mjs";
|
|
9
9
|
import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
|
|
10
10
|
import { createIsFaded, createIsHighlighted } from "./highlight.mjs";
|
|
11
|
+
import identifierSerializer from "./identifierSerializer.mjs";
|
|
12
|
+
import identifierCleaner from "./identifierCleaner.mjs";
|
|
11
13
|
cartesianSeriesTypes.addType('heatmap');
|
|
12
14
|
export const heatmapSeriesConfig = {
|
|
13
15
|
seriesProcessor,
|
|
@@ -18,8 +20,8 @@ export const heatmapSeriesConfig = {
|
|
|
18
20
|
xExtremumGetter: getBaseExtremum,
|
|
19
21
|
yExtremumGetter: getBaseExtremum,
|
|
20
22
|
getSeriesWithDefaultValues,
|
|
21
|
-
identifierSerializer
|
|
22
|
-
identifierCleaner
|
|
23
|
+
identifierSerializer,
|
|
24
|
+
identifierCleaner,
|
|
23
25
|
getItemAtPosition,
|
|
24
26
|
keyboardFocusHandler,
|
|
25
27
|
isHighlightedCreator: createIsHighlighted,
|
|
@@ -13,30 +13,17 @@ function getFirstCell(state) {
|
|
|
13
13
|
if (!seriesId || !series || !data || data.length === 0) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
-
const dataIndex = data.findIndex(value => value[0] === 0 && value[1] === 0);
|
|
17
|
-
if (dataIndex === -1) {
|
|
18
|
-
return {
|
|
19
|
-
type: 'heatmap',
|
|
20
|
-
seriesId,
|
|
21
|
-
xIndex: 0,
|
|
22
|
-
yIndex: 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
16
|
return {
|
|
26
17
|
type: 'heatmap',
|
|
27
18
|
seriesId,
|
|
28
|
-
dataIndex,
|
|
29
19
|
xIndex: 0,
|
|
30
20
|
yIndex: 0
|
|
31
21
|
};
|
|
32
22
|
}
|
|
33
|
-
const updateCoordinates = (newXIndex, newYIndex, currentItem
|
|
34
|
-
const seriesData = state.series.defaultizedSeries.heatmap?.series[currentItem.seriesId]?.data;
|
|
35
|
-
const dataIndex = seriesData?.findIndex(value => value[0] === newXIndex && value[1] === newYIndex);
|
|
23
|
+
const updateCoordinates = (newXIndex, newYIndex, currentItem) => {
|
|
36
24
|
return (0, _extends2.default)({}, currentItem, {
|
|
37
25
|
xIndex: newXIndex,
|
|
38
|
-
yIndex: newYIndex
|
|
39
|
-
dataIndex: dataIndex === -1 || dataIndex === undefined ? undefined : dataIndex
|
|
26
|
+
yIndex: newYIndex
|
|
40
27
|
});
|
|
41
28
|
};
|
|
42
29
|
const keyboardFocusHandler = event => {
|
|
@@ -50,7 +37,7 @@ const keyboardFocusHandler = event => {
|
|
|
50
37
|
if (currentItem.xIndex + 1 === (maxLength ?? 0)) {
|
|
51
38
|
return currentItem;
|
|
52
39
|
}
|
|
53
|
-
return updateCoordinates(currentItem.xIndex + 1, currentItem.yIndex, currentItem
|
|
40
|
+
return updateCoordinates(currentItem.xIndex + 1, currentItem.yIndex, currentItem);
|
|
54
41
|
};
|
|
55
42
|
case 'ArrowLeft':
|
|
56
43
|
return (currentItem, state) => {
|
|
@@ -60,7 +47,7 @@ const keyboardFocusHandler = event => {
|
|
|
60
47
|
if (currentItem.xIndex - 1 < 0) {
|
|
61
48
|
return currentItem;
|
|
62
49
|
}
|
|
63
|
-
return updateCoordinates(currentItem.xIndex - 1, currentItem.yIndex, currentItem
|
|
50
|
+
return updateCoordinates(currentItem.xIndex - 1, currentItem.yIndex, currentItem);
|
|
64
51
|
};
|
|
65
52
|
case 'ArrowDown':
|
|
66
53
|
return (currentItem, state) => {
|
|
@@ -71,7 +58,7 @@ const keyboardFocusHandler = event => {
|
|
|
71
58
|
if (currentItem.yIndex + 1 === (maxLength ?? 0)) {
|
|
72
59
|
return currentItem;
|
|
73
60
|
}
|
|
74
|
-
return updateCoordinates(currentItem.xIndex, currentItem.yIndex + 1, currentItem
|
|
61
|
+
return updateCoordinates(currentItem.xIndex, currentItem.yIndex + 1, currentItem);
|
|
75
62
|
};
|
|
76
63
|
case 'ArrowUp':
|
|
77
64
|
return (currentItem, state) => {
|
|
@@ -81,7 +68,7 @@ const keyboardFocusHandler = event => {
|
|
|
81
68
|
if (currentItem.yIndex - 1 < 0) {
|
|
82
69
|
return currentItem;
|
|
83
70
|
}
|
|
84
|
-
return updateCoordinates(currentItem.xIndex, currentItem.yIndex - 1, currentItem
|
|
71
|
+
return updateCoordinates(currentItem.xIndex, currentItem.yIndex - 1, currentItem);
|
|
85
72
|
};
|
|
86
73
|
default:
|
|
87
74
|
return null;
|