Module-Dependency
view release on metacpan or search on metacpan
lib/Module/Dependency/Grapher.pm view on Meta::CPAN
delete $colours->{'_HREF_FORMAT'};
# add legend and prettiness
TRACE("Drawing legend etc");
$im->text(
'x' => 5,
'y' => 12,
'fill' => $colours->{'title1'},
'style' => { 'font-size' => '12px' }
)->cdata($imgtitle);
$im->text(
'x' => 5,
'y' => 23,
'fill' => $colours->{'title1'},
'style' => { 'font-size' => '9px' }
)->cdata( "Grapher.pm $VERSION - " . localtime() )
unless $options->{'NoVersion'};
_drawLegend( $im, $colours, $realImgWidth - 160 - $eOffset, 3 ) unless $options->{'NoLegend'};
$im->title( id => 'document-title' )->cdata($imgtitle);
$im->desc( id => 'document-desc' )
->cdata('This image shows dependency relationships between perl programs and modules');
TRACE("Printing SVG");
local *IMG;
open( IMG, "> $filename" ) or die("Can't open $filename for image write: $!");
print IMG $im->xmlify;
close IMG;
}
sub makePs {
require PostScript::Simple;
lib/Module/Dependency/Grapher.pm view on Meta::CPAN
elsif ( $type =~ m/^PostScript/ ) {
$im->text( $x, $y, $text );
}
elsif ( $type =~ m/^SVG/ ) {
if ( $colours->{'_HREF_FORMAT'} ) {
$im->anchor( -href => sprintf( $colours->{'_HREF_FORMAT'}, $text ) )->text(
'x' => $x,
'y' => $y + 5.5,
'fill' => $colours->{'type'},
'style' => { 'font-size' => '8px', 'font-family' => 'Courier, Monaco, monospaced' }
)->cdata($text);
}
else {
$im->text(
'x' => $x,
'y' => $y + 5.5,
'fill' => $colours->{'type'},
'style' => { 'font-size' => '8px', 'font-family' => 'Courier, Monaco, monospaced' }
)->cdata($text);
}
}
}
# ! behaves differently for each image type
sub _drawLink {
my ( $im, $colours, $xa, $ya, $xb, $yb ) = @_;
my $type = ref($im);
# TRACE("_drawLink for $type");
( run in 0.476 second using v1.01-cache-2.11-cpan-454fe037f31 )