Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.


Wasted vertical space in Hierarchical layout

0 votes

Using hierarchical layout, I always get loads of wasted vertical space, as shown by the big yellow arrows.  How to I fix this?

in Help by (870 points)

1 Answer

0 votes

Try different layout settings, e.g.

  • use "Grouping" -> "Layering Strategy" -> "Layout Groups" instead of "Ignore Groups"
  • reduce the value of "General" -> "Layer to Layer Distance"
  • use a different value for "Layers" -> "Layer Assignment Policy"
by [yWorks] (160k points)
I've tried all of those but it's still the same issue.  yEd seems to want to stretch everything vertically.

In that case, the space is a result of hierarchic layout's core strategy of assigning nodes to layers and the deep nesting levels of your graph.

E.g. have a look at this annotated image of your graph.

The red lines represent two consecutive layers for nodes in your diagram. Nodes in the same layer are placed on a horizontal line.

The green lines represent the layer distance due to the nesting depth of your nodes. (Actually, the layer distance might be even less if there are even more group nodes for that layer that are not in the image.)

If you have integrated labeling enabled, the vertical green distance is probably twice the minimal layer distance, because the algorithm has to fit your edge labels into the vertical green space as well.

In short, the placement is tight with respect to the algorithm's paradigm.

Is there a way to prevent yEd trying to layer things this way in hierarchical layout?
As I mentioned above, that is the core concept of the hierarchical layout algorithm.
It occurred to me that I maybe misunderstood your last question.
While it is not possible to prevent hierarchical layout from layering nodes, it is possible to choose from different layering strategies, see "Layers" -> "Layer Assignment Policy" in the hierarchical layout settings.
Maybe choosing one of the other strategies will produce an arrangement that is more to your liking.
Legal Disclosure | Privacy Policy