# What changed in @mermaid-js/layout-elk

> 15 changes in @mermaid-js/layout-elk 0.2 to 1 from its official release notes, upgrade guides and advisories: 6 breaking, 2 new APIs and options. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/@mermaid-js/layout-elk/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @mermaid-js/layout-elk 1

### Breaking changes

- Adds edge-crossing line hops, enabled by default. Set false for plain crossings or 'gap' to use gaps instead of arcs. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Adds named combinations of layout options: default, legacy, modelOrder, and depthFirst. The new default changes existing ELK diagram layouts; legacy restores the previous rendered behavior. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Existing ELK diagrams now use balanced node-placement alignment and depth-first cycle breaking by default, so their layouts can differ; preset: legacy restores the previous behavior. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- A margin of 12 is now reserved at the ends of every side so ELK keeps ports off node corners, reducing edges that leave from corners. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Small steps next to nodes are removed by aligning the channel with the port row. Set false to keep the previous behavior. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Mermaid now targets ES2024 and Safari 17.4+; older browsers may need polyfills or transpilation. Node.js v22.12+ is declared as a package requirement. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)

### Performance

- The core entry now defers to the host's Mermaid instead of inlining a separate copy, reducing bundle size and ensuring Mermaid rendering fixes reach the ELK layout path. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)

### Behavior and default changes

- Mermaid bundles and registers ELK automatically, so most projects can drop this dependency and the registerLayoutLoaders call. The package remains usable to add ELK to mermaid.tiny.js builds. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Edges leaving non-rectangular shapes now attach along their departure axis, keeping the opening segment straight and orthogonal. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Subgraph frames are drawn at an even distance from their children while routing lanes remain outside the frame, making groups tighter and less lopsided. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)

### Fixes and other changes

- With ELK, class cardinality labels are placed beside their relation ends on dagre's sides, centred on dagre's ends, and no longer clipped. (1.0.1) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.1)
- Anchors displaced off-center by the ports-surrounding margin are discarded for nodes narrower than 24px, so edges aim at the node center. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)
- Title padding is reserved before ELK routes edges so attachments stay on the painted frame; stale interior endpoints are clipped along the incoming segment. (1.0.0) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0)

## @mermaid-js/layout-elk 0.2

### New APIs and options

- Adds a configuration option to keep a recursive flow's entry node on top. (0.2.3) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.3)
- Adds the `elk.nodePlacementAlignment` configuration option. (0.2.3) — [release notes](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.3)
