Hi, we’re using the linking functionality from Dynamic Ports and we’re running into an “issue”. The users are wondering if it is possible for links inside of a group/multi-selection to stay static and just rotate along with the group they are inside, instead of redrawing and reorienting after each rotate. I tried just changing the angle of the link itself but it added an offset to it and would have to end up redrawing the link in the end. I was overwriting the computePoints() function and what I have to far is
We’ve messed with those props a bit, but we weren’t able to get anything useful out of them. We’re also using https://gojs.net/temp/GroupRotatingTool.js for some custom rotating behavior.
I see. I’m not yet sure what to propose, but what do you expect to happen if, after a rotation, you drag and move one of the nodes? Will the link recompute then?
Are your links orthogonally routed? Orthogonal routing means that the points of the route, which are always in document coordinates, have adjacent points share either the same X or the same Y value. That is different from what I think you want, which would require the points not to be orthogonal.
Right, dragging a single node or rotating a single node should redraw the line, but when rotating the whole system we would like to maintain the existing pathing.
We can look into the orthogonal routing, but the structure/path of the line itself is fine, we just dont want it to change when you rotate the two nodes and line all as one. I think because the coordinates on the line are based on the document, we would need to have some serious math to adjust the line after each rotation tick, since the line will likely not fall right on the center point of the selected group.
Decades ago when we were designing/implementing the routing behavior for links and considering what should happen when “groups” are rotated in the manner you describe, we wondered what other apps do in this situation. Visio maintained orthogonality relative to the whole diagram, just as we do.
Yes, if you want that kind of functionality, you’ll need to turn off OrthogonalLink.routing and just rotate/translate the Link.points. That shouldn’t be too hard, but if then one of those nodes changes size or location – the route might not look “ortho” any more.
Yeah that all makes sense. We’ll have to run this by our stakeholders and see if it’s really a big enough issue for them to change some of the core linking behavior. Thanks for the input.