| 1 | ## Please see file perltidy.ERR | ||||||||||||||||||||||||||||
| 2 | package Chart::GGPlot::Geom::Text; | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | # ABSTRACT: Class for line geom | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Chart::GGPlot::Class qw(:pdl); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 5 | extends qw(Chart::GGPlot::Geom::Path); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Chart::GGPlot::Layer; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use Chart::GGPlot::Util qw(NA); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use Chart::GGPlot::Util::Pod qw(layer_func_pod); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | has '+default_aes' => ( | ||||||||||||||||||||||||||||
| 18 | 0 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 19 | 0 | Chart::GGPlot::Aes->new( | |||||||||||||||||||||||||||
| 20 | color => PDL::SV->new( ['black'] ), | ||||||||||||||||||||||||||||
| 21 | size => pdl(3.88), | ||||||||||||||||||||||||||||
| 22 | angle => pdl(0), | ||||||||||||||||||||||||||||
| 23 | hjust => PDL::SV->new( ['center'] ), | ||||||||||||||||||||||||||||
| 24 | vjust => PDL::SV->new( ['center'] ), | ||||||||||||||||||||||||||||
| 25 | alpha => NA(), | ||||||||||||||||||||||||||||
| 26 | family => PDL::SV->new( ["sans"] ), | ||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | 5 | ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | classmethod required_aes() { [qw(x y label)] } | ||||||||||||||||||||||||||
|
Subroutine
required_aes: not called CC=3 SCAR=22.6
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 5 | my $geom_text_pod = layer_func_pod(<<'EOT'); | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | geom_text(:$mapping=undef, :$data=undef, :$stat='identity', | ||||||||||||||||||||||||||||
| 36 | :$position='identity', | ||||||||||||||||||||||||||||
| 37 | :$na_rm=false, :$show_legend=undef, :$inherit_aes=true, | ||||||||||||||||||||||||||||
| 38 | %rest) | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | C<geom_text()> adds text to the plot. | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | Arguments: | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =over 4 | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | %TMPL_COMMON_ARGS% | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =item * $hjust, $vjust | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | You can modify text alignment with the C<hjust> and C<vjust> aesthetics. | ||||||||||||||||||||||||||||
| 51 | These can either be a number between 0 (right/bottom) and 1 (top/left) or a | ||||||||||||||||||||||||||||
| 52 | string, (C<"left">, C<"right">, C<"bottom">, C<"top">, | ||||||||||||||||||||||||||||
| 53 | C<"center">/C<"middle">). | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =item * $family | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | Font family. Default is C<"sans">. | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =item * $size | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | Font size in mm. Default is 3.88 mm (11pt). | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =back | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | EOT | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 0 | ▶ | my $geom_text_code = fun( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
Branch: 1 branch
Condition0%0/3
@_ > 0 and @_ % 2
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
| |||||||||||||||||||||||||||||
| 68 | : $mapping = undef, | ||||||||||||||||||||||||||||
| 69 | : $data = undef, | ||||||||||||||||||||||||||||
| 70 | : $stat = 'identity', | ||||||||||||||||||||||||||||
| 71 | : $position = 'identity', | ||||||||||||||||||||||||||||
| 72 | : $na_rm = false, | ||||||||||||||||||||||||||||
| 73 | : $show_legend = undef, | ||||||||||||||||||||||||||||
| 74 | : $inherit_aes = true, | ||||||||||||||||||||||||||||
| 75 | %rest | ||||||||||||||||||||||||||||
| 76 | ) | ||||||||||||||||||||||||||||
| 77 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 78 | 0 | return Chart::GGPlot::Layer->new( | |||||||||||||||||||||||||||
| 79 | data => $data, | ||||||||||||||||||||||||||||
| 80 | mapping => $mapping, | ||||||||||||||||||||||||||||
| 81 | stat => $stat, | ||||||||||||||||||||||||||||
| 82 | position => $position, | ||||||||||||||||||||||||||||
| 83 | show_legend => $show_legend, | ||||||||||||||||||||||||||||
| 84 | inherit_aes => $inherit_aes, | ||||||||||||||||||||||||||||
| 85 | geom => 'text', | ||||||||||||||||||||||||||||
| 86 | params => { na_rm => $na_rm, %rest }, | ||||||||||||||||||||||||||||
| 87 | ); | ||||||||||||||||||||||||||||
| 88 | 5 | }; | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 5 | ▶ | classmethod ggplot_functions() { | ||||||||||||||||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 91 | return [ | ||||||||||||||||||||||||||||
| 92 | { | ||||||||||||||||||||||||||||
| 93 | 5 | name => 'geom_text', | |||||||||||||||||||||||||||
| 94 | code => $geom_text_code, | ||||||||||||||||||||||||||||
| 95 | pod => $geom_text_pod, | ||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | ]; | ||||||||||||||||||||||||||||
| 98 | 5 | } | |||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | method setup_data( $data, $params ) { | ||||||||||||||||||||||||||
|
Subroutine
setup_data: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 101 | 0 | return $data->sort( [qw(PANEL group x)] ); | |||||||||||||||||||||||||||
| 102 | 5 | } | |||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 5 | __PACKAGE__->meta->make_immutable( inline_constructor => 0 ); | |||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 5 | 1; | |||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | __END__ | ||||||||||||||||||||||||||||