Extension:GraphViz/v0.9

I (Coffman) have recently (2-oct-2004) created a extension to mediawiki in response to a basic need : Render Graphs online

I found the utility Graphviz on another wiki, and thought about adopting it to mediawiki (the wiki I actually use). Exploring the Graphviz tool I discovered an incredible tool to making Graphs. Automatic graph drawing has many important applications in software engineering, database and web design, networking, and in visual interfaces for many other domains.

You can view a lot of samples at the original page.

Of course the only requisite for this plugin to work is the graphviz program; you can download it from here

You can find information on how to write a graph on the original page at here

Some of the issues with using this extension on Windows have been fixed in Extension:GraphVizAndMSCGen, which also combines support for the MSCGen tool.

Requisites
Graphviz 1.12, download from here

Install instructions

 * 1) Download Graphviz.php.
 * An Update can be found here.

include("extensions/Graphviz.php"); $wgGraphVizSettings->dotCommand = "/usr/bin/dot";
 * 1) Copy Graphviz.php to the $mediawiki/extensions directory.
 * 2) Add these two lines to LocalSettings.php: (the path may vary depending on your distribution)

If you are installing on a Wiki that is hosted by Windows, follow these additional instructions

Online samples

 * http://www.wickle.com/wikis/index.php/Graphviz_extension (a copy of this page)
 * http://www.islandseeds.org/wiki/Test:Graphviz (comments) (not working)
 * http://www.wikischool.de/wiki/WikiSchool:Graphviz
 * http://www.nerux.org/wiki/Graphviz and http://www.nerux.org/wiki/Accueil

Other rendering engines
I wanted to use other layout engines besides dot(1), so I hacked Graphviz.php to allow a Unix-style interpreter specification for the other rendering engines in Graphviz. This is backwards compatible (since it is a legal dot comment) and avoids coming up with new syntax.

The interpreter spec must immediately follow the opening tag: " #!/sw/bin/neato" for example. I explicitly check for allowed rendering engines to avoid script injection security issues.

Extension at: http://www.Bytesmiths.com/InfoArk/Graphviz.php.gz

Annotated examples at: http://www.IslandSeeds.org/wiki/Test:Graphviz (not working)

Enjoy! --Bytesmiths 14:53, 15 Mar 2005 (UTC)

Alternates extensions
There is another Graphviz extension located at http://opensource.case.edu/svn/MediaWikiHacks/extensions/Graphviz/trunk/Graphviz.php. This version features automatic pruning of Graphviz files on the filesystem among other small improvements. An update of this alternate version is avaible here: http://www2.hds.utc.fr/~rherault/index.php/Graphviz_Extension (NO ACCESS). Support for png and svg, support for border and image position

Examples
 digraph G {Hello->World!}