Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 571925

Summary: [ELK] Handle "edge on edge" case
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Laurent Redor <laurent.redor>
Status: CLOSED FIXED QA Contact: Glenn Plouhinec <glenn.plouhinec>
Severity: enhancement    
Priority: P3 CC: glenn.plouhinec
Version: unspecified   
Target Milestone: 6.5.0   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178383
https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178389
https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178429
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=64acc2c20a089671b71aa0feee32f936fe2d0b80
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=72c36ea5f7d7143d7191e53e3d1402d026c88b53
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=454b2a2cf3a6572ce9524d5215bd8a06a018863f
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573874
Whiteboard:
Attachments:
Description Flags
571925_sample.zip
none
sampleDiagram.png
none
2-layoutResultWithoutELK.png
none
3-layoutResultWithELKBeforeBugzilla571925.png
none
4-layoutResultWithELKAfterBugzilla571925.png
none
demoEdgeOnEdgeWithELK-bugzilla571925.mp4
none
ELK_result-571925.png
none
571925_sample_withELKConfig.zip none

Description Laurent Redor CLA 2021-03-12 09:03:04 EST
In Sirius, it is possible to have an edge having another edge as source or as target.
In ELK, this kind of construction is not supported. As you can see in ELK Graph meta model [1], the source and target of an ELKEdge is an ElkConnectableShape (ie an ElkPort or an ElkNode).

The goal of this issue is to analyse if it is possible in Sirius to "convert" the notion of "edge on edge" into something compatible with ELK Graph and have a satisfactory layout into Sirius as result.

[1] https://www.eclipse.org/elk/documentation/tooldevelopers/graphdatastructure.html#the-meta-model
Comment 1 Laurent Redor CLA 2021-03-12 09:10:55 EST
Created attachment 285826 [details]
571925_sample.zip

571925_sample.zip contains a project, "571925_sample", with a diagram with several kind of "edge on edge" cases (see sampleDiagram.png). It is a good starting point of diagram to layout.
Comment 2 Laurent Redor CLA 2021-03-12 09:11:28 EST
Created attachment 285827 [details]
sampleDiagram.png
Comment 3 Eclipse Genie CLA 2021-03-25 12:46:03 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178383
Comment 4 Eclipse Genie CLA 2021-03-25 13:57:44 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178389
Comment 5 Eclipse Genie CLA 2021-03-26 09:32:23 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/178429
Comment 6 Laurent Redor CLA 2021-03-26 12:41:09 EDT
Created attachment 285958 [details]
2-layoutResultWithoutELK.png

With the sampleDiagram (sampleDiagram.png):
* The result without ELK is: "2-layoutResultWithoutELK.png"
* The result with ELK before this bugzilla is: "3-layoutResultWithELKBeforeBugzilla571925.png"
* The result with ELK after this bugzilla is: "4-layoutResultWithELKAfterBugzilla571925.png"

There is also a video showing these different results: "demoEdgeOnEdgeWithELK-bugzilla571925.mp4"
Comment 7 Laurent Redor CLA 2021-03-26 12:41:27 EDT
Created attachment 285959 [details]
3-layoutResultWithELKBeforeBugzilla571925.png
Comment 8 Laurent Redor CLA 2021-03-26 12:41:44 EDT
Created attachment 285960 [details]
4-layoutResultWithELKAfterBugzilla571925.png
Comment 9 Laurent Redor CLA 2021-03-26 12:43:25 EDT
Created attachment 285961 [details]
demoEdgeOnEdgeWithELK-bugzilla571925.mp4
Comment 13 Glenn Plouhinec CLA 2021-04-23 08:37:55 EDT
Created attachment 286214 [details]
ELK_result-571925.png
Comment 14 Glenn Plouhinec CLA 2021-04-23 08:39:42 EDT
I don't get exactly the same result, especially between C6 and C7 (see screenshot attachment 286214 [details]). It is possible that this is due to my configuration. Is this result correct ?
Comment 15 Laurent Redor CLA 2021-04-28 11:45:48 EDT
Created attachment 286259 [details]
571925_sample_withELKConfig.zip

Steps to validate:
* Import project "571925_sample" from 571925_sample_withELKConfig.zip
* Open diagram "diagramEdgeOnEdgeWithoutELK"
* Launch an arrange all
* Expected: A diagram like "2-layoutResultWithoutELK.png"
* Open diagram "diagramEdgeOnEdgeWithELK"
* Launch an arrange all
* Expected: A diagram like "4-layoutResultWithELKAfterBugzilla571925.png"
Comment 16 Laurent Redor CLA 2021-04-28 11:46:37 EDT
(In reply to Glenn Plouhinec from comment #14)
> I don't get exactly the same result, especially between C6 and C7 (see
> screenshot attachment 286214 [details]). It is possible that this is due to
> my configuration. Is this result correct ?

The steps to validate were missing for this issue. Could you follow them (now they are available)?
Comment 17 Laurent Redor CLA 2021-04-28 12:04:32 EDT
(In reply to Laurent Redor from comment #15)
> Created attachment 286259 [details]
> 571925_sample_withELKConfig.zip
> 
> Steps to validate:
> * Import project "571925_sample" from 571925_sample_withELKConfig.zip
> * Open diagram "diagramEdgeOnEdgeWithoutELK"
> * Launch an arrange all
> * Expected: A diagram like "2-layoutResultWithoutELK.png"
> * Open diagram "diagramEdgeOnEdgeWithELK"
> * Launch an arrange all
> * Expected: A diagram like "4-layoutResultWithELKAfterBugzilla571925.png"

You have to install the feature "Sirius ELK Integration - SDK (Experimental) Developer Resources" if it is not already done ;)
Comment 18 Glenn Plouhinec CLA 2021-04-28 12:09:58 EDT
(In reply to Laurent Redor from comment #16)
> (In reply to Glenn Plouhinec from comment #14)
> > I don't get exactly the same result, especially between C6 and C7 (see
> > screenshot attachment 286214 [details]). It is possible that this is due to
> > my configuration. Is this result correct ?
> 
> The steps to validate were missing for this issue. Could you follow them
> (now they are available)?

Done. I installed the right ELK feature. I just forgot some options to override in my configuration.

Validated with Sirius 6.5.0 IT2.
Comment 19 Pierre-Charles David CLA 2021-06-02 02:43:58 EDT
Available in Sirius 6.5.0, see https://projects.eclipse.org/projects/modeling.sirius/releases/6.5.0 for details.