elk icon indicating copy to clipboard operation
elk copied to clipboard

JsonImporter does not clear existing bend points

Open spoenemann opened this issue 1 year ago • 2 comments

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?

spoenemann avatar Feb 21 '24 14:02 spoenemann

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

soerendomroes avatar Feb 21 '24 15:02 soerendomroes

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.

Eddykasp avatar Feb 22 '24 11:02 Eddykasp