Link location on larger nodes

I’ve created a node that has a number of nested components in it including a label and a go.Picture item. When I create links between nodes I see the links get created between between the edge of the nodes but I’d like the links to be created between the edges of the picture instead.

NodeAndLabel
(I guess the picture is a bit small, but you can see the darker black link lines heading into and out of the node between the label and picture.)

I tried setting
{ fromLinkable: false, toLinkable: false } on the various elements of the node and only setting to true on the Picture element, but that didn’t seem to help.

I’m hoping I’m just missing something easy?

I can accomplish this with ports on either side of the picture but that seems like overkill and would require making sure portid information on all of the underlying data is populated.

It appears from further reading of the documentation that locationObjectName on the Node should be able to be set to the name of the Picture element, but that doesn’t seem to have an effect on my links.

That’s the right idea, but Part.locationObjectName and Part.locationSpot control where the Part.location is in within the Part.actualBounds.

I think you just need to set GraphObject.portId to “” (the empty string) on the Picture or whatever you want links to connect with.

Thanks Walter,

As suggested I added { portId: ""}, to the go.Picture definition and that did fix my issue.

I’ll be honest, I’m really surprised that worked, but further reading in the Node section of the API documentation does actually mention this.

Thanks again!