How to use go.Link.Avoid Nodes without diagram layout

how to use routing: go.Link.AvoidsNodes with using isOngoing: false,?
how to use avoid nodes & Orthogonal?
Is there any sample code for this link drowing?

layout: $(go.TreeLayout, { nodeSpacing: 3, isOngoing: false, arrangement: go.TreeLayout.ArrangementFixedRoots })

Link routing is independent of Layout invalidation. There are lots of samples that set Link.routing.

I do not understand what behavior you are currently getting and what you would prefer instead. Two small screenshots might help explain the situation.

Hi Please check the attach image.


I want to use
layout: $(go.TreeLayout, { nodeSpacing: 3, isOngoing: false, arrangement: go.TreeLayout.ArrangementFixedRoots }),


myDiagram.linkTemplate =
{ selectable: true, selectionAdornmentTemplate: linkSelectionAdornmentTemplate },
{ relinkableFrom: true, relinkableTo: true, reshapable: true },
routing: go.Link.Orthogonal,
corner: 4,
curve: go.Link.JumpOver,
reshapable: true,
relinkableFrom: true,
relinkableTo: true,
mouseDragEnter: function (e, link) {
link.isHighlighted = true;
mouseDragLeave: function (e, link) {
link.isHighlighted = false;


        $(go.Shape, { strokeWidth: 2 }),
        $(go.Shape, { toArrow: "OpenTriangle" }),
        $(go.Panel, "Auto",  // this whole Panel is a link label
            $(go.Shape, "RoundedRectangle", { strokeWidth: 8, fill: "white",strokeWidth: 0,}),
            $(go.TextBlock, { margin: 3,editable: true },
                new go.Binding("text", "text"))
            toolTip: myToollinkTips


TreeLayout (and LayeredDigraphLayout) are directional layouts – they position the nodes in a manner such that the links naturally go in basically that direction. In your case TreeLayout.angle is 0, which means all of the links will go rightward. That means by default each link’s fromSpot will be set to go.Spot.Right and each link’s toSpot will be set to go.Spot.Left. GoJS Layouts -- Northwoods Software

If you don’t want that routing behavior, you can set TreeLayout.setsPortSpot to false and/or set TreeLayout.setsChildPortSpot to false. Doing so will allow the fromSpot or toSpot on the port element to control the direction at which the link will connect with the port.

In your screenshot I assume what you circled is a small black port whose toSpot you will want to set or bind to be go.Spot.Top.