| 1 | package Chart::GGPlot::Scale::ContinuousPosition; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Continuous position scale | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use Chart::GGPlot::Class qw(:pdl); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Types::PDL qw(Piddle PiddleFromAny); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Types::Standard qw(InstanceOf Maybe); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Chart::GGPlot::Util qw(:all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 4 | extends qw( | |||||||||||||||||||||||||||
| 16 | Chart::GGPlot::Scale::Continuous | ||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 4 | with qw( | |||||||||||||||||||||||||||
| 20 | Chart::GGPlot::Scale::Positional | ||||||||||||||||||||||||||||
| 21 | Chart::GGPlot::Scale::SupportsSecondaryAxis | ||||||||||||||||||||||||||||
| 22 | ); | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 4 | has '+limits' => ( | |||||||||||||||||||||||||||
| 25 | isa => Piddle->plus_coercions(PiddleFromAny), | ||||||||||||||||||||||||||||
| 26 | coerce => 1, | ||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 28 | ▶ | method map_to_limits ( $p, $limits = $self->get_limits ) { | ||||||||||||||||||||||||||
|
Subroutine
map_to_limits: called CC=4 SCAR=14.2
Pod
undocumented
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 30 | 28 | my $scaled = $self->oob->( $p, $limits ); | |||||||||||||||||||||||||||
| 31 | 28 | $scaled->setbadtoval($self->na_value); | |||||||||||||||||||||||||||
| 32 | 28 | return $scaled; | |||||||||||||||||||||||||||
| 33 | 4 | } | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 10 | ▶ | around break_info ($range = null()) { | ||||||||||||||||||||||||||
|
Subroutine
:around: called CC=6 SCAR=19.9
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 36 | 10 | my $breaks = $self->$orig($range); | |||||||||||||||||||||||||||
| 37 | 10 | ▶ | if ( defined $self->secondary_axis | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $self->secondary_axis and not $self->secondary_axis->empty
MC/DC0%0/2
defined $self->secondary_axis and not $self->secondary_axis->empty
defined $self->secondary_axis
not $self->secondary_axis->empty
Truth table33%1/3
A and not(B)
A= defined $self->secondary_axisB= not $self->secondary_axis->empty
| |||||||||||||||||||||||||||||
| 38 | and not $self->secondary_axis->empty() ) | ||||||||||||||||||||||||||||
| 39 | { | ||||||||||||||||||||||||||||
| 40 | 0 | $self->secondary_axis->init($self); | |||||||||||||||||||||||||||
| 41 | 0 | $breaks = [ | |||||||||||||||||||||||||||
| 42 | $breaks->flatten, | ||||||||||||||||||||||||||||
| 43 | $self->secondary_axis->break_info( $breaks->range, $self )->flatten | ||||||||||||||||||||||||||||
| 44 | ]; | ||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | 10 | return $breaks; | |||||||||||||||||||||||||||
| 47 | 4 | } | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 4 | 1; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||||||||||||