-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 point tooltip shared #3511
Fix point tooltip shared #3511
Conversation
Pull Request Test Coverage Report for Build 1014675773
💛 - Coveralls |
shapes.push((child as IGroup).getShape(x, y, ev)); | ||
} else if ((child as IShape).isHit(x, y)) { | ||
shapes.push(child); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
介绍下逻辑?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里直接参考了 g-base
包src/abstract/container.ts/getShape
方法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前是调用g-base
的getShape
方法,返回对应鼠标位置的shape
(只返回单个),我就参照g-base
,返回了对应鼠标位置的所有shapes
,然后,因为返回的shape[]
是个数组,就对g2/src/util/tooltip.ts
稍微做了些改造,所有的改造基本都是基于老逻辑的
@hustcc tooltip 默认只展示捕获到的最近的数据点(一个),这里处理了之后,就是把所有命中 🎯 的点获取到 但我觉得 shared 的话,应该是从数据上有一个关联关系去获取到,而不是这里的获取所有 hit points,你有其它解法吗 |
没有太看懂逻辑,这个 pr 是修复哪一个 issue 的? |
我也没看懂逻辑,你看下 issue |
Checklist
npm test
passesDescription of change
修复散点图存在多个点在同一位置下,开启shared无反应