Skip to content
Closed
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
13 changes: 8 additions & 5 deletions src/component/visualMap/ContinuousView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class ContinuousView extends VisualMapView {

private _api: ExtensionAPI;

private _ownHoverLinkFromSeriesMouseOver = (e: ElementEvent) => this._hoverLinkFromSeriesMouseOver(e);

private _ownHideIndicator = () => this._hideIndicator();
Comment on lines +112 to +114
Copy link
Copy Markdown
Member

@plainheart plainheart Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can refer to the SliderZoomView and use the same strategy.

Note that since some codes use this.api rather than this._api, you may need to change them to this._api after overriding the init function. And the assignment to this._api in doRender function can be moved into the init function.


doRender(
visualMapModel: ContinuousModel,
Expand Down Expand Up @@ -749,8 +752,8 @@ class ContinuousView extends VisualMapView {
const zr = this.api.getZr();

if (this.visualMapModel.option.hoverLink) {
zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);
zr.on('mouseout', this._hideIndicator, this);
zr.on('mouseover', this._ownHoverLinkFromSeriesMouseOver, this);
zr.on('mouseout', this._ownHideIndicator, this);
}
else {
this._clearHoverLinkFromSeries();
Expand Down Expand Up @@ -866,8 +869,8 @@ class ContinuousView extends VisualMapView {
this._hideIndicator();

const zr = this.api.getZr();
zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);
zr.off('mouseout', this._hideIndicator);
zr.off('mouseover', this._ownHoverLinkFromSeriesMouseOver);
zr.off('mouseout', this._ownHideIndicator);
}
private _applyTransform(vertex: number[], element: Element, inverse?: boolean, global?: boolean): number[]
private _applyTransform(vertex: Direction, element: Element, inverse?: boolean, global?: boolean): Direction
Expand Down Expand Up @@ -947,4 +950,4 @@ function getCursor(orient: Orient) {
return orient === 'vertical' ? 'ns-resize' : 'ew-resize';
}

export default ContinuousView;
export default ContinuousView;
22 changes: 22 additions & 0 deletions test/ut/core/utHelper.ts

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

26 changes: 24 additions & 2 deletions test/ut/spec/component/visualMap/setOption.test.ts

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

3 changes: 2 additions & 1 deletion test/ut/tsconfig.json

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