-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ELK: moving a node and recalculating the edge bends #286
Comments
We have Manhattan-style (orthogonal) edge routing that auto-updates itself when nodes are moved, see the class diagram example in this repo. What that built-in routing does not do is avoiding overlaps with other nodes. If you want that, you need to integrate something like libavoid. @planger is there a public component to use libavoid with Sprotty? I remember you mentioned that some time ago. |
The layer-based algorithm of ELK is not able to route edges with fixed node positions. There have been attempts to reimplement the libavoid algorithm in ELK, but so far there's nothing usable yet. |
Here is a rather up-to-date description of the state: mjwybrow/adaptagrams#44 (comment) As far as I know it works at least for a demo and is consumable. But I haven't checked in detail for a while. @Aksem what do you think? Also, wouldn't it be best have the Sprotty integration of libavoid as part of Sprotty? If necessary, also the libavoid-js to have it in the Eclipse Foundation? |
Not perfect yet, but yes, it works. The main problem currently is its performance: in my demo it works 'good enough' with up to ~25 nodes. The main reason for poor performance is not optimal integration of libavoid in sprotty, libavoid-js itself has much better performance. The current implementation of a router in sprotty reroutes the whole diagram after each action(move, add element, even hovering a node), it is unneeded in most cases. The solution is to integrate incremental changes, what I'm trying to do, but it's not so straightforward, because API of sprotty router needs to be changed as well, I cannot do this only in my implementation of router. I'll publish all updates in sprotty-routing-libavoid library. |
Update: sprotty-routing-libavoid v1.0.35 released. Performance was improved, and the demo works well with ~60+ nodes. |
In case someone wants edge routing as an explicit action (not automatically triggered), we now have it integrated with ELK, so it can be used with the existing sprotty-elk adapter: https://www.eclipse.org/elk/blog/posts/2022/22-11-17-libavoid.html |
hey.. I've heard that you guys were able to implement ELK node fixed position (instead of having ELK calculate the node position and having it just calculating the edges). I saw an example where you were able to drag a node freely and the edges updates correctly. How can I use this feature? I want to implement a diagram with layered algorithm.
The text was updated successfully, but these errors were encountered: