2

I want to programmatically create small, really simple flow charts like the one below:

flowchart

Source: https://commons.wikimedia.org/wiki/File:LampFlowchart.svg

What is a good open-source software choice to do this?

2 Answers 2

3

For simple graphs I could recommend d2lang

#file: d2-example-lamp-bulb.d2
Lamp doen't work: Problem {
  Lamp plugged in? -> Bulb burned out?:yes
  Bulb burned out? -> Replace bulb:yes
}

call it with the shell command:
~/apps/d2/bin/d2 -w d2-example-lamp-bulb.d2 d2-example-lamp-bulb.svg

This generates

enter image description here


From 2022:
The classic software for doing this is Graphviz and its "dot" language.

There are several language bindings available, for many programming languages, actually. Many apps are built on top of graphviz, see Wikipedia article.

There is a very comprehensive repository "Awesome Graphviz" with lots of graphviz related links.

Recently I came across DiagrammeR, but this requires substantial web development skills and full commitment to the modern R ecosystem (R + RStudio + htmlwidgets + JavaScript + d3.js + viz.js + mermaid.js).

But see 2-minute showcasing video on their homepage. It shows almost pure graphviz code (wrapped in a single R function). From simple graph to more complex graph, with animations and "hot reloading".

Previous related Qs about Graphviz and Alternatives

1

You can use https://app.diagrams.net/ for free in your browser. It is easy to use!

Click on Create New Diagram and it lets you select from various flowchart templates:

flowchart models at diagrams.net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.