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.


force direction in hierarchical layout

0 votes
Is it possible to force the direction in the automatic hierarchical layout? e.g from top to bottom so that no directed graph points from bottom to top?

yEd does normaly, but often seams to prefere other things (like compact groups) over the graph direction.

thanks for the great software
in Help by (300 points)

1 Answer

0 votes

Actually, edge direction is the highest priority for hierarchical layout. The algorithm violates that only if you explicitly tell it to do so (e.g. by choosing the BFS layerer or from sketch layout). The priority for compact groups is always lower than the priority for edge direction.

Please note, that the direction of an edge is determined at creation time and does not depend on the chosen arrows!

Please note also, that for graphs with cycles, there is no way for all edges to point in the same direction.

That said, there's always the possibility of a bug in the hierarchical layout that leads to wrong results. If you can upload a GraphML file and corresponding settings here, we could investigate and maybe clear up the issue.

by [yWorks] (160k points)
Maybe direction conflicts with creating good looking groups? Or i missinterpreted some settings?

Anyway i put a demo with 5 nodes and one group here <http://www.ogersoft.at/temp/yworks1.txt> because it was too long to fit into the comment box and I did not know to upload elsewhere.

The nodes are straight in line (no cycles) but one immediate node outside the group.

Thank you for having a look at it.
Thank you very much for the additional information.

The problem lies with setting "Grouping" -> "Layering Strategy" (zu Deutsch "Gruppierung" -> "Strategie für Schichtzuweisung") in the Hierarchical layout settings. If you set this option back to its default value "Ignore Groups" (zu Deutsch "Gruppen ignorieren") the algorithm will produce the desired result.

This option is hard to explain without getting very technical. However, if you are really interested you will find additional information in the yFiles for Java Developer's Guide http://docs.yworks.com/yfiles/doc/developers-guide/incremental_hierarchical_layouter.html#ihl_hierarchically_organized_graphs and in the yFiles for Java API documentation http://docs.yworks.com/yfiles/doc/api/y/layout/hierarchic/IncrementalHierarchicLayouter.html#setRecursiveGroupLayeringEnabled(boolean) . Note, both of these links point to technical documentation intended for software developers/engineers.
Tanks. Looks like there are little things that cannot be done with yED ;-)
When first testing I had the feeling, that large graphs (about 1000 nodes) have a better layout with "Grouping" -> "Layering Strategy" -> "Layout Groups".
But now, when I understand the side-effects I will deactivate.
Legal Disclosure | Privacy Policy