Basic example demonstrating how to override the generation method; in this case to the experimental Graphlib_Dot method.
Continue readingTag Archives: Graphviz
Graphviz Example: Various graphs
Examples borrowed from this GraphViz Pocket Reference and its underlying Git repository.
Error generating Graphviz image:
Graphviz cannot generate graph
Command: /usr/bin/dot '-Kcirco' '-Tsvg' '-o/data/blog.flirble.org/wp-content/tfo-graphviz/e4a72d37c637c75e9afb795fbcc10ba4.svg'
Output:
There is no layout engine support for "circo"
Use one of:
Original DOT:
1
2 graph {
3 rankdir = LR;
4
5 a -- b;
6 b -- c;
7 a -- c;
8 d -- c;
9 e -- c;
10 e -- a;
11 }
12
Continue reading Graphviz Example: State machine
A example of some GraphViz that I found online some time ago and used to test SVG generation. I decided to publish it since it may help someone use the TFO-GraphViz plugin some day.
Error generating Graphviz image:
Graphviz cannot generate graph
Command: /usr/bin/dot '-Kdot' '-Tsvg' '-o/data/blog.flirble.org/wp-content/tfo-graphviz/f5e6b6c98abb67530e0adc6696ccb5c9.svg'
Output:
There is no layout engine support for "dot"
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
Original DOT:
1 digraph test {
2 rankdir = LR;
3 node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
4 node [shape = circle];
5 LR_0 -> LR_2 [ label = "SS(B)" ];
6 LR_0 -> LR_1 [ label = "SS(S)" ];
7 LR_1 -> LR_3 [ label = "S($end)" ];
8 LR_2 -> LR_6 [ label = "SS(b)" ];
9 LR_2 -> LR_5 [ label = "SS(a)" ];
10 LR_2 -> LR_4 [ label = "S(A)" ];
11 LR_5 -> LR_7 [ label = "S(b)" ];
12 LR_5 -> LR_5 [ label = "S(a)" ];
13 LR_6 -> LR_6 [ label = "S(b)" ];
14 LR_6 -> LR_5 [ label = "S(a)" ];
15 LR_7 -> LR_8 [ label = "S(b)" ];
16 LR_7 -> LR_5 [ label = "S(a)" ];
17 LR_8 -> LR_6 [ label = "S(b)" ];
18 LR_8 -> LR_5 [ label = "S(a)" ];
19 }
Continue reading Adding SVG support to TFO-Graphviz
A TFO-Graphviz plugin user recently posted some issues he was having with the plugin. One of his requests was to add the SVG output format which I had hitherto omitted because of the previous lack of browser support. Time has passed, it is time to fix that omission.
For maximum effect this also meant the introduction of the width and height attributes. This an example of the SVG output scaled to 100% of the width of its container on the page:
Error generating Graphviz image:
Graphviz cannot generate graph
Command: /usr/bin/dot '-Kdot' '-Tsvg' '-o/data/blog.flirble.org/wp-content/tfo-graphviz/f9fc0b4fd3dbc1d56043b157a8440b7a.svg'
Output:
There is no layout engine support for "dot"
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
Original DOT:
1 digraph hierarchy {
2 size="5,5"
3
4 graph [bgcolor="transparent"]
5 node[shape=record,style=filled,fillcolor=gray95]
6 edge[dir=back, arrowtail=empty]
7
8 2[label = "{AbstractSuffixTree|+ text\n+ root|...}"]
9 3[label = "{SimpleSuffixTree|...| + constructTree()\l...}"]
10 4[label = "{CompactSuffixTree|...| + compactNodes()\l...}"]
11 5[label = "{SuffixTreeNode|...|+ addSuffix(...)\l...}"]
12 6[label = "{SuffixTreeEdge|...|+ compactLabel(...)\l...}"]
13
14 2->3;
15 2->4;
16
17 5->5[constraint=false, arrowtail=odiamond]
18 4->3[constraint=false, arrowtail=odiamond]
19 2->5[constraint=false, arrowtail=odiamond]
20 5->6[arrowtail=odiamond]
21 }
Graphviz Plugin Demo
I came across the EHT Graphviz plugin for WordPress and, whilst useful, it has a very clumsy shortcode parser, is not well documented and only supports a subset of the Graphviz functionality. Now Graphviz is not exactly a standard for clear documentation but it is a useful tool for flow or organisational diagramming.
So I wrote my own WordPress plugin, which is demonstrated here. Continue reading