Clicker/Data/Series/Size.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 29 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« Clicker/Data/Series/HighLow.pm ↑ Summary Clicker/Decoration.pm »
1 package Chart::Clicker::Data::Series::Size;
2 4 $Chart::Clicker::Data::Series::Size::VERSION = '2.89';
3 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 extends 'Chart::Clicker::Data::Series';
6  
7 # ABSTRACT: Chart data with additional attributes for Size charts
8  
9 4 ▶use List::Util qw(min max);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 has 'sizes' => (
13 traits => [ 'Array' ],
14 is => 'rw',
15 isa => 'ArrayRef',
16 1 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
17 4 handles => {
18 'add_to_sizes' => 'push',
19 'size_count' => 'count',
20 'get_size' => 'get'
21 }
22 );
23  
24  
25 has max_size => (
26 is => 'ro',
27 isa => 'Num',
28 lazy => 1,
29 default => sub {
30 1 ▶ my ($self) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
31 1 return max(@{ $self->sizes });
32 }
33 4 );
34  
35  
36 has min_size => (
37 is => 'ro',
38 isa => 'Num',
39 lazy => 1,
40 default => sub {
41 1 ▶ my ($self) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
42 1 return min(@{ $self->sizes });
43 }
44 4 );
45  
46 4 __PACKAGE__->meta->make_immutable;
47  
48 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 4 1;
51  
52 __END__
53  
54 =pod
55  
56 =head1 NAME
57  
58 Chart::Clicker::Data::Series::Size - Chart data with additional attributes for Size charts
59  
60 =head1 VERSION
61  
62 version 2.89
63  
64 =head1 SYNOPSIS
65  
66 use Chart::Clicker::Data::Series::Size;
67  
68 my @keys = ();
69 my @values = ();
70 my @sizes = ();
71  
72 my $series = Chart::Clicker::Data::Series::Size->new({
73 keys => \@keys,
74 values => \@values,
75 sizes => \@sizes
76 });
77  
78 =head1 DESCRIPTION
79  
80 Chart::Clicker::Data::Series::Size is an extension of the Series class
81 that provides storage for a third variable called the size. This is useful
82 for the Bubble renderer.
83  
84 =head1 ATTRIBUTES
85  
86 =head2 sizes
87  
88 Set/Get the sizes for this series.
89  
90 =head2 max_size
91  
92 Gets the largest value from this Series' C<sizes>.
93  
94 =head2 min_size
95  
96 Gets the smallest value from this Series' C<sizes>.
97  
98 =head1 METHODS
99  
100 =head2 add_to_sizes
101  
102 Adds a size to this series.
103  
104 =head2 get_size
105  
106 Get a size by it's index.
107  
108 =head2 size_count
109  
110 Gets the count of sizes in this series.
111  
112 =head1 AUTHOR
113  
114 Cory G Watson <gphat@cpan.org>
115  
116 =head1 COPYRIGHT AND LICENSE
117  
118 This software is copyright (c) 2016 by Cory G Watson.
119  
120 This is free software; you can redistribute it and/or modify it under
121 the same terms as the Perl 5 programming language system itself.
122  
123 =cut
« Clicker/Data/Series/HighLow.pm ↑ Summary Clicker/Decoration.pm »