microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 302 forks source link

Edge routing issues after moving nodes #292

Closed dkuzakov closed 2 years ago

dkuzakov commented 3 years ago

There are two edge routing issues after moving nodes. 1) For routing mode EdgeRoutingMode.SugiyamaSplines : if there are multiple edges between two nodes (SugiyamaSplines.msagl example), after moving one of them these edges merge exactly into each other, so that I cannot see how many edges are there. 2) For routing mode EdgeRoutingMode.Rectilinear: if and edge starts and ends in the same node (Rectlinear.msagl example), after moving the node, edge merges right inside the node, so that I cannot see that edge anymore.

Issues.zip

dkuzakov commented 3 years ago

Here are some illustrations:

  1. Initial graph: Скриншот 2021-07-22 17 26 01 After moving node 2: Скриншот 2021-07-22 17 26 10

  2. Initial graph: Скриншот 2021-07-22 17 26 43 After moving node 1: Скриншот 2021-07-22 17 26 48

dkuzakov commented 3 years ago

One more notice about routing mode SugiyamaSplines. If I select an edge in initial graph, I can see the spline points. But after moving a node, incident edges lose the points. So I think that after moving a node, incident edges are always drawn with Straight Line strategy (what is absolutely not a desirable behaviour).

levnach commented 3 years ago

If you hold a Shift Key while dragging a node then the routing is smarter. bundle The switch to the straight line routing is done for performance reasons. Of course it can be fine tuned for smaller graphs, and can be improved otherwise.

dkuzakov commented 3 years ago

The switch to the straight line routing is done for performance reasons. Of course it can be fine tuned for smaller graphs, and can be improved otherwise.

Thanks for the answer! But is there a way to use the smart routing while moving without Shift? Maybe there is some parameter that I can provide to achieve this? Because for my graph straight lines are absolutely inappropriate. So I'd like to always see smart-routed graph even if it is slow.

levnach commented 3 years ago

I added property IncrementalDraggingModeAlways to IViewer in commit https://github.com/microsoft/automatic-graph-layout/commit/809ed40b1d7ad291f3cc12881a9539afb94e8d04. By default, this property is set to false. Set this property to true in GViewer and you will have the incremental smart&slow routing.