Some Misc Notes

Graphviz

Graphviz is a toolkit for making diagrams. You write a text file containing a description of the graph, then process it with one of the graphviz command-line tools to create a graphical image of the diagram. It can do more than that, but I’m just using it for making simple diagrams.

Install

On Debian:

apt install graphviz

There are many other graphviz-related packages available as well, including programs that can generate dot files for you.

Dot

dot is for drawing directed graphs. Diagram files are written in the “DOT language”.

As an example, from the dotguide manual, greate a my-diag.gv file:

digraph G {
    main -> parse -> execute;
    main -> init;
    main -> cleanup;
    execute -> make_string;
    execute -> printf
    init -> make_string;
    main -> printf;
    execute -> compare;
}

And process it like so:

dot -Tpng my-diag.gv -o my-diag.png

You can open the resulting file with ristretto my-diag.png, and it should look like: