Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/chart/heatmap/HeatmapSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface HeatmapDataItemOption extends HeatmapStateOption, StatesOptionM
export interface HeatmapSeriesOption extends SeriesOption<HeatmapStateOption>, HeatmapStateOption,
SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin, SeriesEncodeOptionMixin {
type?: 'heatmap'
strictlyAligned?: boolean;

coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar'

Expand Down Expand Up @@ -112,7 +113,8 @@ class HeatmapSeriesModel extends SeriesModel<HeatmapSeriesOption> {
itemStyle: {
borderColor: '#212121'
}
}
},
strictlyAligned: false,
};
}

Expand Down
7 changes: 6 additions & 1 deletion src/chart/heatmap/HeatmapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ class HeatmapView extends ChartView {
]);

rect = new graphic.Rect({
shape: {
shape: seriesModel.option.strictlyAligned ? {
x: point[0] - width / 2,
y: point[1] - height / 2,
width: width,
height: height
} : {
x: Math.floor(Math.round(point[0]) - width / 2),
y: Math.floor(Math.round(point[1]) - height / 2),
width: Math.ceil(width),
Expand Down
182 changes: 182 additions & 0 deletions test/heatmap-strictly-aligned.html

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