Making tree layouts look better

Using the Tree Layout sample code, I modified the link template to use Routing=Normal. In this scenario, the routes produced by the layout are not what I desire: each line seems to be composed of 3 segments instead of 1 or 2. Looking at the Tree Layout sample, all of the relevant properties seem to have their default values (FromEndSegmentLength, FromShortLength, etc).

Is there any way to reduce the number of segments in the lines produced by the tree layout?

Well, “better” is in the eye of the beholder.

Do your nodes set go:Node.FromSpot or .ToSpot at all? For normal usage, if you want to get the behavior that you describe, the spots should be Spot.None, which is actually the default value.

But TreeLayout (and LayeredDigraphLayout) are “layered”, so there is a natural direction in which links are expected to go. So both of these layouts, by default, set the appropriate Spots on the Link.Routes of all of the links. Most of the time, this is what people expect. This information on each Route takes precedence over the corresponding properties on the port/node.

To avoid this, set TreeLayout.SetsPortSpot=“False” and SetsChildPortSpot=“False” (or LayeredDigraphLayout.SetsPortSpots=“False”).

Exactly what I was looking for, thanks!