Sometimes wraps connection around icon

It is any possible to fix this issue ?

Are your links using AvoidsNodes routing?

If your nodes show a selection adornment when selected and if you have not specified a Part.selectionObjectName, select all of the parts and show us the screenshot. And in the debugger select “element2” and tell us the value of myDiagram.selection.first().actualBounds.

I am wondering how big your nodes really are. I am guessing that the “element2” node is much bigger then what you see. If it were covering an area up to or overlapping with “element3”, that would explain the routing.

How did you define the icon in your nodes?

Here is what I have exactly:


node definition:

diagram.nodeTemplate =
$(go.Node, ‘Vertical’,
{ fromSpot: go.Spot.RightSide, // coming out from right side
toSpot: go.Spot.LeftSide }, // going into at left side
new go.Binding(‘location’, ‘loc’, go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Panel, ‘Spot’,
$(go.Panel, ‘Auto’, {name: ‘ICON’, width: 40, height: 40},
{ scale: 0.1,
strokeWidth: 0,
background: ‘transparent’
new go.Binding(‘fill’, ‘type’, getIconColor),
new go.Binding(‘geometryString’, ‘type’, getIcon))
portId: ‘’, cursor: ‘pointer’,
fromLinkable: true, toLinkable: true,
fromLinkableSelfNode: false, toLinkableSelfNode: true,
fromLinkableDuplicates: true, toLinkableDuplicates: true
$(go.TextBlock, {margin: 3}, new go.Binding(‘text’, ‘name’)), {},
dragComputation: stayInGroup,
mouseDrop: function (e, node) {
mouseDropValidation(e, node.containingGroup);
contextMenu: partContextMenu,
layoutConditions: go.Part.LayoutAdded || go.Part.LayoutNodeSized

I hope you don’t mind if I provide some commentary about your node template.

First, I notice that you set fromSpot and toSpot on the Node, and yet there is another GraphObject within in the Node that has its portId set – the Spot Panel. So those two property settings of fromSpot and toSpot will be ignored – you should set “from…” and/or “to…” properties only on port objects. (Yes, that defaults to being the whole Node, but since you have specified a particular port object by setting its portId property, the whole Node is no longer being used as a port.)

The Spot Panel appears to only have one element in it. That suggests that you don’t need that Panel at all – just keep its one element and delete the Spot Panel. Of course that means applying those port properties to the element, the Auto Panel.

But the Auto Panel itself only has one element in it – again you aren’t gaining any benefits from it. So again I suggest that you delete it, and transfer its properties to its only element, the Shape.

I’m guessing that your Shape.geometryString is huge, hence the Shape.scale of 0.1. You don’t need to set the scale if you set its width and height. By default the geometry will be stretched/compressed to fit in the desired size. You might want to set Shape.geometryStretch to be go.GraphObject.Uniform, so that its aspect ratio is not changed.

I’m wondering if that is what is causing the node to be bigger than it appears to be, which in turn causes AvoidsNodes link routing to go “around” nodes farther away than it would appear to a human.

{} as an argument to GraphObject.make does nothing.

By the way, we are working on improving the SwimLanes sample for version 1.5.

Thank You very much :)