Downloading and Setting up the Graphviz Tools Package

Downloading and Setting up the Graphviz Tools Package

The original Graphviz tools package, upon which Graphviz Filter is built, comes in the form of command-line tools named "dot", "neato", "twopi", etc. Graphviz Filter and the PEAR package Image_Graphviz depend on finding these command-line tools to be able to produce their output.

This is why they should be on the system path.

On Linux, installing those tools is as easy as letting the package manager do it for us. For example on Ubuntu this will install the command-line tools and make them available for anyone who calls them.
sudo apt-get install graphviz

On Windows it is necessary to download an installer from the Graphviz site. Unfortunately, this installer does not add the folder where these tools are installed (e.g. C:\Program Files\Graphviz 2.21\bin) to the %PATH% variable. In order for PHP on Windows to find Graphviz, the %PATH% variable must be modified to include the bin folder. This is usually done by right-clicking My Computer | Properties | Advanced | Environment Variables, then finding and editing the Path system variable in that dialog. The full path of the bin folder should be appended to the value of the Path variable, preceded by a semicolon (;).
Example:
;C:\Program Files\Graphviz 2.21\bin

To make sure this works, type 'cmd' in the Start | Run... box, then in the console, type:
dot -h

This should display a help message on using 'dot'. Of course, if the path isn't set correctly, you'll get an 'unrecognized command' message instead.

Graphviz tools package Installation

  1. Per the Graphviz tools package link download the Graphviz tools package msi file. Run the msi file and follow the installation instructions.
  2. Add the folder location (folder path) to the existing Windows %PATH% environment variable.
  3. Test from the command line interface (CLI) using the command and flag, dot -h.

The dot: option -h unrecognized message was intended as there is no actual -h, just a simply way to force the print to screen output.
Example output of a working installation:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>dot -h
dot: option -h unrecognized
Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>
(additional options for neato) [-x] [-n<v>]
(additional options for fdp) [-L(gO)] [-L(nUCT)<val>]
(additional options for memtest) [-m]
(additional options for config) [-cv]
-V - Print version and exit
-v - Enable verbose mode
-Gname=val - Set graph attribute 'name' to 'val'
-Nname=val - Set node attribute 'name' to 'val'
-Ename=val - Set edge attribute 'name' to 'val'
-Tv - Set output format to 'v'
-Kv - Set layout engine to 'v' (overrides default based on command name)
-lv - Use external library 'v'
-ofile - Write output to 'file'
-O - Automatically generate an output filename based on the input filename with a .'format
' appended. (Causes all -ofile options to be ignored.)
-q[l] - Set level of message suppression (=1)
-s[v] - Scale input by 'v' (=72)
-y - Invert y coordinate in output
-n[v] - No layout mode 'v' (=1)
-x - Reduce graph
-Lg - Don't use grid
-LO - Use old attractive force
-Ln<i> - Set number of iterations to i
-LU<i> - Set unscaled factor to i
-LC<v> - Set overlap expansion factor to v
-LT[*]<v> - Set temperature (temperature factor) to v
-m - Memory test (Observe no growth with top. Kill when done.)
-c - Configure plugins (Writes $prefix/lib/graphviz/config
with available plugin information. Needs write privilege.)
-v - Enable verbose mode

Additional Reading

On-line reference pages

The DOT Language
Command-line Usage
Output Formats
Node, Edge and Graph Attributes
Node Shapes
Arrow Shapes
Colors

Schema Files

(XSD format)
Node, Edge and Graph Attributes

User's Guides

(PDF format)
NOTE: The first two documents are not current with the features and details of Graphviz. They can serve as tutorials for understanding how to use Graphviz, but the most up-to-date documentation is provided in the on-line pages listed above.
dot
neato
lefty
dotty
Cgraph library tutorial
Using Graphviz as a library

FAQs, Contributions

Graphviz FAQ
How to create custom shapes