eclipse / elk

Eclipse Layout Kernel - Automatic layout for Java applications.
https://www.eclipse.org/elk/
Other
258 stars 86 forks source link

JsonImporter does not clear existing bend points #1001

Open spoenemann opened 9 months ago

spoenemann commented 9 months ago

Looking more closely at issue https://github.com/eclipse-sprotty/sprotty/issues/427 reported for Sprotty, it seems that it's actually elkjs that's failing to delete the old bend points. The responsible class is JsonImporter.

Just looking at the code, my assumption is that this method in particular should delete old bend points from the JsonObject in case none are provided by the layout algorithm: https://github.com/eclipse/elk/blob/c6f44e8a09d092fb69cb220dd1074f543bee35c0/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonImporter.xtend#L562

Can anyone confirm this?

soerendomroes commented 9 months ago

We might have time to investigate this in March. @Eddykasp can we test this with the elk-cli?

Eddykasp commented 9 months ago

I reproduced the issue: Unlayouted graph: graph-pre-layout.json produces: graph-pre-layout

If I then change the height of n1 to 70 as in this file graph-1-layout.json and then run elk again I get the following drawing graph-1-layout and this output final-layout.json.

On elk-live this works correctly since each layout is fresh.