GoLayoutLayeredDigraph problem


#1

Hi,
I’m using the GoLayoutLayeredDigraph class to perform layouts on my GoView. I would like to arrange all connected nodes so that they are linked only vertically or horitontally. I’ve tried all DirectionOption alternatives but my links always end up bent in some way. I would like to have straight-line links only.
The nodes are GoMultiTextNodes and the ports used are the top, bottom and Right/Left ports are only used for the each node’s first text item.
Any help would be appreciated.
Thanks.


#2

Are you saying that you want your graph to basically be oriented vertically, using the links connecting top and bottom ports?
And that there are some secondary nodes that are attached to the main ones by left or right ports?
Did you want these secondary nodes to be in the same row (layer) as the main ones? What should happen when there is more than one such secondary node for a main one?


#3

Hi Walter.
Yes, I have primary nodes which are attached vertically (top / bottom ports) and have secondary nodes attached to them horitontally (right / left ports).
I would like to have many secondary nodes (all horizontally lined up with the first one). All secondary nodes on the same row should be placed next to each other. The second linked to the first, the third linked to the second, etc.
I will never have more than one secondary horizontal node connected to the same main node. Thus, the main node will always have only one right node attached to it. That right node could then also have a right node and so on.
The main node will also never have more than one vertical node attached to it’s bottom port.
Thanks.
Denis


#4

Are you saying that there is never any more than two links coming out of each node: at most one downward and at most one rightward? So this is just a tree?
The Classier example includes a tree-layout algorithm.