9 ms·
Mermaid: Markdown-like generation of diagrams and flowcharts from text
- mkempe 9y agoThis is wonderful. Just being able to generate (and modify) a sequence diagram from a text description is worth hours of work.
- binarycrusader 9y agoSee also markdeep: https://casual-effects.com/markdeep https://casual-effects.com/markdeep
- HIPisTheAnswer 9y ago> Markdeep is a technology for writing plain text documents that will look good in any web browser I couldn't read their website on my mobile...
- binarycrusader 9y agoIt’s perfectly readable on a mobile phone for me?
- stareatgoats 9y agoMe neither, on desktop: ERR_BAD_SSL_CLIENT_AUTH_CERT
- IIAOPSW 9y agographviz http://www.graphviz.org/download/ http://www.graphviz.org/download/ also the DOT language has been around for ages.
- krapht 9y agoYeah, I'd like a comparison to graphviz/plantuml, not sure how this is different.
- vvanders 9y agoYeah, PlantUML is my go-to for sequence diagrams. I used to hate them until I discovered it, there's even a great VSCode plugin for real-time iteration. It's not so great with other things but worth it for that alone.
- nerdponx 9y agoIt's almost identical, and it's a shame they didn't just make a Graphviz compiler for te browser.
- bitexploder 9y agoThere is an emscripten compiled graphviz already. Works fine.
- Groxx 9y agoYea, I've used http://www.webgraphviz.com/ http://www.webgraphviz.com/ for quite a while. Toss in a tiny script to click the button after every keypress, and voila: live-editing graphviz stuff. It's magical.
- tmoravec 9y agoThe Mermaid syntax looks quite similar to DOT. It's at least partially inspired I guess.
- vidarh 9y agoDOT is really messy for complex layout of nodes, and Graphviz to my knowledge doesn't have any layout options to produce straight angled edges between nodes. I love Graphviz, but that space badly needs more competition.
- lvh 9y agoNot that I don’t welcome competition, but you mean the “splines” attribute? https://www.graphviz.org/doc/info/attrs.html#d:splines https://www.graphviz.org/doc/info/attrs.html#d:splines
- vidarh 9y agoAh, I had never seen that before - I see it was added in 2010, shows how long it was since I looked at the Graphviz docs I guess. But even so the docs and screenshot shows it has plenty of problems unless it's improved substantially beyond what's on that page.
- cjhveal 9y agoOh wow, at first I thought this was another ASCII-art to image generator like ditaa[1]. This is much more practical. I'll give this a shot next time I might have otherwise reached for Graphviz or Lucidchart. [1]: http://ditaa.sourceforge.net/ http://ditaa.sourceforge.net/
- Lio 9y agoNot to knock Mermaid but the interesting thing about Markdown to my mind is that it’s still readable in raw format. By which I mean it looks like a well annotated ASCII text file rather than a raw markup language in text. Ditta looks like at least has the potential for that. If github had the ability render Ditaa it would be brilliant. I think the main problem is that you still need the right tooling to draw it efficiently and Markdown doesn’t really require that. Eg editor plugins for reflow and drawing/resizing boxes.
- gegtik 9y agoYou should also check out http://plantuml.com/ http://plantuml.com/ An online editor/renderer is available at http://planttext.com/ http://planttext.com/
- CMCDragonkai 9y agoMain issue is being able to render in-browser. Which mermaid can. Wish plantuml can be ported to js.
- BLanen 9y agoWouldn't it? Graphviz can be ported to JS, I found an example although I didn't try it.
- erichdongubler 9y agoGraphViz in the browser was made possible by `emscripten`, which is essentially a JavaScript compiler target. In that sense, there's not a implementation in a language besides C++ that's gotten much traction.
- laythea 9y agoIt seems to me, to be a really bad idea to generate "almost code" in order to be able to generate diagrams for "actual code" that you have to write.
- michaelbuckbee 9y agoI really like this, it's a bit buried in their "sibling projects" but there is a live rendering version as well: https://mermaidjs.github.io/mermaid-live-editor/ https://mermaidjs.github.io/mermaid-live-editor/ Very cool project.
- stevemk14ebr 9y agoGood find. This should be linked in the readme
- pronoiac 9y agoI like this! I'd love it if Github rendered Mermaid diagrams in their Markdown.
- logiclabs 9y agoGitlab.com supports Mermaid in markdown.. https://docs.gitlab.com/ee/user/markdown.html#mermaid https://docs.gitlab.com/ee/user/markdown.html#mermaid
- wooly_bully 9y agoI just found this feature in our installation at work. It's so much more convenient than lucidcharts or Visio or really any GUI option.
- sytse 9y agoYes, we use it at GitLab and it has been a game changer in making sure diagrams are open to contributions.
- QML 9y agoWished they rendered latex as well.
- cben 9y agoGitLab renders math (via KaTeX iirc): https://docs.gitlab.com/ee/user/markdown.html#math https://docs.gitlab.com/ee/user/markdown.html#math
- hnaccy 9y agoI'm waiting for TikZ on the web.
- cben 9y agoClient-side is not really feasible (emscripten TeX has been done, but the packages to load are just too huge...). Server-side, https://tex.s2cms.com/ https://tex.s2cms.com/ does a nice job and outputs svg; https://upmath.me/ https://upmath.me/ by same author is markdown editor integrating it - see tikz examples there.
- retzkek 9y agoThe Diagram panel plugin for Grafana uses this, you can attach metrics to nodes in the diagram and color them according to a gradient. I like using it instead of single stat panels for giving a quick overview of the state of the system, then including detailed graphs underneath. https://grafana.com/plugins/jdbranham-diagram-panel https://grafana.com/plugins/jdbranham-diagram-panel
- lobster_johnson 9y agoMermaid is great, and I've used it for architectural diagrams of how tech stacks are put together, or data flows between apps. But it only produces marginally nicer-looking diagrams than Graphviz, and it optimizes badly against unnecessary line intersections (e.g. it's far too easy to end up with this, even in trivial diagrams: https://imgur.com/Tkpa9fD https://imgur.com/Tkpa9fD). My wish is for a diagram renderer with a smarter layout algorithm that heavily optimizes for direction and cleanness, understands grouping really well, and comes with easy ways to apply SVG styles. I like Google's diagrams in this regard: http://donatz.info/wp-content/uploads/2017/10/google-cloud-architecture-beautiful-on-with-regard-to-real-time-bidding-architectures-1.png http://donatz.info/wp-content/uploads/2017/10/google-cloud-a... http://donatz.info/wp-content/uploads/2017/10/google-cloud-architecture-lovely-on-intended-designing-etl-for-a-native-data-warehouse-5.png http://donatz.info/wp-content/uploads/2017/10/google-cloud-a... http://donatz.info/wp-content/uploads/2017/10/google-cloud-architecture-fine-on-intended-for-platform-blog-understanding-pricing-6.png http://donatz.info/wp-content/uploads/2017/10/google-cloud-a...
- qznc 9y agoI would love a GraphViz like tool which produces more beautiful graphs. Example: https://www.flickr.com/photos/gigile/3505955900 https://www.flickr.com/photos/gigile/3505955900 Note how well the overall graph fits into the rectangular format. GraphViz sucks at this. This image is not perfect though. There are a few unnecessary crossovers. Another thing I miss in GraphViz are line jumps: https://support.office.com/en-us/article/add-or-remove-connector-line-jumps-1a5516db-0212-4352-90dd-fc9cfd4018ed https://support.office.com/en-us/article/add-or-remove-conne...
- Heisgone01 9y agoThe following code is pretty easy to hack: https://archive.codeplex.com/?p=graphviz4net https://archive.codeplex.com/?p=graphviz4net I started to customize it but lacked times. The biggest challenge was to be able to convert the WPF rendering into something else, which I couldn’t figure out. I changed the canvas for another one with a better zoom function but couldn’t export or print the canvas.
- 9y ago
- os72 9y agoTypora (https://typora.io/ https://typora.io/) can render mermaid and is useful for local markdown editing in general. It's quite cool.
- GordonS 9y agoAny idea if it supports Asciidoc? It wasn't obvious to me where to find info on the supported markdown languages on their website.
- mpcjanssen 9y agoIt is supported by asciidoctor-diagram.
- soulnothing 9y agoIf you have a grafana stack this is great with their plugin. https://grafana.com/plugins/jdbranham-diagram-panel https://grafana.com/plugins/jdbranham-diagram-panel I was able to do architectural diagrams and post them as dashboards. Showing a top-level metric, then make that block red on a thresh hold breach. It gave not only a top-level view, but a performance over view as well. An example would be the frontend web requests and average latency response, to api request count and latency than the actual database backend. All as separate blocks with individual metrics.
- rmetzler 9y agoblockdiag [0] has several helpful types of text to diagram processors with several output filetypes like svg and png. In particular I like nwdiag (network diagrams), rackdiag (server rack layout) and packetdiag the most. There is also an interactive web form [1] to try it out. You can switch between the types of diagram in the top right dropdown. [0] http://blockdiag.com/en/ http://blockdiag.com/en/ [1] http://interactive.blockdiag.com/nwdiag/ http://interactive.blockdiag.com/nwdiag/
- arca_vorago 9y agoI second blockdiag and it's variants. One of my half done side projects is an automatic network scanner and mapper that is versions so you can walk back in time on the network with netdiag. The only downside to me is the non gpl license.
- jwilk 9y agoWhat do you mean by "Markdown-like"?
- coldtea 9y agoPlain ascii text with as few special characters as possible and simple line oriented syntax.
- renku 9y agoI think the main advantage of Markdown is that the source is equally readable without having to run it through a processor. I don't think this really applies to this Mermaid library. For a Markdown-like I would expect more of an ASCII-art like input, which would look like the rendered chart also in its ASCII form.
- coldtea 9y ago>I don't think this really applies to this Mermaid library. Well, it is easy to just read and understand what it talks about (as opposed to some more opaque format) and only has the bare minimum annotations needed beyond the text labels and node names. >For a Markdown-like I would expect more of an ASCII-art like input, which would look like the rendered chart also in its ASCII form I don't see much value in such a scheme (even though there does exist such a program), because to produce (and later edit/update) the ASCII-art would be as tiresome and evolved as producing the final graphic document. I'd rather write e.g something like: label a = "start" label b = "end" a -> b than draw 2 ascii art boxes, place the labels myself, and draw ascii art arrow between them.
- vanderZwan 9y agoMarkDeep tries this, it doesn't quite work in my opinion: https://casual-effects.com/markdeep/features.md.html#toc2 https://casual-effects.com/markdeep/features.md.html#toc2
- nablaoperator 9y agoThere is also 'Markdown Preview Enhanced' for Atom and VS Code which can render Mermaid. https://github.com/shd101wyy/markdown-preview-enhanced https://github.com/shd101wyy/markdown-preview-enhanced
- zapita 9y agoProtip: Gitbook has a Mermaid plugin, and they make for a sweet combination.
- Lunatic666 9y agoWow, that’s awesome, I was looking for something like this a while ago to visualize a state machine. I ended up using graphviz, but I’ll have a look at mermaid for presentations, my diagrams always look super embarrassing.
- seanwilson 9y agoWhy does the text for flowchart end lines with semicolons but the other diagram types don't?
- mark_l_watson 9y agoI understand that Mermaid is designed to generate diagrams into HTML DOMs, not my use case. I have experimented over the years with text based diagram tools to replace OmniGraffle for figures in the books I write. My writing process is fairly streamlined and efficient, except for generating OmniGraffle figures which takes some time. My day job is in machine learning (30+ years) and I have considered creating a model to map my hand drawn figures to something nicer - not too difficult, except for a lack of training data.
- teleclimber 9y agoHave a look at drawexpress which turns hand gestures into shapes. It's excellent, one of my favorite apps. http://www.drawexpress.com http://www.drawexpress.com
- andrewmcwatters 9y agoThis isn't markdown-like.
- tomonocle 9y agoDoes anyone know of something similar for architecture diagrams? I've tried PlantUML's component mode (http://plantuml.com/component-diagram http://plantuml.com/component-diagram) but wondered whether there were any other options out there, as being able to write maintain source-controlled diagrams as code/text would make me very happy!