Graphs (last update: 2012-10-07, created: 2012-10-07) back to the list ↑
Some more stuff I tend to forget.

DOT file format

http://en.wikipedia.org/wiki/DOT_language
http://www.graphviz.org/doc/info/attrs.html - good reference
http://www.graphviz.org/Gallery.php - example gallery

Renderers: dot / graphviz

Installing and using graphviz on Ubuntu:

sudo apt-get install graphviz
dot -Tpng name.dot > name.png


Simple example graph

Sample code:

digraph nodes {
  ratio = "auto";
  layout = "dot";
  outputorder="edgesfirst"
  /*ranksep=3.0; nodesep=2.0;*/
  overlap=false;
  node [fontsize=12, height=0.6, width=0.6, fixedsize=false];
  node [shape=ellipse, style=filled];
  edge [style=solid];

  node [fillcolor="#0000ff", fontcolor="white", penwidth=2];

  a [label="I am the A"];
  b [label="Hi from B"];
  c [label="Diamond C"];
  d [label="D d d..."];


  a -> b;
  b -> d;
  edge [style=dashed];   c -> b;
  
};

Result:


【 design & art by Xa / Gynvael Coldwind 】 【 logo font (birdman regular) by utopiafonts / Dale Harris 】