About Curved Bezier Link Control Point

related to this,

then, I specify some graphobject’s fromSpot/toSpot some are not.
but this time curve control object has become one point. not the two control points.
See,

you can drag out link confirm.

And some link line totally out of the arrow heads.


That’s odd. I’ll investigate and get back to you.

This appears to be an issue with the toShortLength when used with Bezier curves. For now, you’ll have to remove it.

Yes removes the toShortLength may get better, but you know it’s not good looks, not beautiful.

and another problem I said before,
when specifying some graphobject’s fromSpot/toSpot , and some are not.
the control points become one point, not two. still can’t solve.

When one end of the link has a computed spot that is None and the other end’s spot is not None (i.e. is a specific spot or is a side), then there are only three points in the route. I think both handles are being created, but there’s only one point to put them, so they are on top of each other.

Sorry, but that’s the way that it is designed. If you want different behavior, you could override Link.computePoints to do whatever you want.

We hard work for customize, yes, every thing is maybe possible, But you see, this is normal? normal for graph software design? , at least I don’t think so. sorry for Overstatement.

The normal routing behavior is that when both spot (fromSpot and toSpot) are (computed to be) go.Spot.None, then there are only two points in the link. When one of the spots indicates a direction because it is a specific spot or because it specifies a side, then it adds a point to the route in order to support the end segment at that end of the link route. So when both spots are specific or sided, there are four points in the route (i.e. in the Link.points list).

The computation of the path’s geometry is based on the properties of the Link, including Link.curve as well as Link.points. I think when the curve is Bezier the computed geometry is pretty good for 2, for 3, and for 4 points. However, it is true that it could be better – since we seem not to handle short length (toShortLength and fromShortLength) for Bezier curves well. [That is partly because we didn’t want to be doing that mathematical calculation all the time, for performance reasons.]

I think the LinkReshapingTool behavior is pretty reasonable too, for all of these combinations of cases. It doesn’t make sense to be able to reshape a route that only consists of 2 points. When there are 3 points, there is only one point that can have any freedom. But for 4 points, one can have two reshaping handles. When it’s a Bezier curve, that means for both control points.

I think you are the first person to ask for any behavior like what I think you are describing, as far as I can recall over twenty years and many thousands of customers. Your request is quite reasonable, but that’s just not how things were designed for the default behavior, which I have just outlined. You can override almost all of the behavior so that you can do what you want. That’s the trade-off.

But you know gojs is not open source so I see few samples to figure out how to change them,
And it just other people not use this gojs to this detail, I love gojs. not i am different for others. If you want to make a better library I think should fix this to any side and any kind of spot to link any type of link curve no problem to edit it. I am not sure, but I feel, feel theoretically it is possible. we are both software engineers I know everything is not easy, but we have the same goal to make good software.

of course, I will a little bit deeply think it tomorrow, in Tokyo now is late night time I so sleepy. sorry.
If you have the most good solution let me know thank you.