Open research

In the spirit of free and open source software the central topic of this site is to make my research open to the public. My methodology is freely available via the internet, along with any data or results extracted or derived from them. This permits collaboration, which anyone may participate at any level of the project. So feel free to contribute on Github.

Homepage » DOT & Graphviz

DOT & Graphviz

What is DOT?
DOT is a tool to generate nice-looking diagrams with a minimum of effort. It is not just another paint program, nor a vector graphics program. DOT is a scriptable, batch-oriented graphing tool; it is to vector drawing programs as LaTeX is to word processors. DOT is especially useful in repetitive and automatic tasks. You can not control the positioning of Nodes exactly – but the idea is that Graphviz does the positioning automatically so that you only have to worry about and document the Nodes and the relationships between them, so don’t get hung up on the layout too much.

What is Graphviz?
Graphviz (short for Graph Visualization Software) is a package of open source tools initiated by AT&T Research Labs for drawing graphs specified in DOT language scripts.

Graphviz Installation

If you are using a Mac simply install Homebrew. Just paste ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" into your terminal. Then update the package list by typing brew update and install Graphviz afterwards by brew install graphviz. Done.

Terms

Resources

Filter

A filter is a layout algorithms to automatically arrange the diagram. Graphviz comes with the following filters:

Layout parameter

Parameter Description dot neato fdp circo twopi Default value Examples
size Maximum size of the diagram XX XX XX XX XX “3,3” (small), “10.3,5.3” (fits 1024px)
ranksep distance between hierarchical ranks X       XXX 0.5 (dot), 1.5 (twopi) 0.1 (very tiny), 0.6 (large)
nodesep minimal distance to two hierarchical identical nodes X         0.25 nodesep=0.05 (very tine)
len preferred edge(!) length, edge attribute   XXX X     1.0 (neato), 0.3 (fdp) 0.5
mindist changes spaces for circos diagrams       XXX     0.5 (few nodes), 0.01 (many nodes)
ratio favored ratio X X X X X 2 (portrait format)
start influences node segmentation   X XXX       2
overlap are overlaps allowed?   X X     true false (otherwise edges collapse possibly)

The more crosses (XXX), the more important is the parameter.
cf. Graphviz-Tutorial (german)

Terminal commands

Tutorials

Interesting code snippets

