Curved Bezier link, use mouse we can change the two guide points to adjust curviness, good, but
add (comment out) this fromSpot and toSpot,
fromSpot: go.Spot.Right, toSpot: go.Spot.Left,
line 29
then the two guide points are gone, I can’t change the curviness,
By specifying a link connection spot at an end of a link (either directly on the Link or defaulting to the spot value at the GraphObject port) you are saying that there should be an “end segment” coming out or going into that spot at an appropriate angle. Specifying a segment takes up an extra point, so that takes away the use of that point as a Bezier control point. Specifying end segments at both ends of the link means there cannot be any control points at all. At least not with the default routing.
You could do your own routing and form poly-Bezier curves or whatever you want. For example, see the routing created by LayeredDigraphLayout: Beat Paths
I don’t want to make a curves link programmatically, I just want to control point out here
you mean Bezier line need 4 points, there is only 2 point so the control points are gone?
then look when
I set “draggingTool.dragsLink”: true,
then drag out the link to no link to any object the control points came back, how to explain this.
They aren’t connected with any ports that have fromSpot or toSpot. If you have any Nodes that don’t have spots and connect the link with it or them, they might retain the control point handle(s).
I’m not sure why you cannot reconnect dragged links to nodes. Maybe because you set the portGravity to zero? Try a small value such as 20.
But then when you do reconnect a link, I notice that the control point handles do remain visible. That seems like a bug to me, although that is exactly what you want, isn’t it?
Yes, I want to move the control point, even at fromSpot: go.Spot.Right, toSpot: go.Spot.Left is are setting.
the problem is when I setting the fromSpot or toSpot, I can’t move the control points, it not visible or hidden.
I just want to change the curves by control points. no matter fromSpot or toSpot setting or not.
by the way, I add these to diagram settings, so the free links can reconnect to the objects again.
It is not a bug I think.
“linkingTool.isUnconnectedLinkValid”: true,
“relinkingTool.isUnconnectedLinkValid”: true,
This requires customizing the LinkReshapingTool so that it creates those reshaping handles. I’m not sure how much work that is. I’ll try later when I get some free time.
[EDIT:] It’s because the fromSpot and/or toSpot are specific or sided Spots. That affects the routing, causing the automatic maintenance of the routing via Link.adjusting to be preempted.
Maybe you should customize the LinkReshapingTool to set Link.fromSpot and Link.toSpot back to go.Spot.Default in an override of LinkReshapingTool.doActivate. Call the super method first.