Skip to content

Commit df47699

Browse files
authored
fix: Fix gaps between heatmap cells
1 parent c4615f7 commit df47699

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/app/src/components/DBHeatmapChart/heatmapPaths.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ export function heatmapPaths(opts: {
5656
const bottom = valToPosY(y0s[i], scaleY, yDim, yOff);
5757
const top = valToPosY(y1s[i], scaleY, yDim, yOff);
5858

59+
// Snap both edges (not just the origin) so adjacent cells share a
60+
// pixel boundary; a fractional size leaves antialiased seams.
61+
const x0 = Math.round(left);
62+
const y0 = Math.round(bottom);
5963
rect(
6064
fillPaths[fills[i]],
61-
Math.round(left),
62-
Math.round(bottom),
63-
right - left,
64-
top - bottom,
65+
x0,
66+
y0,
67+
Math.round(right) - x0,
68+
Math.round(top) - y0,
6569
);
6670
}
6771
}

0 commit comments

Comments
 (0)