Chart/GGPlot/Coord/Flip.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 86.1% 31 / 36 CC 3 SCAR 6.5
CC
3
Cov
90%
ggplot_functions
3.1
__ANON__
2.0
BEGIN
1.0
CRAP 1.9
« Chart/GGPlot/Theme/Functions.pm ↑ Summary Chart/GGPlot/Range.pm »
1 package Chart::GGPlot::Coord::Flip;
2  
3 # ABSTRACT: Cartesian coordinates with x and y flipped
4  
5 4 ▶use Chart::GGPlot::Class qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.002003'; # VERSION
9  
10 4 extends qw(Chart::GGPlot::Coord::Cartesian);
11  
12 4 ▶use Chart::GGPlot::Util::Pod qw(unindent);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 4 my $coord_flip_pod = unindent(<<'EOT');
15  
16 coord_flip(:$xlim=undef, :$ylim=undef, :$expand=true)
17  
18 Flip cartesian coordinates so that horizontal becomes vertical, and
19 vertical becoms horizontal.
20  
21 EOT
22  
23 0 ▶my $coord_flip_code = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 0 return __PACKAGE__->new(@_);
25 4 };
26  
27 3 ▶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 3 3
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 3 3
28 return [
29 {
30 3 name => 'coord_flip',
31 code => $coord_flip_code,
32 pod => $coord_flip_pod,
33 }
34 ];
35 4 }
36  
37 4 ▶use Chart::GGPlot::Scale::Functions qw(scale_flip_position);
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 # The R ggplot2 code has some logic for flipping things inside its
40 # CoordFlip class. For Chart::Plot we don't do similar things here.
41 # Instead we implement that in the graphics backend.
42  
43 4 __PACKAGE__->meta->make_immutable;
44  
45 4 1;
46  
47 __END__
« Chart/GGPlot/Theme/Functions.pm ↑ Summary Chart/GGPlot/Range.pm »