That is odd. Still, I think the problem is that you haven’t declared the (default) port of each node to be that small round shape. Just set its portId: "". Please read GoJS Ports in Nodes-- Northwoods Software
Added the portId to the picture and problem was fixed. Thanks.
So, what if a want to connect two parallel links between nodes, one between Spot(y=0.2) and the second between Spot(y=0.8). Will i have to set port for each link ?
I have tried to toSpot/fromSpot and it does locate the link at the right sport, yet when i move the nodes around, the link retain on the same spot.
I need that the link will be adjusted automatically to the “normal” spot when nodes are moved, for example switch places.
This is exactly the problem,
When i don’t set the toSpot/fromSpot the link “floats” around any time i move the node. The link adjusts its location automaticaly as the node is dragged.
As soon as i set the toSpot/fromSpot, the link is “nailed” to the spot
Take a look at the pic.
I would like to have 2 parallel links withouht setting the spot location (because the link is nailed)
That can work, but as you say, the link connection points are now “fixed” and unchanging based on the relative positions of the nodes. But using go.Spot.AllSides should work. Here’s an example:
Let’s see if i understand.
I should set the LINK to/fromSpot as i wrote before and in the nodeTemaplte i should use AllSides ?
That will enable the links to float from side to side ?
No, don’t set the Link.fromSpot or Link.toSpot at all. The default values for those two properties will cause the actual spots to be taken from the connected port. Link | GoJS API
Those links look parallel to me. Although you haven’t declared the Picture as the port, so it appears that the whole node is acting as the default port.
My mistake,
i set the link to/fromSpot properly and the links went parallel.
I also set the AllSides for the node Template.
Still, when i move the links, the links are nailed to the spot.
So, how do i make them parallel without setting the to/fromSpot ?
I’m lost…
I see,
So set the AllSides on the node template and NOT set the to/fromSpot on the link object.
It works fine. YET, when i set the portId on the picture object, all links are packed near each other.
So there is kind of trade of :
In order to put the link in parallel i shouldn’t set the portId (which was the problem in first place).
Port-related properties, which include most properties starting with “from” or “to”, should go on the port element in the node template, not necessarily on the Node element.
So if you change the element that has its portId property set (or bound) to a string, you should move all of the port-related properties too.
I thought I was very specific in my previous statements. Don’t set or bind fromSpot or toSpot in your link template(s). Set it on the port element(s) in your node template(s).
I see,
So, i have a go.Picture element with portId set to “”.
I set on it the to/fromSpot AllSides and all links are now set parallel and floats where ever the node goes.
Thanks very much.