sprotty icon indicating copy to clipboard operation
sprotty copied to clipboard

Integrate ELK in a simple Sprotty diagram.

Open PatrikN-work opened this issue 1 year ago • 1 comments

Trying to figure out how to integrate ELK in a simple Sprotty diagram.

I'm using yo to generate a sprotty project and then I'm "retrofitting" elk by looking at the random-graph example: https://github.com/eclipse-sprotty/sprotty/blob/master/examples/random-graph/src/di.config.ts

My changes are hightlighted:

image

However I'm getting this error: image

Shape here I suppose is the same as view?

What am I missing?

PatrikN-work avatar Apr 03 '24 07:04 PatrikN-work

It looks like you have an edge where the sourceId or targetId does not exist in the graph. I'm wondering whether we should validate this when we transform the SGraph into an ELK graph:

https://github.com/eclipse-sprotty/sprotty/blob/55f6b055ff880575a1befcaf45f25acb24eb7d2d/packages/sprotty-elk/src/elk-layout.ts#L169-L174

spoenemann avatar Sep 25 '24 12:09 spoenemann