VizTooltip: Fix heatmap mode All (#86463)

This commit is contained in:
Adela Almasan
2024-04-17 23:24:13 +02:00
committed by GitHub
parent 82dd573ea4
commit 38fe9fcfd1
@@ -112,7 +112,11 @@ const HeatmapHoverCell = ({
let contentItems: VizTooltipItem[] = [];
const yValueIdx = index % (data.yBucketCount ?? 1);
const getYValueIndex = (idx: number) => {
return idx % (data.yBucketCount ?? 1);
};
let yValueIdx = getYValueIndex(index);
const xValueIdx = Math.floor(index / (data.yBucketCount ?? 1));
const getData = (idx: number = index) => {
@@ -182,6 +186,7 @@ const HeatmapHoverCell = ({
if (isSparse) {
({ xBucketMin, xBucketMax, yBucketMin, yBucketMax } = getSparseCellMinMax(data!, idx));
} else {
yValueIdx = getYValueIndex(idx);
getData(idx);
}