| 1 | package Chart::GGPlot::HasParams; | ||||||||||||||||||
| 2 | |||||||||||||||||||
| 3 | # ABSTRACT: The role for the 'extra_params' thing | ||||||||||||||||||
| 4 | |||||||||||||||||||
| 5 | 7 | ▶ | use Chart::GGPlot::Role; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 6 | 7 | ▶ | use namespace::autoclean; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 7 | |||||||||||||||||||
| 8 | 7 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||
| 9 | |||||||||||||||||||
| 10 | 7 | ▶ | use Types::Standard qw(ArrayRef); | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 11 | |||||||||||||||||||
| 12 | |||||||||||||||||||
| 13 | |||||||||||||||||||
| 14 | # used by parameters() | ||||||||||||||||||
| 15 | 19 | ▶ | classmethod _parameters() { [] } | ||||||||||||||||
|
Subroutine
_parameters: called CC=3 SCAR=11.2
Branch: 2 branches
| |||||||||||||||||||
| 16 | |||||||||||||||||||
| 17 | 16 | ▶ | classmethod extra_params() { [qw(na_rm)] } | ||||||||||||||||
|
Subroutine
extra_params: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| |||||||||||||||||||
| 18 | |||||||||||||||||||
| 19 | |||||||||||||||||||
| 20 | # R ggplot2's Geom parameters() function automatically gets params from | ||||||||||||||||||
| 21 | # draw_panel and draw_group methods via introspection on the method | ||||||||||||||||||
| 22 | # arguments. Although Perl Function::Parameters supports introspection, | ||||||||||||||||||
| 23 | # I would now do it in a "dumb" way. | ||||||||||||||||||
| 24 | 22 | ▶ | classmethod parameters( $extra = false ) { | ||||||||||||||||
|
Subroutine
parameters: called CC=5 SCAR=16.2
Pod
documented
Branch: 3 branches
| |||||||||||||||||||
| 25 | 22 | my $args = $class->_parameters; | |||||||||||||||||
| 26 | 22 | ▶ | if ($extra) { | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 27 | 20 | $args = $args->union( $class->extra_params ); | |||||||||||||||||
| 28 | } | ||||||||||||||||||
| 29 | 22 | return $args; | |||||||||||||||||
| 30 | 7 | } | |||||||||||||||||
| 31 | |||||||||||||||||||
| 32 | 7 | 1; | |||||||||||||||||
| 33 | |||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||