eclipse-sprotty / sprotty

A diagramming framework for the web
https://sprotty.org/
Eclipse Public License 2.0
731 stars 83 forks source link

sprotty-elk sometimes doesn't delete old edge bends on layout changes #427

Closed semira222 closed 9 months ago

semira222 commented 9 months ago

The video shows the issue. When expanding/collapsing nodes, edge bends are not deleted from the layout, which can turn into quite the spaghetti on larger graphs. This only happens when the edge wouldn't need bends in the new layout. If the new edge layout just needs different bend points the old bend points are being deleted as expected.

https://github.com/eclipse-sprotty/sprotty/assets/77962181/a68bfd13-770a-4174-ae82-829d570015cb

spoenemann commented 9 months ago

We haven't seen this in other applications using the collapse / expand feature. I think solving the issue is not possible without seeing the source code of your implementation.

semira222 commented 9 months ago

I am using elk for layouting, probably should have made that clearer. I managed to reproduce the bug in the randomgraph example from the sprotty repo by reducing the number of nodes and edges to 5 each:

https://github.com/eclipse-sprotty/sprotty/assets/77962181/5d5a1620-328a-41d7-8376-fde214ece0a3

You can even see clearly that the problem only occurs for edges that used to have bends and now don't. Edge 0 and 4 are fine because they are always straight and egde 1 is fine because it always has bends.

jbicker commented 9 months ago

@spoenemann, I can have a look a it.

spoenemann commented 9 months ago

It turned out this is an ELK bug: https://github.com/eclipse/elk/issues/1001