GraphViz::Graph - Object Oriented interface to graphviz.
Version 0.01
use GraphViz::Graph; my $graph = GraphViz::Graph->new('filename-without-suffix'); # Create nodes: my $nd_1 = $graph->node(…); my $nd_2 = $graph->node(…); # Connect nodes: $graph->edge($nd_1, $nd_2); # Create .dot file, run graphviz/dot to # create filename-without-suffix.png: $graph->create('png');
my $graph = GraphViz::Graph->new('FileNameBase');
Start a graph. 'FileNameBase' is the base name for the produced dot and png/pdf/svg… etc. output file.
'FileNameBase'
GraphViz::Graph->label({text => 'Graph Title'}'); GraphViz::Graph->label({html => '<font point-size="20">Say <font face="Courier">Hello World</font></font>'}');
Add a label to a graph. Most probably used as a title.
my $nd_foo = GraphViz::Graph->node(); # … later: $nd_foo -> label({html=>"<b>Bold</b><i>Italic</i>"});
Add a node to a graph
Add an edge to a graph.
my $nd_one = $graph->node(); my $nd_two = $graph->node(); my $nd_three = $graph->node(); $nd_one->label({html=>"…"}); $nd_two->label({html=>"<table> <tr><td port='port_f'>f</td><td>g</td></tr> </table>"}); $graph->edge($nd_one, $nd_two->port('port_f')): $graph->edge($nd_two, $nd_three);
This function is internally used by the constructur (new()) of GraphViz::Graph::Edge.
new()
Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: http://www.perlfoundation.org/artistic_license_2_0
The tests need Test::Files.
To install GraphViz::Graph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GraphViz::Graph
CPAN shell
perl -MCPAN -e shell install GraphViz::Graph
For more information on module installation, please visit the detailed CPAN module installation guide.