Skip to content
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

Closed
wagnerpaz opened this issue Apr 12, 2022 · 6 comments
Closed

ELK: moving a node and recalculating the edge bends #286

wagnerpaz opened this issue Apr 12, 2022 · 6 comments
Labels
question Further information is requested

Comments

@wagnerpaz
Copy link

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.

@spoenemann
Copy link
Contributor

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.

@spoenemann spoenemann added the question Further information is requested label Apr 28, 2022
@spoenemann
Copy link
Contributor

I want to implement a diagram with layered algorithm.

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.

@planger
Copy link
Contributor

planger commented Apr 28, 2022

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.

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?

@Aksem
Copy link
Contributor

Aksem commented Apr 28, 2022

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.

@Aksem
Copy link
Contributor

Aksem commented Jun 29, 2022

Update: sprotty-routing-libavoid v1.0.35 released. Performance was improved, and the demo works well with ~60+ nodes.
Also, there is the first real-world usage: it was integrated into bigER modeling tool (note: the new version was not published in the marketplace yet and should be built from sources). Documentation of sprotty-routing-libavoid is still missing, it will be the next step.

@spoenemann
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants