dotnet / dotnet/docfx

[Feature Request] Support Elk Rendering in Mermaid

Open
#10,728 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**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
```js
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.