antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

[Feat]: Make getNeighborIds in ClickSelect public #6871

Bergiu posted onGitHub

Describe the feature / 功能描述

I was trying to implement a custom hover+click selection that would highlight a path in a graph instead of neighborhood. Adding that behavior to HoverActive was easy, because I was allowed to overwrite the getActiveIds method. But for ClickSelect it was more difficult, because the getNeighbotIds method is private (so I needed to monkey patch it).

I think it would be better to make the getNeighborIds method public, such that developers can easily extend the class to match their own behavior. Also it might be worth of renaming that function to getActiveIds like in the HoverActive class. Both changes together would make the apis to those classes more similar.

Image The image shows the differences in the extension of those classes and the mentioned monkey patch. It's not a big deal for me as a developer, but unpleasant.

Are you willing to contribute? / 是否愿意参与贡献?

✅ Yes / 是


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests