| 1 |
|
| package Chart::GGPlot::Facet; |
| 2 |
|
| |
| 3 |
|
| # ABSTRACT: The facet class |
| 4 |
|
| |
| 5 |
5 |
▶ | use Chart::GGPlot::Role 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 Data::Munge qw(elem); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 12 |
5 |
▶ | use List::AllUtils qw(firstidx); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 13 |
5 |
▶ | use Types::Standard qw(ArrayRef Bool CodeRef); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 14 |
|
| |
| 15 |
|
| #use Chart::GGPlot::LegendDraw qw(:all); |
| 16 |
5 |
▶ | use Chart::GGPlot::Params; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 17 |
5 |
▶ | use Chart::GGPlot::Types qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 18 |
5 |
▶ | use Chart::GGPlot::Util qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 19 |
|
| |
| 20 |
0 |
▶ | has shrink => ( is => 'ro', default => sub { false } ); |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
|
| 21 |
|
| has params => ( |
| 22 |
|
| is => 'ro', |
| 23 |
|
| isa => GGParams, |
| 24 |
|
| coerce => 1, |
| 25 |
11 |
▶ | default => sub { Chart::GGPlot::Params->new(); } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 26 |
5 |
| ); |
| 27 |
|
| |
| 28 |
7 |
▶ | method setup_params ($data, $params) { $params } |
|
Subroutine
setup_params: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for method setup_params (expected 3, got ' . @_ . ')') |
0 |
7 |
7 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for method setup_params (expected 3, got ' . @_ . ')') |
0 |
7 |
7 |
|
| 29 |
7 |
▶ | method setup_data ($data, $params) { $data } |
|
Subroutine
setup_data: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for method setup_data (expected 3, got ' . @_ . ')') |
0 |
7 |
7 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for method setup_data (expected 3, got ' . @_ . ')') |
0 |
7 |
7 |
|
| 30 |
|
| |
| 31 |
|
| |
| 32 |
|
| |
| 33 |
13 |
▶ | method init_scales ($layout, $params, :$x_scale=undef, :$y_scale=undef) { |
|
Subroutine
init_scales: called CC=7 SCAR=19.9
Pod
documented
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for method init_scales (expected 3, got ' . @_ . ')') |
0 |
13 |
13 |
| @_ > 3 and (@_ - 3) % 2 and Function::Parameters::_croak("Odd number of paired arguments for method init_scales") |
0 |
13 |
13 |
| keys %{__rest} and Function::Parameters::_croak('In method init_scales: no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
13 |
13 |
MC/DC0%0/2
@_ > 3 and (@_ - 3) % 2
@_ > 3
(@_ - 3) % 2
Truth table33%1/3
A and B
A= @_ > 3B= (@_ - 3) % 2
|
| 34 |
13 |
| my $scales = {}; |
| 35 |
13 |
▶ | if ( defined $x_scale ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $x_scale) |
6 |
7 |
13 |
|
| 36 |
6 |
| $scales->{x} = [ ( $x_scale->clone ) x ($layout->at('SCALE_X')->max+1) ]; |
| 37 |
|
| } |
| 38 |
13 |
▶ | if ( defined $y_scale ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $y_scale) |
6 |
7 |
13 |
|
| 39 |
6 |
| $scales->{y} = [ ( $y_scale->clone ) x ($layout->at('SCALE_Y')->max+1) ]; |
| 40 |
|
| } |
| 41 |
13 |
| return $scales; |
| 42 |
5 |
| } |
| 43 |
|
| |
| 44 |
|
| |
| 45 |
12 |
▶ | method train_scales (ArrayRef $data, $layout, $params, |
|
Subroutine
train_scales: called CC=9 SCAR=22.7
Pod
documented
|
| 46 |
12 |
▶ | :$x_scales=undef, :$y_scales=undef) { |
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 4 and Function::Parameters::_croak('Too few arguments for method train_scales (expected 4, got ' . @_ . ')') |
0 |
12 |
12 |
| @_ > 4 and (@_ - 4) % 2 and Function::Parameters::_croak("Odd number of paired arguments for method train_scales") |
0 |
12 |
12 |
| keys %{__rest} and Function::Parameters::_croak('In method train_scales: no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
12 |
12 |
| Ref::Util::XS::is_plain_arrayref($data) or Function::Parameters::_croak('In method train_scales: parameter 1 ($data): ' . ${my $v = bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_plain_arrayref($_[0]) or _failed_check(21, 'ArrayRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_ArrayRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => bless( ["ArrayRef","coercion_generator"], 'Types::Standard::LazyLoad' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'ARRAY';},"constraint_generator" => bless( ["ArrayRef","constraint_generator"], 'Types::Standard::LazyLoad' ),"deep_explanation" => bless( ["ArrayRef","deep_explanation"], 'Types::Standard::LazyLoad' ),"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 523,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ArrayRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => bless( ["ArrayRef","inline_generator"], 'Types::Standard::LazyLoad' ),"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_arrayref($_[1])" : "ref($_[1]) eq 'ARRAY'";},"library" => "Types::Standard","name" => "ArrayRef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; not ref $_[0] and _failed_check(16, 'Ref', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Ref","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_;},"constraint_generator" => sub { package Types::Standard; no warnings; use strict; return $meta->get_type('Ref') unless @_; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'Ref', \@_, 1); my $reftype = shift(); $reftype =~ /^(SCALAR|ARRAY|HASH|CODE|REF|GLOB|LVALUE|FORMAT|IO|VSTRING|REGEXP|Regexp)$/i or _croak "Parameter to Ref[`a] expected to be a Perl ref type; got $reftype"; $reftype = "$reftype"; return sub { ref $_[0] and builtin::reftype($_[0]) eq $reftype; } ;},"deep_explanation" => sub { package Types::Standard; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; return if $type->check($value); my $reftype = builtin::reftype($value); return [sprintf('"%s" constrains reftype(%s) to be equal to %s', $type, $varname, B::perlstring($param)), sprintf('reftype(%s) is %s', $varname, defined $reftype ? B::perlstring($reftype) : 'undef')];},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 438,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Ref","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard; no warnings; use strict; my $reftype = shift(); return sub { my $v = $_[1]; &$maybe_load_modules('Scalar::Util', "ref($v) and Scalar::Util::reftype($v) eq q($reftype)"); } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; "!!ref($_[1])";},"library" => "Types::Standard","name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return [];},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 21}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"};$v->{"parent"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"complementary_type"}{"parent"}; \$v}->get_message($data)) |
12 |
0 |
12 |
MC/DC0%0/2
@_ > 4 and (@_ - 4) % 2
@_ > 4
(@_ - 4) % 2
Truth table33%1/3
A and B
A= @_ > 4B= (@_ - 4) % 2
|
| 47 |
|
| # loop over each layer, training x and y scales in turn |
| 48 |
12 |
| for my $layer_data (@$data) { |
| 49 |
12 |
| my $match_id = |
| 50 |
|
| pdl( match( $layer_data->at('PANEL'), $layout->at('PANEL') ) ); |
| 51 |
|
| |
| 52 |
23 |
▶ | my $do_axis = fun( $axis, $scales ) { |
|
Subroutine
__ANON__: called CC=3 SCAR=11.1
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') |
0 |
23 |
23 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') |
0 |
23 |
23 |
|
| 53 |
23 |
| my $column_name = "SCALE_" . uc($axis); |
| 54 |
23 |
| my $vars = |
| 55 |
|
| $scales->at(0)->aesthetics->intersect($layer_data->names); |
| 56 |
23 |
| my $SCALE = $layout->at($column_name)->slice($match_id); |
| 57 |
23 |
| Chart::GGPlot::Layout->scale_apply( $layer_data, $vars, "train", |
| 58 |
|
| $SCALE, $scales ); |
| 59 |
12 |
| }; |
| 60 |
|
| |
| 61 |
12 |
▶ | if ( defined $x_scales ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $x_scales) |
12 |
0 |
12 |
|
| 62 |
12 |
| &$do_axis( 'x', $x_scales ); |
| 63 |
|
| } |
| 64 |
12 |
▶ | if ( defined $y_scales ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $y_scales) |
11 |
1 |
12 |
|
| 65 |
11 |
| &$do_axis( 'y', $y_scales ); |
| 66 |
|
| } |
| 67 |
|
| } |
| 68 |
12 |
| return; |
| 69 |
5 |
| } |
| 70 |
|
| |
| 71 |
|
| |
| 72 |
6 |
▶ | method finish_data ($data, $layout, $params, |
|
Subroutine
finish_data: called CC=7 SCAR=21.3
Pod
documented
|
| 73 |
6 |
▶ | :$x_scales, :$y_scales) { $data } |
Branch: 5 branches
| Branch | True | False | Total |
| @_ < 8 and Function::Parameters::_croak('Too few arguments for method finish_data (expected 8, got ' . @_ . ')') |
0 |
6 |
6 |
| @_ > 4 and (@_ - 4) % 2 and Function::Parameters::_croak("Odd number of paired arguments for method finish_data") |
0 |
6 |
6 |
| exists ${__rest}{'x_scales'} ? : |
6 |
0 |
6 |
| exists ${__rest}{'y_scales'} ? : |
6 |
0 |
6 |
| keys %{__rest} and Function::Parameters::_croak('In method finish_data: no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
6 |
6 |
MC/DC0%0/2
@_ > 4 and (@_ - 4) % 2
@_ > 4
(@_ - 4) % 2
Truth table33%1/3
A and B
A= @_ > 4B= (@_ - 4) % 2
|
| 74 |
|
| |
| 75 |
|
| |
| 76 |
0 |
▶ | classmethod render_axes ($x, $y, $coord, $theme, $transpose=false) { |
|
Subroutine
render_axes: not called CC=7 SCAR=40.3
Pod
documented
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 5 and Function::Parameters::_croak('Too few arguments for classmethod render_axes (expected 5, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 6 and Function::Parameters::_croak('Too many arguments for classmethod render_axes (expected 6, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ < 5 and $transpose = &false() |
0 |
0 |
0 |
|
| 77 |
0 |
| my $axes = {}; |
| 78 |
0 |
▶ | if ( defined $x ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $x) |
0 |
0 |
0 |
|
| 79 |
0 |
▶ | $axes->{x} = [ $x->map( sub { $coord->render_axis_h( $_, $theme ) } ) ]; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 80 |
|
| } |
| 81 |
0 |
▶ | if ( defined $y ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $y) |
0 |
0 |
0 |
|
| 82 |
0 |
▶ | $axes->{y} = [ $y->map( sub { $coord->render_axis_v( $_, $theme ) } ) ]; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 83 |
|
| } |
| 84 |
0 |
▶ | if ($transpose) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($transpose) |
0 |
0 |
0 |
|
| 85 |
|
| $axes->{x} = { |
| 86 |
|
| top => $axes->{x}->{top}, |
| 87 |
|
| bottom => $axes->{x}->{bottom} |
| 88 |
0 |
| }; |
| 89 |
|
| $axes->{y} = { |
| 90 |
|
| left => $axes->{y}->{left}, |
| 91 |
|
| bottom => $axes->{y}->{right} |
| 92 |
0 |
| }; |
| 93 |
|
| } |
| 94 |
0 |
| return $axes; |
| 95 |
5 |
| } |
| 96 |
|
| |
| 97 |
|
| |
| 98 |
0 |
▶ | classmethod render_strips ($x, $y, $labeller, $theme) { |
|
Subroutine
render_strips: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 5 and Function::Parameters::_croak('Too few arguments for classmethod render_strips (expected 5, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 5 and Function::Parameters::_croak('Too many arguments for classmethod render_strips (expected 5, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 99 |
|
| return { |
| 100 |
0 |
| x => $class->_build_strip( $x, $labeller, $theme, true ), |
| 101 |
|
| y => $class->_build_strip( $y, $labeller, $theme, false ), |
| 102 |
|
| }; |
| 103 |
5 |
| } |
| 104 |
|
| |
| 105 |
0 |
▶ | classmethod check_coord_freedom ($coord) { |
|
Subroutine
check_coord_freedom: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for classmethod check_coord_freedom (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for classmethod check_coord_freedom (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 106 |
0 |
▶ | if ( |
Branch: 1 branch
| Branch | True | False | Total |
| if (&List::AllUtils::any(sub {
$coord->$Chart::GGPlot::Facet::_isa("Chart::GGPlot::$_");
}
, "Cartesian", "Flip")) |
0 |
0 |
0 |
|
| 107 |
0 |
▶ | List::AllUtils::any { $coord->$_isa("Chart::GGPlot::$_") } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 108 |
|
| qw(Cartesian Flip) |
| 109 |
|
| ) |
| 110 |
|
| { |
| 111 |
0 |
| return; |
| 112 |
|
| } |
| 113 |
|
| die( |
| 114 |
0 |
| q{Free scales are only supported with 'coord_cartesian()' and 'coord_flip()'} |
| 115 |
|
| ); |
| 116 |
5 |
| } |
| 117 |
|
| |
| 118 |
0 |
▶ | classmethod check_layout ($layout) { |
|
Subroutine
check_layout: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for classmethod check_layout (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for classmethod check_layout (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 119 |
0 |
| my $layout_names = $layout->names; |
| 120 |
0 |
▶ | unless ( |
Branch: 1 branch
| Branch | True | False | Total |
| unless (&List::AllUtils::all(sub {
elem($_, $layout_names);
}
, "PANEL", "SCALE_X", "SCALE_Y")) |
0 |
0 |
0 |
|
| 121 |
0 |
▶ | List::AllUtils::all { elem( $_, $layout_names ) } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 122 |
|
| qw(PANEL SCALE_X SCALE_Y) |
| 123 |
|
| ) |
| 124 |
|
| { |
| 125 |
0 |
| die( "Facet layout has bad format. " |
| 126 |
|
| . "It must contain columns 'PANEL', 'SCALE_X', and 'SCALE_Y'" ); |
| 127 |
|
| } |
| 128 |
5 |
| } |
| 129 |
|
| |
| 130 |
7 |
▶ | classmethod layout_null () { |
|
Subroutine
layout_null: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod layout_null (expected 1, got ' . @_ . ')') |
0 |
7 |
7 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod layout_null (expected 1, got ' . @_ . ')') |
0 |
7 |
7 |
|
| 131 |
7 |
| return Data::Frame->new( |
| 132 |
|
| columns => [ |
| 133 |
|
| PANEL => pdl([0]), |
| 134 |
|
| ROW => pdl([0]), |
| 135 |
|
| COL => pdl([0]), |
| 136 |
|
| SCALE_X => pdl([0]), |
| 137 |
|
| SCALE_Y => pdl([0]) |
| 138 |
|
| ] |
| 139 |
|
| ); |
| 140 |
5 |
| } |
| 141 |
|
| |
| 142 |
5 |
| 1; |
| 143 |
|
| |
| 144 |
|
| __END__ |