Bug 540186

Summary: [ELK] Edge labels not layouted correctly with ELK layered
Product: [Modeling] Sirius Reporter: Pierre Guilet <pierre.guilet>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: laurent.redor, pierre-charles.david
Version: 5.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
project to reproduce
none
problem screenshot
none
pure elk result
none
DifferenceSiriusVsELK.png
none
ElkTests-basicfamily-mmAndModeler.zip
none
ElkTests-basicfamily-sample.zip
none
ElkExpectedResult.png none

Description Pierre Guilet CLA 2018-10-16 11:07:45 EDT
Created attachment 276265 [details]
project to reproduce

The layouting produced by ELK layered on a diagrame with start and end labels for edges is not correct. Labels are overlapping with each other and nodes with SVG image at least.

Steps to reproduce:

1-import the model and design project and launch a runtime.
2-import the sample project in runtime and open the representation
3- Click on arrange all

KO edge labels are overlapping.
Comment 1 Pierre Guilet CLA 2018-10-16 11:08:10 EDT
Created attachment 276266 [details]
problem screenshot
Comment 2 Pierre Guilet CLA 2018-10-16 11:11:25 EDT
Created attachment 276267 [details]
pure elk result

Add a screenshot of the layouting done by ELK without the SIrius integration
Comment 3 Pierre Guilet CLA 2018-11-27 04:03:10 EST
See https://www.eclipse.org/forums/index.php/mv/msg/1095588/1796388/#msg_1796388 for reported case
Comment 4 Laurent Redor CLA 2019-10-31 04:02:42 EDT
Created attachment 280476 [details]
DifferenceSiriusVsELK.png

I analyzed this problem. The cause of this problem is that in Sirius the edges do not stop on the bounding box of the image (red rectangle in the image DifferenceSiriusVsELK.png). Each edge goes until the border of the image instead of the bounding box (thanks to bug 452294). So the length of the edge is longer in Sirius than in ELK. And the label location is relative to an anchor Point that is computed according to the length of the edge. So the edge labels are wrongly located.
This specific aspect, this specific transformation, is, for the moment, not considered when we apply the ELK layout into Sirius.
Comment 5 Laurent Redor CLA 2019-11-27 06:12:48 EST
Here is another case corresponding to edge layout problem.

Steps to reproduce
* Import projects from ElkTests-basicfamily-mmAndModeler.zip in your workspace
* Launch a runtime
* Import project from ElkTests-basicfamily-sample.zip in your runtime
* Open diagram "new Persons diagram with ELK"
* Launch "arrange all" action from tabbar
* The expected result is something like "ElkExpectedResult.png". KO: The edge don't correspond to what is expected. It would be better if only the last segment is increased to target the real figure bounding box.
Comment 6 Laurent Redor CLA 2019-11-27 06:13:09 EST
Created attachment 280796 [details]
ElkTests-basicfamily-mmAndModeler.zip
Comment 7 Laurent Redor CLA 2019-11-27 06:13:25 EST
Created attachment 280797 [details]
ElkTests-basicfamily-sample.zip
Comment 8 Laurent Redor CLA 2019-11-27 06:13:58 EST
Created attachment 280798 [details]
ElkExpectedResult.png