line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Google::Chart::Legend; |
4
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
7863
|
use Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
6
|
1
|
|
|
1
|
|
2554
|
use URI::Escape (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
322
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Google::Chart::QueryComponent'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
coerce 'Google::Chart::Legend' |
11
|
|
|
|
|
|
|
=> from 'HashRef' |
12
|
|
|
|
|
|
|
=> via { |
13
|
|
|
|
|
|
|
Google::Chart::Legend->new(%{$_}); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
; |
16
|
|
|
|
|
|
|
coerce 'Google::Chart::Legend' |
17
|
|
|
|
|
|
|
=> from 'ArrayRef' |
18
|
|
|
|
|
|
|
=> via { |
19
|
|
|
|
|
|
|
Google::Chart::Legend->new(values => $_); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
coerce 'Google::Chart::Legend' |
24
|
|
|
|
|
|
|
=> from 'Str' |
25
|
|
|
|
|
|
|
=> via { |
26
|
|
|
|
|
|
|
Google::Chart::Legend->new(values => [$_]) |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
subtype 'Google::Chart::Legend::Data' |
31
|
|
|
|
|
|
|
=> as 'Str' |
32
|
|
|
|
|
|
|
; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
subtype 'Google::Chart::Legend::DataList' |
35
|
|
|
|
|
|
|
=> as 'ArrayRef[Google::Chart::Legend::Data]', |
36
|
|
|
|
|
|
|
; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
coerce 'Google::Chart::Legend::DataList' |
39
|
|
|
|
|
|
|
=> from 'Str' |
40
|
|
|
|
|
|
|
=> via { [ $_ ] } |
41
|
|
|
|
|
|
|
; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has 'values' => ( |
44
|
|
|
|
|
|
|
is => 'rw', |
45
|
|
|
|
|
|
|
isa => 'Google::Chart::Legend::DataList', |
46
|
|
|
|
|
|
|
coerce => 1, |
47
|
|
|
|
|
|
|
required => 1, |
48
|
|
|
|
|
|
|
default => sub { +[] } |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has 'position' => ( |
52
|
|
|
|
|
|
|
is => 'rw', |
53
|
|
|
|
|
|
|
isa => enum([ qw(b t r l) ]), |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
1
|
|
6
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
59
|
1
|
|
|
1
|
|
252
|
no Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub as_query { |
62
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
63
|
0
|
|
|
|
|
|
my %data = ( |
64
|
0
|
|
|
|
|
|
chdl => join('|', @{ $self->values }), |
65
|
|
|
|
|
|
|
); |
66
|
0
|
0
|
|
|
|
|
if (my $position = $self->position) { |
67
|
0
|
|
|
|
|
|
$data{chdlp} = $position; |
68
|
|
|
|
|
|
|
} |
69
|
0
|
|
|
|
|
|
return wantarray ? %data : join('&', |
70
|
|
|
|
|
|
|
map { |
71
|
0
|
0
|
|
|
|
|
join('=', URI::Escape::uri_escape($_), URI::Escape::uri_escape($data{$_})) |
72
|
|
|
|
|
|
|
} keys %data |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 NAME |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Google::Chart::Legend - Google::Chart Legend |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 METHODS |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 as_query |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |