Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Request for suggestion on SLabel placement and scaling #6

Closed
Gabetn opened this issue Nov 13, 2019 · 2 comments
Closed

Request for suggestion on SLabel placement and scaling #6

Gabetn opened this issue Nov 13, 2019 · 2 comments

Comments

@Gabetn
Copy link

Gabetn commented Nov 13, 2019

Hello,
I am using sprotty version 4.0 and am facing issues regarding SLabel placement above SNodes. Particularly, generated SLabels are direct children of the SNode and as such modify the dimensions of the SVG. This effects our ELK layout where SEdges no longer connect to the center of our SVG's rendered shape but rather the newly off-settled "center". Additionally this reshaping of our SVG posses an issue for us as long labels further distort the boundaries and correspondingly our edges.

Is there any way to place SLabels as children of SNodes without modifying the boundaries of our SVG? Or if that is not possible, would creating new SNodes solely for our SLabels suffice.

Any insight would be appreciated.

@spoenemann
Copy link
Contributor

Could you provide a JSON example of a node with label like you are creating?

Note that Sprotty has a notion of macro layout (provided by ELK) and micro layout (provided by Sprotty internally). ELK is able to compute positions for nested labels, see e.g. the Node Label Placement option. The micro layouts of Sprotty are controlled with the layout property of nodes and compartments. You should decide whether to use micro layout or macro layout for label placement. Using both at the same time will lead to problems (see also eclipse-sprotty/sprotty#27).

@spoenemann
Copy link
Contributor

Please open a new issue at https://github.com/eclipse/sprotty if this is still relevant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants