eclipse-sprotty / sprotty

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

ELK rectpacking causes error #422

Closed Drakae closed 9 months ago

Drakae commented 10 months ago

I want to use the rectpacking layout algorithm of ELK (using Sprotty version 0.13.0). However, when setting the property in the layout config I get the following error: Failed to generate diagram: Error: org.eclipse.elk.core.UnsupportedConfigurationException: Layout algorithm 'rectpacking' not found

I tested the JSON of my graph in elklive as well as with an ELK CLI (both times the versions 0.8.2 and 0.9.0) and there it works just fine. Example JSON:

{
    "id": "root",
    "layoutOptions": {
        "org.eclipse.elk.algorithm": "rectpacking"
    },
    "children": [
        {
            "id": "dummy",
            "children": [],
            "edges": [],
            "labels": [
                {
                    "id": "dummyLabel1_label",
                    "text": "dummy",
                    "x": 5,
                    "y": 5,
                    "width": 43.1181640625,
                    "height": 15
                }
            ],
            "ports": [],
            "width": 53.1181640625,
            "height": 25
        },
        {
            "id": "dummy2",
            "children": [],
            "edges": [],
            "labels": [
                {
                    "id": "dummyLabel2_label",
                    "text": "dummy",
                    "x": 5,
                    "y": 5,
                    "width": 43.1181640625,
                    "height": 15
                }
            ],
            "ports": [],
            "width": 53.1181640625,
            "height": 25
        }
    ],
    "edges": []
}
spoenemann commented 9 months ago

How are you integrating ELK with Sprotty – elkjs, elk-server, sprotty-server, or something else?

Drakae commented 9 months ago

I use sprotty-elk and elkjs.

spoenemann commented 9 months ago

Ok then this issue should rather be discussed in the elkjs repo.

Just one hint: are you using the latest version of elkjs, and have you enabled the rectpacking algorithm in the API?

Drakae commented 9 months ago

Thanks for the hint, I overlooked this.