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

onDoubleClickNode #194

Closed
henzesberger opened this issue Apr 11, 2019 · 5 comments
Closed

onDoubleClickNode #194

henzesberger opened this issue Apr 11, 2019 · 5 comments

Comments

@henzesberger
Copy link

Describe the solution you'd like
I'd like to have an onDoubleClickNode event, similar to onClickNode or onRightClickNode

Describe your use case
I'd like to be able to call a function when a user double-clicks a node in the graph.
In this case, onClickNode should not be called.

Additional context
Tried to implement it myself using a simple copy and replace approach but it didn't work because the onClickNode is always called.

Double-click in D3

@danielcaldas
Copy link
Owner

Thanks for the suggestion. This should be fairly easy to implement within our Node component. You just need to make sure that the callback is exposed through the react-d3-graph Graph API so that people can actually provide the callback through the top level API. If you want to give it a try, I would recommend you to look into mdn dblclick event and simply implement a call to some handler in the Node component. This is something interesting to have that does not harm the react-d3-graph API at all.

Thanks for the suggestion.

@IgorMacGregor
Copy link
Contributor

Hello,
I would like to work on that issue ! :)

@danielcaldas
Copy link
Owner

Hello @IgorMacGregor, awesome, thanks for that. Tagged the issue with in progress

@stale stale bot added the wontfix label Jun 18, 2019
Repository owner deleted a comment from stale bot Jun 20, 2019
@stale stale bot removed the wontfix label Jun 20, 2019
@danielcaldas danielcaldas self-assigned this Jun 20, 2019
@danielcaldas
Copy link
Owner

This was merged, it will be included in the next release of react-d3-graph. Thanks a lot for your contribution @IgorMacGregor 🎉 @henzesberger @LonelyPrincess stay tuned 🙂

@danielcaldas
Copy link
Owner

Released in 2.1.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants