| 1 | package Chart::GGPlot::Geom::Line; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Class for line geom | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Chart::GGPlot::Class qw(:pdl); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 5 | extends qw(Chart::GGPlot::Geom::Path); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 5 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use Chart::GGPlot::Layer; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Chart::GGPlot::Util::Pod qw(layer_func_pod); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 5 | my $geom_line_pod = layer_func_pod(<<'EOT'); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | geom_line(:$mapping=undef, :$data=undef, :$stat='identity', | ||||||||||||||||||||||||||||
| 18 | :$position='identity', :$na_rm=false, :$show_legend=undef, | ||||||||||||||||||||||||||||
| 19 | :$inherit_aes=true, | ||||||||||||||||||||||||||||
| 20 | %rest) | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | The "line" geom connects the observations in the order of the variable | ||||||||||||||||||||||||||||
| 23 | on the x axis. | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | Arguments: | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =over 4 | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | %TMPL_COMMON_ARGS% | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | =back | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | EOT | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 1 | ▶ | my $geom_line_code = fun ( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=21.1
Branch: 1 branch
Condition33%1/3
@_ > 0 and @_ % 2
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
| |||||||||||||||||||||||||||||
| 36 | :$mapping = undef, :$data = undef, | ||||||||||||||||||||||||||||
| 37 | :$stat = 'identity', :$position = 'identity', | ||||||||||||||||||||||||||||
| 38 | :$na_rm = false, | ||||||||||||||||||||||||||||
| 39 | :$show_legend = undef, :$inherit_aes = true, | ||||||||||||||||||||||||||||
| 40 | %rest ) | ||||||||||||||||||||||||||||
| 41 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 42 | 1 | return Chart::GGPlot::Layer->new( | |||||||||||||||||||||||||||
| 43 | data => $data, | ||||||||||||||||||||||||||||
| 44 | mapping => $mapping, | ||||||||||||||||||||||||||||
| 45 | stat => $stat, | ||||||||||||||||||||||||||||
| 46 | position => $position, | ||||||||||||||||||||||||||||
| 47 | show_legend => $show_legend, | ||||||||||||||||||||||||||||
| 48 | inherit_aes => $inherit_aes, | ||||||||||||||||||||||||||||
| 49 | geom => 'line', | ||||||||||||||||||||||||||||
| 50 | params => { na_rm => $na_rm, %rest }, | ||||||||||||||||||||||||||||
| 51 | ); | ||||||||||||||||||||||||||||
| 52 | 5 | }; | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 5 | ▶ | classmethod ggplot_functions() { | ||||||||||||||||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 55 | return [ | ||||||||||||||||||||||||||||
| 56 | { | ||||||||||||||||||||||||||||
| 57 | 5 | name => 'geom_line', | |||||||||||||||||||||||||||
| 58 | code => $geom_line_code, | ||||||||||||||||||||||||||||
| 59 | pod => $geom_line_pod, | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | ]; | ||||||||||||||||||||||||||||
| 62 | 5 | } | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 1 | ▶ | method setup_data ($data, $params) { | ||||||||||||||||||||||||||
|
Subroutine
setup_data: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 65 | 1 | return $data->sort( [qw(PANEL group x)] ); | |||||||||||||||||||||||||||
| 66 | 5 | } | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 5 | __PACKAGE__->meta->make_immutable( inline_constructor => 0 ); | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 5 | 1; | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | __END__ | ||||||||||||||||||||||||||||