Chart/GGPlot/Geom/Smooth.pm

filter: Statementstmt 57.8% 33 / 57 Branchbran 7.6% 2 / 26 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 63.6% 7 / 11 Podpod 0.0% 0 / 3 totaltotal 41.1% 42 / 102 CC 15 SCAR 35.7
CC
15
Cov
41%
__ANON__
90.0
required_aes
9.6
optional_aes
9.6
CRAP 35.4
« Chart/GGPlot/Guide/Legend.pm ↑ Summary Chart/GGPlot/Backend/Plotly/Geom/Path.pm »
1 package Chart::GGPlot::Geom::Smooth;
2  
3 # ABSTRACT: Class for smooth 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 extends qw(Chart::GGPlot::Geom::Line);
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::Pod qw(layer_func_pod);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 has '+default_aes' => (
18 0 ▶ default => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 0 Chart::GGPlot::Aes->new(
20 color => PDL::SV->new( ['#3366FF'] ),
21 fill => PDL::SV->new( ['grey60'] ),
22 size => pdl(1),
23 linetype => PDL::SV->new( ['solid'] ),
24 weight => pdl(1),
25 alpha => pdl(0.4),
26 );
27 }
28 5 );
29  
30 0 ▶classmethod required_aes() { [qw(x y)] }
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 0 ▶classmethod optional_aes() { [qw(ymin ymax)] }
Subroutine optional_aes: not called CC=3 SCAR=22.6
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod optional_aes (expected 1, got ' . @_ . ')') 0 0 0
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod optional_aes (expected 1, got ' . @_ . ')') 0 0 0
32  
33 5 my $geom_smooth_pod = layer_func_pod(<<'EOT');
34  
35 geom_smooth(:$mapping=undef, :$data=undef,
36 :$stat='smooth', :$position='identity',
37 :$method='auto', :$se=true,
38 :$na_rm=false, :$show_legend=undef, :$inherit_aes=true,
39 %rest)
40  
41 Aids the eye in seeing patterns in the presence of overplotting, by
42 calculating a smoothed conditional mean.
43  
44 C<geom_smooth()> and C<stat_smooth()> are effectively aliases: they
45 both use the same arguments. Use C<stat_smooth()> if you want to
46 display the results with a non-standard geom.
47  
48 Arguments:
49  
50 =over 4
51  
52 %TMPL_COMMON_ARGS%
53  
54 =back
55  
56 See also L<Chart::GGPlot::Stat::Functions/stat_smooth>.
57  
58 EOT
59  
60 0 ▶my $geom_smooth_code = fun (
Subroutine __ANON__: not called CC=9 SCAR=45.0
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
61 :$mapping = undef, :$data = undef,
62 :$stat = 'smooth', :$position = 'identity',
63 :$method = 'auto',
64 :$se = true,
65 :$na_rm = false, :$show_legend = undef, :$inherit_aes = true,
66 %rest )
67 0 ▶{
Branch: 6 branches
BranchTrueFalseTotal
exists $rest{'stat'} ? : 0 0 0
exists $rest{'position'} ? : 0 0 0
exists $rest{'method'} ? : 0 0 0
exists $rest{'se'} ? : 0 0 0
exists $rest{'na_rm'} ? : 0 0 0
exists $rest{'inherit_aes'} ? : 0 0 0
68 0 return Chart::GGPlot::Layer->new(
69 data => $data,
70 mapping => $mapping,
71 stat => $stat,
72 geom => 'smooth',
73 position => $position,
74 show_legend => $show_legend,
75 inherit_aes => $inherit_aes,
76 params => {
77 na_rm => $na_rm,
78 se => $se,
79 method => $method,
80 %rest
81 },
82 );
83 5 };
84  
85 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
86 return [
87 {
88 5 name => 'geom_smooth',
89 code => $geom_smooth_code,
90 pod => $geom_smooth_pod,
91 },
92 ];
93 5 }
94  
95 5 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
96  
97 5 1;
98  
99 __END__
« Chart/GGPlot/Guide/Legend.pm ↑ Summary Chart/GGPlot/Backend/Plotly/Geom/Path.pm »