| 1 | package Chart::GGPlot::Geom::Rect; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Class for rect 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 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use Chart::GGPlot::Aes; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use Chart::GGPlot::Util qw(NA); | ||||||||||||||||||||||||||
|
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 | with qw(Chart::GGPlot::Geom); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | ▶ | has '+non_missing_aes' => ( default => sub { [qw(size shape color)] } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | has '+default_aes' => ( | ||||||||||||||||||||||||||||
| 19 | 3 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 3 | Chart::GGPlot::Aes->new( | |||||||||||||||||||||||||||
| 21 | color => NA(), | ||||||||||||||||||||||||||||
| 22 | fill => PDL::SV->new(["grey35"]), | ||||||||||||||||||||||||||||
| 23 | size => pdl(0.5), | ||||||||||||||||||||||||||||
| 24 | linetype => PDL::SV->new(["solid"]), | ||||||||||||||||||||||||||||
| 25 | alpha => NA(), | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 5 | ); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | classmethod required_aes() { [qw(xmin xmax ymin ymax)] }; | ||||||||||||||||||||||||||
|
Subroutine
required_aes: not called CC=3 SCAR=22.6
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 5 | my $geom_rect_pod = layer_func_pod(<<'EOT'); | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | geom_rect(:$mapping=undef, :$data=undef, :$stat='count', | ||||||||||||||||||||||||||||
| 35 | :$position='stack', :$width=undef, | ||||||||||||||||||||||||||||
| 36 | :$na_rm=false, :$show_legend=undef, :$inherit_aes=true, | ||||||||||||||||||||||||||||
| 37 | %rest) | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | C<geom_rect()> uses the locations of the four corners | ||||||||||||||||||||||||||||
| 40 | (aethetics C<xmin>, C<xmax>, C<ymin> and C<ymax>) to define rectangles. | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | Arguments: | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =over 4 | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | %TMPL_COMMON_ARGS% | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =back | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | EOT | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | my $geom_rect_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
| |||||||||||||||||||||||||||||
| 53 | :$mapping = undef, :$data = undef, | ||||||||||||||||||||||||||||
| 54 | :$stat = 'identity', :$position = 'identity', | ||||||||||||||||||||||||||||
| 55 | :$na_rm = false, :$show_legend = undef, :$inherit_aes = true, | ||||||||||||||||||||||||||||
| 56 | %rest) | ||||||||||||||||||||||||||||
| 57 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 58 | 0 | return Chart::GGPlot::Layer->new( | |||||||||||||||||||||||||||
| 59 | data => $data, | ||||||||||||||||||||||||||||
| 60 | mapping => $mapping, | ||||||||||||||||||||||||||||
| 61 | stat => $stat, | ||||||||||||||||||||||||||||
| 62 | geom => 'rect', | ||||||||||||||||||||||||||||
| 63 | position => $position, | ||||||||||||||||||||||||||||
| 64 | show_legend => $show_legend, | ||||||||||||||||||||||||||||
| 65 | inherit_aes => $inherit_aes, | ||||||||||||||||||||||||||||
| 66 | params => { | ||||||||||||||||||||||||||||
| 67 | na_rm => $na_rm, | ||||||||||||||||||||||||||||
| 68 | %rest | ||||||||||||||||||||||||||||
| 69 | }, | ||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||
| 71 | 5 | }; | |||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 5 | ▶ | classmethod ggplot_functions () { | ||||||||||||||||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 74 | return [ | ||||||||||||||||||||||||||||
| 75 | { | ||||||||||||||||||||||||||||
| 76 | 5 | name => 'geom_rect', | |||||||||||||||||||||||||||
| 77 | code => $geom_rect_code, | ||||||||||||||||||||||||||||
| 78 | pod => $geom_rect_pod, | ||||||||||||||||||||||||||||
| 79 | }, | ||||||||||||||||||||||||||||
| 80 | ]; | ||||||||||||||||||||||||||||
| 81 | 5 | } | |||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 5 | 1; | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | __END__ | ||||||||||||||||||||||||||||