Skip to content

ELK Edge Label is not positioned correctly #514

@BjBe82

Description

@BjBe82

I just updated Sprotty to the newest version 1.4.0 (from 1.0.0) and noticed that the edge label position changed. I use ELK layered to layout everything.

Version 1.0.0:

Image

Version 1.4.0

Image

I just tried to reproduce this in the examples and the effect can be seen there too, as it looks like the edge label does not respect the x,y coordinates from ELK.

Plain ELK

Image

Sprotty Example

Image
#di.config.ts 
 configureModelElement(container, 'label:edge', SLabelImpl, SLabelView);

#standalone.ts
const NODES = 2;
const EDGES = 1;
....
        const edge: SEdge = {
            type: 'edge',
            id: `edge${i}`,
            sourceId: `port${sourceNo}-${i}`,
            targetId: `port${targetNo}-${i}`,
                        children: [
                <SLabel>{
                    type: 'label:edge',
                    id: `port${sourceNo}-${i}-->${targetNo}-${i}-label`,
                    text: `port${sourceNo}-${i}-->${targetNo}-${i}`
                }
            ]
        };

With two edges:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions