By default the LayeredDigraphLayout, just like TreeLayout, assumes a directionality to the whole graph and thus to how links should come out of nodes and how they go into nodes.
So if you remove any settings of Link.fromSpot and Link.toSpot, things should work well for the common cases.
But if you really do want to control the spots on links, you can disable the layout from setting the spots by setting LayeredDigraphLayout.setsPortSpots to false. LayeredDigraphLayout | GoJS API
谢谢walter,现在它很好的工作了