Graph/Glyph/bubble.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 22 / 22 CC 2 SCAR 4.1
CC
2
Cov
100%
draw
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Graph/Data/Tree.pm ↑ Summary Graph/Glyph/scatter.pm »
1 package SVG::Graph::Glyph::bubble;
2  
3 2 ▶use base SVG::Graph::Glyph;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head2 draw
7  
8 Title : draw
9 Usage :
10 Function:
11 Example :
12 Returns :
13 Args :
14  
15  
16 =cut
17  
18 5 ▶sub draw{
Subroutine draw: called CC=2 SCAR=6.9
Pod documented
19 5 my ($self,@args) = @_;
20  
21 5 my $id = 'n'.sprintf("%07d",int(rand(9999999)));
22 5 my $group = $self->svg->group(id=>"bubble$id");
23  
24 5 my $xscale = $self->xsize / $self->group->xrange;
25 5 my $yscale = $self->ysize / $self->group->yrange;
26 5 my $zscale = 30 / $self->group->zrange;
27  
28 5 foreach my $datum($self->group->data){
29 100 my $cx = (($datum->x - $self->group->xmin) * $xscale) + $self->xoffset;
30 100 my $cy = (($self->xsize - ($datum->y - $self->group->ymin) * $yscale)) + $self->yoffset;
31  
32 100 my $r = $zscale * ($datum->z + 0.001);
33  
34 100 $group->circle(cx=>$cx,cy=>$cy,r=>$r,style=>{$self->_style});
35 }
36 }
37  
38 2 1;
« Graph/Data/Tree.pm ↑ Summary Graph/Glyph/scatter.pm »