Chart/GGPlot/Geom/Polygon.pm

filter: Statementstmt 90.0% 54 / 60 Branchbran 40.9% 9 / 22 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 91.6% 11 / 12 Podpod 0.0% 0 / 3 totaltotal 73.5% 75 / 102 CC 13 SCAR 15.4
CC
13
Cov
75%
handle_na
9.8
__ANON__
8.1
ggplot_functions
3.1
CRAP 4.7
« Chart/GGPlot/Geom/Line.pm ↑ Summary Chart/GGPlot/Global.pm »
1 package Chart::GGPlot::Geom::Polygon;
2  
3 # ABSTRACT: Class for polygon geom
4  
5 5 ▶use Chart::GGPlot::Class qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use MooseX::Singleton;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 with qw(Chart::GGPlot::Geom);
10  
11 5 our $VERSION = '0.002003'; # VERSION
12  
13 5 ▶use Chart::GGPlot::Aes;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 5 ▶use Chart::GGPlot::Layer;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 5 ▶use Chart::GGPlot::Util qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
16 5 ▶use Chart::GGPlot::Util::Pod qw(layer_func_pod);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 has '+default_aes' => (
19 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
20 1 Chart::GGPlot::Aes->new(
21 color => PDL::SV->new( ['NA'] )->setbadat(0),
22 fill => PDL::SV->new( ['grey20'] ),
23 size => pdl(0.5),
24 linetype => PDL::SV->new( ['solid'] ),
25 alpha => NA(),
26 );
27 }
28 5 );
29  
30 4 ▶classmethod required_aes() { [qw(x y)] }
Subroutine required_aes: called CC=3 SCAR=11.2
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod required_aes (expected 1, got ' . @_ . ')') 0 4 4
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod required_aes (expected 1, got ' . @_ . ')') 0 4 4
31  
32 5 my $geom_polygon_pod = layer_func_pod(<<'EOT');
33  
34 geom_polygon(:$mapping=undef, :$data=undef,
35 :$stat='identity', :$position='identity',
36 :$na_rm=false, :$show_legend=undef,
37 :$inherit_aes=true,
38 %rest)
39  
40 Polygons are very similar to paths (as drawn by C<geom_path()>)
41 except that the start and end points are connected and the inside is
42 colored by the C<fill> aesthetic. The C<group> aesthetic determines
43 which cases are connected together into a polygon.
44  
45 =over 4
46  
47 %TMPL_COMMON_ARGS%
48  
49 =back
50  
51 EOT
52  
53 1 ▶my $geom_polygon_code = fun (
Subroutine __ANON__: called CC=7 SCAR=20.9
Branch: 1 branch
BranchTrueFalseTotal
@_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") 0 1 1
Condition33%1/3
@_ > 0 and @_ % 2
!ll&&!rl&&r
010
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0 @_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
ABresult
0X0
100
111
54 :$mapping = undef, :$data = undef,
55 :$stat = 'identity', :$position = 'identity',
56 :$width = undef, :$na_rm = false,
57 :$show_legend = undef, :$inherit_aes = true,
58 %rest )
59 1 ▶{
Branch: 4 branches
BranchTrueFalseTotal
exists $rest{'stat'} ? : 0 1 1
exists $rest{'position'} ? : 0 1 1
exists $rest{'na_rm'} ? : 0 1 1
exists $rest{'inherit_aes'} ? : 0 1 1
60 1 return Chart::GGPlot::Layer->new(
61 data => $data,
62 mapping => $mapping,
63 stat => $stat,
64 geom => 'polygon',
65 position => $position,
66 show_legend => $show_legend,
67 inherit_aes => $inherit_aes,
68 params => {
69 na_rm => $na_rm,
70 %rest,
71 },
72 );
73 5 };
74  
75 5 ▶classmethod ggplot_functions() {
Subroutine ggplot_functions: called CC=3 SCAR=11.3
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 5 5
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 5 5
76 return [
77 {
78 5 name => 'geom_polygon',
79 code => $geom_polygon_code,
80 pod => $geom_polygon_pod,
81 },
82 ];
83 5 }
84  
85 0 ▶method handle_na ( $data, $params ) { $data }
Subroutine handle_na: not called CC=3 SCAR=22.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for method handle_na (expected 3, got ' . @_ . ')') 0 0 0
@_ > 3 and Function::Parameters::_croak('Too many arguments for method handle_na (expected 3, got ' . @_ . ')') 0 0 0
86  
87 5 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
88  
89 5 1;
90  
91 __END__
« Chart/GGPlot/Geom/Line.pm ↑ Summary Chart/GGPlot/Global.pm »