Diagram links should be straight

I’ve implemented my diagram with layered diagraph layout in which some of links is not going straight as per diagram

I want these all link in a straight manner. Suggest me some useful to overcome from this issue.
here is my layout options

layout: this.$(go.LayeredDigraphLayout,


      direction: 90,

      layerSpacing: 50,

      columnSpacing: 50,

      layeringOption: go.LayeredDigraphLayout.LayerLongestPathSource,

      initializeOption: go.LayeredDigraphLayout.InitDepthFirstIn,

      isOngoing: false,

      setsPortSpots: true


here is my link template code:-

this.$(go.Link, // the whole link panel


      routing: go.Link.AvoidsNodes,

      corner: 10,

      adjusting: go.Link.Stretch,

      curve: go.Link.None,

      relinkableFrom: true,

      relinkableTo: true,

      reshapable: false,

      resegmentable: false,

      fromSpot: go.Spot.BottomCenter,

      fromLinkable: true,

      fromLinkableSelfNode: true,

      fromLinkableDuplicates: true,

      toLinkable: true,

      toShortLength: 4,

      zOrder: 1,

      selectionAdorned: false,


How wide are your nodes? I suspect they are not an even multiple of the columnSpacing.

hi, could you please elaborate your point…!

LayeredDigraphLayout positions each node in a column whose width is determined by LayeredDigraphLayout.columnSpacing. Of course when a node is wider than that value, the node occupies multiple columns.

But it means that each node is positioned according to an invisible grid determined by the columns. If a node’s width is not an even multiple of the column width, the middle of the nodes (assuming that’s where links connect) will not be lined up vertically.

There probably are other reasons that the nodes aren’t lined up vertically; I’m not sure that it will be easy to affect that behavior.