netbox-community/netbox-topology-views

Allow dragging directly via grouping rectangles

Azmodeszer opened this issue · 3 comments

NetBox version

4.0.9

Topology Views version

4.0.1

Feature type

Change to existing functionality

Proposed functionality

When selecting a location/site/etc. group by clicking on their rectangle, one can drag around all included objects, but only after then selecting one of those objects and not the rectangle itself.

It would be more convenient and IMO intuitive to be able to drag around the groups via the rectangle itself.

Use case

Sometimes when you have a lot of objects in the topology clustered together and you want to quickly create some semblance of order, it's not always obvious to me which objects belong to which groups; the highlighting of selected icons helps a bit, but is not super apparent all the time, especially when zoomed out and/or stuff densely packed.

External dependencies

No response

I totally agree to your proposal. The problem is that the rectangles and the belonging click events are created by NTV while the drag feature is part of the vis-network engine we use. We would have to override the engine and we have to check if this is possible in a proper way. We use vis-network in order to not reinvent the wheel. It wouldn't be smart to break things the engine does.

Bad news. I wasted the last couple of hours to find a solution for this proposal. I couldn't get it to work even though I tried some very dirty hacks. I'm afraid we would have to completely override (and rewrite) the dragging events from vis-network. Frankly, I won't do that because it's a very bad idea.

If someone has a brilliant idea how to solve this in a smart way and wants to open a PR, I'd happily commit it.

Too bad. Appreciate the attempt anyway. :)