line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chart::OFC::Role::OFCDataLines; |
2
|
|
|
|
|
|
|
$Chart::OFC::Role::OFCDataLines::VERSION = '0.12'; |
3
|
20
|
|
|
20
|
|
22493
|
use strict; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
861
|
|
4
|
20
|
|
|
20
|
|
122
|
use warnings; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
681
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
114
|
use Moose::Role; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
171
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
requires '_ofc_data_lines'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _data_line ## no critic RequireArgUnpacking |
11
|
|
|
|
|
|
|
{ |
12
|
215
|
|
|
215
|
|
336
|
my $self = shift; |
13
|
215
|
|
|
|
|
300
|
my $label = shift; |
14
|
215
|
|
|
|
|
536
|
my @vals = @_; |
15
|
|
|
|
|
|
|
|
16
|
215
|
|
|
|
|
386
|
$label =~ s/color/colour/; |
17
|
|
|
|
|
|
|
|
18
|
215
|
|
|
|
|
442
|
my $line = q{&} . $label . q{=}; |
19
|
|
|
|
|
|
|
|
20
|
694
|
|
|
|
|
1488
|
$line .= |
21
|
215
|
|
|
|
|
352
|
join ',', map { $self->_format_value($_) } @vals; |
22
|
|
|
|
|
|
|
|
23
|
215
|
|
|
|
|
389
|
$line .= q{&}; |
24
|
|
|
|
|
|
|
|
25
|
215
|
|
|
|
|
937
|
return $line; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _format_value |
29
|
|
|
|
|
|
|
{ |
30
|
694
|
|
|
694
|
|
853
|
my $self = shift; |
31
|
694
|
|
|
|
|
861
|
my $value = shift; |
32
|
|
|
|
|
|
|
|
33
|
694
|
100
|
|
|
|
1371
|
return 'null' unless defined $value; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# nested array ref values attr for things like scatter charts |
36
|
689
|
100
|
|
|
|
1196
|
if ( ref $value eq 'ARRAY' ) |
37
|
|
|
|
|
|
|
{ |
38
|
21
|
|
|
|
|
30
|
return '[' . ( join ',', @{ $value } ) . ']'; |
|
21
|
|
|
|
|
129
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
else |
41
|
|
|
|
|
|
|
{ |
42
|
668
|
|
|
|
|
1383
|
return $self->_escape($value); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _escape |
47
|
|
|
|
|
|
|
{ |
48
|
668
|
|
|
668
|
|
690
|
shift; |
49
|
668
|
|
|
|
|
768
|
my $string = shift; |
50
|
|
|
|
|
|
|
|
51
|
668
|
|
|
|
|
906
|
$string =~ s/,/#comma#/g; |
52
|
|
|
|
|
|
|
|
53
|
668
|
|
|
|
|
2075
|
return $string; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
20
|
|
|
20
|
|
127107
|
no Moose::Role; |
|
20
|
|
|
|
|
52
|
|
|
20
|
|
|
|
|
125
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# ABSTRACT: helper for classes which generate OFC data |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 NAME |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Chart::OFC::Role::OFCDataLines - helper for classes which generate OFC data |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 VERSION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
version 0.12 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DESCRIPTION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This class provides a common helper method for classes which generate |
77
|
|
|
|
|
|
|
OFC data (which is most classes in the Chart::OFC distro). |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Dave Rolsky. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is free software, licensed under: |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |