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(visualMap): fix continuous visualMap mouseover event not register except first countinous visualMap #19097

Merged
merged 3 commits into from Sep 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/component/visualMap/ContinuousView.ts
Expand Up @@ -108,17 +108,19 @@ class ContinuousView extends VisualMapView {

private _firstShowIndicator: boolean;

private _api: ExtensionAPI;
init(ecModel: GlobalModel, api: ExtensionAPI) {
super.init(ecModel, api);

this._hoverLinkFromSeriesMouseOver = zrUtil.bind(this._hoverLinkFromSeriesMouseOver, this);
this._hideIndicator = zrUtil.bind(this._hideIndicator, this);
}

doRender(
visualMapModel: ContinuousModel,
ecModel: GlobalModel,
api: ExtensionAPI,
payload: {type: string, from: string}
) {
this._api = api;

if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {
this._buildView();
}
Expand Down Expand Up @@ -711,7 +713,7 @@ class ContinuousView extends VisualMapView {
for (let i = 0; i < handleLabels.length; i++) {
// Fade out handle labels.
// NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
this._api.enterBlur(handleLabels[i]);
this.api.enterBlur(handleLabels[i]);
}
}
}
Expand Down Expand Up @@ -856,7 +858,7 @@ class ContinuousView extends VisualMapView {
for (let i = 0; i < handleLabels.length; i++) {
// Fade out handle labels.
// NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
this._api.leaveBlur(handleLabels[i]);
this.api.leaveBlur(handleLabels[i]);
}
}
}
Expand All @@ -874,6 +876,7 @@ class ContinuousView extends VisualMapView {
this._hideIndicator();

const zr = this.api.getZr();

zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);
zr.off('mouseout', this._hideIndicator);
}
Expand All @@ -892,7 +895,7 @@ class ContinuousView extends VisualMapView {
: graphic.transformDirection(vertex, transform, inverse);
}

// TODO: TYPE more specified payload types.
// TODO: TYPE more specified payload types.
private _dispatchHighDown(type: 'highlight' | 'downplay', batch: Payload['batch']) {
batch && batch.length && this.api.dispatchAction({
type: type,
Expand All @@ -908,14 +911,6 @@ class ContinuousView extends VisualMapView {
this._clearHoverLinkToSeries();
}

/**
* @override
*/
remove() {
this._clearHoverLinkFromSeries();
this._clearHoverLinkToSeries();
}

}

function createPolygon(
Expand Down
3 changes: 2 additions & 1 deletion test/runTest/actions/__meta__.json

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

1 change: 1 addition & 0 deletions test/runTest/actions/visualMap-multi-continuous.json

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