line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chart::OFC::Dataset; |
2
|
|
|
|
|
|
|
$Chart::OFC::Dataset::VERSION = '0.12'; |
3
|
17
|
|
|
17
|
|
70944
|
use strict; |
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
1685
|
|
4
|
17
|
|
|
17
|
|
102
|
use warnings; |
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
573
|
|
5
|
|
|
|
|
|
|
|
6
|
17
|
|
|
17
|
|
2639
|
use Moose; |
|
17
|
|
|
|
|
1143330
|
|
|
17
|
|
|
|
|
128
|
|
7
|
17
|
|
|
17
|
|
83240
|
use MooseX::StrictConstructor; |
|
17
|
|
|
|
|
58785
|
|
|
17
|
|
|
|
|
155
|
|
8
|
17
|
|
|
17
|
|
73443
|
use Chart::OFC::Types; |
|
17
|
|
|
|
|
50
|
|
|
17
|
|
|
|
|
5183
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Chart::OFC::Role::OFCDataLines'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'values' => |
13
|
|
|
|
|
|
|
( is => 'ro', |
14
|
|
|
|
|
|
|
isa => 'Chart::OFC::Type::NonEmptyArrayRefOfNums', |
15
|
|
|
|
|
|
|
required => 1, |
16
|
|
|
|
|
|
|
auto_deref => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'links' => |
20
|
|
|
|
|
|
|
( is => 'ro', |
21
|
|
|
|
|
|
|
isa => 'Chart::OFC::Type::NonEmptyArrayRef', |
22
|
|
|
|
|
|
|
required => 0, |
23
|
|
|
|
|
|
|
auto_deref => 1, |
24
|
|
|
|
|
|
|
predicate => 'has_links', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _ofc_data_lines |
28
|
|
|
|
|
|
|
{ |
29
|
54
|
|
|
54
|
|
465
|
my $self = shift; |
30
|
54
|
|
|
|
|
91
|
my $count = shift; |
31
|
|
|
|
|
|
|
|
32
|
54
|
|
|
|
|
107
|
my @lines; |
33
|
54
|
100
|
|
|
|
392
|
if ( $self->can('type') ) |
34
|
|
|
|
|
|
|
{ |
35
|
52
|
|
|
|
|
223
|
my $name = $self->type(); |
36
|
52
|
100
|
100
|
|
|
299
|
$name .= q{_} . $count |
37
|
|
|
|
|
|
|
if $count && $count > 1; |
38
|
|
|
|
|
|
|
|
39
|
52
|
|
|
|
|
289
|
push @lines, |
40
|
|
|
|
|
|
|
$self->_data_line( $name, $self->_parameters_for_type() ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
54
|
|
|
|
|
126
|
my $val_name = 'values'; |
44
|
54
|
100
|
100
|
|
|
257
|
$val_name .= q{_} . $count |
45
|
|
|
|
|
|
|
if $count && $count > 1; |
46
|
|
|
|
|
|
|
|
47
|
54
|
|
|
|
|
2279
|
push @lines, |
48
|
|
|
|
|
|
|
$self->_data_line( $val_name, $self->values() ); |
49
|
|
|
|
|
|
|
|
50
|
54
|
100
|
|
|
|
2446
|
if ( $self->has_links() ) |
51
|
|
|
|
|
|
|
{ |
52
|
3
|
|
|
|
|
8
|
my $links_name = 'links'; |
53
|
3
|
100
|
66
|
|
|
19
|
$links_name .= q{_} . $count |
54
|
|
|
|
|
|
|
if $count && $count > 1; |
55
|
|
|
|
|
|
|
|
56
|
3
|
|
|
|
|
122
|
push @lines, $self->_data_line( $links_name, $self->links() ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
54
|
|
|
|
|
453
|
return @lines; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
17
|
|
|
17
|
|
130
|
no Moose; |
|
17
|
|
|
|
|
42
|
|
|
17
|
|
|
|
|
122
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# ABSTRACT: A set of values to be charted |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=pod |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 NAME |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Chart::OFC::Dataset - A set of values to be charted |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 VERSION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
version 0.12 |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SYNOPSIS |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my @numbers = (1, 2, 3); |
86
|
|
|
|
|
|
|
my $dataset = Chart::OFC::Dataset->new( values => \@numbers ); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 DESCRIPTION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This class represents a set of values that will be charted along the X |
91
|
|
|
|
|
|
|
axis of a chart (or as pie slices). |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This class has one attribute which may be passed to the C<new()> |
96
|
|
|
|
|
|
|
method. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 values |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This should be an array reference containing one more numbers |
101
|
|
|
|
|
|
|
representing values to be plotted on the chart. On grid charts, these |
102
|
|
|
|
|
|
|
are plotted on the X axis. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This attribute is required, and must contain at least one value. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 links |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This is an optional attribute which may be an array reference of |
109
|
|
|
|
|
|
|
links, one per value. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 ROLES |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This class does the C<Chart::OFC::Role::OFCDataLines> role. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 AUTHOR |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Dave Rolsky. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
This is free software, licensed under: |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |