Eclipse Layout Kernel

+6 votes
asked Apr 28, 2021 in Wanted features by plantuml (295,000 points)

As explained here we are currently testing Eclipse Layout Kernel.

For example, you can now have :

(You can click on the image to see the source)

This is still an alpha release, so do not expect to much from it.

The big question for our users is: do you think it's an interesting development ?

Thanks for your feedback.

commented Apr 29, 2021 by Serge Wenger Work (15,620 points)

Yes, it is an interesting development. I check with a previous Graphviz problem (not PlantUml) and a part is solved. https://forum.plantuml.net/12543/label-position-not-correct-in-entity-diagram

commented May 3, 2021 by Martin (8,360 points)
Having a sensible arrow between two packages (i.e. not via the corners) is a refreshing improvement. (Although I don't understand why this couldn't be an option in the existing engine).

The more options for automated layout the better - what works for one diagram might not work for another - so I'm all for this.  It looks like rank is ignored in the new engine, which certainly makes things simpler, but reduces the options for minor tweaking.

I'll try to remember to try this engine on my diagrams going forward in case it improves their look; especially when heavily using packages.
commented Dec 27, 2023 by anonymous
In the documentation it has a link to the elk-full.jar or build it yourself. Is there any documentation on how to build it yourself? Ideally would help in testing this out in our environment where the only way to get this in house is via maven central or built from GitHub. Any information with regards to this will be super helpful

4 Answers

+2 votes
answered May 31, 2021 by mgrol (3,150 points)

I think this is definitely a major improvement. Especially when working with larger diagrams and linestyle ortho the lines connecting to an interface e.g. in a component diagram look less distorted than with the current layout.

A simple plain example to test this is:

@startuml
skinparam linetype ortho
!pragma layout elk

() "/api?param" as api
component component1
component component2
component component3
component component4

component1 -- api
component2 --> api
component3 --> api
component4 --> api
@enduml

commented May 31, 2021 by The-Lu (65,440 points)

Hello all,

To compare, here are the corresponding diagrams:

Without layout elk (old fashion)
With layout elk (new fashion)


If that can help,
Regards,
Th.

commented Jun 1, 2021 by The-Lu (65,440 points)

Hello All,

Here is another example, from:

Without layout elk
(old fashion)
With layout elk
(new fashion)

Regards,
Th.

commented Jun 1, 2021 by Martin (8,360 points)
As I demonstrate in the linked ticket, a small(?*) tweak to the existing engine to better handle shapes containing other shapes would improve the existing engine's effort.

(?* I have no idea whether treating containers the same as empty shapes from the point of view of connecting arrows is a small change or not; but it feels like code has been specifically written to handle containers differently which perhaps could be easily skipped on request...).
0 votes
answered Jun 1, 2021 by The-Lu (65,440 points)

Hello All,

Here is another [old] example, from:

Without layout elk
(old fashion)
With layout elk
(new fashion)

Perhaps some ajustements for direction management (left, right) will be necessary... wink
Regards,
Th.

commented Jun 1, 2021 by Martin (8,360 points)

Again, if the old engine could allow containers to be treated as regular shapes, then it would do well for this diagram...

0 votes
answered Sep 2, 2021 by The-Lu (65,440 points)

Hello PlantUML team,

  • What is the algorithm with ELK for placement of nestabled elements?

See this example:

Code Without ELKWith ELK
node Node {
  artifact artifact_01
  artifact artifact_02
  artifact artifact_03
  artifact artifact_04
  artifact artifact_05
  artifact artifact_06
  artifact artifact_07
  artifact artifact_08
  artifact artifact_09
  artifact artifact_10
  artifact artifact_11
  artifact artifact_12
  artifact artifact_13
  artifact artifact_14
  artifact artifact_15
}
  • What are the reason of the shift between the columns?

Regards,
Th.

commented Nov 21, 2022 by dev-faha (100 points)

Very nice new feature. For some diagrams the layout improves very much. Just one bug I noticed so far (not sure if this is relevant as it is still in alpha status):

For component diagrams the stereotype is missing in nested components.

Codewithout ELKwith ELK

@startuml
!pragma layout elk

component foo <<test>>{
 component bar <<test>>
}
@enduml

0 votes
answered Nov 15, 2023 by melonion (140 points)

Really good work! One issue is the layouting of groups for example when using OSA2 graphics as containers, then the content overlaps, see:

@startuml
!pragma layout elk

!define osaPuml https://github.com/Crashedmind/PlantUML-opensecurityarchitecture-icons/tree/main

!include osaPuml/Common.puml
!include osaPuml/Hardware/all.puml
!include osaPuml/Misc/all.puml
!include osaPuml/Server/all.puml

osa_cloud(cloud, "cloud", "cloud") {
    osa_server(server, "Server VM", "Debian", "HestiaCP")
    osa_vpn(vpn, "Gateway VM", "Debian", "HestiaCP")
    osa_vpn(vpn2, "Gateway VM", "Debian", "HestiaCP")
}

@enduml

yields

https://github.com/Crashedmind/PlantUML-opensecurityarchitecture-icons/issues/1#issuecomment-1812887041

commented Nov 16, 2023 by plantuml (295,000 points)

Thanks for the feedback.

This should be fixed in last beta:

Tell us if it's not working for you!

...