Graph::Flowchart is a Perl module that can generate easily flowcharts as Graph::Easy objects.
SYNOPSIS
use Graph::Flowchart;
my $flow = Graph::Flowchart->new();
print $flow->as_ascii();
This module lets you easily create flowcharts as Graph::Easy objects. This means you can output your flowchart as HTML, ASCII, Boxart (unicode drawing) or SVG.
Classes
The nodes constructed by the various add_* methods will set the subclass of the node according to the following list:
start
The start block.
end
The end block, created by finish().
block
Orindary code blocks, f.i. from $b = 9;.
if, for, while, until
Blocks for the various constructs for conditional and loop constructs.
sub
For sub routine declarations.
use
For use, no and require statements.
goto, break, return, next, last, continue
Blocks for the various constructs for jumps/returns.
true, false, goto, call, return, break, next, continue
Classes for edges of the true and false if-branches, and for goto, as well as sub routine calls.
Each class will get some default attributes, like if constructs having a diamond-shape.
You can override the graph appearance most easily by changing the (sub)-class attributes:
my $chart = Graph::Flowchart->new();
$chart->add_block('$a = 9;');
$chart->add_if_then('$a == 9;', '$b = 1;');
$chart->finish();
my $graph = $chart->as_graph();
Now $graph is a Graph::Easy object and you can manipulate the class attributes like so:
$graph->set_attribute('node.if', 'fill', 'red');
$graph->set_attribute('edge.true', 'color', 'green');
print $graph->as_html_file();
This will color all conditional blocks red, and edges that represent the true branch green.
Product's homepage
Requirements:
· Perl