New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Border nodes appear inside of their container #956
Comments
Small comment for myself and the rest of the team: I'm pretty sure that on the frontend side at least, the solution should involve a better support for |
I'm not so sure. Sprotty's SPorts are not SNodes. It's a different type of element, which in particular does not have children. It seems designed more as "anchor points" for incoming/outgoing edges, but in Sirius border nodes have all the capabilities of other nodes (they can have their own children, and even their own border nodes). The only thing that makes them special is that their location is constrained to the (rectangular) bounding box of their parent. Sprotty's type hierarchy seems to match ELK's metamodel:
ELK has the same limitation. So it seems there are two options:
|
Yes that's a core part of the issue. I wonder if it's worth trying to support border nodes as nodes. We could simply convert border nodes to Have you encountered, over the years, that many Sirius RCP diagrams with border nodes containing child nodes or border nodes? |
Technically the Sirius Desktop support for sequence diagrams is almost entirely based on that capacity (lifelines are border nodes of the participant nodes, and all executions on a lifeline are border nodes of the lifeline or of their parent execution). But that is a very special case. I don't have other concrete examples, so I guess we can decide to only support the common case. There's still the issue that SPorts are not SNode, so going this route, while being more in line with how Sprotty and ELK work, may require some duplication or refactorings to get the same behaviors we have on nodes available on ports (styling, tool application, direct edit, etc.). We'll see when I start concretely (soon). |
On the backend, we already convert border nodes to |
Already started on that, but currently stuck with Note that one limitation of |
Actually, readonly children: ReadonlyArray<SChildElement> = [];
It seems we're supposed to use |
Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The border node enters its parent container with 8px. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
This commit changes the way the child is added to its parent in convertDiagram. A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. The border node enters its parent container with 8px. The ELK layout has been updated to have a border node offset. The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
This commit changes the way the child is added to its parent in convertDiagram. A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. The border node enters its parent container with 8px. The ELK layout has been updated to have a border node offset. The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
This commit changes the way the child is added to its parent in convertDiagram. A child is now added with the add method instead of parent.children=xxx. It allows to properly set SParentElement.parent property. Each child adds itself to its parent as soon as created to make sure that its own children will be added in a graph containing a root element. The border node enters its parent container with 8px. The ELK layout has been updated to have a border node offset. The ELK option CoreOptions.PORT_BORDER_OFFSET is set by default to 8 pixels entering the parent node. Bug: #956 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Screenshots
Note that the border nodes are inside of the container
Whereas in Sirius Desktop they are correctly rendered right outside the border of the container
Interestingly, the border nodes are positioned correctly after I force rearrangement of elements on the diagram, but they go back into the container after I try to move them
Peek.2022-01-12.19-20.mp4
Steps to reproduce
Expected behavior
Border nodes appear on the edge of their container, just like in Sirius Desktop
Actual behavior
Border nodes appear inside of their container, not making them border nodes anymore.
I thought #359 was supposed to fix it, but it seems I was wrong. The problem is also visible in the screenshots in that issue, though, so it seems like a regression.
The text was updated successfully, but these errors were encountered: