| 1 | package Chart::GGPlot::Coord::Flip; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # ABSTRACT: Cartesian coordinates with x and y flipped | ||||||||||||||
| 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 | extends qw(Chart::GGPlot::Coord::Cartesian); | |||||||||||||
| 11 | |||||||||||||||
| 12 | 4 | ▶ | use Chart::GGPlot::Util::Pod qw(unindent); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | |||||||||||||||
| 14 | 4 | my $coord_flip_pod = unindent(<<'EOT'); | |||||||||||||
| 15 | |||||||||||||||
| 16 | coord_flip(:$xlim=undef, :$ylim=undef, :$expand=true) | ||||||||||||||
| 17 | |||||||||||||||
| 18 | Flip cartesian coordinates so that horizontal becomes vertical, and | ||||||||||||||
| 19 | vertical becoms horizontal. | ||||||||||||||
| 20 | |||||||||||||||
| 21 | EOT | ||||||||||||||
| 22 | |||||||||||||||
| 23 | 0 | ▶ | my $coord_flip_code = sub { | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||
| 24 | 0 | return __PACKAGE__->new(@_); | |||||||||||||
| 25 | 4 | }; | |||||||||||||
| 26 | |||||||||||||||
| 27 | 3 | ▶ | classmethod ggplot_functions() { | ||||||||||||
|
Subroutine
ggplot_functions: called CC=3 SCAR=11.3
Pod
undocumented
Branch: 2 branches
| |||||||||||||||
| 28 | return [ | ||||||||||||||
| 29 | { | ||||||||||||||
| 30 | 3 | name => 'coord_flip', | |||||||||||||
| 31 | code => $coord_flip_code, | ||||||||||||||
| 32 | pod => $coord_flip_pod, | ||||||||||||||
| 33 | } | ||||||||||||||
| 34 | ]; | ||||||||||||||
| 35 | 4 | } | |||||||||||||
| 36 | |||||||||||||||
| 37 | 4 | ▶ | use Chart::GGPlot::Scale::Functions qw(scale_flip_position); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 38 | |||||||||||||||
| 39 | # The R ggplot2 code has some logic for flipping things inside its | ||||||||||||||
| 40 | # CoordFlip class. For Chart::Plot we don't do similar things here. | ||||||||||||||
| 41 | # Instead we implement that in the graphics backend. | ||||||||||||||
| 42 | |||||||||||||||
| 43 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||
| 44 | |||||||||||||||
| 45 | 4 | 1; | |||||||||||||
| 46 | |||||||||||||||
| 47 | __END__ | ||||||||||||||