reaflow icon indicating copy to clipboard operation
reaflow copied to clipboard

Context Menu

Open amcdnl opened this issue 4 years ago • 7 comments

Figure out best way to do a context menu on a node.

amcdnl avatar Nov 10 '20 16:11 amcdnl

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.

Vadorequest avatar Feb 05 '21 18:02 Vadorequest

Ya - its tricky because its SVG + DOM mixture w/ screen position relativity.

amcdnl avatar Feb 05 '21 18:02 amcdnl

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.

Vadorequest avatar Feb 05 '21 19:02 Vadorequest

I used blueprintjs for that

I'm not sure that graph visualisation library should implement context menus

emil14 avatar Oct 25 '21 23:10 emil14

@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

amcdnl avatar Oct 26 '21 12:10 amcdnl

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!

Vadorequest avatar Oct 26 '21 12:10 Vadorequest

Assign this issue to me, I'll add an example

emil14 avatar Oct 26 '21 21:10 emil14