| 1 |
|
| package Chart::GGPlot::Plot; |
| 2 |
|
| |
| 3 |
|
| # ABSTRACT: ggplot class |
| 4 |
|
| |
| 5 |
2 |
▶ | use Chart::GGPlot::Class; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 6 |
2 |
▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 7 |
|
| |
| 8 |
2 |
| our $VERSION = '0.002003'; # VERSION |
| 9 |
|
| |
| 10 |
2 |
▶ | use Autoload::AUTOCAN; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 11 |
2 |
▶ | use Data::Frame::Types qw(DataFrame); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 12 |
2 |
▶ | use List::AllUtils qw(pairgrep pairmap firstres); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 13 |
2 |
▶ | use Module::Load; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 14 |
2 |
▶ | use Package::Stash; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 15 |
2 |
▶ | use Scalar::Util qw(looks_like_number); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 16 |
2 |
▶ | use String::Util qw(trim); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 17 |
2 |
▶ | use Types::Standard qw(ArrayRef ConsumerOf HashRef InstanceOf); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 18 |
|
| |
| 19 |
2 |
▶ | use Chart::GGPlot::Aes; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 20 |
2 |
▶ | use Chart::GGPlot::Coord::Functions (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 21 |
2 |
▶ | use Chart::GGPlot::Guides; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 22 |
2 |
▶ | use Chart::GGPlot::Layout; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 23 |
2 |
▶ | use Chart::GGPlot::Params; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 24 |
2 |
▶ | use Chart::GGPlot::ScalesList; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 25 |
2 |
▶ | use Chart::GGPlot::Types qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 26 |
|
| |
| 27 |
2 |
| my @function_namespaces = qw( |
| 28 |
|
| Chart::GGPlot::Geom::Functions |
| 29 |
|
| Chart::GGPlot::Scale::Functions |
| 30 |
|
| Chart::GGPlot::Labels::Functions |
| 31 |
|
| Chart::GGPlot::Limits |
| 32 |
|
| Chart::GGPlot::Coord::Functions |
| 33 |
|
| Chart::GGPlot::Facet::Functions |
| 34 |
|
| Chart::GGPlot::Guide::Functions |
| 35 |
|
| Chart::GGPlot::Theme::Defaults |
| 36 |
|
| ); |
| 37 |
|
| |
| 38 |
2 |
| for (@function_namespaces) { |
| 39 |
16 |
| load $_; |
| 40 |
|
| } |
| 41 |
|
| |
| 42 |
6 |
▶ | method AUTOCAN ($method) { |
|
Subroutine
AUTOCAN: called CC=7 SCAR=20.1
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method AUTOCAN (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method AUTOCAN (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
|
| 43 |
6 |
| state $known_methods; # mapping method name to coderef |
| 44 |
6 |
▶ | unless ($known_methods) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless ($known_methods) |
1 |
5 |
6 |
|
| 45 |
|
| $known_methods = { |
| 46 |
|
| map { |
| 47 |
1 |
| my $ns = $_; |
| 48 |
2 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 49 |
8 |
| my @funcs = @{ ${"${ns}::EXPORT_TAGS"}{ggplot} }; |
| 50 |
8 |
| map { $_ => \&{"${ns}::$_"}; } @funcs; |
| 51 |
|
| } @function_namespaces |
| 52 |
|
| }; |
| 53 |
|
| } |
| 54 |
6 |
| my $f = $known_methods->{$method}; |
| 55 |
|
| |
| 56 |
6 |
▶ | unless ( defined $f ) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless (defined $f) |
0 |
6 |
6 |
|
| 57 |
|
| |
| 58 |
|
| # For several kinds of methods, fallback to look for them in the |
| 59 |
|
| # caller pacakge. |
| 60 |
0 |
▶ | if ( $method =~ /^(?:geom|scale)_/ ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($method =~ /^(?:geom|scale)_/u) |
0 |
0 |
0 |
|
| 61 |
0 |
| my $p = Package::Stash->new( ( caller() )[0] ); |
| 62 |
0 |
| $f = $p->get_symbol("&$method"); |
| 63 |
|
| } |
| 64 |
|
| } |
| 65 |
6 |
▶ | return undef unless ($f); |
Branch: 1 branch
| Branch | True | False | Total |
| unless $f |
0 |
6 |
6 |
|
| 66 |
|
| |
| 67 |
6 |
| state $type_to_method = [ |
| 68 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Facet'] ), 'facet' ], |
| 69 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Layer'] ), 'add_layer' ], |
| 70 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Labels'] ), 'add_labels' ], |
| 71 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Coord'] ), 'add_coord' ], |
| 72 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Guide'] ), 'add_guide' ], |
| 73 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Scale'] ), 'add_scale' ], |
| 74 |
|
| [ ( ConsumerOf ['Chart::GGPlot::Theme'] ), '_set__theme' ], |
| 75 |
|
| ]; |
| 76 |
|
| |
| 77 |
6 |
▶ | return method(@rest) { |
|
Subroutine
__ANON__: called CC=4 SCAR=14.0
Branch: 1 branch
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method (anon) (expected 1, got ' . @_ . ')') |
0 |
6 |
6 |
|
| 78 |
6 |
| my $x = $f->(@rest); |
| 79 |
|
| |
| 80 |
6 |
| for my $item (@$type_to_method) { |
| 81 |
12 |
| my ( $type, $add_method ) = @$item; |
| 82 |
12 |
▶ | if ( $type->check($x) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($type->check($x)) |
6 |
6 |
12 |
|
| 83 |
6 |
| $self->$add_method($x); |
| 84 |
6 |
| return $self; |
| 85 |
|
| } |
| 86 |
|
| } |
| 87 |
0 |
| die "Unsupported data type: $x got from method $method"; |
| 88 |
6 |
| }; |
| 89 |
2 |
| } |
| 90 |
|
| |
| 91 |
|
| |
| 92 |
2 |
| my $DEFAULT_BACKEND = 'Plotly'; |
| 93 |
|
| |
| 94 |
|
| has backend => ( |
| 95 |
|
| is => 'ro', |
| 96 |
|
| isa => ConsumerOf ['Chart::GGPlot::Backend'], |
| 97 |
6 |
▶ | builder => sub { |
|
Subroutine
_build_backend: called CC=1 SCAR=0.0
|
| 98 |
6 |
| my $backend_class = "Chart::GGPlot::Backend::$DEFAULT_BACKEND"; |
| 99 |
6 |
| load $backend_class; |
| 100 |
6 |
| return $backend_class->new(); |
| 101 |
|
| }, |
| 102 |
2 |
| ); |
| 103 |
|
| |
| 104 |
|
| |
| 105 |
2 |
| has data => ( |
| 106 |
|
| is => 'ro', |
| 107 |
|
| isa => DataFrame, |
| 108 |
|
| ); |
| 109 |
|
| |
| 110 |
|
| |
| 111 |
|
| has mapping => ( |
| 112 |
|
| is => 'ro', |
| 113 |
|
| isa => AesMapping, |
| 114 |
0 |
▶ | builder => sub { Chart::GGPlot::Aes->new() } |
|
Subroutine
_build_mapping: not called CC=1 SCAR=6.9
|
| 115 |
2 |
| ); |
| 116 |
|
| |
| 117 |
|
| has layers => ( |
| 118 |
|
| is => 'ro', |
| 119 |
|
| isa => ArrayRef, |
| 120 |
6 |
▶ | default => sub { [] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 121 |
2 |
| traits => ['Array'], |
| 122 |
|
| ); |
| 123 |
|
| has scales => ( |
| 124 |
|
| is => 'ro', |
| 125 |
6 |
▶ | default => sub { Chart::GGPlot::ScalesList->new() } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 126 |
2 |
| ); |
| 127 |
2 |
| has _theme => ( is => 'rwp', isa => InstanceOf['Chart::GGPlot::Theme'] ); |
| 128 |
|
| has coordinates => ( |
| 129 |
|
| is => 'rwp', |
| 130 |
|
| isa => Coord, |
| 131 |
6 |
▶ | default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 132 |
6 |
| Chart::GGPlot::Coord::Functions::coord_cartesian( default => true ); |
| 133 |
|
| }, |
| 134 |
2 |
| ); |
| 135 |
|
| has facet => ( |
| 136 |
|
| is => 'rw', |
| 137 |
|
| isa => Facet, |
| 138 |
6 |
▶ | default => sub { Chart::GGPlot::Facet::Functions::facet_null() }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 139 |
2 |
| ); |
| 140 |
|
| |
| 141 |
|
| has _labels => ( |
| 142 |
|
| is => 'rw', |
| 143 |
6 |
▶ | default => sub { Chart::GGPlot::Params->new(); }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 144 |
2 |
| ); |
| 145 |
|
| |
| 146 |
6 |
▶ | has guides => ( is => 'ro', default => sub { Chart::GGPlot::Guides->new() } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 147 |
|
| |
| 148 |
2 |
| with qw(MooseX::Clone); |
| 149 |
|
| |
| 150 |
2 |
▶ | method labels () { |
|
Subroutine
labels: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method labels (expected 1, got ' . @_ . ')') |
0 |
2 |
2 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for method labels (expected 1, got ' . @_ . ')') |
0 |
2 |
2 |
|
| 151 |
2 |
| return $self->make_labels( $self->mapping ) |
| 152 |
|
| ->merge( $self->_labels->as_hashref ); |
| 153 |
2 |
| } |
| 154 |
|
| |
| 155 |
|
| |
| 156 |
0 |
▶ | method show (HashRef $opts={}) { |
|
Subroutine
show: not called CC=5 SCAR=34.0
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method show (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method show (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ < 1 and $opts = {} |
0 |
0 |
0 |
| Ref::Util::XS::is_plain_hashref($opts) or Function::Parameters::_croak('In method show: parameter 1 ($opts): ' . ${my $v = bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_plain_hashref($_[0]) or _failed_check(22, 'HashRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_HashRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my($parent, $child, $param) = @_; return unless $param->has_coercion; my $coercable_item = $param->coercion->_source_type_union; my $C = 'Type::Coercion'->new('type_constraint', $child); if ($param->coercion->can_be_inlined and $coercable_item->can_be_inlined) { $C->add_type_coercions($parent, &Types::Standard::Stringable(sub { my @code; push @code, 'do { my ($orig, $return_orig, %new) = ($_, 0);'; push @code, 'for (keys %$orig) {'; push @code, sprintf('$return_orig++ && last unless (%s);', $coercable_item->inline_check('$orig->{$_}')); push @code, sprintf('$new{$_} = (%s);', $param->coercion->inline_coercion('$orig->{$_}')); push @code, '}'; push @code, '$return_orig ? $orig : \\%new'; push @code, '}'; join $", @code; } )); } else { $C->add_type_coercions($parent, sub { my $value = @_ ? $_[0] : $_; my %new; foreach my $k (keys %$value) { return $value unless $coercable_item->check($value->{$k}); $new{$k} = $param->coerce($value->{$k}); } return \%new; } ); } return $C;},"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; return &Types::Standard::HashRef() unless @_; require Error::TypeTiny::WrongNumberOfParameters; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'HashRef', \@_, 1); my $param = shift(); Types::TypeTiny::is_TypeTiny($param) or _croak "Parameter to HashRef[`a] expected to be a type constraint; got $param"; my $param_compiled_check = $param->compiled_check; my $xsub; do { my $paramname = Type::Tiny::XS::is_known($param_compiled_check); $xsub = Type::Tiny::XS::get_coderef_for("HashRef[$paramname]") if $paramname }; return sub { my $hash = shift(); ($param->check($_) or return) foreach (values %$hash); return !0; } , $xsub;},"deep_explanation" => sub { package Types::Standard::HashRef; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; foreach my $k (sort keys %$value) { my $item = $value->{$k}; next if $param->check($item); return [sprintf('"%s" constrains each value in the hash with "%s"', $type, $param), @{$param->validate_explain($item, sprintf('%s->{%s}', $varname, B::perlstring($k)));}]; } return;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 544,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "HashRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my $param = shift(); my $compiled = $param->compiled_check; my $xsubname; unless ($Type::Tiny::AvoidCallbacks) { my $paramname = Type::Tiny::XS::is_known($compiled); $xsubname = Type::Tiny::XS::get_subname_for("HashRef[$paramname]"); } return unless $param->can_be_inlined; return sub { my $v = $_[1]; return "$xsubname($v)" if $xsubname and not $Type::Tiny::AvoidCallbacks; my $p = &Types::Standard::HashRef()->inline_check($v); my $param_check = $param->inline_check('$i'); "$p and do { " . 'my $ok = 1; ' . "for my \$i (values %{$v}) { " . "(\$ok = 0, last) unless $param_check " . '}; ' . '$ok ' . '}'; } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_hashref($_[1])" : "ref($_[1]) eq 'HASH'";},"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_63; use warnings; use strict; do { ref $_[0] eq 'HASH' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $type_parameter = shift(); my $check = $type_parameter->_compiled_type_constraint; return sub { foreach my $x (values %$_) { &$check($x) or return; } 1; } ;},"inline_environment" => {},"inline_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $self = shift(); my $type_parameter = shift(); my $val = shift(); 'do {my $check = ' . $val . ';' . 'ref($check) eq "HASH" ' . '&& &List::Util::all(' . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' . 'values %{$check}' . ')' . '}';},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ') eq "HASH"';},"name" => "HashRef","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; 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","moose_type" => {},"name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"_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" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint::Parameterizable' ),"my_methods" => {"hashref_allows_key" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); Types::Standard::is_Str($_[0]);},"hashref_allows_value" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); my($key, $value) = @_; return !1 unless $self->my_hashref_allows_key($key); return !0 if $self == &Types::Standard::HashRef(); my $href = $self->find_parent(sub { $_->has_parent and $_->parent == &Types::Standard::HashRef(); } ); my $param = $href->type_parameter; Types::Standard::is_Str($key) and $param->check($value);}},"name" => "HashRef","name_generator" => sub { package Type::Tiny; use warnings; use strict; defined $_ and s/[\x00-\x1F]//gms foreach (my($s, @a) = @_); sprintf '%s[%s]', $s, join(',', map((!defined($_) ? 'undef' : (!ref($_) && /\W/ ? B::perlstring($_) : $_)), @a));},"parent" => {},"type_default" => sub { package Types::Standard; no warnings; use strict; return {};},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 22}, '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"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($opts)) |
0 |
0 |
0 |
|
| 157 |
0 |
| $self->backend->show( $self, $opts ); |
| 158 |
2 |
| } |
| 159 |
|
| |
| 160 |
0 |
▶ | method save ($filename, HashRef $opts={}) { |
|
Subroutine
save: not called CC=5 SCAR=34.0
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method save (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for method save (expected 3, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ < 2 and $opts = {} |
0 |
0 |
0 |
| Ref::Util::XS::is_plain_hashref($opts) or Function::Parameters::_croak('In method save: parameter 2 ($opts): ' . ${my $v = bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_plain_hashref($_[0]) or _failed_check(22, 'HashRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_HashRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my($parent, $child, $param) = @_; return unless $param->has_coercion; my $coercable_item = $param->coercion->_source_type_union; my $C = 'Type::Coercion'->new('type_constraint', $child); if ($param->coercion->can_be_inlined and $coercable_item->can_be_inlined) { $C->add_type_coercions($parent, &Types::Standard::Stringable(sub { my @code; push @code, 'do { my ($orig, $return_orig, %new) = ($_, 0);'; push @code, 'for (keys %$orig) {'; push @code, sprintf('$return_orig++ && last unless (%s);', $coercable_item->inline_check('$orig->{$_}')); push @code, sprintf('$new{$_} = (%s);', $param->coercion->inline_coercion('$orig->{$_}')); push @code, '}'; push @code, '$return_orig ? $orig : \\%new'; push @code, '}'; join $", @code; } )); } else { $C->add_type_coercions($parent, sub { my $value = @_ ? $_[0] : $_; my %new; foreach my $k (keys %$value) { return $value unless $coercable_item->check($value->{$k}); $new{$k} = $param->coerce($value->{$k}); } return \%new; } ); } return $C;},"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; return &Types::Standard::HashRef() unless @_; require Error::TypeTiny::WrongNumberOfParameters; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'HashRef', \@_, 1); my $param = shift(); Types::TypeTiny::is_TypeTiny($param) or _croak "Parameter to HashRef[`a] expected to be a type constraint; got $param"; my $param_compiled_check = $param->compiled_check; my $xsub; do { my $paramname = Type::Tiny::XS::is_known($param_compiled_check); $xsub = Type::Tiny::XS::get_coderef_for("HashRef[$paramname]") if $paramname }; return sub { my $hash = shift(); ($param->check($_) or return) foreach (values %$hash); return !0; } , $xsub;},"deep_explanation" => sub { package Types::Standard::HashRef; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; foreach my $k (sort keys %$value) { my $item = $value->{$k}; next if $param->check($item); return [sprintf('"%s" constrains each value in the hash with "%s"', $type, $param), @{$param->validate_explain($item, sprintf('%s->{%s}', $varname, B::perlstring($k)));}]; } return;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 544,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "HashRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my $param = shift(); my $compiled = $param->compiled_check; my $xsubname; unless ($Type::Tiny::AvoidCallbacks) { my $paramname = Type::Tiny::XS::is_known($compiled); $xsubname = Type::Tiny::XS::get_subname_for("HashRef[$paramname]"); } return unless $param->can_be_inlined; return sub { my $v = $_[1]; return "$xsubname($v)" if $xsubname and not $Type::Tiny::AvoidCallbacks; my $p = &Types::Standard::HashRef()->inline_check($v); my $param_check = $param->inline_check('$i'); "$p and do { " . 'my $ok = 1; ' . "for my \$i (values %{$v}) { " . "(\$ok = 0, last) unless $param_check " . '}; ' . '$ok ' . '}'; } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_hashref($_[1])" : "ref($_[1]) eq 'HASH'";},"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_63; use warnings; use strict; do { ref $_[0] eq 'HASH' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $type_parameter = shift(); my $check = $type_parameter->_compiled_type_constraint; return sub { foreach my $x (values %$_) { &$check($x) or return; } 1; } ;},"inline_environment" => {},"inline_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $self = shift(); my $type_parameter = shift(); my $val = shift(); 'do {my $check = ' . $val . ';' . 'ref($check) eq "HASH" ' . '&& &List::Util::all(' . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' . 'values %{$check}' . ')' . '}';},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ') eq "HASH"';},"name" => "HashRef","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; 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","moose_type" => {},"name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"_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" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint::Parameterizable' ),"my_methods" => {"hashref_allows_key" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); Types::Standard::is_Str($_[0]);},"hashref_allows_value" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); my($key, $value) = @_; return !1 unless $self->my_hashref_allows_key($key); return !0 if $self == &Types::Standard::HashRef(); my $href = $self->find_parent(sub { $_->has_parent and $_->parent == &Types::Standard::HashRef(); } ); my $param = $href->type_parameter; Types::Standard::is_Str($key) and $param->check($value);}},"name" => "HashRef","name_generator" => sub { package Type::Tiny; use warnings; use strict; defined $_ and s/[\x00-\x1F]//gms foreach (my($s, @a) = @_); sprintf '%s[%s]', $s, join(',', map((!defined($_) ? 'undef' : (!ref($_) && /\W/ ? B::perlstring($_) : $_)), @a));},"parent" => {},"type_default" => sub { package Types::Standard; no warnings; use strict; return {};},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 22}, '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"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($opts)) |
0 |
0 |
0 |
|
| 161 |
0 |
| $self->backend->save( $self, $filename, $opts ); |
| 162 |
2 |
| } |
| 163 |
|
| |
| 164 |
0 |
▶ | method iplot (HashRef $opts={}) { |
|
Subroutine
iplot: not called CC=5 SCAR=34.0
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method iplot (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method iplot (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ < 1 and $opts = {} |
0 |
0 |
0 |
| Ref::Util::XS::is_plain_hashref($opts) or Function::Parameters::_croak('In method iplot: parameter 1 ($opts): ' . ${my $v = bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_plain_hashref($_[0]) or _failed_check(22, 'HashRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_HashRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my($parent, $child, $param) = @_; return unless $param->has_coercion; my $coercable_item = $param->coercion->_source_type_union; my $C = 'Type::Coercion'->new('type_constraint', $child); if ($param->coercion->can_be_inlined and $coercable_item->can_be_inlined) { $C->add_type_coercions($parent, &Types::Standard::Stringable(sub { my @code; push @code, 'do { my ($orig, $return_orig, %new) = ($_, 0);'; push @code, 'for (keys %$orig) {'; push @code, sprintf('$return_orig++ && last unless (%s);', $coercable_item->inline_check('$orig->{$_}')); push @code, sprintf('$new{$_} = (%s);', $param->coercion->inline_coercion('$orig->{$_}')); push @code, '}'; push @code, '$return_orig ? $orig : \\%new'; push @code, '}'; join $", @code; } )); } else { $C->add_type_coercions($parent, sub { my $value = @_ ? $_[0] : $_; my %new; foreach my $k (keys %$value) { return $value unless $coercable_item->check($value->{$k}); $new{$k} = $param->coerce($value->{$k}); } return \%new; } ); } return $C;},"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; return &Types::Standard::HashRef() unless @_; require Error::TypeTiny::WrongNumberOfParameters; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'HashRef', \@_, 1); my $param = shift(); Types::TypeTiny::is_TypeTiny($param) or _croak "Parameter to HashRef[`a] expected to be a type constraint; got $param"; my $param_compiled_check = $param->compiled_check; my $xsub; do { my $paramname = Type::Tiny::XS::is_known($param_compiled_check); $xsub = Type::Tiny::XS::get_coderef_for("HashRef[$paramname]") if $paramname }; return sub { my $hash = shift(); ($param->check($_) or return) foreach (values %$hash); return !0; } , $xsub;},"deep_explanation" => sub { package Types::Standard::HashRef; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; foreach my $k (sort keys %$value) { my $item = $value->{$k}; next if $param->check($item); return [sprintf('"%s" constrains each value in the hash with "%s"', $type, $param), @{$param->validate_explain($item, sprintf('%s->{%s}', $varname, B::perlstring($k)));}]; } return;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 544,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "HashRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard::HashRef; no warnings; use strict; my $param = shift(); my $compiled = $param->compiled_check; my $xsubname; unless ($Type::Tiny::AvoidCallbacks) { my $paramname = Type::Tiny::XS::is_known($compiled); $xsubname = Type::Tiny::XS::get_subname_for("HashRef[$paramname]"); } return unless $param->can_be_inlined; return sub { my $v = $_[1]; return "$xsubname($v)" if $xsubname and not $Type::Tiny::AvoidCallbacks; my $p = &Types::Standard::HashRef()->inline_check($v); my $param_check = $param->inline_check('$i'); "$p and do { " . 'my $ok = 1; ' . "for my \$i (values %{$v}) { " . "(\$ok = 0, last) unless $param_check " . '}; ' . '$ok ' . '}'; } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_hashref($_[1])" : "ref($_[1]) eq 'HASH'";},"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_63; use warnings; use strict; do { ref $_[0] eq 'HASH' };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_ eq 'HASH';},"constraint_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $type_parameter = shift(); my $check = $type_parameter->_compiled_type_constraint; return sub { foreach my $x (values %$_) { &$check($x) or return; } 1; } ;},"inline_environment" => {},"inline_generator" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; my $self = shift(); my $type_parameter = shift(); my $val = shift(); 'do {my $check = ' . $val . ';' . 'ref($check) eq "HASH" ' . '&& &List::Util::all(' . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' . 'values %{$check}' . ')' . '}';},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ') eq "HASH"';},"name" => "HashRef","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; 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","moose_type" => {},"name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"_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" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint::Parameterizable' ),"my_methods" => {"hashref_allows_key" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); Types::Standard::is_Str($_[0]);},"hashref_allows_value" => sub { package Types::Standard::HashRef; no warnings; use strict; my $self = shift(); my($key, $value) = @_; return !1 unless $self->my_hashref_allows_key($key); return !0 if $self == &Types::Standard::HashRef(); my $href = $self->find_parent(sub { $_->has_parent and $_->parent == &Types::Standard::HashRef(); } ); my $param = $href->type_parameter; Types::Standard::is_Str($key) and $param->check($value);}},"name" => "HashRef","name_generator" => sub { package Type::Tiny; use warnings; use strict; defined $_ and s/[\x00-\x1F]//gms foreach (my($s, @a) = @_); sprintf '%s[%s]', $s, join(',', map((!defined($_) ? 'undef' : (!ref($_) && /\W/ ? B::perlstring($_) : $_)), @a));},"parent" => {},"type_default" => sub { package Types::Standard; no warnings; use strict; return {};},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 22}, '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"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($opts)) |
0 |
0 |
0 |
|
| 165 |
0 |
| $self->backend->iplot( $self, $opts ); |
| 166 |
2 |
| } |
| 167 |
|
| |
| 168 |
|
| |
| 169 |
1 |
▶ | method summary () { |
|
Subroutine
summary: called CC=6 SCAR=18.3
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method summary (expected 1, got ' . @_ . ')') |
0 |
1 |
1 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for method summary (expected 1, got ' . @_ . ')') |
0 |
1 |
1 |
|
| 170 |
1 |
| my $s = ''; |
| 171 |
1 |
▶ | my $label = fun($l) { sprintf( "%-9s", $l ); }; |
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 1, got ' . @_ . ')') |
0 |
4 |
4 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 1, got ' . @_ . ')') |
0 |
4 |
4 |
|
| 172 |
|
| |
| 173 |
|
| #TODO: use Text::Wrap for better format |
| 174 |
1 |
▶ | if ( $self->data ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($self->data) |
1 |
0 |
1 |
|
| 175 |
|
| $s .= |
| 176 |
|
| &$label("data:") |
| 177 |
1 |
| . join(", ", @{$self->data->names}) |
| 178 |
|
| . sprintf( " [%sx%s] ", $self->data->nrow, $self->data->ncol ) . "\n"; |
| 179 |
|
| } |
| 180 |
1 |
▶ | if ( $self->mapping->length > 0 ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($self->mapping->length > 0) |
1 |
0 |
1 |
|
| 181 |
1 |
| $s .= &$label("mapping:") . $self->mapping->string . "\n"; |
| 182 |
|
| } |
| 183 |
1 |
▶ | if ( $self->scales->length() > 0 ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($self->scales->length > 0) |
1 |
0 |
1 |
|
| 184 |
|
| $s .= |
| 185 |
1 |
| &$label("scales:") . join( ", ", @{ $self->scales->input } ) . "\n"; |
| 186 |
|
| } |
| 187 |
1 |
| $s .= &$label("faceting: ") . $self->facet . "\n"; |
| 188 |
1 |
| $s .= "-----------------------------------"; |
| 189 |
1 |
| return $s; |
| 190 |
2 |
| } |
| 191 |
|
| |
| 192 |
|
| |
| 193 |
0 |
▶ | method theme() { |
|
Subroutine
theme: not called CC=5 SCAR=30.3
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method theme (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for method theme (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 194 |
2 |
▶ | use Chart::GGPlot::Global; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 195 |
|
| |
| 196 |
0 |
| my $default = Chart::GGPlot::Global->theme_current(); |
| 197 |
0 |
▶ | if (my $theme = $self->_theme) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (my $theme = $self->_theme) { } |
0 |
0 |
0 |
|
| 198 |
0 |
▶ | if ($theme->is_complete) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($theme->is_complete) { } |
0 |
0 |
0 |
|
| 199 |
0 |
| return $theme; |
| 200 |
|
| } |
| 201 |
|
| else { |
| 202 |
0 |
| return $theme->defaults($default); |
| 203 |
|
| } |
| 204 |
|
| } else { |
| 205 |
0 |
| return $default; |
| 206 |
|
| } |
| 207 |
2 |
| } |
| 208 |
|
| |
| 209 |
|
| |
| 210 |
|
| |
| 211 |
6 |
▶ | method add_layer ($layer) { |
|
Subroutine
add_layer: called CC=4 SCAR=14.2
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method add_layer (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method add_layer (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
|
| 212 |
6 |
| push @{ $self->layers }, $layer; |
| 213 |
|
| |
| 214 |
|
| # Add any new labels |
| 215 |
6 |
| my $mapping = $self->make_labels($layer->mapping); |
| 216 |
6 |
| my $defaults = $self->make_labels($layer->stat->default_aes); |
| 217 |
6 |
▶ | map { $mapping->{$_} //= $defaults->{$_} } keys %$defaults; |
Condition33%1/3
$mapping->{$_} //= $defaults->{$_}
MC/DC0%0/2
$mapping->{$_} //= $defaults->{$_}
$mapping->{$_}
$defaults->{$_}
Truth table33%1/3
A //= B
A= $mapping->{$_}B= $defaults->{$_}
|
| 218 |
6 |
| $self->add_labels($mapping); |
| 219 |
|
| |
| 220 |
6 |
| return $self; |
| 221 |
2 |
| } |
| 222 |
|
| |
| 223 |
|
| |
| 224 |
6 |
▶ | method add_labels ($labels) { |
|
Subroutine
add_labels: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method add_labels (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method add_labels (expected 2, got ' . @_ . ')') |
0 |
6 |
6 |
|
| 225 |
6 |
| $self->_labels( $self->_labels->merge($labels) ); |
| 226 |
6 |
| return $self; |
| 227 |
2 |
| } |
| 228 |
|
| |
| 229 |
|
| |
| 230 |
0 |
▶ | method add_scale ($scale) { |
|
Subroutine
add_scale: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method add_scale (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method add_scale (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 231 |
0 |
| $self->scales->add($scale); |
| 232 |
0 |
| return $self; |
| 233 |
2 |
| } |
| 234 |
|
| |
| 235 |
|
| |
| 236 |
0 |
▶ | method add_coord($coord) { |
|
Subroutine
add_coord: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method add_coord (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method add_coord (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 237 |
0 |
| $self->_set_coordinates($coord); |
| 238 |
0 |
| return $self; |
| 239 |
2 |
| } |
| 240 |
|
| |
| 241 |
14 |
▶ | classmethod make_labels($mapping) { |
|
Subroutine
make_labels: called CC=3 SCAR=11.1
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for classmethod make_labels (expected 2, got ' . @_ . ')') |
0 |
14 |
14 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for classmethod make_labels (expected 2, got ' . @_ . ')') |
0 |
14 |
14 |
|
| 242 |
8 |
▶ | state $strip = sub { # strip_dots() in R ggplot2 |
|
Subroutine
__ANON__: called CC=4 SCAR=14.0
|
| 243 |
8 |
| my ($aesthetic, $expr) = @_; |
| 244 |
8 |
▶ | unless ($expr->$_DOES('Eval::Quosure')) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless ($expr->$Chart::GGPlot::Plot::_DOES("Eval::Quosure")) |
0 |
8 |
8 |
|
| 245 |
0 |
| return $expr; |
| 246 |
|
| } |
| 247 |
|
| |
| 248 |
8 |
| $expr = $expr->expr; |
| 249 |
|
| |
| 250 |
|
| # TODO: Need PPR here. |
| 251 |
8 |
▶ | if (looks_like_number($expr)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (&looks_like_number($expr)) { } |
1 |
7 |
8 |
| elsif ($expr =~ /^\s*stat\s*\((.*)\)/u) { } |
1 |
6 |
7 |
|
| 252 |
1 |
| return $aesthetic; |
| 253 |
|
| } |
| 254 |
|
| elsif ($expr =~ /^\s*stat\s*\((.*)\)/) { |
| 255 |
1 |
| return trim($1); |
| 256 |
|
| } |
| 257 |
6 |
| return $expr; |
| 258 |
14 |
| }; |
| 259 |
|
| |
| 260 |
14 |
▶ | my %labels = pairmap { $a => $strip->($a, $b) } $mapping->flatten; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 261 |
14 |
| return \%labels; |
| 262 |
2 |
| } |
| 263 |
|
| |
| 264 |
2 |
| __PACKAGE__->meta->make_immutable; |
| 265 |
|
| |
| 266 |
2 |
| 1; |
| 267 |
|
| |
| 268 |
|
| __END__ |