mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 02:39:41 +02:00

* 'neo-new-shapes' of https://github.com/Mermaid-Chart/alana-mermaid: (45 commits) updated styles, testcases and fixed html labels for image shape MC-1733 Reset layout updated ImageSqaure shape updated styles updated pos changes fixed html labels for icon shape updated test cases Added rounded icon shape Updated circle icon updated image shape Updated labels for shapes updated icon square and icon MC-1733 Reset layout Updated logic for vertex label Updated test cases Update .changeset/rude-meals-invite.md changesets added neo-fication and shape-resize for linedCylinder shape added neo-fication for curvedTrapezoid shape Version Packages ...
@mermaid-js/layout-elk
This package provides a layout engine for Mermaid based on the ELK layout engine.
Note
The ELK Layout engine will not be available in all providers that support mermaid by default. The websites will have to install the
@mermaid-js/layout-elk
package to use the ELK layout engine.
Usage
flowchart-elk TD
A --> B
A --> C
---
config:
layout: elk
---
flowchart TD
A --> B
A --> C
---
config:
layout: elk.stress
---
flowchart TD
A --> B
A --> C
With bundlers
npm install @mermaid-js/layout-elk
import mermaid from 'mermaid';
import elkLayouts from '@mermaid-js/layout-elk';
mermaid.registerLayoutLoaders(elkLayouts);
With CDN
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
import elkLayouts from 'https://cdn.jsdelivr.net/npm/@mermaid-js/layout-elk@11/dist/mermaid-layout-elk.esm.min.mjs';
mermaid.registerLayoutLoaders(elkLayouts);
</script>
Supported layouts
elk
: The default layout, which iselk.layered
.elk.layered
: Layered layoutelk.stress
: Stress layoutelk.force
: Force layoutelk.mrtree
: Multi-root tree layoutelk.sporeOverlap
: Spore overlap layout