digraph G {
  compound=true;
  ranksep=1.25;
  label="From Past to Future...";

  node [shape=plaintext, fontsize=16];

  bgcolor=white;
  edge [arrowsize=1, color=black];

  /* Nodes */
  subgraph cluster_Computers {label="Computers"; labelloc="b"; Computers_icon};
  Computers_icon [label="", shape=box, style=invis, shapefile="Computers.png"];

  subgraph cluster_Semantic_Web {label="Semantic Web"; labelloc="b"; Semantic_Web_icon};
  Semantic_Web_icon [label="", shape=box, style=invis, shapefile="Semantic_Web.png"];

  subgraph cluster_Cryptography {label="Cryptography"; labelloc="b"; Cryptography_icon};
  Cryptography_icon [label="", shape=box, style=invis, shapefile="Cryptography.png"];

  subgraph cluster_Automata {label="Automata"; labelloc="b"; Automata_icon};
  Automata_icon [label="", shape=box, style=invis, shapefile="Automata.png"];

  subgraph cluster_AI {label="A.I."; labelloc="b"; AI_icon};
  AI_icon [label="", shape=box, style=invis, shapefile="AI.png"];

  subgraph cluster_Chaos {label="Chaos / Fractals"; labelloc="b"; Chaos_icon};
  Chaos_icon [label="", shape=box, style=invis, shapefile="Chaos.png"];

  subgraph cluster_XML {label="XML / RDF / URI"; labelloc="b"; XML_icon};
  XML_icon [label="", shape=box, style=invis, shapefile="XML.png"];

  subgraph cluster_Ontology {label="Ontology / Clustering"; labelloc="b"; Ontology_icon};
  Ontology_icon [label="", shape=box, style=invis, shapefile="Ontology.png"];

  subgraph cluster_Biology {label="Biology / Neurons"; labelloc="b"; Biology_icon};
  Biology_icon [label="", shape=box, style=invis, shapefile="Biology.png"];

  subgraph cluster_Agents {label="Agents / Security"; labelloc="b"; Agents_icon};
  Agents_icon [label="", shape=box, style=invis, shapefile="Agents.png"];

  subgraph cluster_Small_World {label="The Small World Project"; labelloc="b"; Small_World_icon};
  Small_World_icon [label="", shape=box, style=invis, shapefile="Small_World.png"];

  subgraph cluster_Social_Networks {label="Social Networks"; labelloc="b"; Social_Networks_icon};
  Social_Networks_icon [label="", shape=box, style=invis, shapefile="Social_Networks.png"];

  subgraph cluster_Search_Engines {label="Search Engines"; labelloc="b"; Search_Engines_icon};
  Search_Engines_icon [label="", shape=box, style=invis, shapefile="Search_Engines.png"];

  subgraph cluster_Turing {label="A. Turing"; labelloc="b"; Turing_icon};
  Turing_icon [label="", shape=box, style=invis, shapefile="Turing.png"];

  subgraph cluster_Rejewski {label="M. Rejewski"; labelloc="b"; Rejewski_icon};
  Rejewski_icon [label="", shape=box, style=invis, shapefile="Rejewski.png"];

  subgraph cluster_Dertouzos {label="M. Dertouzos"; labelloc="b"; Dertouzos_icon};
  Dertouzos_icon [label="", shape=box, style=invis, shapefile="Dertouzos.png"];

  subgraph cluster_Berners_Lee {label="T. Berners-Lee"; labelloc="b"; Berners_Lee_icon};
  Berners_Lee_icon [label="", shape=box, style=invis, shapefile="Berners_Lee.png"];

  /* Relationships */
  Computers_icon -> Semantic_Web_icon;
  Semantic_Web_icon -> Computers_icon;
  Cryptography_icon -> Semantic_Web_icon;
  Cryptography_icon -> Computers_icon;
  Automata_icon -> Computers_icon;
  AI_icon -> Automata_icon;
  Automata_icon -> AI_icon;
  Chaos_icon -> Computers_icon;
  Chaos_icon -> AI_icon;
  AI_icon -> Chaos_icon;
  Computers_icon -> Chaos_icon;
  XML_icon -> Semantic_Web_icon;
  XML_icon -> Computers_icon;
  Computers_icon -> XML_icon;
  Ontology_icon -> Semantic_Web_icon;
  Biology_icon -> AI_icon;
  Biology_icon -> Chaos_icon;
  Chaos_icon -> Biology_icon;
  Chaos_icon -> Semantic_Web_icon;
  Agents_icon -> Semantic_Web_icon;
  Semantic_Web_icon -> Agents_icon;
  Agents_icon -> AI_icon;
  AI_icon -> Agents_icon;
  Small_World_icon -> Chaos_icon;
  Small_World_icon -> Agents_icon;
  Small_World_icon -> Biology_icon;
  Biology_icon -> Small_World_icon;
  Social_Networks_icon -> Small_World_icon;
  Social_Networks_icon -> Biology_icon;
  Search_Engines_icon -> Semantic_Web_icon;
  Computers_icon -> Search_Engines_icon;
  Turing_icon -> Cryptography_icon;
  Turing_icon -> Computers_icon;
  Turing_icon -> Automata_icon;
  Rejewski_icon -> Turing_icon;
  Rejewski_icon -> Cryptography_icon;
  Dertouzos_icon -> Computers_icon;
  Dertouzos_icon -> Berners_Lee_icon;
  Berners_Lee_icon -> Semantic_Web_icon;

  { rank=same; Rejewski_icon; Turing_icon; Dertouzos_icon; Berners_Lee_icon };
  { rank=same; Biology_icon; AI_icon; Social_Networks_icon };
}

Source: How to use Graphviz to generate complex graphs