How do I get DOT to display an image for a node?

Using a graphviz snapshot from May 2011 (2.29), the following syntax digraph g{ imgnode[image=”apple-touch-icon.png”, label=””]; } results in You’ll need to set an empty label to prevent the node name from being displayed. If this is not working for you, you may check the output of dot (something like dot -Tpng -o graph.png graph.gv) – … Read more

Graphviz .dot node ordering

Here’s how I’d write that graph: First of all, to me this is a graph which goes from top to bottom, not left to right, therefore I removed the rankdir=LR and added rank=same only for nodes 0/1 and nodes 2/3. I removed all the weights Most importantly, I added constraint=false to the edges going against … Read more

How to control subgraphs’ layout in dot?

The steps to achieve this uses multiple graphviz tools which can be piped together. The following line is a possible configuration, graph.dot being the file which contains your graph(s). You may have to fiddle with the options. ccomps -x graph.dot | dot | gvpack -array3 | neato -Tpng -n2 -o graph.png And here’s the explanation: … Read more

Reading DOT files in javascript/d3

⚠ Solution proposed here depends on two libraries marked as unsupported by their authors. To get Graphviz DOT files rendered in Javascript, combine the graphlib-dot and dagre-d3 libraries. The graphlibDot.read() method takes a graph or digraph definition in DOT syntax and produces a graph object. The dagreD3.render() method can then output this graph object to … Read more

How does one define double-lines for edge and node shapes in graphviz dot?

Doubled shapes can be done by using [peripheries=2] on the node Doubled edges can be done by specifying more than one colour for the edge, separated by a colon. In this case use the same colour twice: [color=”black:black”] (or, to separate them slightly more, do [color=”black:invis:black”]) I got there eventually! Sorry for the “evolutionary” nature … Read more