| 1 | package Chart::GGPlot::Scale::ContinuousDateTime; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Continuous datetime scale | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Chart::GGPlot::Class qw(:pdl); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Types::PDL qw(Piddle PiddleFromAny); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Types::Standard qw(InstanceOf Maybe); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Chart::GGPlot::Trans::Functions qw(time_trans); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Chart::GGPlot::Util qw(:all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 1 | extends qw( | |||||||||||||||||||||||||||
| 17 | Chart::GGPlot::Scale::Continuous | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | has timezone => (is => 'rwp'); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 1 | with qw( | |||||||||||||||||||||||||||
| 23 | Chart::GGPlot::Scale::Positional | ||||||||||||||||||||||||||||
| 24 | Chart::GGPlot::Scale::SupportsSecondaryAxis | ||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | ▶ | around transform($p) { | ||||||||||||||||||||||||||
|
Subroutine
:around: called CC=5 SCAR=18.3
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 28 | 1 | my $tz = $p->$_can('timezone'); | |||||||||||||||||||||||||||
| 29 | 1 | ▶ | if (not defined $self->timezone and defined $tz) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $self->timezone and defined $tz
MC/DC0%0/2
not defined $self->timezone and defined $tz
not defined $self->timezone
defined $tz
Truth table33%1/3
not(A) and B
A= not defined $self->timezoneB= defined $tz
| |||||||||||||||||||||||||||||
| 30 | 0 | $self->_set_timezone($tz); | |||||||||||||||||||||||||||
| 31 | 0 | $self->trans(time_trans($self->timezone)); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 1 | return $self->$orig($p); | |||||||||||||||||||||||||||
| 34 | 1 | } | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 2 | ▶ | method map_to_limits ( $p, $limits = $self->get_limits ) { | ||||||||||||||||||||||||||
|
Subroutine
map_to_limits: called CC=4 SCAR=14.5
Pod
undocumented
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 37 | 2 | return $self->oob->( $p, $limits ); | |||||||||||||||||||||||||||
| 38 | 1 | } | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | ▶ | method break_info ($range = null()) { | ||||||||||||||||||||||||||
|
Subroutine
break_info: called CC=6 SCAR=20.8
Pod
undocumented
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 41 | 1 | my $breaks = $self->SUPER::break_info($range); | |||||||||||||||||||||||||||
| 42 | 1 | ▶ | 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
| |||||||||||||||||||||||||||||
| 43 | and not $self->secondary_axis->empty() ) | ||||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||
| 45 | 0 | $self->secondary_axis->init($self); | |||||||||||||||||||||||||||
| 46 | 0 | $breaks = [ | |||||||||||||||||||||||||||
| 47 | $breaks->flatten, | ||||||||||||||||||||||||||||
| 48 | $self->secondary_axis->break_info( $breaks->range, $self )->flatten | ||||||||||||||||||||||||||||
| 49 | ]; | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | 1 | return $breaks; | |||||||||||||||||||||||||||
| 52 | 1 | } | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 1 | 1; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||||||||||