| 1 | package Chart::GGPlot::Geom::Polygon; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Class for polygon 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 | 5 | ▶ | use MooseX::Singleton; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 5 | with qw(Chart::GGPlot::Geom); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Chart::GGPlot::Aes; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use Chart::GGPlot::Layer; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use Chart::GGPlot::Util qw(:all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use Chart::GGPlot::Util::Pod qw(layer_func_pod); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | has '+default_aes' => ( | ||||||||||||||||||||||||||||
| 19 | 1 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 1 | Chart::GGPlot::Aes->new( | |||||||||||||||||||||||||||
| 21 | color => PDL::SV->new( ['NA'] )->setbadat(0), | ||||||||||||||||||||||||||||
| 22 | fill => PDL::SV->new( ['grey20'] ), | ||||||||||||||||||||||||||||
| 23 | size => pdl(0.5), | ||||||||||||||||||||||||||||
| 24 | linetype => PDL::SV->new( ['solid'] ), | ||||||||||||||||||||||||||||
| 25 | alpha => NA(), | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 5 | ); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 4 | ▶ | classmethod required_aes() { [qw(x y)] } | ||||||||||||||||||||||||||
|
Subroutine
required_aes: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 5 | my $geom_polygon_pod = layer_func_pod(<<'EOT'); | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | geom_polygon(:$mapping=undef, :$data=undef, | ||||||||||||||||||||||||||||
| 35 | :$stat='identity', :$position='identity', | ||||||||||||||||||||||||||||
| 36 | :$na_rm=false, :$show_legend=undef, | ||||||||||||||||||||||||||||
| 37 | :$inherit_aes=true, | ||||||||||||||||||||||||||||
| 38 | %rest) | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | Polygons are very similar to paths (as drawn by C<geom_path()>) | ||||||||||||||||||||||||||||
| 41 | except that the start and end points are connected and the inside is | ||||||||||||||||||||||||||||
| 42 | colored by the C<fill> aesthetic. The C<group> aesthetic determines | ||||||||||||||||||||||||||||
| 43 | which cases are connected together into a polygon. | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =over 4 | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | %TMPL_COMMON_ARGS% | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =back | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | EOT | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 1 | ▶ | my $geom_polygon_code = fun ( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=20.9
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
| |||||||||||||||||||||||||||||
| 54 | :$mapping = undef, :$data = undef, | ||||||||||||||||||||||||||||
| 55 | :$stat = 'identity', :$position = 'identity', | ||||||||||||||||||||||||||||
| 56 | :$width = undef, :$na_rm = false, | ||||||||||||||||||||||||||||
| 57 | :$show_legend = undef, :$inherit_aes = true, | ||||||||||||||||||||||||||||
| 58 | %rest ) | ||||||||||||||||||||||||||||
| 59 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 60 | 1 | return Chart::GGPlot::Layer->new( | |||||||||||||||||||||||||||
| 61 | data => $data, | ||||||||||||||||||||||||||||
| 62 | mapping => $mapping, | ||||||||||||||||||||||||||||
| 63 | stat => $stat, | ||||||||||||||||||||||||||||
| 64 | geom => 'polygon', | ||||||||||||||||||||||||||||
| 65 | position => $position, | ||||||||||||||||||||||||||||
| 66 | show_legend => $show_legend, | ||||||||||||||||||||||||||||
| 67 | inherit_aes => $inherit_aes, | ||||||||||||||||||||||||||||
| 68 | params => { | ||||||||||||||||||||||||||||
| 69 | na_rm => $na_rm, | ||||||||||||||||||||||||||||
| 70 | %rest, | ||||||||||||||||||||||||||||
| 71 | }, | ||||||||||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||||||||||
| 73 | 5 | }; | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 5 | ▶ | classmethod ggplot_functions() { | ||||||||||||||||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 76 | return [ | ||||||||||||||||||||||||||||
| 77 | { | ||||||||||||||||||||||||||||
| 78 | 5 | name => 'geom_polygon', | |||||||||||||||||||||||||||
| 79 | code => $geom_polygon_code, | ||||||||||||||||||||||||||||
| 80 | pod => $geom_polygon_pod, | ||||||||||||||||||||||||||||
| 81 | }, | ||||||||||||||||||||||||||||
| 82 | ]; | ||||||||||||||||||||||||||||
| 83 | 5 | } | |||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 0 | ▶ | method handle_na ( $data, $params ) { $data } | ||||||||||||||||||||||||||
|
Subroutine
handle_na: not called CC=3 SCAR=22.8
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 5 | __PACKAGE__->meta->make_immutable(inline_constructor => 0); | |||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | 5 | 1; | |||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | __END__ | ||||||||||||||||||||||||||||