Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(heatmap): fix heatmap label may overlap when dataZoom is enabled #17876

Merged
merged 1 commit into from
Nov 7, 2022
Merged
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
8 changes: 5 additions & 3 deletions src/chart/heatmap/HeatmapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { StageHandlerProgressParams, Dictionary, OptionDataValue } from '../../u
import type Cartesian2D from '../../coord/cartesian/Cartesian2D';
import type Calendar from '../../coord/calendar/Calendar';
import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';
import Element from 'zrender/src/Element';
import type Element from 'zrender/src/Element';

// Coord can be 'geo' 'bmap' 'amap' 'leaflet'...
interface GeoLikeCoordSys extends CoordinateSystem {
Expand Down Expand Up @@ -94,7 +94,7 @@ function getIsInContinuousRange(dataExtent: number[], range: number[]) {

function isGeoCoordSys(coordSys: CoordinateSystem): coordSys is GeoLikeCoordSys {
const dimensions = coordSys.dimensions;
// Not use coorSys.type === 'geo' because coordSys maybe extended
// Not use coordSys.type === 'geo' because coordSys maybe extended
return dimensions[0] === 'lng' && dimensions[1] === 'lat';
}

Expand Down Expand Up @@ -235,6 +235,8 @@ class HeatmapView extends ChartView {

// Ignore empty data and out of extent data
if (isNaN(data.get(dataDims[2], idx) as number)
|| isNaN(dataDimX as number)
|| isNaN(dataDimY as number)
|| dataDimX < xAxisExtent[0]
|| dataDimX > xAxisExtent[1]
|| dataDimY < yAxisExtent[0]
Expand Down Expand Up @@ -271,7 +273,7 @@ class HeatmapView extends ChartView {
});
}

// Optimization for large datset
// Optimization for large dataset
if (data.hasItemOption) {
const itemModel = data.getItemModel<HeatmapDataItemOption>(idx);
const emphasisModel = itemModel.getModel('emphasis');
Expand Down
112 changes: 111 additions & 1 deletion test/heatmap.html

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

2 changes: 1 addition & 1 deletion test/runTest/actions/__meta__.json

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

2 changes: 1 addition & 1 deletion test/runTest/actions/heatmap.json

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