| 1 | package CXC::Gnuplot::V0::Key::Title; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use v5.38; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use experimental 'builtin'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Feature::Compat::Class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | our $VERSION = 'v0.29.3'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | class CXC::Gnuplot::V0::Key::Title; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | use CXC::Gnuplot::V0::Types -lexical => qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | Enum is_Str | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | use CXC::Gnuplot::V0::Util | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | -lexical => 'maybe_quote', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | 'assert_coerce_object', 'clone_object', 'pvalidate', 'to_hash_r', 'render_opts'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use builtin 'is_bool'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | my sub croak { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | require Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
croak: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | goto \&Carp::croak; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | #<<< no tidy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | field $on :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | field $text :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | field $enhanced :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | field $justify :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | field $font :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | field $textcolor :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | #>>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | ADJUST { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | # this is equivalent to 'set key notitle' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | # $on => Bool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | defined $on | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
Condition0%0/3
defined $on and not builtin::is_bool($on)
MC/DC0%0/2
defined $on and not builtin::is_bool($on)
defined $on
not builtin::is_bool($on)
Truth table0%0/3
A and not(B)
A= defined $onB= not builtin::is_bool($on)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | and !is_bool( $on ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | and croak( q{"on" parameter is not a Boolean} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # {font "<face>,<size>"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # $font => Font|ArrayRef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | pvalidate( font => Font => \$font ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | pvalidate( textcolor => ColorSpec => \$textcolor ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # {{no}enhanced} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | # $enhanced => Bool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | defined $enhanced | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $enhanced and not builtin::is_bool($enhanced)
MC/DC0%0/2
defined $enhanced and not builtin::is_bool($enhanced)
defined $enhanced
not builtin::is_bool($enhanced)
Truth table0%0/3
A and not(B)
A= defined $enhancedB= not builtin::is_bool($enhanced)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | and !is_bool( $enhanced ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | and croak( q{invalid value for "enhanced" parameter; must be bool} ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # $justify => [ left, center, right ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | pvalidate( justify => Enum->of( 'left', 'right', 'center' ), \$justify ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | method to_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | to_hash_r( { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_hash: not called CC=7 SCAR=40.3
Pod
documented
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | ( defined $text ? ( text => $text ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | ( defined $on ? ( on => $on ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | ( defined $font ? ( font => $font ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | ( defined $enhanced ? ( enhanced => $enhanced ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | ( defined $textcolor ? ( textcolor => $textcolor ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | ( defined $justify ? ( justify => $justify ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | ▶ | sub assert_coerce( $class, $args ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
assert_coerce: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | assert_coerce_object( $class, $args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | ▶ | method clone ( %args ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | return clone_object( $self, \%args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | method opts { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | return 'notitle' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
opts: not called CC=9 SCAR=45.0
Pod
documented
Branch: 1 branch
Condition0%0/9
defined $on and not $on or defined $text and 0 == length $text
defined $on and not $on
defined $text and 0 == length $text
MC/DC0%0/4
defined $on and not $on or defined $text and 0 == length $text
defined $on
not $on
defined $text
0 == length $text
Truth table0%0/7
A and not(B) or C and D
A= defined $onB= not $onC= defined $textD= 0 == length $text
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | if defined $on and !$on | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | or defined $text and 0 == length( $text ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | my @opts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | push @opts, maybe_quote( $text ) if defined $text; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | push @opts, render_opts( font => $font ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | push @opts, $enhanced ? 'enhanced' : 'noenhaced' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | if defined $enhanced; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | push @opts, $justify if defined $justify; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | push @opts, render_opts( textcolor => $textcolor ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | return @opts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | ▶ | sub coerce_attrs( $class, @attrs ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
coerce_attrs: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | return undef if @attrs > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my $attr = $attrs[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | return { on => $attr } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | if is_bool( $attr ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | return { text => $attr } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | if is_Str( $attr ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | # This file is part of CXC-Gnuplot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | # This is free software, licensed under: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | # The GNU General Public License, Version 3, June 2007 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||