I am confused…
Is it right, that if I am layouting my diagram with GoLayoutLayeredDigraph or GoLayoutForceDirected the ports of the nodes are also new arranged?
Thanks for your answer.
No, those layout algorithms just reposition nodes – they don’t modify nodes in any other way.
Links get their stroke points modified, of course.
GoLayoutTree lets you optionally set the FromSpot and ToSpot for the ports, which helps improve the link points when the port does not have a natural direction (i.e. NoSpot). We ought to provide the same options for GoLayoutLayeredDigraph, since it too is trying to provide a direction to a graph, but that hasn’t happened yet.
…then I must have an other problem…
my ports are partially replaced after the layouting and the behavior of the layout is also mysterious…
- The nodes which are connect to other nodes are placed on the opposite side.
- The orthogonal connections are not routed around the nodes.
If you are using layered-digraph autolayout, do all of the ports have their FromSpot and ToSpot values set to spots that are appropriate for the direction that the graph is being laid out?
For the force-directed autolayout, there isn’t any attempt to have links avoid any nodes.
I like to layout the diagram with the layered-digraph.
What did you mean with:
If you are using layered-digraph autolayout, do all of the ports have their From<SPAN =highlight>Spot and To<SPAN =highlight>Spot values set to <SPAN =highlight>spots that are appropriate for the direction that the graph is being laid out?
The ports which lies on the right side of a node have following values: FromSpot = ToSpot = MiddleRight
… on the left side: FromSpot = ToSpot = MiddleLeft
… on the top: FromSpot = ToSpot = MiddleTop
… on the bottom: FromSpot = ToSpot = MiddleBottom
Is this a wrong way? …and why?
Without auto layout, it looks fine.
Please help me.
Those spot values seem fine.
Maybe it’s a completely different problem. Did you define the node class yourself? If so, did you override GoObject.SelectionObject to return one of the child objects? If so, did you also override GoGroup.LayoutChildren to make sure all of the children are positioned relative to that SelectionObject?
In version 2.4 and earlier the layered-digraph autolayout code (actually GoLayoutNode.CommitPosition, if I recall correctly) just set the Position of the node’s SelectionObject. If your node class definition didn’t handle that correctly, perhaps the ports would be left behind when the node was moved. In 2.5 we calculate positions based on the SelectionObject, but we actually move the whole node, so as to handle node classes that didn’t implement LayoutChildren correctly.