docfx icon indicating copy to clipboard operation
docfx copied to clipboard

[Feature Request] Support Elk Rendering in Mermaid

Open skmcavoy opened this issue 10 months ago • 0 comments

Is your feature request related to a problem? Please describe. Mermaid now supports Elk renderer (https://mermaid.js.org/config/schema-docs/config.html#defaultrenderer). This allows you to have a very different (and superior imo) layout for generated diagrams.

Describe the solution you'd like While you can use the mermaid options to pass a DefaultRenderer value, the Elk renderer must be manually loaded by calling

import elkLayouts from "https://cdn.jsdelivr.net/npm/@mermaid-js/layout-elk@latest/dist/mermaid-layout-elk.esm.min.mjs"
mermaid.registerLayoutLoaders(elkLayouts)

or similar prior to calling mermaid.initialize.

There's no way to currently do this.

Describe alternatives you've considered Provide a hook where additional js code can be injected to manipulate the mermaid object.

Additional context See https://github.com/mermaid-js/mermaid/issues/5969#issuecomment-2645923926

skmcavoy avatar Jun 27 '25 22:06 skmcavoy