Show HN: Mermaid ASCII Diagrams

AlexanderGrooff | 234 points

Some nits:

The "Example" buttons don't jump out at me; I found them but it took a while. Also consider labeling them with their point, e.g. "Example 3: Color"

If you change the input text to something well-formed, the graph seems to update immediately. But if you change it to something ill-formed, the graph doesn't update immediately — and then if you click "Generate" manually, it blanks the input box. Either this is a bug, or the "Generate" button doesn't do what I think it does (i.e. generate output). Again, adding a noun to the verb might help. Or just adding some usage information somewhere on the page.

For those like me who've never heard of "Mermaid," apparently it's like GraphViz's dot language but different. https://github.com/mermaid-js/mermaid I tried the flowchart example from Mermaid's own README, but it didn't come out right: looks like the shape characters [] and {} aren't handled.

quuxplusone | 9 months ago

This obviously needs a direct pipe into Svgbob!

https://ivanceras.github.io/svgbob-editor/

virtualritz | 9 months ago

Hey, where are the mermaids?!?

But now seriously.. the diagrams are working really well for simple examples, thank you so much for sharing this tool. I have bookmarked your page, my documentation is based on text files and often have to build these kind of diagrams too.

The example buttons took me a while to be found, but are good for syntax explanation. Thank you for making this available.

nunobrito | 9 months ago

Nice work, I love ascii diagrams. Especially useful when you want a visual explanation that can be embedded directly in source code.

Small nit on layout: 90 degree joints should use "+" in the connecting lines, as they do in the boxes.

jonahx | 9 months ago
zczc | 9 months ago

I have been using Monodraw for a long time: https://monodraw.helftone.com/

It's a macOS app and I've found it great. However if given an ASCII diagram, you cannot edit it with the same ease as creating a new one (e.g. reflowing text or resizing boxes).

I really like the idea of having the mermaid source and the ASCII diagram together, so you could use the source to change the diagram if needed. But I feel that would feel cluttered to have both in a plain text file or comment, where ASCII diagrams shine.

comebhack | 9 months ago

Is there something that can turn those ascii diagrams back into mermaid sources?

I tried the first example with gpt-o1 and the result wasn't bad:

    graph LR
    A --> B --> D
    A --> C
    B --> C
    D --> C
would a smaller model but fine tuned on many syntetic renderings do a better job?
ithkuil | 9 months ago

I supposed it's good for basic usage. I just tried a more complex graph and it didn't render well.

piedpiper99 | 9 months ago

Hah we rely on Mermaid a _heap_ at work for building internal dependency graphs from `yarn info` JSON data and a super lazy depth-first graph haha. Super useful, nice to see another renderer!

ts-directed-graph outputs Mermaid :)

This tool seems way more useful for hand-made ones, definitely bookmarking

girvo | 9 months ago

I use this for generating AWS deployment diagrams, which is kinda similar - https://github.com/mingrammer/diagrams

the_arun | 9 months ago

Are you planning to support more of mermaids features? I tried one example where this could be useful to me - Mermaids gitGraph - and it looks like it's not supported.

Lorak_ | 9 months ago

In the age of AI someone automated Mentifex[1]!

[1] https://nothingisreal.com/mentifex_faq.html

abraxas | 9 months ago

graph TD

project is called Mermaid ASCII -->|expectation| It supports mermaidjs syntax

It supports mermaidjs syntax -->|I tried| It doesn't

It doesn't -->|conclusion| I am a bit bummed

https://mermaid.js.org/syntax/examples.html

prmoustache | 9 months ago

Wow! this will come pretty in hand when building plaintext documentation using diagrams.

flykespice | 9 months ago

love it, will definitely be using it for sketching documentation in comments for SQL sprocs, etc.

One request: support for self-reference, i.e. "A --> A", "A --> A & B"

nlake906 | 9 months ago

This would be great to build into project readme workflows.

ewalk153 | 9 months ago
[deleted]
| 9 months ago

I'm disappointed. I was actually expecting lovely ascii art pictures of mermaids.

octopusRex | 9 months ago

[flagged]

airstrike | 9 months ago