Extension:GraphViz

The GraphViz extension lets you create and display graphs as in-line images on wiki pages using tools from the open-source Graphviz and Mscgen projects:
 * Graphviz (short for Graph Visualization Software) is a package of open-source tools initiated by AT&T Labs Research for drawing graphs specified in DOT files.
 * Mscgen (short for MSC generator) is a software tool for drawing message sequence charts from a text source file.

Graphviz

 * 1) First, you need at least one of the external tools "Graphviz" or "Mscgen" that renders your graph.
 * 2) Windows: Get your copy here: http://www.graphviz.org/Download.php or here http://www.mcternan.me.uk/mscgen/
 * 3) Unix: Same links as for windows but normally it should be pre-installed (at least graphviz - search for dot) or can be found in the package manager.
 * 4) Ubuntu/Debian:
 * 5) Then obtain the Graphviz extension code by downloading a snapshot or from GIT
 * 6) and then put it in your MediaWiki "/extensions/GraphViz" directory.
 * 7) Add these lines to LocalSettings.php:
 * 1) and then put it in your MediaWiki "/extensions/GraphViz" directory.
 * 2) Add these lines to LocalSettings.php:
 * Windows Default: "C:/Program Files/Graphviz/bin/" (without dot.exe) or "C:\\Program Files\\Graphviz\\bin\\"
 * Other Platform : "/usr/bin/" or "/usr/local/bin/" (where the dot binary is)


 * Make sure that write permissions for the "$IP/images" directory are granted.
 * Make sure that Internet users get read/execute access on your executables if you use server installations (especially under Windows).

Mscgen
The same procedure as with Graphviz - the path to MscGen has to be provided in LocalSettings.php:

Configuration
For each parameter add the line  in your LocalSettings.php after the  -line.

Drawing Graphs
Define a graph in the dot language and enclose it in graphviz tags as follows:

Likewise, define a message sequence chart in the mscgen language and enclose it in mscgen tags as follows:

When the wiki page is saved (or when you click "Show preview" after editing) an image is produced that corresponds to the DOT or mscgen text and it is shown in-line on the page. The image is also uploaded so it may be included in other pages directly.

See the for some basic graphs.

Graph Tag Attributes
Graph tag attributes may be supplied with either graphviz or mscgen as follows:

The following Extended image syntax attributes are supported as graph tag attributes: type, border, location, alignment, size, link, alt, caption.


 * SVG requires additional configuration.

Multiple Graphs
For graphviz, use unique names for each graph to display multiple graphs on the same page.

For mscgen, use the "uniquifier" tag attribute to display multiple message sequence charts on the same page.

Wiki-links
In DOT you can define URLs for nodes, edges and other elements. See for an example with Wiki-links.

In case you need an external URL, write this:

And for an internal link in your wiki, write this:

That's all.

Examples
For a start you can try these Examples:

Example 1

Example 2

Example 3

You can see many more examples of images created with Graphviz in this Flickr gallery.

Tutorials/online samples
See here for examples of this extension in use on other wikis:
 * http://www.wikischool.de/wiki/WikiSchool:Graphviz
 * http://wiki.zum.de/Hilfe:Graphviz
 * http://www.wickle.com/wikis/index.php/Graphviz_extension (old)
 * http://www.EcoReality.org/wiki/Test:Graphviz (comments) (maintained very well)
 * http://www.nerux.org/wiki/Graphviz and http://www.nerux.org/wiki/Accueil

Contributions and history

 * In 2004 the user Coffman created an extension to MediaWiki in response to a basic need: rendering graphs online. He found the utility Graphviz in use on another wiki application, and thought about adapting it for MediaWiki (the wiki he actually used). Exploring the Graphviz tool, he discovered an incredible tool for making graphs.
 * Later on, many people improved the extension on their own or provided little bug fixes as snippets on the discussion page. This led to several functional solutions for different use cases, and to a bit of chaos.
 * In 2006 Gregory Szorc independently created his own GraphViz extension, this one called "Graphviz" (small "v"), that included some helpful features like autopruning.
 * Also in 2006, Ruud Schramp created the MscGen extension, adapting the code from the GraphViz extension to work with MscGen.
 * In 2008 Matthew Pearson created the extension GraphVizAndMSCGen, combining the code from the GraphViz with the MscGen extension.
 * In 2010 Thomas Hummel merged these and other versions, along with his own fixes, to try to create a working solution for several OSes in one file.
 * In 2011 Jeroen De Dauw uploaded the resulting code onto MediaWiki SVN.
 * In 2014, Keith Welter re-wrote the extension to leverage the ImageMap extension and to improve security, performance, documentation and ease of use.

Projects that rely on this extension

 * The "Semantic Result Formats" extension is used in conjunction with the Semantic MediaWiki extension, that bundles a number of further result formats for SMW's inline queries.
 * graph format (displays connections between pages as graphs)
 * process format (displays process graphs)
 * Extension:Collaboration_Diagram (renders and visualizes a bipartite graph of any article and its editors)