toSpot and fromSpot on ports

I have nodes that look like this: image. The dark grey boxes are ports. I currently have code that changes sets the toSpot and fromSpot on the port based on where it is positioned. So, for example, the ‘I/O’ port has a fromSpot and toSpot of go.Spot.Top so that links will only connect at a single point in the center of that port.

However, for the ‘PoE’ port, I want the behaviour to be that links can connect to a single point on the top side, or a single point on the right side chosen based on the shortest path. In this situation I currently set the value to go.Spot.TopRightSides, but that is not to a single point. I could set the value to go.Spot.TopRight, but that would force links out of the corner rather than the top or the right.

Is there are way to get the behaviour I want on these corner ports?

Not easily for just that port. Setting Node.portSpreading to go.Node.SpreadingNone will apply to all ports that have “Sides…” spots. But maybe that’s OK for you.

Thanks. That is exactly what I wanted.