reaflow
reaflow copied to clipboard
Context Menu
Figure out best way to do a context menu on a node.
I could use such a feature, it'd need to be extendable (configuring which actions are possible through the menu).
For instance, built-in actions could be:
- Delete
By context menu, I assume you mean something that displays upon right-click on a node?
Edges could also benefit from this, with delete and "Edit label" built-in actions would be very useful IMHO.
Ya - its tricky because its SVG + DOM mixture w/ screen position relativity.
I see, similar to the issue I opened recently with Add component.
Extending the Node component with a new property like ContextMenu
that's displayed relatively to the Node might work out, no? It's a bit similar to children? Except it would appear on top of other elements and would't need to redraw the whole canvas.
I used blueprintjs for that
I'm not sure that graph visualisation library should implement context menus
@emil14 - +1 - I was not going to make it part of the core - was planning to make a helper component users could apply.
I have a library that does context menus that I'm planning to enhance to try and solve this - https://reaviz.github.io/rdk/?path=/story/examples-overlay-connected-overlay--context-menu-example
Yeah, I don't necessarily want it as part of the core, but simply have an example of how to add one would be a great start!
Assign this issue to me, I'll add an example