I just realised that the nodes in this diagram had fromSpot and toSpot set to be all sides (I allow the user to change the layout between force directed, grid, circle etc). Setting to go.Spot.LeftSide and go.Spot.RightSide fix the initial routing. I will set a binding to control the spot control based on the layout.
binding the node spot values to the appropriate side for the given layout type (and changing the layout initialization to setsPortSpots:false) is still giving the odd zigzag type route when first adding the link. Moving the node, or redrawing the graph makes the link appear as expected.
I have removed the binding fromSpot / toSpot from my nodes, and turned LayeredDigraphLayout.setsPortSpots = false. The links are now drawing nicely and my code has been simplified :-)
When I expand from a node in the diagram, the node that I am expanding moves position. I would prefer it if it stayed in place instead of rearranging so that the expanded nodes appear at the top of the column. For ForceDirectedGraphs, you suggested a way to make a stable graph (based on the Interactive Force sample). Is there anything I could refer to to get a similar result in LayeredDigraphLayout?