unstale

npm / @mermaid-js/layout-elk

@mermaid-js/layout-elk

What changed in @mermaid-js/layout-elk 0.2 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-27.

6 breaking2 new APIs and options1 performance3 behavior and defaults3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.8 on npm

@mermaid-js/layout-elk 113 changes

Breaking changes 6

  • Adds edge-crossing line hops, enabled by default. Set false for plain crossings or 'gap' to use gaps instead of arcs.

    1.0.0release notes

  • 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.0release notes

  • 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.0release notes

  • 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.0release notes

  • Small steps next to nodes are removed by aligning the channel with the port row. Set false to keep the previous behavior.

    1.0.0release notes

  • 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.0release notes

Performance 1

  • 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.0release notes

Behavior and default changes 3

  • 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.0release notes

  • Edges leaving non-rectangular shapes now attach along their departure axis, keeping the opening segment straight and orthogonal.

    1.0.0release notes

  • 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.0release notes

Fixes and other changes 3

  • 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.1release notes

  • 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.0release notes

  • 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.0release notes

@mermaid-js/layout-elk 0.22 changes

New APIs and options 2

  • Adds a configuration option to keep a recursive flow's entry node on top.

    0.2.3release notes

  • Adds the elk.nodePlacementAlignment configuration option.

    0.2.3release notes