react-d3-graph icon indicating copy to clipboard operation
react-d3-graph copied to clipboard

Adding an onRightClickGraph event.

Open ArnaudRib opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. Hello there ! I was looking for a way to catch a right click event on the graph (not on a node), but I've noticed the event wasn't catched. Following https://stackoverflow.com/a/31113000, the onContextMenu, or an equivalent, does not seem to be present on the tag in your source code.

Describe the solution you'd like Being able to do a <Graph ... onRightClickGraph={onRightClickGraph} ... /> or <Graph ... onContextMenu={onRightClickGraph} ... />

Describe your use case Being able to show a Menu on graph right click. The event should be different from onRightClickNode, which should still work correctly by only triggering onRightClickNode.

Describe alternatives you've considered Haven't found any alternative yet.

ArnaudRib avatar Jan 06 '21 10:01 ArnaudRib

Hi @ArnaudRib ,

To the best of my knowledge, this feature does not exist for now. However, onRightClickGraph would seem like a great feature and consistent with each graph element having a left and right click callback (onClickNode - onRightClickNode and onClickLink - onRightClickLink) but not the graph itself.

Feel free to submit a PR if you want to implement the feature.

antoninklopp avatar Jan 10 '21 13:01 antoninklopp

Agree with @antoninklopp; it seems like low-hanging fruit. We can pass along onRightClickXXX callbacks for the Graph's elements (nodes & links), including the Graph itself as described in a feature request.

danielcaldas avatar Jan 12 '21 11:01 danielcaldas

Up, do you have news about this feature ?

0xN0x avatar Apr 11 '22 09:04 0xN0x