Directed Graph Plugin
This plugin accepts valid input to create a .dot file.
Graphviz's dot application is then used to create a .png of the directed graph.
Syntax Rules
Enclose the rules for your directed graph within
<dot>
...
</dot>
tags.
You may create a clientside map of the graph by setting map to 1 within the dot tags:
<dot map=1>
...
</dot>
.
Examples
You type:
<dot>
digraph G {
subgraph cluster_c0 {a0 -> a1 -> a2 -> a3}
subgraph cluster_c1 {
b0 -> b1 -> b2 -> b3;
label="Group B";
}
x -> a0;
x -> b0;
a1 -> a3 [style=bold, label="a1 to a3"];
a3 -> a0;
a0 [shape=box, fontname=Courier, fontsize=11];
a1 [color=red];
a3 [label="Label\nfor a3"];
label="Cole's Example";
}
</dot>
You get: (simulated)
|
You get: (if installed)
digraph G {
subgraph cluster_c0 {a0 -> a1 -> a2 -> a3}
subgraph cluster_c1 {
b0 -> b1 -> b2 -> b3;
label="Group B";
}
x -> a0 [style=dotted];
x -> b0;
a1 -> a3 [style=bold, label="a1 to a3"];
a3 -> a0;
a0 [shape=box, fontname=Courier, fontsize=11];
a1 [color=red];
a3 [label="Label\nfor a3"];
label="Cole's Example";
}
|
You type:
<dot map=1>
digraph G {
URL="http://www.twiki.org";
Plugins [URL="http://twiki.org/cgi-bin/view/Plugins/PluginPackage"];
DirectedGraphPlugin [URL="http://twiki.org/cgi-bin/view/Plugins/DirectedGraphPlugin"];
Plugins -> DirectedGraphPlugin;
}
</dot>
You get: (simulated)
|
You get: (if installed)
digraph G {
URL="http://www.twiki.org";
Plugins [URL="http://twiki.org/cgi-bin/view/Plugins/PluginPackage"];
DirectedGraphPlugin [URL="http://twiki.org/cgi-bin/view/Plugins/DirectedGraphPlugin"];
Plugins -> DirectedGraphPlugin;
}
|
DirectedGraphPlugin Global Settings
-
- Set SHORTDESCRIPTION = Embed directed graphs in TWiki topics
- Debug plugin: (See output in
data/debug.txt
)
Plugin Installation Instructions
Note: The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Install the Graphviz package
- Install required web fonts
- Install the Perl module Digest::MD5
- Download the ZIP file from the Plugin web (see below)
- Unzip
DirectedGraphPlugin.zip
in your twiki installation directory.
Content:
File: |
Description: |
data/TWiki/DirectedGraphPlugin.txt |
Plugin topic |
data/TWiki/DirectedGraphPlugin.txt,v |
Plugin topic repository |
lib/TWiki/Plugins/DirectedGraphPlugin.pm |
Plugin Perl module |
pub/TWiki/DirectedGraphPlugin/graphsample.png |
sample image |
pub/TWiki/DirectedGraphPlugin/graphsample2.png |
sample image |
Dependencies:
Package: |
Description: |
Graphviz dot |
Preprocessor for drawing directed graphs |
Digest::MD5 |
MD5 Perl module |
Web fonts |
Fonts required for dot's png creations |
To install the web fonts, download this
rpm and run the command
rpm --install webfonts-1.0-5.noarch.rpm (Red Hat only).
Plugin Info
--
TWiki:Main.ColeBeck - 01 Jul 2004