Make linkingtool snap to centerport

Hi,

I was wondering if it is possible to make a link snap to a certain port when relinking. My nodes have arrays of ports attached to the sides, and i would like to make the linkingtool snap to the centerport if the user gets close enough. i was looking at the portGravity property but it seems that only works for all ports, i would like to be able to set a gravity per port.

Is this possible?

Thanks is advamce,
Tim

That is correct about LinkingBaseTool.portGravity.

You could override http://gojs.net/latest/api/symbols/LinkingBaseTool.html#findTargetPort and choose whichever valid port element that you want, disregarding the portGravity.

Thanks, i’ll look into it!