| 1 | package Chart::GGPlot::Scale::ContinuousIdentity; | ||
| 2 | |||
| 3 | # ABSTRACT: Continuous identity scale | ||
| 4 | |||
| 5 | use Chart::GGPlot::Class qw(:pdl); | ||
| 6 | use namespace::autoclean; | ||
| 7 | |||
| 8 | our $VERSION = '0.002003'; # VERSION | ||
| 9 | |||
| 10 | use Chart::GGPlot::Util qw(:all); | ||
| 11 | |||
| 12 | extends qw( | ||
| 13 | Chart::GGPlot::Scale::Continuous | ||
| 14 | ); | ||
| 15 | |||
| 16 | method map_to_limits ( $p, $limits = $self->get_limits ) { | ||
| 17 | if (is_factor($p)) { | ||
| 18 | return as_character($p); | ||
| 19 | } else { | ||
| 20 | return $p; | ||
| 21 | } | ||
| 22 | } | ||
| 23 | |||
| 24 | around train ($p) { | ||
| 25 | return if $self->guide eq 'none'; | ||
| 26 | return $self->$orig($p); | ||
| 27 | } | ||
| 28 | |||
| 29 | __PACKAGE__->meta->make_immutable; | ||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ |