Using ELK with Archi for automatic diagram layouts

Started by fanievh, April 22, 2025, 09:32:24 AM

Previous topic - Next topic

fanievh

Hi,

Has anyone implemented automatic diagram layouts in Archi, either in a plugin or in Javascript? In looking at the options, the Eclipse Layout Kernel looks like a promising option: https://eclipse.dev/elk/

Some background: I have built a plugin that creates or updates Application elements in Archi from a company API that stores a central reference for all Applications.  I also have a script running in JArchi that generates application landscape views from these application elements.  The views are however based on a static reference layout using a packing algorithm to size the various enclosing boxes (groups). I want to expand the use case to also create / update servers and other infrastructure elements and possibly capabilities for each application element.  I will do that in the plugin.  To generate the views, I think I need a more generalised automatic layout solution. I could do the view generation and layout either in the plugin or in a script.

So back to automatic diagram layouts:
  • What would be the best approach / library / algorithm to do automatic layouts in Archi?
  • Would ELK be a good candidate given that Archi uses EMF?
  • Does anyone have sample code to implement org.eclipse.elk.core.service.ILayoutSetup and org.eclipse.elk.core.service.IDiagramLayoutConnector in Archi?
  • Are there any plans in the Archi roadmap to implement automatic diagram layout functionality?

Thanks,
Fanie van Heerden

Phil Beauvoir

If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

fanievh


Alexis_H

Hi @fanievh,

I've went the same path as you do : generated via jArchi some basic 'catalog' views to list applications, capabilities .. and faced the difficulty to layout them : after writing a basic JS layout algorithm from scratch, I found the ELK project and started implemented a PoC, you'll find some starting point in my github repos : https://github.com/AlexisHFr/archi-contribs

Unfortunately I didn't had enough time (or motivation) to finalize it yet..

Regards,
Alexis