Repository navigation
Render Mermaid.js diagrams directly in chatbot responses #1593
Replies: 1 comment
|
@AntoFarmer0 this isn't supported today, and the part that renders diagrams in chat is small enough to build, so I've opened #1625 for it. Nobody is assigned yet; it's marked What I checked:
Three constraints come with the Issue: Mermaid loads only when a diagram is actually on screen (it's a large library), it renders in strict security mode because the diagram source is model output, and while an answer is still streaming an unfinished block stays as code until it closes. Two things that would help whoever picks it up: which diagram types do you actually get from your models (flowcharts, sequence, mind maps)? And how often is the generated syntax invalid in practice? If you can paste one or two real blocks into #1625, valid and invalid, they make good test cases. If you or anyone reading wants to implement it, say so on #1625. Status: graduated → #1625 |
Uh oh!
There was an error while loading. Please reload this page.
What are you trying to do?
I frequently ask the chatbot to map out relationships between concepts, summarize workflows from uploaded sources, I want the chatbot to be able to generate visual diagrams using Mermaid syntax that appear directly inside the conversation
What feels difficult or missing today?
When the LLM generates a ```mermaid code block, the chat interface only renders it as raw plain-text code
What outcome would help?
When a chatbot response contains a ```mermaid code block, it should automatically render as a clean, readable diagram right inside the chat:
Ability to zoom in, zoom out, reset zoom, and pan/drag around the rendered SVG diagram
Theme consistency: Rendered diagrams match notebook active light or dark theme so they remain easy to read.
A toggle to switch between the rendered diagram and the raw Mermaid code
if an LLM occasionally outputs invalid Mermaid syntax, the chat falls back to showing the raw code block
How do you handle this today?
I copy the raw mermaid code block from the Open Notebook chat open an external tool and paste it there
Additional context, examples, or possible directions
Extending the same rendering support to standard Notes would make it seamless to save and edit generated diagrams inside a notebook
How would you like to participate?
Before posting
All reactions