| 1 | package Chart::GGPlot::Coord; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # ABSTRACT: The role for coordinates | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Chart::GGPlot::Role 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 Types::Standard qw(Bool); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # Renders the horizontal axes. | ||||||||||||||||||||||||||||
| 13 | 5 | has render_axis_h => ( is => 'rw' ); | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | # Renders the vertical axes. | ||||||||||||||||||||||||||||
| 16 | 5 | has render_axis_v => ( is => 'rw' ); | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 5 | with qw(Chart::GGPlot::HasCollectibleFunctions); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | classmethod is_linear() { false; } | ||||||||||||||||||||||||||
|
Subroutine
is_linear: not called CC=3 SCAR=22.6
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 5 | requires 'transform'; | |||||||||||||||||||||||||||
| 25 | 5 | requires 'distance'; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # Returns the desired aspect ratio for the plot. | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | method aspect () { return; } | ||||||||||||||||||||||||||
|
Subroutine
aspect: not called CC=3 SCAR=22.6
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # Returns a list containing labels for x and y. | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | method labels ($panel_params) { $panel_params } | ||||||||||||||||||||||||||
|
Subroutine
labels: not called CC=3 SCAR=22.8
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | method range ($panel_params) { | ||||||||||||||||||||||||||
|
Subroutine
range: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 34 | return { | ||||||||||||||||||||||||||||
| 35 | 0 | x => $panel_params->at('x_range'), | |||||||||||||||||||||||||||
| 36 | y => $panel_params->at('y_range'), | ||||||||||||||||||||||||||||
| 37 | }; | ||||||||||||||||||||||||||||
| 38 | 5 | } | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | method setup_panel_params ($scale_x, $scale_y, $params = {}) { {}; } | ||||||||||||||||||||||||||
|
Subroutine
setup_panel_params: not called CC=4 SCAR=28.1
Pod
undocumented
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 7 | ▶ | method setup_params ($data) { {}; } | ||||||||||||||||||||||||||
|
Subroutine
setup_params: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 43 | 7 | ▶ | method setup_data ($data, $params) { $data } | ||||||||||||||||||||||||||
|
Subroutine
setup_data: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 44 | 7 | ▶ | method setup_layout ($layout, $params) { $layout } | ||||||||||||||||||||||||||
|
Subroutine
setup_layout: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | # Optionally, modifies list of x and y scales in place. Currently | ||||||||||||||||||||||||||||
| 47 | # used as a fudge for CoordFlip and CoordPolar | ||||||||||||||||||||||||||||
| 48 | 6 | ▶ | method modify_scales ($scales_x, $scales_y) { } | ||||||||||||||||||||||||||
|
Subroutine
modify_scales: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 12 | ▶ | classmethod expand_default ($scale, | ||||||||||||||||||||||||||
|
Subroutine
expand_default: called CC=7 SCAR=21.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 51 | 12 | ▶ | $discrete = [0, 0.6, 0, 0.6], $continuous = [0.05, 0, 0.05, 0]) { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 52 | return ( | ||||||||||||||||||||||||||||
| 53 | ( | ||||||||||||||||||||||||||||
| 54 | 12 | ▶ | $scale->expand | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$scale->expand // $scale->$Chart::GGPlot::Coord::_DOES("Chart::GGPlot::Scale::Discrete")
MC/DC0%0/2
$scale->expand // $scale->$Chart::GGPlot::Coord::_DOES("Chart::GGPlot::Scale::Discrete")
$scale->expand
$scale->$Chart::GGPlot::Coord::_DOES("Chart::GGPlot::Scale::Discrete")
Truth table33%1/3
A // B
A= $scale->expandB= $scale->$Chart::GGPlot::Coord::_DOES("Chart::GGPlot::Scale::Discrete")
| |||||||||||||||||||||||||||||
| 55 | // ( $scale->$_DOES('Chart::GGPlot::Scale::Discrete') ) | ||||||||||||||||||||||||||||
| 56 | ) | ||||||||||||||||||||||||||||
| 57 | ? $discrete | ||||||||||||||||||||||||||||
| 58 | : $continuous | ||||||||||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||||||||||
| 60 | 5 | } | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 5 | 1; | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | __END__ | ||||||||||||||||||||||||||||