Chart/GGPlot/Geom/Rect.pm

filter: Statementstmt 68.6% 35 / 51 Branchbran 11.1% 2 / 18 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 81.8% 9 / 11 Podpod 0.0% 0 / 2 totaltotal 52.8% 46 / 87 CC 11 SCAR 30.4
CC
11
Cov
51%
__ANON__
56.0
required_aes
9.6
ggplot_functions
3.1
CRAP 20.9
« Chart/GGPlot/Backend/Plotly/Geom.pm ↑ Summary Chart/GGPlot/Stat/Boxplot.pm »
1 package Chart::GGPlot::Geom::Rect;
2  
3 # ABSTRACT: Class for rect 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 our $VERSION = '0.002003'; # VERSION
10  
11 5 ▶use Chart::GGPlot::Aes;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Chart::GGPlot::Util qw(NA);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use Chart::GGPlot::Util::Pod qw(layer_func_pod);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 5 with qw(Chart::GGPlot::Geom);
16  
17 1 ▶has '+non_missing_aes' => ( default => sub { [qw(size shape color)] } );
Subroutine __ANON__: called CC=1 SCAR=0.0
18 has '+default_aes' => (
19 3 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
20 3 Chart::GGPlot::Aes->new(
21 color => NA(),
22 fill => PDL::SV->new(["grey35"]),
23 size => pdl(0.5),
24 linetype => PDL::SV->new(["solid"]),
25 alpha => NA(),
26 );
27 }
28 5 );
29  
30 0 ▶classmethod required_aes() { [qw(xmin xmax ymin ymax)] };
Subroutine required_aes: not called CC=3 SCAR=22.6
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod required_aes (expected 1, got ' . @_ . ')') 0 0 0
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod required_aes (expected 1, got ' . @_ . ')') 0 0 0
31  
32 5 my $geom_rect_pod = layer_func_pod(<<'EOT');
33  
34 geom_rect(:$mapping=undef, :$data=undef, :$stat='count',
35 :$position='stack', :$width=undef,
36 :$na_rm=false, :$show_legend=undef, :$inherit_aes=true,
37 %rest)
38  
39 C<geom_rect()> uses the locations of the four corners
40 (aethetics C<xmin>, C<xmax>, C<ymin> and C<ymax>) to define rectangles.
41  
42 Arguments:
43  
44 =over 4
45  
46 %TMPL_COMMON_ARGS%
47  
48 =back
49  
50 EOT
51  
52 0 ▶my $geom_rect_code = fun(
Subroutine __ANON__: not called CC=7 SCAR=40.3
Branch: 1 branch
BranchTrueFalseTotal
@_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") 0 0 0
Condition0%0/3
@_ > 0 and @_ % 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0 @_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
ABresult
0X0
100
111
53 :$mapping = undef, :$data = undef,
54 :$stat = 'identity', :$position = 'identity',
55 :$na_rm = false, :$show_legend = undef, :$inherit_aes = true,
56 %rest)
57 0 ▶{
Branch: 4 branches
BranchTrueFalseTotal
exists $rest{'stat'} ? : 0 0 0
exists $rest{'position'} ? : 0 0 0
exists $rest{'na_rm'} ? : 0 0 0
exists $rest{'inherit_aes'} ? : 0 0 0
58 0 return Chart::GGPlot::Layer->new(
59 data => $data,
60 mapping => $mapping,
61 stat => $stat,
62 geom => 'rect',
63 position => $position,
64 show_legend => $show_legend,
65 inherit_aes => $inherit_aes,
66 params => {
67 na_rm => $na_rm,
68 %rest
69 },
70 );
71 5 };
72  
73 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
74 return [
75 {
76 5 name => 'geom_rect',
77 code => $geom_rect_code,
78 pod => $geom_rect_pod,
79 },
80 ];
81 5 }
82  
83 5 __PACKAGE__->meta->make_immutable;
84  
85 5 1;
86  
87 __END__
« Chart/GGPlot/Backend/Plotly/Geom.pm ↑ Summary Chart/GGPlot/Stat/Boxplot.pm »