GraphViz

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


tarta.

Goal

Use text markup to generate graphs within the wiki editor FrançoisElie: I had the same goal.

Solution

Using graphviz as a backend, this script generates dot graphs and displays them inline. Visit http://www.graphviz.org/Documentation.php for complete documentation on available commands.

Attach:graphviz.php

the markup looks like the following:

 =graphviz [=
   // any dot language calls are valid here -- 
   // it's passed directly to webdot
   digraph G {
        Hello->World;
   }
   =]

gives

Discussion

FrançoisElie: due to PmWiki 2, we have to use another convention for the directive (cf PM remarks in the lists), so

 (:graphviz [=
   // any dot language calls are valid here -- 
   // it's passed directly to webdot
   digraph G {
        Hello->World;
   }
   :)

You must have downloaded and installed the graphviz and webdot utilities from http://www.graphviz.org/. You should test the webdot utility outside of pmwiki to ensure it was set up properly.

FrançoisElie: it is possible to use graphviz in PmWiki with only dot. In the version I propose, you have the choice: dot (exec in php) or webdot (in perl). Thereis a limitation with the directive graphwiki, which require dot.

Edit the graphviz.php file to reflect the setup of your machine. There are three variables after the license that should be inspected and probably changed.

Place the graphviz.php script into your local/ directory, and call include_once( 'local/graphviz.php') from your config.php file.

FrançoisElie

see samples at http://maison.elie.org/pmwiki/index.php/Elie/GraphViz

Enjoy!

History

  • 11/4/2004 - first whack
  • 11/27/2004 - FrançoisElie proposition for graphviz
  • 11/28/2004 - FrançoisElie add graphmap
  • 11/29/2004 - FrançoisElie add graphwiki

Comments & Bugs

Contributors

(http://www.elie.org)

Copyright

(c) 2004 Paul Williams, Licensed under BSD-style License, see graphviz.php comments for more information. pmwiki-2.3.32 -- Last modified by {{}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons