App-Navegante
view release on metacpan or search on metacpan
examples/htgraph view on Meta::CPAN
$path->add_node('START',style=>'filled',fillcolor=>'orange',shape=>'octagon');
$last = 'START';
foreach (sort keys %estado) {
my ($left,$right) = split /;/, $estado{$_};
$path->add_node($right,style=>'filled',fillcolor=>$left);
$path->add_edge($last=>$right);
$last = $right;
}
open FPNG, ">/var/www/html/nrc/navegante/$file.png";
open FPS, ">/var/www/html/nrc/navegante/$file.ps";
open FSVG, ">/var/www/html/nrc/navegante/$file.svg";
print FPNG $path->as_png;
print FPS $path->as_ps;
print FSVG $path->as_svg;
system "/usr/bin/ps2pdf /var/www/html/nrc/navegante/$file.ps /var/www/html/nrc/navegante/$file.pdf";
unlink "/var/www/html/nrc/navegante/$file.ps";
close FPNG;
close FPS;
close PSVG;
print "<center><img border='1' src='http://nrc.homelinux.org/navegante/$file.png'>";
print "<table width='50%'>";
print "<tr bgcolor='orange'><td>Pos</td><td>URL</td></tr>";
foreach (sort keys %estado) {
my ($left,$right) = split /;/, $estado{$_};
print "<tr><td>$_</td><td><a href='$right'>$right</a></td></tr>";
}
print "</table><hr>Your graph exported in other formats: <a href='http://nrc.homelinux.org/navegante/$file.pdf'>PDF</a> || <a href='http://nrc.homelinux.org/navegante/$file.svg'>SVG</a></center>";
}
( run in 0.691 second using v1.01-cache-2.11-cpan-df04353d9ac )