| 1 |
|
| package Chart::GGPlot::Scale::Functions; |
| 2 |
|
| |
| 3 |
|
| # ABSTRACT: Scale functions |
| 4 |
|
| |
| 5 |
7 |
▶ | use Chart::GGPlot::Setup qw(:base :pdl); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 6 |
|
| |
| 7 |
7 |
| our $VERSION = '0.002003'; # VERSION |
| 8 |
|
| |
| 9 |
7 |
▶ | use List::AllUtils qw(pairgrep); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 10 |
7 |
▶ | use Module::Load; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 11 |
7 |
▶ | use Type::Params; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 12 |
7 |
▶ | use Types::PDL qw(Piddle PiddleFromAny); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 13 |
7 |
▶ | use Types::Standard qw(Any CodeRef Maybe Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 14 |
|
| |
| 15 |
7 |
▶ | use Chart::GGPlot::Aes::Functions qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 16 |
7 |
▶ | use Chart::GGPlot::Range::Functions qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 17 |
7 |
▶ | use Chart::GGPlot::Trans::Functions qw(as_trans); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 18 |
7 |
▶ | use Chart::GGPlot::Types qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 19 |
7 |
▶ | use Chart::GGPlot::Util qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 20 |
|
| |
| 21 |
7 |
▶ | use parent qw(Exporter::Tiny); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 22 |
|
| |
| 23 |
7 |
| my @export_ggplot = ( |
| 24 |
|
| alias_color_functions( |
| 25 |
|
| __PACKAGE__, |
| 26 |
|
| qw( |
| 27 |
|
| continuous_scale discrete_scale |
| 28 |
|
| scale_x_continuous scale_y_continuous |
| 29 |
|
| scale_x_log10 scale_y_log10 |
| 30 |
|
| scale_x_reverse scale_y_reverse |
| 31 |
|
| scale_x_sqrt scale_y_sqrt |
| 32 |
|
| scale_x_discrete scale_y_discrete |
| 33 |
|
| scale_x_datetime scale_y_datetime |
| 34 |
|
| scale_color_hue scale_color_discrete |
| 35 |
|
| scale_fill_hue scale_fill_discrete |
| 36 |
|
| scale_color_continuous scale_fill_continuous |
| 37 |
|
| scale_color_brewer scale_fill_brewer |
| 38 |
|
| scale_color_distiller scale_fill_distiller |
| 39 |
|
| scale_color_gradient scale_fill_gradient |
| 40 |
|
| scale_color_gradient2 scale_fill_gradient2 |
| 41 |
|
| scale_color_gradientn scale_fill_gradientn |
| 42 |
|
| scale_color_viridis_d scale_fill_viridis_d |
| 43 |
|
| scale_fill_ordinal scale_fill_ordinal |
| 44 |
|
| scale_color_viridis_c scale_fill_viridis_c |
| 45 |
|
| scale_size_continuous |
| 46 |
|
| scale_alpha_continuous scale_alpha |
| 47 |
|
| scale_color_identity scale_shape_identity scale_linetype_identity |
| 48 |
|
| scale_alpha_identity scale_size_identity |
| 49 |
|
| ) |
| 50 |
|
| ) |
| 51 |
|
| ); |
| 52 |
|
| |
| 53 |
7 |
| our @EXPORT_OK = ( @export_ggplot, qw(find_scale scale_flip_position) ); |
| 54 |
7 |
| our %EXPORT_TAGS = ( |
| 55 |
|
| all => \@EXPORT_OK, |
| 56 |
|
| ggplot => \@export_ggplot, |
| 57 |
|
| ); |
| 58 |
|
| |
| 59 |
7 |
| my %scale_funcs; |
| 60 |
|
| |
| 61 |
|
| |
| 62 |
16 |
▶ | fun find_scale ($aes, $x) { |
|
Subroutine
find_scale: called CC=6 SCAR=19.1
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun find_scale (expected 2, got ' . @_ . ')') |
0 |
16 |
16 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun find_scale (expected 2, got ' . @_ . ')') |
0 |
16 |
16 |
|
| 63 |
16 |
| my $types = scale_type($x); |
| 64 |
|
| |
| 65 |
16 |
| for my $t (@$types) { |
| 66 |
16 |
| my $func_name = join( '_', "scale", $aes, $t ); |
| 67 |
16 |
▶ | if ( my $f = $scale_funcs{$func_name} ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (my $f = $scale_funcs{$func_name}) |
16 |
0 |
16 |
|
| 68 |
16 |
▶ | return ( wantarray ? ( $f, $func_name ) : $f ); |
Branch: 1 branch
| Branch | True | False | Total |
| wantarray ? : |
16 |
0 |
16 |
|
| 69 |
|
| } |
| 70 |
|
| } |
| 71 |
0 |
| return; |
| 72 |
7 |
| } |
| 73 |
|
| |
| 74 |
16 |
▶ | fun scale_type ($x) { |
|
Subroutine
scale_type: called CC=9 SCAR=23.3
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun scale_type (expected 1, got ' . @_ . ')') |
0 |
16 |
16 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun scale_type (expected 1, got ' . @_ . ')') |
0 |
16 |
16 |
|
| 75 |
16 |
▶ | if ( $x->$_DOES('PDL::Factor') ) { |
Branch: 4 branches
| Branch | True | False | Total |
| if ($x->$Chart::GGPlot::Scale::Functions::_DOES('PDL::Factor')) { } |
1 |
15 |
16 |
| elsif ($x->$Chart::GGPlot::Scale::Functions::_DOES('PDL::SV')) { } |
2 |
13 |
15 |
| elsif ($x->$Chart::GGPlot::Scale::Functions::_DOES('PDL::DateTime')) { } |
1 |
12 |
13 |
| elsif ($x->$Chart::GGPlot::Scale::Functions::_DOES('PDL')) { } |
12 |
0 |
12 |
|
| 76 |
1 |
▶ | return $x->DOES('PDL::Factor::Ordered') |
Branch: 1 branch
| Branch | True | False | Total |
| $x->DOES('PDL::Factor::Ordered') ? : |
0 |
1 |
1 |
|
| 77 |
|
| ? [qw(ordinal discrete)] |
| 78 |
|
| : ['discrete']; |
| 79 |
|
| } |
| 80 |
|
| elsif ( $x->$_DOES('PDL::SV') ) { |
| 81 |
2 |
| return ['discrete']; |
| 82 |
|
| } |
| 83 |
|
| elsif ( $x->$_DOES('PDL::DateTime') ) { |
| 84 |
1 |
| return ['datetime']; |
| 85 |
|
| } |
| 86 |
|
| elsif ( $x->$_DOES('PDL') ) { |
| 87 |
12 |
▶ | if ( $x->type eq 'byte' ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($x->type eq 'byte') { } |
0 |
12 |
12 |
|
| 88 |
0 |
| return ['discrete']; |
| 89 |
|
| } |
| 90 |
|
| else { |
| 91 |
12 |
| return ['continuous']; |
| 92 |
|
| } |
| 93 |
|
| } |
| 94 |
0 |
| return ['identity']; |
| 95 |
7 |
| } |
| 96 |
|
| |
| 97 |
25 |
▶ | fun _check_breaks_labels ( $breaks, $labels ) { |
|
Subroutine
_check_breaks_labels: called CC=10 SCAR=37.1
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun _check_breaks_labels (expected 2, got ' . @_ . ')') |
0 |
25 |
25 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun _check_breaks_labels (expected 2, got ' . @_ . ')') |
0 |
25 |
25 |
|
| 98 |
|
| state $check = Type::Params::compile( |
| 99 |
|
| Maybe [ Piddle->plus_coercions(PiddleFromAny) | CodeRef ], |
| 100 |
|
| Maybe [ |
| 101 |
0 |
▶ | Piddle->plus_coercions( Any, sub { PDL::SV->new($_) } ) | CodeRef ] |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
|
| 102 |
|
| ); |
| 103 |
25 |
| ( $breaks, $labels ) = $check->( $breaks, $labels ); |
| 104 |
|
| |
| 105 |
25 |
▶ | return ( $breaks, $labels ) |
Branch: 1 branch
| Branch | True | False | Total |
| unless defined $breaks and not $breaks->isempty |
25 |
0 |
25 |
Condition33%1/3
defined $breaks and not $breaks->isempty
MC/DC0%0/2
defined $breaks and not $breaks->isempty
defined $breaks
not $breaks->isempty
Truth table33%1/3
A and not(B)
A= defined $breaksB= not $breaks->isempty
|
| 106 |
|
| unless ( defined $breaks and !$breaks->isempty ); |
| 107 |
0 |
▶ | return ( $breaks, $labels ) |
Branch: 1 branch
| Branch | True | False | Total |
| unless defined $labels and not $labels->isempty |
0 |
0 |
0 |
Condition0%0/3
defined $labels and not $labels->isempty
MC/DC0%0/2
defined $labels and not $labels->isempty
defined $labels
not $labels->isempty
Truth table0%0/3
A and not(B)
A= defined $labelsB= not $labels->isempty
|
| 108 |
|
| unless ( defined $labels and !$labels->isempty ); |
| 109 |
|
| |
| 110 |
|
| # In R code there is check for is.atomic(breaks) && is.atomic(labels). |
| 111 |
|
| # List or function is not atomic in R. |
| 112 |
0 |
▶ | if ( $breaks->$_isa('PDL') |
Branch: 1 branch
| Branch | True | False | Total |
| if ($breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $labels->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $breaks->length != $labels->length) |
0 |
0 |
0 |
Condition0%0/6
$breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $labels->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $breaks->length != $labels->length
$breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $labels->$Chart::GGPlot::Scale::Functions::_isa("PDL")
MC/DC0%0/3
$breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $labels->$Chart::GGPlot::Scale::Functions::_isa("PDL") and $breaks->length != $labels->length
$breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL")
$labels->$Chart::GGPlot::Scale::Functions::_isa("PDL")
$breaks->length != $labels->length
Truth table0%0/4
A and B and C
A= $breaks->$Chart::GGPlot::Scale::Functions::_isa("PDL")B= $labels->$Chart::GGPlot::Scale::Functions::_isa("PDL")C= $breaks->length != $labels->length
| A | B | C | result |
| 0 | X | X | 0 |
| 1 | 0 | X | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
|
| 113 |
|
| && $labels->$_isa('PDL') |
| 114 |
|
| && ( $breaks->length != $labels->length ) ) |
| 115 |
|
| { |
| 116 |
0 |
| die("`breaks` and `labels` must have the same length"); |
| 117 |
|
| } |
| 118 |
|
| |
| 119 |
0 |
| return ($breaks, $labels); |
| 120 |
7 |
| } |
| 121 |
|
| |
| 122 |
|
| |
| 123 |
19 |
▶ | fun continuous_scale (:$aesthetics, :$scale_name, |
|
Subroutine
continuous_scale: called CC=22 SCAR=34.2
Pod
documented
|
| 124 |
|
| :$palette, :$name=undef, |
| 125 |
|
| :$breaks=undef, :$minor_breaks=undef, |
| 126 |
|
| :$labels=undef, :$limits=null(), |
| 127 |
|
| :$rescaler=\&rescale, :$oob=\&censor, :$expand=undef, |
| 128 |
|
| :$na_value='nan', |
| 129 |
|
| :$trans="identity", :$guide="legend", |
| 130 |
|
| PositionEnum :$position="left", |
| 131 |
|
| Str :$super='Chart::GGPlot::Scale::Continuous', |
| 132 |
|
| %rest |
| 133 |
19 |
▶ | ) { |
Branch: 15 branches
| Branch | True | False | Total |
| @_ < 6 and Function::Parameters::_croak('Too few arguments for fun continuous_scale (expected 6, got ' . @_ . ')') |
0 |
19 |
19 |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun continuous_scale") |
0 |
19 |
19 |
| exists $rest{'aesthetics'} ? : |
19 |
0 |
19 |
| exists $rest{'scale_name'} ? : |
19 |
0 |
19 |
| exists $rest{'palette'} ? : |
19 |
0 |
19 |
| exists $rest{'limits'} ? : |
16 |
3 |
19 |
| exists $rest{'rescaler'} ? : |
0 |
19 |
19 |
| exists $rest{'oob'} ? : |
16 |
3 |
19 |
| exists $rest{'na_value'} ? : |
18 |
1 |
19 |
| exists $rest{'trans'} ? : |
17 |
2 |
19 |
| exists $rest{'guide'} ? : |
19 |
0 |
19 |
| exists $rest{'position'} ? : |
17 |
2 |
19 |
| exists $rest{'super'} ? : |
17 |
2 |
19 |
| Type::Tiny::XS::AUTO::TC8($position) or Function::Parameters::_croak('In fun continuous_scale: parameter 15 ($position): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 32,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "PositionEnum","exception_class" => "Error::TypeTiny::Assertion","is_using_default_message" => 1,"library" => "Chart::GGPlot::Types","name" => "PositionEnum","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1069,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Enum[\"left\",\"right\",\"top\",\"bottom\"]","exception_class" => "Error::TypeTiny::Assertion","name" => "__ANON__","uniq" => 106,"unique_values" => ["bottom","left","right","top"],"values" => ["left","right","top","bottom"]}, 'Type::Tiny::Enum' ),"uniq" => 107}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"}; \$v}->get_message($position)) |
19 |
0 |
19 |
| Type::Tiny::XS::Str($super) or Function::Parameters::_croak('In fun continuous_scale: parameter 16 ($super): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_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; Type::Tiny::XS::Str($_[0]) or _failed_check(9, 'Str', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Str","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 \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 291,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Str","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; use warnings; use strict; $Type::Tiny::AvoidCallbacks ? goto $orig_inlined : "$xsubname($_[1])";},"is_using_default_message" => 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_51; use warnings; use strict; do { do { do { defined $_[0] } and not ref $_[0] } and ref \$_[0] eq 'SCALAR' || ref \(my $val = $_[0]) eq 'SCALAR' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && (' . 'ref(\\' . $_[1] . ') eq "SCALAR"' . ' || ref(\\(my $val = ' . $_[1] . ')) eq "SCALAR"' . ')';},"name" => "Str","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_49; use warnings; use strict; do { do { defined $_[0] } and not ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; not ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && !ref(' . $_[1] . ')';},"name" => "Value","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => 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" => {},"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"_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' )}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Str","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] and not ref $_[0] or _failed_check(8, 'Value', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Value","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; not ref $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 276,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Value","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1]) and not ref($_[1])";},"library" => "Types::Standard","name" => "Value","parent" => {},"uniq" => 8}, 'Type::Tiny' ),"sorter" => sub { package Types::Standard; no warnings; use strict; $_[0] cmp $_[1];},"type_default" => sub { package Types::Standard; no warnings; use strict; return '';},"uniq" => 9}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v;$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($super)) |
19 |
0 |
19 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 134 |
19 |
| ($breaks, $labels) = _check_breaks_labels( $breaks, $labels ); |
| 135 |
|
| |
| 136 |
19 |
▶ | if ( ( defined $breaks and $breaks->isempty ) |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none") |
0 |
19 |
19 |
Condition33%3/9
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none"
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics)
defined $breaks and $breaks->isempty
MC/DC0%0/4
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none"
defined $breaks
$breaks->isempty
not is_position_aes($aesthetics)
$guide ne "none"
Truth table20%1/5
A and B and not(C) and D
A= defined $breaksB= $breaks->isemptyC= not is_position_aes($aesthetics)D= $guide ne "none"
| A | B | C | D | result |
| 0 | X | X | X | 0 |
| 1 | 0 | X | X | 0 |
| 1 | 1 | 0 | X | 0 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
|
| 137 |
|
| and !is_position_aes($aesthetics) |
| 138 |
|
| and $guide ne "none" ) |
| 139 |
|
| { |
| 140 |
0 |
| $guide = "none"; |
| 141 |
|
| } |
| 142 |
|
| |
| 143 |
19 |
| $trans = as_trans($trans); |
| 144 |
19 |
▶ | if ( defined $limits ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $limits) |
19 |
0 |
19 |
|
| 145 |
19 |
| $limits = $trans->transform->( pdl($limits) ); |
| 146 |
|
| } |
| 147 |
|
| |
| 148 |
19 |
| load $super; |
| 149 |
|
| return $super->new( |
| 150 |
304 |
▶ | pairgrep { defined $b } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 151 |
|
| ( |
| 152 |
19 |
| aesthetics => $aesthetics, |
| 153 |
|
| scale_name => $scale_name, |
| 154 |
|
| palette => $palette, |
| 155 |
|
| range => continuous_range(), |
| 156 |
|
| limits => $limits, |
| 157 |
|
| trans => $trans, |
| 158 |
|
| na_value => $na_value, |
| 159 |
|
| expand => $expand, |
| 160 |
|
| rescaler => $rescaler, # Used by diverging and n color gradients |
| 161 |
|
| oob => $oob, |
| 162 |
|
| name => $name, |
| 163 |
|
| breaks => $breaks, |
| 164 |
|
| minor_breaks => $minor_breaks, |
| 165 |
|
| labels => $labels, |
| 166 |
|
| guide => $guide, |
| 167 |
|
| position => $position, |
| 168 |
|
| %rest |
| 169 |
|
| ) |
| 170 |
|
| ); |
| 171 |
7 |
| } |
| 172 |
|
| |
| 173 |
|
| |
| 174 |
6 |
▶ | fun discrete_scale (:$aesthetics, :$scale_name, |
|
Subroutine
discrete_scale: called CC=19 SCAR=33.2
Pod
documented
|
| 175 |
|
| :$palette, :$name=undef, |
| 176 |
|
| :$breaks=undef, :$labels=undef, |
| 177 |
|
| :$limits=PDL::SV->new([]), |
| 178 |
|
| :$expand=undef, :$na_translate=true, :$na_value=undef, |
| 179 |
|
| :$drop=true, :$guide="legend", |
| 180 |
|
| PositionEnum :$position = "left", |
| 181 |
|
| Str :$super = 'Chart::GGPlot::Scale::Discrete', |
| 182 |
|
| %rest |
| 183 |
6 |
▶ | ) { |
Branch: 13 branches
| Branch | True | False | Total |
| @_ < 6 and Function::Parameters::_croak('Too few arguments for fun discrete_scale (expected 6, got ' . @_ . ')') |
0 |
6 |
6 |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun discrete_scale") |
0 |
6 |
6 |
| exists $rest{'aesthetics'} ? : |
6 |
0 |
6 |
| exists $rest{'scale_name'} ? : |
6 |
0 |
6 |
| exists $rest{'palette'} ? : |
6 |
0 |
6 |
| exists $rest{'limits'} ? : |
1 |
5 |
6 |
| exists $rest{'na_translate'} ? : |
0 |
6 |
6 |
| exists $rest{'drop'} ? : |
0 |
6 |
6 |
| exists $rest{'guide'} ? : |
3 |
3 |
6 |
| exists $rest{'position'} ? : |
3 |
3 |
6 |
| exists $rest{'super'} ? : |
3 |
3 |
6 |
| Type::Tiny::XS::AUTO::TC8($position) or Function::Parameters::_croak('In fun discrete_scale: parameter 13 ($position): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 32,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "PositionEnum","exception_class" => "Error::TypeTiny::Assertion","is_using_default_message" => 1,"library" => "Chart::GGPlot::Types","name" => "PositionEnum","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1069,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Enum[\"left\",\"right\",\"top\",\"bottom\"]","exception_class" => "Error::TypeTiny::Assertion","name" => "__ANON__","uniq" => 106,"unique_values" => ["bottom","left","right","top"],"values" => ["left","right","top","bottom"]}, 'Type::Tiny::Enum' ),"uniq" => 107}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"}; \$v}->get_message($position)) |
6 |
0 |
6 |
| Type::Tiny::XS::Str($super) or Function::Parameters::_croak('In fun discrete_scale: parameter 14 ($super): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_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; Type::Tiny::XS::Str($_[0]) or _failed_check(9, 'Str', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Str","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 \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 291,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Str","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; use warnings; use strict; $Type::Tiny::AvoidCallbacks ? goto $orig_inlined : "$xsubname($_[1])";},"is_using_default_message" => 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_51; use warnings; use strict; do { do { do { defined $_[0] } and not ref $_[0] } and ref \$_[0] eq 'SCALAR' || ref \(my $val = $_[0]) eq 'SCALAR' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && (' . 'ref(\\' . $_[1] . ') eq "SCALAR"' . ' || ref(\\(my $val = ' . $_[1] . ')) eq "SCALAR"' . ')';},"name" => "Str","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_49; use warnings; use strict; do { do { defined $_[0] } and not ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; not ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && !ref(' . $_[1] . ')';},"name" => "Value","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => 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" => {},"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"_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' )}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Str","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] and not ref $_[0] or _failed_check(8, 'Value', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Value","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; not ref $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 276,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Value","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1]) and not ref($_[1])";},"library" => "Types::Standard","name" => "Value","parent" => {},"uniq" => 8}, 'Type::Tiny' ),"sorter" => sub { package Types::Standard; no warnings; use strict; $_[0] cmp $_[1];},"type_default" => sub { package Types::Standard; no warnings; use strict; return '';},"uniq" => 9}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v;$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($super)) |
6 |
0 |
6 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 184 |
6 |
| ($breaks, $labels) = _check_breaks_labels( $breaks, $labels ); |
| 185 |
|
| |
| 186 |
6 |
▶ | if ( ( defined $breaks and $breaks->isempty ) |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none") |
0 |
6 |
6 |
Condition33%3/9
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none"
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics)
defined $breaks and $breaks->isempty
MC/DC0%0/4
defined $breaks and $breaks->isempty and not is_position_aes($aesthetics) and $guide ne "none"
defined $breaks
$breaks->isempty
not is_position_aes($aesthetics)
$guide ne "none"
Truth table20%1/5
A and B and not(C) and D
A= defined $breaksB= $breaks->isemptyC= not is_position_aes($aesthetics)D= $guide ne "none"
| A | B | C | D | result |
| 0 | X | X | X | 0 |
| 1 | 0 | X | X | 0 |
| 1 | 1 | 0 | X | 0 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
|
| 187 |
|
| and !is_position_aes($aesthetics) |
| 188 |
|
| and $guide ne "none" ) |
| 189 |
|
| { |
| 190 |
0 |
| $guide = "none"; |
| 191 |
|
| } |
| 192 |
|
| |
| 193 |
6 |
| load $super; |
| 194 |
|
| return $super->new( |
| 195 |
87 |
▶ | pairgrep { defined $b } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 196 |
|
| ( |
| 197 |
6 |
| aesthetics => $aesthetics, |
| 198 |
|
| scale_name => $scale_name, |
| 199 |
|
| palette => $palette, |
| 200 |
|
| range => discrete_range(), |
| 201 |
|
| limits => $limits, |
| 202 |
|
| na_value => $na_value, |
| 203 |
|
| na_translate => $na_translate, |
| 204 |
|
| expand => $expand, |
| 205 |
|
| name => $name, |
| 206 |
|
| breaks => $breaks, |
| 207 |
|
| labels => $labels, |
| 208 |
|
| drop => $drop, |
| 209 |
|
| guide => $guide, |
| 210 |
|
| position => $position, |
| 211 |
|
| %rest |
| 212 |
|
| ) |
| 213 |
|
| ); |
| 214 |
7 |
| } |
| 215 |
|
| |
| 216 |
|
| # In place modification of a scale to change the primary axis |
| 217 |
0 |
▶ | fun scale_flip_position ($scale) { |
|
Subroutine
scale_flip_position: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun scale_flip_position (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun scale_flip_position (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 218 |
0 |
| state $switch = { |
| 219 |
|
| top => "bottom", |
| 220 |
|
| bottom => "top", |
| 221 |
|
| left => "right", |
| 222 |
|
| right => "left", |
| 223 |
|
| }; |
| 224 |
0 |
| $scale->position( $switch->{ $scale->position } ); |
| 225 |
0 |
| return $scale; |
| 226 |
7 |
| } |
| 227 |
|
| |
| 228 |
|
| |
| 229 |
14 |
▶ | fun _scale_hue ($aes) { |
|
Subroutine
_scale_hue: called CC=3 SCAR=11.3
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_hue (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_hue (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 230 |
2 |
▶ | return fun(:$h = pdl( [ 0, 360 ] ) + 15, |
|
Subroutine
__ANON__: called CC=9 SCAR=22.9
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
2 |
2 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table66%2/3
A and B
A= @_ > 0B= @_ % 2
|
| 231 |
|
| :$c = 100, :$l = 65, |
| 232 |
|
| :$h_start = 0, |
| 233 |
|
| :$direction = 1, |
| 234 |
|
| :$na_value = 'grey50', |
| 235 |
|
| %rest |
| 236 |
2 |
▶ | ) { |
Branch: 6 branches
| Branch | True | False | Total |
| exists $rest{'h'} ? : |
0 |
2 |
2 |
| exists $rest{'c'} ? : |
1 |
1 |
2 |
| exists $rest{'l'} ? : |
1 |
1 |
2 |
| exists $rest{'h_start'} ? : |
0 |
2 |
2 |
| exists $rest{'direction'} ? : |
0 |
2 |
2 |
| exists $rest{'na_value'} ? : |
0 |
2 |
2 |
|
| 237 |
2 |
| return discrete_scale( |
| 238 |
|
| aesthetics => $aes, |
| 239 |
|
| scale_name => 'hue', |
| 240 |
|
| palette => hue_pal( |
| 241 |
|
| h => $h, |
| 242 |
|
| c => $c, |
| 243 |
|
| l => $l, |
| 244 |
|
| h_start => $h_start, |
| 245 |
|
| direction => $direction |
| 246 |
|
| ), |
| 247 |
|
| na_value => _na_value_color($na_value), |
| 248 |
|
| %rest |
| 249 |
|
| ); |
| 250 |
14 |
| }; |
| 251 |
7 |
| } |
| 252 |
|
| |
| 253 |
7 |
| *scale_color_hue = _scale_hue('color'); |
| 254 |
7 |
| *scale_color_discrete = \&scale_color_hue; |
| 255 |
7 |
| *scale_fill_hue = _scale_hue('fill'); |
| 256 |
7 |
| *scale_fill_discrete = \&scale_fill_hue; |
| 257 |
|
| |
| 258 |
|
| |
| 259 |
14 |
▶ | fun _scale_brewer ($aes) { |
|
Subroutine
_scale_brewer: called CC=3 SCAR=11.8
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_brewer (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_brewer (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 260 |
1 |
▶ | return fun(ColorBrewerTypeEnum :$type = "seq", |
|
Subroutine
__ANON__: called CC=7 SCAR=21.8
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
1 |
1 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 261 |
|
| :$palette = 0, |
| 262 |
|
| :$direction = 1, |
| 263 |
|
| %rest |
| 264 |
1 |
▶ | ) { |
Branch: 4 branches
| Branch | True | False | Total |
| exists $rest{'type'} ? : |
0 |
1 |
1 |
| exists $rest{'palette'} ? : |
0 |
1 |
1 |
| exists $rest{'direction'} ? : |
0 |
1 |
1 |
| Type::Tiny::XS::AUTO::TC7($type) or Function::Parameters::_croak('In fun (anon): parameter 1 ($type): ' . ${my $v = bless( {"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 31,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "ColorBrewerTypeEnum","exception_class" => "Error::TypeTiny::Assertion","library" => "Chart::GGPlot::Types","name" => "ColorBrewerTypeEnum","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1069,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Enum[\"seq\",\"dev\",\"qual\"]","exception_class" => "Error::TypeTiny::Assertion","name" => "__ANON__","uniq" => 103,"unique_values" => ["dev","qual","seq"],"values" => ["seq","dev","qual"]}, 'Type::Tiny::Enum' ),"uniq" => 104}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"}; \$v}->get_message($type)) |
1 |
0 |
1 |
|
| 265 |
1 |
| return discrete_scale( |
| 266 |
|
| aesthetics => $aes, |
| 267 |
|
| scale_name => "brewer", |
| 268 |
|
| palette => brewer_pal( $type, $palette, $direction ), |
| 269 |
|
| %rest |
| 270 |
|
| ); |
| 271 |
14 |
| }; |
| 272 |
7 |
| } |
| 273 |
|
| |
| 274 |
7 |
| *scale_color_brewer = _scale_brewer('color'); |
| 275 |
7 |
| *scale_fill_brewer = _scale_brewer('fill'); |
| 276 |
|
| |
| 277 |
|
| |
| 278 |
14 |
▶ | fun _scale_distiller ($aes) { |
|
Subroutine
_scale_distiller: called CC=3 SCAR=21.1
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_distiller (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_distiller (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 279 |
0 |
▶ | return fun(ColorBrewerTypeEnum :$type = "seq", |
|
Subroutine
__ANON__: not called CC=11 SCAR=48.8
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 280 |
|
| :$palette = 1, |
| 281 |
|
| :$direction = -1, :$values = [], :$na_value = "grey50", |
| 282 |
|
| :$guide = "colorbar", |
| 283 |
|
| %rest |
| 284 |
0 |
▶ | ) { |
Branch: 7 branches
| Branch | True | False | Total |
| exists $rest{'type'} ? : |
0 |
0 |
0 |
| exists $rest{'palette'} ? : |
0 |
0 |
0 |
| exists $rest{'direction'} ? : |
0 |
0 |
0 |
| exists $rest{'values'} ? : |
0 |
0 |
0 |
| exists $rest{'na_value'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
| Type::Tiny::XS::AUTO::TC7($type) or Function::Parameters::_croak('In fun (anon): parameter 1 ($type): ' . ${my $v = bless( {"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 31,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "ColorBrewerTypeEnum","exception_class" => "Error::TypeTiny::Assertion","library" => "Chart::GGPlot::Types","name" => "ColorBrewerTypeEnum","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1069,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Enum[\"seq\",\"dev\",\"qual\"]","exception_class" => "Error::TypeTiny::Assertion","name" => "__ANON__","uniq" => 103,"unique_values" => ["dev","qual","seq"],"values" => ["seq","dev","qual"]}, 'Type::Tiny::Enum' ),"uniq" => 104}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"}; \$v}->get_message($type)) |
0 |
0 |
0 |
|
| 285 |
0 |
▶ | if ( $type eq "qual" ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($type eq "qual") |
0 |
0 |
0 |
|
| 286 |
0 |
| warn( "Using a discrete color palette in a continuous scale.\n" |
| 287 |
|
| . " Consider using type = \"seq\" or type = \"div\" instead" |
| 288 |
|
| ); |
| 289 |
|
| } |
| 290 |
0 |
| return continuous_scale( |
| 291 |
|
| aesthetics => $aes, |
| 292 |
|
| scale_name => 'distiller', |
| 293 |
|
| palette => gradient_n_pal( |
| 294 |
|
| brewer_pal( $type, $palette, $direction )->[6], $values, |
| 295 |
|
| ), |
| 296 |
|
| na_value => _na_value_color($na_value), |
| 297 |
|
| guide => $guide, |
| 298 |
|
| %rest |
| 299 |
|
| ); |
| 300 |
14 |
| }; |
| 301 |
7 |
| } |
| 302 |
|
| |
| 303 |
7 |
| *scale_color_distiller = _scale_distiller('color'); |
| 304 |
7 |
| *scale_fill_distiller = _scale_distiller('fill'); |
| 305 |
|
| |
| 306 |
|
| |
| 307 |
14 |
▶ | fun _scale_gradient ($aes) { |
|
Subroutine
_scale_gradient: called CC=3 SCAR=11.8
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_gradient (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_gradient (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 308 |
2 |
▶ | return fun(:$low = "#132B43", :$high = "#56B1F7", |
|
Subroutine
__ANON__: called CC=7 SCAR=21.8
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
2 |
2 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 309 |
|
| :$na_value = "grey50", |
| 310 |
|
| :$guide = "colorbar", |
| 311 |
|
| %rest |
| 312 |
2 |
▶ | ) { |
Branch: 4 branches
| Branch | True | False | Total |
| exists $rest{'low'} ? : |
0 |
2 |
2 |
| exists $rest{'high'} ? : |
0 |
2 |
2 |
| exists $rest{'na_value'} ? : |
0 |
2 |
2 |
| exists $rest{'guide'} ? : |
0 |
2 |
2 |
|
| 313 |
2 |
| return continuous_scale( |
| 314 |
|
| aesthetics => $aes, |
| 315 |
|
| scale_name => "gradient", |
| 316 |
|
| palette => seq_gradient_pal( $low, $high ), |
| 317 |
|
| na_value => _na_value_color($na_value), |
| 318 |
|
| guide => $guide, |
| 319 |
|
| %rest |
| 320 |
|
| ); |
| 321 |
14 |
| }; |
| 322 |
7 |
| } |
| 323 |
|
| |
| 324 |
7 |
| *scale_color_gradient = _scale_gradient('color'); |
| 325 |
7 |
| *scale_fill_gradient = _scale_gradient('fill'); |
| 326 |
|
| |
| 327 |
|
| |
| 328 |
14 |
▶ | fun _scale_gradient2 ($aes) { |
|
Subroutine
_scale_gradient2: called CC=3 SCAR=20.4
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_gradient2 (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_gradient2 (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 329 |
0 |
▶ | return fun(:$low = muted("red"), :$mid = "white", |
|
Subroutine
__ANON__: not called CC=9 SCAR=45.0
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 330 |
|
| :$high = muted("blue"), |
| 331 |
|
| :$midpoint = 0, |
| 332 |
|
| :$na_value = "grey50", |
| 333 |
|
| :$guide = "colorbar", |
| 334 |
|
| %rest |
| 335 |
0 |
▶ | ) { |
Branch: 6 branches
| Branch | True | False | Total |
| exists $rest{'low'} ? : |
0 |
0 |
0 |
| exists $rest{'mid'} ? : |
0 |
0 |
0 |
| exists $rest{'high'} ? : |
0 |
0 |
0 |
| exists $rest{'midpoint'} ? : |
0 |
0 |
0 |
| exists $rest{'na_value'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
|
| 336 |
0 |
| return continuous_scale( |
| 337 |
|
| aesthetics => $aes, |
| 338 |
|
| scale_name => "gradient2", |
| 339 |
|
| palette => div_gradient_pal( $low, $mid, $high ), |
| 340 |
|
| na_value => _na_value_color($na_value), |
| 341 |
|
| guide => $guide, |
| 342 |
|
| rescaler => _mid_rescaler($midpoint), |
| 343 |
|
| %rest |
| 344 |
|
| ); |
| 345 |
14 |
| }; |
| 346 |
7 |
| } |
| 347 |
|
| |
| 348 |
7 |
| *scale_color_gradient2 = _scale_gradient2('color'); |
| 349 |
7 |
| *scale_fill_gradient2 = _scale_gradient2('fill'); |
| 350 |
|
| |
| 351 |
|
| |
| 352 |
14 |
▶ | fun _scale_gradientn ($aes) { |
|
Subroutine
_scale_gradientn: called CC=3 SCAR=19.7
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_gradientn (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_gradientn (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 353 |
0 |
▶ | return fun(:$values = [], :$na_value = "grey50", |
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 354 |
|
| :$guide = "colorbar", |
| 355 |
|
| %rest |
| 356 |
0 |
▶ | ) { |
Branch: 3 branches
| Branch | True | False | Total |
| exists $rest{'values'} ? : |
0 |
0 |
0 |
| exists $rest{'na_value'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
|
| 357 |
0 |
▶ | my $colors = ( delete $rest{colors} ) // ( delete $rest{colours} ); |
Condition0%0/3
delete $rest{"colors"} // delete $rest{"colours"}
MC/DC0%0/2
delete $rest{"colors"} // delete $rest{"colours"}
delete $rest{"colors"}
delete $rest{"colours"}
Truth table0%0/3
A // B
A= delete $rest{"colors"}B= delete $rest{"colours"}
|
| 358 |
0 |
| continuous_scale( |
| 359 |
|
| aesthetics => $aes, |
| 360 |
|
| scale_name => "gradientn", |
| 361 |
|
| palette => gradient_n_pal( $colors, $values ), |
| 362 |
|
| na_value => _na_value_color($na_value), |
| 363 |
|
| guide => $guide, |
| 364 |
|
| %rest |
| 365 |
|
| ); |
| 366 |
14 |
| }; |
| 367 |
7 |
| } |
| 368 |
|
| |
| 369 |
7 |
| *scale_color_gradientn = _scale_gradientn('color'); |
| 370 |
7 |
| *scale_fill_gradientn = _scale_gradientn('fill'); |
| 371 |
|
| |
| 372 |
|
| |
| 373 |
14 |
▶ | fun _scale_viridis_d ($aes) { |
|
Subroutine
_scale_viridis_d: called CC=3 SCAR=19.5
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_viridis_d (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_viridis_d (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 374 |
0 |
▶ | return fun (:$begin = 0, :$end = 1, |
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 375 |
|
| :$direction = 1, :$option = 'viridis', |
| 376 |
|
| %rest |
| 377 |
0 |
▶ | ) { |
Branch: 4 branches
| Branch | True | False | Total |
| exists $rest{'begin'} ? : |
0 |
0 |
0 |
| exists $rest{'end'} ? : |
0 |
0 |
0 |
| exists $rest{'direction'} ? : |
0 |
0 |
0 |
| exists $rest{'option'} ? : |
0 |
0 |
0 |
|
| 378 |
0 |
| return discrete_scale( |
| 379 |
|
| aesthetics => $aes, |
| 380 |
|
| scale_name => "viridis_d", |
| 381 |
|
| palette => viridis_pal( $begin, $end, $direction, $option ), |
| 382 |
|
| %rest, |
| 383 |
|
| ); |
| 384 |
14 |
| }; |
| 385 |
7 |
| } |
| 386 |
|
| |
| 387 |
7 |
| *scale_color_viridis_d = _scale_viridis_d('color'); |
| 388 |
7 |
| *scale_color_ordinal = \&scale_color_viridis_d; |
| 389 |
7 |
| *scale_fill_viridis_d = _scale_viridis_d('fill'); |
| 390 |
7 |
| *scale_fill_ordinal = \&scale_fill_viridis_d; |
| 391 |
|
| |
| 392 |
|
| |
| 393 |
14 |
▶ | fun _scale_viridis_c ($aes) { |
|
Subroutine
_scale_viridis_c: called CC=3 SCAR=20.9
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_viridis_c (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_viridis_c (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 394 |
0 |
▶ | return fun (:$begin = 0, :$end = 1, |
|
Subroutine
__ANON__: not called CC=10 SCAR=47.0
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 395 |
|
| :$direction = 1, :$option = 'viridis', :$values = null(), |
| 396 |
|
| :$na_value = 'grey50', |
| 397 |
|
| :$guide = 'colorbar', |
| 398 |
|
| %rest |
| 399 |
0 |
▶ | ) { |
Branch: 7 branches
| Branch | True | False | Total |
| exists $rest{'begin'} ? : |
0 |
0 |
0 |
| exists $rest{'end'} ? : |
0 |
0 |
0 |
| exists $rest{'direction'} ? : |
0 |
0 |
0 |
| exists $rest{'option'} ? : |
0 |
0 |
0 |
| exists $rest{'values'} ? : |
0 |
0 |
0 |
| exists $rest{'na_value'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
|
| 400 |
|
| |
| 401 |
0 |
| my $pal = |
| 402 |
|
| gradient_n_pal( viridis_pal( $begin, $end, $direction, $option )->(6), |
| 403 |
|
| $values ); |
| 404 |
0 |
| return continuous_scale( |
| 405 |
|
| aesthetics => $aes, |
| 406 |
|
| scale_name => "viridis_c", |
| 407 |
|
| palette => $pal, |
| 408 |
|
| na_value => $na_value, |
| 409 |
|
| guide => $guide, |
| 410 |
|
| %rest, |
| 411 |
|
| ); |
| 412 |
14 |
| }; |
| 413 |
7 |
| } |
| 414 |
|
| |
| 415 |
7 |
| *scale_color_viridis_c = _scale_viridis_c('color'); |
| 416 |
7 |
| *scale_fill_viridis_c = _scale_viridis_c('fill'); |
| 417 |
|
| |
| 418 |
|
| |
| 419 |
1 |
▶ | fun scale_color_continuous (:$type = "gradient", %rest) { |
|
Subroutine
scale_color_continuous: called CC=5 SCAR=18.1
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_color_continuous") |
0 |
1 |
1 |
| exists $rest{'type'} ? : |
0 |
1 |
1 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 420 |
1 |
| state $switch = { |
| 421 |
|
| gradient => \&scale_color_gradient, |
| 422 |
|
| viridis => \&scale_color_viridis_c, |
| 423 |
|
| }; |
| 424 |
1 |
▶ | if ( my $func = $switch->{$type} ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (my $func = $switch->{$type}) |
1 |
0 |
1 |
|
| 425 |
1 |
| return $func->(%rest); |
| 426 |
|
| } |
| 427 |
0 |
| die("Unknown scale type"); |
| 428 |
7 |
| } |
| 429 |
|
| |
| 430 |
1 |
▶ | fun scale_fill_continuous (:$type = "gradient", %rest) { |
|
Subroutine
scale_fill_continuous: called CC=5 SCAR=18.1
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_fill_continuous") |
0 |
1 |
1 |
| exists $rest{'type'} ? : |
0 |
1 |
1 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 431 |
1 |
| state $switch = { |
| 432 |
|
| gradient => \&scale_fill_gradient, |
| 433 |
|
| viridis => \&scale_fill_viridis_c, |
| 434 |
|
| }; |
| 435 |
1 |
▶ | if ( my $func = $switch->{$type} ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (my $func = $switch->{$type}) |
1 |
0 |
1 |
|
| 436 |
1 |
| return $func->(%rest); |
| 437 |
|
| } |
| 438 |
0 |
| die("Unknown scale type"); |
| 439 |
7 |
| } |
| 440 |
|
| |
| 441 |
|
| |
| 442 |
0 |
▶ | fun scale_alpha_continuous (:$range=[0, 1], %rest) { |
|
Subroutine
scale_alpha_continuous: not called CC=4 SCAR=30.0
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_alpha_continuous") |
0 |
0 |
0 |
| exists $rest{'range'} ? : |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 443 |
|
| return continuous_scale( |
| 444 |
0 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 445 |
0 |
| aesthetics => "alpha", |
| 446 |
|
| scale_name => "alpha_c", |
| 447 |
|
| palette => rescale_pal($range), |
| 448 |
|
| %rest |
| 449 |
|
| ) |
| 450 |
|
| ); |
| 451 |
7 |
| } |
| 452 |
7 |
| *scale_alpha = \&scale_alpha_continuous; |
| 453 |
|
| |
| 454 |
|
| |
| 455 |
14 |
▶ | fun _scale_position_continuous ($aes) { |
|
Subroutine
_scale_position_continuous: called CC=3 SCAR=11.9
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_position_continuous (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_position_continuous (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 456 |
16 |
▶ | return fun(:$name = undef, :$breaks = undef, :$minor_breaks = undef, |
|
Subroutine
__ANON__: called CC=12 SCAR=28.7
|
| 457 |
16 |
▶ | :$labels = undef, :$limits = [], |
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
16 |
16 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table66%2/3
A and B
A= @_ > 0B= @_ % 2
|
| 458 |
|
| :$expand = undef, :$oob = \&censor, :$na_value = 'nan', |
| 459 |
|
| :$trans = 'identity', :$position = _default_position($aes), |
| 460 |
|
| :$sec_axis = undef, |
| 461 |
|
| %rest, |
| 462 |
|
| ) |
| 463 |
16 |
▶ | { |
Branch: 5 branches
| Branch | True | False | Total |
| exists $rest{'limits'} ? : |
2 |
14 |
16 |
| exists $rest{'oob'} ? : |
0 |
16 |
16 |
| exists $rest{'na_value'} ? : |
0 |
16 |
16 |
| exists $rest{'trans'} ? : |
1 |
15 |
16 |
| exists $rest{'position'} ? : |
0 |
16 |
16 |
|
| 464 |
16 |
▶ | if ( defined $sec_axis ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $sec_axis) |
0 |
16 |
16 |
|
| 465 |
0 |
▶ | if ( is_formula($sec_axis) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (is_formula($sec_axis)) |
0 |
0 |
0 |
|
| 466 |
0 |
| $sec_axis = sec_axis($sec_axis); |
| 467 |
|
| } |
| 468 |
0 |
▶ | if ( $sec_axis->$_isa('Chart::GGPlot::AxisSecondary') ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($sec_axis->$Chart::GGPlot::Scale::Functions::_isa("Chart::GGPlot::AxisSecondary")) |
0 |
0 |
0 |
|
| 469 |
0 |
| die( |
| 470 |
|
| "Secondary axes must be specified using a Chart::GGPlot::AxisSecondary object" |
| 471 |
|
| ); |
| 472 |
|
| } |
| 473 |
|
| } |
| 474 |
|
| |
| 475 |
|
| return continuous_scale( |
| 476 |
240 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 477 |
16 |
▶ | aesthetics => $aes, |
Branch: 1 branch
| Branch | True | False | Total |
| $sec_axis ? : |
0 |
16 |
16 |
|
| 478 |
|
| scale_name => 'position_c', |
| 479 |
|
| palette => \&identity, |
| 480 |
|
| name => $name, |
| 481 |
|
| breaks => $breaks, |
| 482 |
|
| minor_breaks => $minor_breaks, |
| 483 |
|
| labels => $labels, |
| 484 |
|
| limits => $limits, |
| 485 |
|
| expand => $expand, |
| 486 |
|
| oob => $oob, |
| 487 |
|
| na_value => $na_value, |
| 488 |
|
| trans => $trans, |
| 489 |
|
| guide => "none", |
| 490 |
|
| position => $position, |
| 491 |
|
| ( $sec_axis ? ( secondary_axis => $sec_axis ) : () ), |
| 492 |
|
| super => 'Chart::GGPlot::Scale::ContinuousPosition', |
| 493 |
|
| %rest |
| 494 |
|
| ) |
| 495 |
|
| ); |
| 496 |
14 |
| }; |
| 497 |
7 |
| } |
| 498 |
|
| |
| 499 |
7 |
| *scale_x_continuous = _scale_position_continuous( |
| 500 |
|
| [ |
| 501 |
|
| qw(x xmin xmax xend xintercept xmin_final xmax_final xlower xmiddle xupper) |
| 502 |
|
| ] |
| 503 |
|
| ); |
| 504 |
7 |
| *scale_y_continuous = _scale_position_continuous( |
| 505 |
|
| [qw(y ymin ymax yend yintercept ymin_final ymax_final lower middle upper)] |
| 506 |
|
| ); |
| 507 |
|
| |
| 508 |
7 |
| for my $trans (qw(log10 reverse sqrt)) { |
| 509 |
21 |
| for my $aes (qw(x y)) { |
| 510 |
42 |
| my $scale_func = "scale_${aes}_${trans}"; |
| 511 |
42 |
| my $continuous_func = "scale_${aes}_continuous"; |
| 512 |
7 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 513 |
0 |
▶ | *{$scale_func} = sub { $continuous_func->( @_, trans => $trans ) } |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
|
| 514 |
42 |
| } |
| 515 |
|
| } |
| 516 |
|
| |
| 517 |
|
| |
| 518 |
0 |
▶ | fun scale_size_continuous (:$name=undef, :$breaks=undef, :$labels=undef, |
|
Subroutine
scale_size_continuous: not called CC=8 SCAR=42.8
Pod
documented
|
| 519 |
|
| :$limits=[], :$range=[1, 6], |
| 520 |
0 |
▶ | :$trans='identity', :$guide='legend') { |
Branch: 6 branches
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_size_continuous") |
0 |
0 |
0 |
| exists ${__rest}{'limits'} ? : |
0 |
0 |
0 |
| exists ${__rest}{'range'} ? : |
0 |
0 |
0 |
| exists ${__rest}{'trans'} ? : |
0 |
0 |
0 |
| exists ${__rest}{'guide'} ? : |
0 |
0 |
0 |
| keys %{__rest} and Function::Parameters::_croak('In fun scale_size_continuous: no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 521 |
|
| return continuous_scale( |
| 522 |
0 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 523 |
0 |
| aesthetics => 'size', |
| 524 |
|
| scale_name => 'area', |
| 525 |
|
| palette => area_pal($range), |
| 526 |
|
| name => $name, |
| 527 |
|
| breaks => $breaks, |
| 528 |
|
| labels => $labels, |
| 529 |
|
| limits => $limits, |
| 530 |
|
| trans => $trans, |
| 531 |
|
| guide => "none", |
| 532 |
|
| ) |
| 533 |
|
| ); |
| 534 |
7 |
| } |
| 535 |
|
| |
| 536 |
|
| |
| 537 |
14 |
▶ | fun _scale_discrete ($aes) { |
|
Subroutine
_scale_discrete: called CC=3 SCAR=11.3
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_discrete (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_discrete (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 538 |
3 |
▶ | return fun( :$expand = undef, :$position = _default_position($aes), |
|
Subroutine
__ANON__: called CC=4 SCAR=14.2
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
3 |
3 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table66%2/3
A and B
A= @_ > 0B= @_ % 2
|
| 539 |
3 |
▶ | %rest ) { |
Branch: 1 branch
| Branch | True | False | Total |
| exists $rest{'position'} ? : |
0 |
3 |
3 |
|
| 540 |
|
| return discrete_scale( |
| 541 |
25 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 542 |
3 |
| aesthetics => $aes, |
| 543 |
|
| scale_name => 'position_c', |
| 544 |
|
| palette => \&identity, |
| 545 |
|
| expand => $expand, |
| 546 |
|
| guide => "none", |
| 547 |
|
| position => $position, |
| 548 |
|
| range_c => continuous_range(), |
| 549 |
|
| super => 'Chart::GGPlot::Scale::DiscretePosition', |
| 550 |
|
| %rest |
| 551 |
|
| ) |
| 552 |
|
| ); |
| 553 |
14 |
| }; |
| 554 |
7 |
| } |
| 555 |
|
| |
| 556 |
7 |
| *scale_x_discrete = _scale_discrete( [qw(x xmin xmax xend)] ); |
| 557 |
7 |
| *scale_y_discrete = _scale_discrete( [qw(y ymin ymax yend)] ); |
| 558 |
|
| |
| 559 |
|
| |
| 560 |
|
| |
| 561 |
0 |
▶ | fun scale_continuous_identity ( :$aesthetics, :$guide='none', %rest ) { |
|
Subroutine
scale_continuous_identity: not called CC=6 SCAR=37.4
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun scale_continuous_identity (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_continuous_identity") |
0 |
0 |
0 |
| exists $rest{'aesthetics'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 562 |
|
| return continuous_scale( |
| 563 |
0 |
▶ | pairgrep { defined $b } { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 564 |
0 |
| aesthetics => $aesthetics, |
| 565 |
|
| scale_name => 'identity', |
| 566 |
|
| palette => identity_pal(), |
| 567 |
|
| guide => $guide, |
| 568 |
|
| super => 'Chart::GGPlot::Scale::ContinuousIdentity', |
| 569 |
|
| %rest, |
| 570 |
|
| } |
| 571 |
|
| ); |
| 572 |
7 |
| } |
| 573 |
|
| |
| 574 |
0 |
▶ | fun scale_discrete_identity ( :$aesthetics, :$guide='none', %rest ) { |
|
Subroutine
scale_discrete_identity: not called CC=6 SCAR=37.4
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun scale_discrete_identity (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun scale_discrete_identity") |
0 |
0 |
0 |
| exists $rest{'aesthetics'} ? : |
0 |
0 |
0 |
| exists $rest{'guide'} ? : |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 575 |
|
| return discrete_scale( |
| 576 |
0 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 577 |
0 |
| aesthetics => $aesthetics, |
| 578 |
|
| scale_name => 'identity', |
| 579 |
|
| palette => identity_pal(), |
| 580 |
|
| guide => $guide, |
| 581 |
|
| super => 'Chart::GGPlot::Scale::DiscreteIdentity', |
| 582 |
|
| %rest, |
| 583 |
|
| ) |
| 584 |
|
| ); |
| 585 |
7 |
| } |
| 586 |
|
| |
| 587 |
7 |
| for my $aes (qw(fill shape linetype color)) { |
| 588 |
28 |
| my $scale_func = "scale_${aes}_identity"; |
| 589 |
7 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 590 |
0 |
▶ | *{$scale_func} = fun(%rest) { |
|
Subroutine
__ANON__: not called CC=3 SCAR=22.6
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 591 |
0 |
| scale_discrete_identity( %rest, aesthetics => $aes ) |
| 592 |
28 |
| }; |
| 593 |
|
| } |
| 594 |
|
| |
| 595 |
7 |
| for my $aes (qw(alpha size)) { |
| 596 |
14 |
| my $scale_func = "scale_${aes}_identity"; |
| 597 |
7 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 598 |
0 |
▶ | *{$scale_func} = fun(%rest) { |
|
Subroutine
__ANON__: not called CC=3 SCAR=22.6
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
0 |
0 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
|
| 599 |
0 |
| scale_continuous_identity( %rest, aesthetics => $aes ) |
| 600 |
14 |
| }; |
| 601 |
|
| } |
| 602 |
|
| |
| 603 |
|
| #=func scale_x_date |
| 604 |
|
| # |
| 605 |
|
| # scale_x_date(:$name = undef, :$breaks = undef, |
| 606 |
|
| # :$date_breaks = undef, :$labels = undef, :$date_labels = undef, |
| 607 |
|
| # :$minor_breaks = undef, :$date_minor_breaks = undef, |
| 608 |
|
| # :$limits = undef, :$expand = undef, |
| 609 |
|
| # PositionEnum :$position = "bottom", |
| 610 |
|
| # :$sec_axis = undef) |
| 611 |
|
| # |
| 612 |
|
| #=func scale_y_date |
| 613 |
|
| # |
| 614 |
|
| # scale_y_date(:$name = undef, :$breaks = undef, |
| 615 |
|
| # :$date_breaks = undef, :$labels = undef, :$date_labels = undef, |
| 616 |
|
| # :$minor_breaks = undef, :$date_minor_breaks = undef, |
| 617 |
|
| # :$limits = undef, :$expand = undef, |
| 618 |
|
| # PositionEnum :$position = "left", |
| 619 |
|
| # :$sec_axis = undef) |
| 620 |
|
| |
| 621 |
|
| |
| 622 |
1 |
▶ | fun datetime_scale (:$aesthetics, :$trans, :$palette, |
|
Subroutine
datetime_scale: called CC=14 SCAR=30.2
Pod
undocumented
|
| 623 |
|
| :$breaks = pretty_breaks(), :$minor_breaks = undef, |
| 624 |
|
| :$labels = undef, :$date_breaks = undef, |
| 625 |
|
| :$date_labels = undef, |
| 626 |
|
| :$date_minor_breaks = undef, :$timezone = undef, |
| 627 |
|
| :$guide = 'legend', |
| 628 |
1 |
▶ | %rest) { |
Branch: 7 branches
| Branch | True | False | Total |
| @_ < 6 and Function::Parameters::_croak('Too few arguments for fun datetime_scale (expected 6, got ' . @_ . ')') |
0 |
1 |
1 |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun datetime_scale") |
0 |
1 |
1 |
| exists $rest{'aesthetics'} ? : |
1 |
0 |
1 |
| exists $rest{'trans'} ? : |
1 |
0 |
1 |
| exists $rest{'palette'} ? : |
1 |
0 |
1 |
| exists $rest{'breaks'} ? : |
1 |
0 |
1 |
| exists $rest{'guide'} ? : |
1 |
0 |
1 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 629 |
|
| |
| 630 |
|
| # TODO: handle timezone |
| 631 |
|
| |
| 632 |
1 |
▶ | if ( defined $date_breaks ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $date_breaks) |
0 |
1 |
1 |
|
| 633 |
0 |
| $breaks = date_breaks($date_breaks); |
| 634 |
|
| } |
| 635 |
1 |
▶ | if ( defined $date_minor_breaks ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $date_minor_breaks) |
0 |
1 |
1 |
|
| 636 |
0 |
| $minor_breaks = date_breaks($date_minor_breaks); |
| 637 |
|
| } |
| 638 |
1 |
▶ | if ( defined $date_labels ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $date_labels) |
0 |
1 |
1 |
|
| 639 |
0 |
▶ | $labels = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
|
| 640 |
0 |
| my ($x) = @_; |
| 641 |
0 |
| return $x->as_pdlsv; |
| 642 |
0 |
| }; |
| 643 |
|
| } |
| 644 |
|
| |
| 645 |
1 |
| my $name = 'datetime'; |
| 646 |
|
| |
| 647 |
|
| state $positional_aes = |
| 648 |
1 |
| { map { $_ => 1 } qw(x xmin xmax xend y ymin ymax yend) }; |
| 649 |
1 |
| my $scale_class; |
| 650 |
1 |
▶ | if ( List::AllUtils::all { $positional_aes->exists($_) } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
| Branch | True | False | Total |
| if (&List::AllUtils::all(sub {
$positional_aes->exists($_);
}
, $aesthetics->flatten)) { } |
1 |
0 |
1 |
|
| 651 |
|
| $aesthetics->flatten ) |
| 652 |
|
| { |
| 653 |
1 |
▶ | if ($name eq 'datetime') { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($name eq "datetime") |
1 |
0 |
1 |
|
| 654 |
1 |
| $scale_class = 'Chart::GGPlot::Scale::ContinuousDateTime'; |
| 655 |
|
| } |
| 656 |
|
| } |
| 657 |
|
| else { |
| 658 |
0 |
| $scale_class = 'Chart::GGPlot::Scale::Continuous'; |
| 659 |
|
| } |
| 660 |
|
| |
| 661 |
|
| my $sc = continuous_scale( |
| 662 |
13 |
▶ | pairgrep { defined $b } ( |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 663 |
1 |
| aesthetics => $aesthetics, |
| 664 |
|
| scale_name => $name, |
| 665 |
|
| palette => $palette, |
| 666 |
|
| breaks => $breaks, |
| 667 |
|
| minor_breaks => $minor_breaks, |
| 668 |
|
| labels => $labels, |
| 669 |
|
| guide => $guide, |
| 670 |
|
| trans => $trans, |
| 671 |
|
| super => $scale_class, |
| 672 |
|
| %rest, |
| 673 |
|
| ) |
| 674 |
|
| ); |
| 675 |
|
| |
| 676 |
|
| #$sc->timezone($timezone); |
| 677 |
1 |
| return $sc; |
| 678 |
7 |
| } |
| 679 |
|
| |
| 680 |
14 |
▶ | fun _scale_datetime ($aes) { |
|
Subroutine
_scale_datetime: called CC=3 SCAR=11.2
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _scale_datetime (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _scale_datetime (expected 1, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 681 |
1 |
▶ | return fun(:$name = undef, :$breaks = undef, :$date_breaks = undef, |
|
Subroutine
__ANON__: called CC=6 SCAR=18.4
|
| 682 |
|
| :$labels = undef, :$date_labels = undef, |
| 683 |
|
| :$minor_breaks = undef, :$date_minor_breaks = undef, |
| 684 |
|
| :$timezone = undef, |
| 685 |
|
| :$limits = undef, :$expand = undef, |
| 686 |
1 |
▶ | PositionEnum :$position = _default_position($aes), |
Branch: 1 branch
| Branch | True | False | Total |
| @_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") |
0 |
1 |
1 |
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
|
| 687 |
1 |
▶ | :$sec_axis = undef) { |
Branch: 3 branches
| Branch | True | False | Total |
| exists ${__rest}{'position'} ? : |
0 |
1 |
1 |
| keys %{__rest} and Function::Parameters::_croak('In fun (anon): no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
1 |
1 |
| Type::Tiny::XS::AUTO::TC8($position) or Function::Parameters::_croak('In fun (anon): parameter 11 ($position): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 32,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "PositionEnum","exception_class" => "Error::TypeTiny::Assertion","is_using_default_message" => 1,"library" => "Chart::GGPlot::Types","name" => "PositionEnum","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1069,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Enum[\"left\",\"right\",\"top\",\"bottom\"]","exception_class" => "Error::TypeTiny::Assertion","name" => "__ANON__","uniq" => 106,"unique_values" => ["bottom","left","right","top"],"values" => ["left","right","top","bottom"]}, 'Type::Tiny::Enum' ),"uniq" => 107}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"}; \$v}->get_message($position)) |
1 |
0 |
1 |
|
| 688 |
1 |
| my $sc = datetime_scale( |
| 689 |
|
| aesthetics => $aes, |
| 690 |
|
| trans => 'time', |
| 691 |
|
| name => $name, |
| 692 |
|
| palette => \&identify, |
| 693 |
|
| breaks => $breaks, |
| 694 |
|
| date_breaks => $date_breaks, |
| 695 |
|
| labels => $labels, |
| 696 |
|
| date_labels => $date_labels, |
| 697 |
|
| minor_breaks => $minor_breaks, |
| 698 |
|
| date_minor_breaks => $date_minor_breaks, |
| 699 |
|
| timezone => $timezone, |
| 700 |
|
| guide => 'none', |
| 701 |
|
| limits => $limits, |
| 702 |
|
| expand => $expand, |
| 703 |
|
| position => $position, |
| 704 |
|
| ); |
| 705 |
1 |
| return $sc; |
| 706 |
14 |
| }; |
| 707 |
7 |
| } |
| 708 |
|
| |
| 709 |
7 |
| *scale_x_datetime = _scale_datetime([qw(x xmin xmax xend)]); |
| 710 |
7 |
| *scale_y_datetime = _scale_datetime([qw(y ymin ymax yend)]); |
| 711 |
|
| |
| 712 |
0 |
▶ | fun _mid_rescaler ($mid) { |
|
Subroutine
_mid_rescaler: not called CC=3 SCAR=24.8
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun _mid_rescaler (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun _mid_rescaler (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 713 |
0 |
▶ | return fun( $v, $to = [ 0, 1 ], $from = range( $v, true ) ) { |
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 3, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ < 3 and do {
@_ < 2 and $to = [0, 1];
$from = range($v, &true())
} |
0 |
0 |
0 |
| @_ < 2 and $to = [0, 1] |
0 |
0 |
0 |
|
| 714 |
0 |
| rescale_mid( $v, $to, $from, $mid ); |
| 715 |
0 |
| }; |
| 716 |
7 |
| } |
| 717 |
|
| |
| 718 |
|
| # TODO: remove this |
| 719 |
4 |
▶ | sub _na_value_color { $_[0] } |
|
Subroutine
_na_value_color: called CC=1 SCAR=0.0
|
| 720 |
|
| |
| 721 |
20 |
▶ | sub _default_position { |
|
Subroutine
_default_position: called CC=3 SCAR=11.1
|
| 722 |
20 |
| my ($aes) = @_; |
| 723 |
20 |
▶ | $aes = $aes->[0] if ref($aes); |
Branch: 1 branch
| Branch | True | False | Total |
| if ref $aes |
20 |
0 |
20 |
|
| 724 |
20 |
▶ | return ($aes =~ /^x/ ? 'bottom' : 'left'); |
Branch: 1 branch
| Branch | True | False | Total |
| $aes =~ /^x/u ? : |
12 |
8 |
20 |
|
| 725 |
|
| } |
| 726 |
|
| |
| 727 |
|
| # register scale functions within this pacakge |
| 728 |
406 |
▶ | fun _register_scale (Str $name, CodeRef $func) { |
|
Subroutine
_register_scale: called CC=5 SCAR=17.0
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun _register_scale (expected 2, got ' . @_ . ')') |
0 |
406 |
406 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun _register_scale (expected 2, got ' . @_ . ')') |
0 |
406 |
406 |
| Type::Tiny::XS::Str($name) or Function::Parameters::_croak('In fun _register_scale: parameter 1 ($name): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_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; Type::Tiny::XS::Str($_[0]) or _failed_check(9, 'Str', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Str","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 \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 291,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Str","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; use warnings; use strict; $Type::Tiny::AvoidCallbacks ? goto $orig_inlined : "$xsubname($_[1])";},"is_using_default_message" => 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_51; use warnings; use strict; do { do { do { defined $_[0] } and not ref $_[0] } and ref \$_[0] eq 'SCALAR' || ref \(my $val = $_[0]) eq 'SCALAR' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref \$_ eq 'SCALAR' or ref \(my $val = $_) eq 'SCALAR';},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && (' . 'ref(\\' . $_[1] . ') eq "SCALAR"' . ' || ref(\\(my $val = ' . $_[1] . ')) eq "SCALAR"' . ')';},"name" => "Str","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_49; use warnings; use strict; do { do { defined $_[0] } and not ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; not ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; $_[0]->parent->_inline_check($_[1]) . ' && !ref(' . $_[1] . ')';},"name" => "Value","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => 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" => {},"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"_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' )}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Str","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] and not ref $_[0] or _failed_check(8, 'Value', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Value","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; not ref $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 276,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Value","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1]) and not ref($_[1])";},"library" => "Types::Standard","name" => "Value","parent" => {},"uniq" => 8}, 'Type::Tiny' ),"sorter" => sub { package Types::Standard; no warnings; use strict; $_[0] cmp $_[1];},"type_default" => sub { package Types::Standard; no warnings; use strict; return '';},"uniq" => 9}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v;$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($name)) |
406 |
0 |
406 |
| Ref::Util::XS::is_plain_coderef($func) or Function::Parameters::_croak('In fun _register_scale: parameter 2 ($func): ' . ${my $v = bless( {"_default_message" => sub { package Type::Tiny; use warnings; use strict; sprintf '%s did not pass type constraint "%s"', _dd($_[0]), $name;},"_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_coderef($_[0]) or _failed_check(17, 'CodeRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_CodeRef","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 $_ eq 'CODE';},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 452,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "CodeRef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_coderef($_[1])" : "ref($_[1]) eq 'CODE'";},"is_using_default_message" => 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_54; use warnings; use strict; do { ref $_[0] eq 'CODE' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_ eq 'CODE';},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ') eq "CODE"';},"name" => "CodeRef","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_50; use warnings; use strict; do { ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ')';},"name" => "Ref","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => 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" => {},"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"_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' )}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "CodeRef","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" => {},"uniq" => 16}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return sub { } ;},"uniq" => 17}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v;$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($func)) |
406 |
0 |
406 |
|
| 729 |
406 |
| $scale_funcs{$name} = $func; |
| 730 |
7 |
| } |
| 731 |
|
| |
| 732 |
7 |
▶ | use Package::Stash; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 733 |
|
| |
| 734 |
7 |
| my $stash = Package::Stash->new(__PACKAGE__); |
| 735 |
7 |
| my $symbols = $stash->get_all_symbols('CODE'); |
| 736 |
7 |
| for my $key ( grep { /^scale_/ } keys %$symbols ) { |
| 737 |
406 |
| _register_scale( $key, $symbols->{$key} ); |
| 738 |
|
| } |
| 739 |
|
| |
| 740 |
7 |
| 1; |
| 741 |
|
| |
| 742 |
|
| __END__ |