line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Google::Chart::Encoding::Simple; |
2
|
1
|
|
|
1
|
|
6981
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use Scalar::Util qw(looks_like_number); |
4
|
|
|
|
|
|
|
use namespace::clean -except => qw(meta); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with 'Google::Chart::Encoding'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my @ENCODE_VALUES = ('A'..'Z', 'a'..'z', 0..9); |
9
|
|
|
|
|
|
|
sub encode { |
10
|
|
|
|
|
|
|
my ($self, $sets) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return 's:' . join( ',', # join data sets |
13
|
|
|
|
|
|
|
map { |
14
|
|
|
|
|
|
|
my $set = $_; |
15
|
|
|
|
|
|
|
join('', map { |
16
|
|
|
|
|
|
|
defined $_ ? |
17
|
|
|
|
|
|
|
(looks_like_number($_) ? $ENCODE_VALUES[$_] : '_') : |
18
|
|
|
|
|
|
|
'_' |
19
|
|
|
|
|
|
|
} @{$set->data} ) # join data values |
20
|
|
|
|
|
|
|
} @$sets |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Google::Chart::Encoding::Simple - Encode Values Based On "Simple Encoding" |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |