Skip to content

Commit

Permalink
fix(heatmap): fix labels that are not in calendar range are unexpecte…
Browse files Browse the repository at this point in the history
…dly displayed (resolves #20690)
  • Loading branch information
plainheart committed Jan 18, 2025
1 parent 1d4895f commit 2872e5c
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/chart/heatmap/HeatmapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,15 @@ class HeatmapView extends ChartView {
continue;
}

const contentShape = coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape;
// Ignore data that are not in range
if (isNaN(contentShape.x) || isNaN(contentShape.y)) {
continue;
}

rect = new graphic.Rect({
z2: 1,
shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,
shape: contentShape,
style
});
}
Expand Down
81 changes: 81 additions & 0 deletions test/calendar-heatmap2.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2872e5c

Please sign in to comment.