microsoft / automatic-graph-layout

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

Any suggestions to improve Sugiyama layout generated by Msagl? #290

Closed assopri closed 2 years ago

assopri commented 3 years ago

I'm trying to visualize MD file repositary with Devexpress XtraDiagram. I turn each particular file to the shape. MD links become connectors. Devexpress XtraDiagram supports using 3rd party layout calculators for generating Sugiyama layout. image

I use Microsoft.Msagl. Here is the layout I'm getting using Sugiyama layout just out of the box: image

By the way, here is node distribution, which another software (Obsidian) generates on the same repositary: image

I feel there are 2 things, that can improve situation: 1.Can I somehow distribute nodes along the canvas nor vertically elongated, neigher horizontally? I mean they should aim to distribute in a square: image

  1. Can I make empty nodes distribute not in one vertical line, but everywhere along the canvas (just just taking any available free space): image
levnach commented 3 years ago

Try MDSLayout. I think it will work better than the hierarchical/layered layout of Sugiyama.

assopri commented 3 years ago

Try MDSLayout. I think it will work better than the hierarchical/layered layout of Sugiyama.

Thank you! Working awesome:

image

Only one thing: maybe you have any ideas how I can evenly redistribute the set of not connected nodes in free space on diagram?

assopri commented 3 years ago

Or maybe there is at least some option to set the minimal allowable distance between such nodes?

image

levnach commented 3 years ago

I am not sure how to spread disconnected nodes evenly. To make a gap between the nodes use NodeSeparation.Is should be a property of MdsLayoutSettings.

assopri commented 3 years ago

I am not sure how to spread disconnected nodes evenly. To make a gap between the nodes use NodeSeparation.Is should be a property of MdsLayoutSettings.

Thank you! If effects diagram, however impacts just connected parts: image

image

levnach commented 3 years ago

@assopri, I fixed the node separation bug, https://github.com/microsoft/automatic-graph-layout/commit/62ce41ec87e1612e2cf5fddf6bf23f5cd6fd64db, it should work with MDS layout without touching NodeSeparation