Chart/GGPlot/Facet/Null.pm

filter: Statementstmt 95.6% 44 / 46 Branchbran 50.0% 6 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 2 totaltotal 85.5% 59 / 69 CC 7 SCAR 11.0
CC
7
Cov
86%
map_data
5.8
compute_layout
3.1
BEGIN
1.0
CRAP 3.0
« Chart/GGPlot/Coord/Polar.pm ↑ Summary Chart/GGPlot/HasRequiredAes.pm »
1 package Chart::GGPlot::Facet::Null;
2  
3 # ABSTRACT: A single panel for faceting
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  
8 5 our $VERSION = '0.002003'; # VERSION
9  
10 5 ▶use Data::Frame;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use PDL::Primitive qw(which);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Type::Params;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use Types::Standard qw(ArrayRef Bool CodeRef Enum Maybe Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 5 ▶use Chart::GGPlot::Types qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17  
18 5 with qw(Chart::GGPlot::Facet);
19  
20 5 has '+shrink' => ( default => 1 );
21 5 has '+params' => (init_arg => undef);
22  
23 7 ▶method compute_layout ($data, $params) {
Subroutine compute_layout: called CC=3 SCAR=11.2
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for method compute_layout (expected 3, got ' . @_ . ')') 0 7 7
@_ > 3 and Function::Parameters::_croak('Too many arguments for method compute_layout (expected 3, got ' . @_ . ')') 0 7 7
24 7 return $self->layout_null();
25 5 }
26  
27 7 ▶method map_data ($data, $layout, $params) {
Subroutine map_data: called CC=5 SCAR=17.6
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 4 and Function::Parameters::_croak('Too few arguments for method map_data (expected 4, got ' . @_ . ')') 0 7 7
@_ > 4 and Function::Parameters::_croak('Too many arguments for method map_data (expected 4, got ' . @_ . ')') 0 7 7
28 7 ▶ if ( not defined $data ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $data) 0 7 7
29 0 return Data::Frame->new( columns => [ PANEL => null ] );
30 }
31 7 ▶ if ( $data->isempty ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->isempty) 0 7 7
32 0 return $data->merge( PANEL => null );
33 }
34  
35 7 $data->set('PANEL', pdl([0])->repeat( $data->nrow ));
36 7 return $data;
37 5 }
38  
39 5 __PACKAGE__->meta->make_immutable;
40  
41 5 1;
42  
43 __END__
« Chart/GGPlot/Coord/Polar.pm ↑ Summary Chart/GGPlot/HasRequiredAes.pm »