| 1 | package Chart::GGPlot::Geom::Point; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Class for point 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::Layer; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use Chart::GGPlot::Util qw(:all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use Chart::GGPlot::Util::Pod qw(layer_func_pod); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 5 | with qw(Chart::GGPlot::Geom); | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | ▶ | has '+non_missing_aes' => ( default => sub { [qw(size shape color)] } ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | has '+default_aes' => ( | ||||||||||||||||||||||||||||
| 20 | 2 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 2 | Chart::GGPlot::Aes->new( | |||||||||||||||||||||||||||
| 22 | shape => pdl(19), | ||||||||||||||||||||||||||||
| 23 | color => PDL::SV->new(["black"]), | ||||||||||||||||||||||||||||
| 24 | size => pdl(1.5), | ||||||||||||||||||||||||||||
| 25 | fill => NA(), | ||||||||||||||||||||||||||||
| 26 | alpha => NA(), | ||||||||||||||||||||||||||||
| 27 | stroke => pdl(0.5), | ||||||||||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 5 | ); | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 12 | ▶ | classmethod required_aes() { [qw(x y)] } | ||||||||||||||||||||||||||
|
Subroutine
required_aes: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 5 | my $geom_point_pod = layer_func_pod(<<'EOT'); | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | geom_point(:$mapping=undef, :$data=undef, :$stat='identity', | ||||||||||||||||||||||||||||
| 37 | :$position='identity', | ||||||||||||||||||||||||||||
| 38 | :$na_rm=false, :$show_legend=undef, :$inherit_aes=true, | ||||||||||||||||||||||||||||
| 39 | %rest) | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | The "point" geom is used to create scatterplots. | ||||||||||||||||||||||||||||
| 42 | The scatterplot is most useful for displaying the relationship between | ||||||||||||||||||||||||||||
| 43 | two continuous variables. | ||||||||||||||||||||||||||||
| 44 | A bubblechart is a scatterplot with a third variable mapped to the size | ||||||||||||||||||||||||||||
| 45 | of points. | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | Arguments: | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =over 4 | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | %TMPL_COMMON_ARGS% | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | =back | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | EOT | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 4 | ▶ | my $geom_point_code = fun ( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=20.5
Branch: 1 branch
Condition66%2/3
@_ > 0 and @_ % 2
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0
@_ % 2
Truth table66%2/3
A and B
A= @_ > 0B= @_ % 2
| |||||||||||||||||||||||||||||
| 58 | :$mapping = undef, :$data = undef, | ||||||||||||||||||||||||||||
| 59 | :$stat = 'identity', :$position = 'identity', | ||||||||||||||||||||||||||||
| 60 | :$na_rm = false, | ||||||||||||||||||||||||||||
| 61 | :$show_legend = undef, :$inherit_aes = true, | ||||||||||||||||||||||||||||
| 62 | %rest ) | ||||||||||||||||||||||||||||
| 63 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 64 | 4 | return Chart::GGPlot::Layer->new( | |||||||||||||||||||||||||||
| 65 | data => $data, | ||||||||||||||||||||||||||||
| 66 | mapping => $mapping, | ||||||||||||||||||||||||||||
| 67 | stat => $stat, | ||||||||||||||||||||||||||||
| 68 | position => $position, | ||||||||||||||||||||||||||||
| 69 | show_legend => $show_legend, | ||||||||||||||||||||||||||||
| 70 | inherit_aes => $inherit_aes, | ||||||||||||||||||||||||||||
| 71 | geom => 'point', | ||||||||||||||||||||||||||||
| 72 | params => { na_rm => $na_rm, %rest }, | ||||||||||||||||||||||||||||
| 73 | ); | ||||||||||||||||||||||||||||
| 74 | 5 | }; | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 5 | ▶ | classmethod ggplot_functions() { | ||||||||||||||||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 77 | return [ | ||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||
| 79 | 5 | name => 'geom_point', | |||||||||||||||||||||||||||
| 80 | code => $geom_point_code, | ||||||||||||||||||||||||||||
| 81 | pod => $geom_point_pod, | ||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||
| 83 | ]; | ||||||||||||||||||||||||||||
| 84 | 5 | } | |||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 5 | __PACKAGE__->meta->make_immutable(); | |||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 5 | 1; | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | __END__ | ||||||||||||||||||||||||||||