Skip to content
Discussion options

You must be logged in to vote

ELK layout is not working for Mermaid version 11.*. According to the discussion at that issue, you need to have the engine loaded and registered.

Try:

---
title: "Reproducible Quarto Document"
format: 
  html:
    include-in-header: 
      text: |
        <script type="module">
        import elkLayouts from 'https://cdn.jsdelivr.net/npm/@mermaid-js/layout-elk@0/dist/mermaid-layout-elk.esm.min.mjs';
        mermaid.registerLayoutLoaders(elkLayouts);
        </script>
---

```{mermaid}
---
config:
  layout: elk
  elk:
    mergeEdges: true
    nodePlacementStrategy: LINEAR_SEGMENTS
---
flowchart LR
  A[Start] --> B{Choose Path}
  B -->|Option 1| C[Path 1]
  B -->|Option 2| D[Path 2]
```

Yo…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@anaitab
Comment options

Comment options

You must be logged in to vote
6 replies
@Steinthal
Comment options

Answer selected by anaitab
@anaitab
Comment options

@anaitab
Comment options

@mcanouil
Comment options

mcanouil Dec 1, 2025
Collaborator

@anaitab
Comment options

Comment options

You must be logged in to vote
1 reply
@Steinthal
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
diagrams-mermaid Mermaid diagrams
3 participants