Hacker News new | ask | show | jobs
by karboosx 3275 days ago
There is good tool for making diagrams (so state machines as well) called mermaid[1], just by writing simple readable text.

[1] https://github.com/knsv/mermaid

2 comments

I wanted to like Mermaid, then I realized it was just a neutered version of GraphViz. I had wanted to write a Mermaid-to-Graphviz compiler but never got around to it.

It produces pretty ugly graphs that can't be exported to any other format. Meanwhile just about ever graph manipulation program (e.g. Gephi) can handle GraphViz DOT format.

I didn't know GraphViz. I have to try it. DOT language looks very similar to Mermaid.

It was too hard to make that compiler or you have encountered another problem?

I didn't even know what BNF was when I had the idea ;)

It's still on my list of short projects. I have a lot of learning to do, knowing nothing about writing parsers and such. Yes, I know I could probably hack it together with a bunch of garbage Python. But that just does not sound fun to write, let alone maintain.

Apparently some people also wanted graphviz syntax: https://github.com/knsv/mermaid/issues/5

I also find another project called Viz.js[1]. It's graphviz in javascript. Looks promising. It's hard to choose between this two. On the one hand is very simple syntax, and on the other hand more flexibility.

[1] https://github.com/mdaines/viz.js/

PlantUML is a text based solution, too. I use it write in the Atom IDE.

http://plantuml.com/state-diagram