Bio-Gonzales

 view release on metacpan or  search on metacpan

lib/Bio/Gonzales/Util/Graphics/Color/Generator.pm  view on Meta::CPAN

    }

    my $num_elements = keys %{$a};

    my $height = ( 30 + 10 ) * $num_elements - 10;
    my $width  = 500;
    my $svg    = SVG->new( width => $width, height => $height );
    my $i      = 0;
    while ( my ( $group_id, $color ) = each %{$a} ) {
        my $y_offset = $i * ( 30 + 10 );
        my $text1 = $svg->text( id => "text_$i", x => 45, y => $y_offset + 15 )->cdata($group_id);
        my $tag = $svg->rectangle( x => 0, y => $y_offset, width => 40, height => 30, id => "rect_$i", fill => $color );
        $i++;

    }
    return $svg->xmlify;
}

1;
__END__



( run in 0.489 second using v1.01-cache-2.11-cpan-454fe037f31 )