| 1 | package Chart::GGPlot::Facet::Null; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # ABSTRACT: A single panel for faceting | ||||||||||||||
| 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 | our $VERSION = '0.002003'; # VERSION | |||||||||||||
| 9 | |||||||||||||||
| 10 | 5 | ▶ | use Data::Frame; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 5 | ▶ | use PDL::Primitive qw(which); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | 5 | ▶ | use Type::Params; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | 5 | ▶ | use Types::Standard qw(ArrayRef Bool CodeRef Enum Maybe Str); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | |||||||||||||||
| 15 | 5 | ▶ | use Chart::GGPlot::Types qw(:all); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 16 | |||||||||||||||
| 17 | |||||||||||||||
| 18 | 5 | with qw(Chart::GGPlot::Facet); | |||||||||||||
| 19 | |||||||||||||||
| 20 | 5 | has '+shrink' => ( default => 1 ); | |||||||||||||
| 21 | 5 | has '+params' => (init_arg => undef); | |||||||||||||
| 22 | |||||||||||||||
| 23 | 7 | ▶ | method compute_layout ($data, $params) { | ||||||||||||
|
Subroutine
compute_layout: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||
| 24 | 7 | return $self->layout_null(); | |||||||||||||
| 25 | 5 | } | |||||||||||||
| 26 | |||||||||||||||
| 27 | 7 | ▶ | method map_data ($data, $layout, $params) { | ||||||||||||
|
Subroutine
map_data: called CC=5 SCAR=17.6
Pod
undocumented
Branch: 2 branches
| |||||||||||||||
| 28 | 7 | ▶ | if ( not defined $data ) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 29 | 0 | return Data::Frame->new( columns => [ PANEL => null ] ); | |||||||||||||
| 30 | } | ||||||||||||||
| 31 | 7 | ▶ | if ( $data->isempty ) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 32 | 0 | return $data->merge( PANEL => null ); | |||||||||||||
| 33 | } | ||||||||||||||
| 34 | |||||||||||||||
| 35 | 7 | $data->set('PANEL', pdl([0])->repeat( $data->nrow )); | |||||||||||||
| 36 | 7 | return $data; | |||||||||||||
| 37 | 5 | } | |||||||||||||
| 38 | |||||||||||||||
| 39 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||||||
| 40 | |||||||||||||||
| 41 | 5 | 1; | |||||||||||||
| 42 | |||||||||||||||
| 43 | __END__ | ||||||||||||||