line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Google::Chart::Size; |
4
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
5
|
1
|
|
|
1
|
|
7975
|
use Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
6
|
1
|
|
|
1
|
|
3288
|
use Google::Chart::Types qw(hash_coercion); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
12
|
|
7
|
1
|
|
|
1
|
|
354
|
use Carp(); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use constant parameter_name => 'chs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
367
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Google::Chart::QueryComponent::Simple'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
coerce 'Google::Chart::Size' |
14
|
|
|
|
|
|
|
=> from 'Str' |
15
|
|
|
|
|
|
|
=> via { |
16
|
|
|
|
|
|
|
if (! /^(\d+)x(\d+)$/) { |
17
|
|
|
|
|
|
|
Carp::confess("Could not parse $_ as size"); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return Google::Chart::Size->new(width => $1, height => $2); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
coerce 'Google::Chart::Size' |
25
|
|
|
|
|
|
|
=> from 'HashRef' |
26
|
|
|
|
|
|
|
=> via { |
27
|
|
|
|
|
|
|
my $h = $_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my ($width, $height) = ($h->{args}) ? |
30
|
|
|
|
|
|
|
($h->{args}->{width}, $h->{args}->{height}) : |
31
|
|
|
|
|
|
|
($h->{width}, $h->{height}) |
32
|
|
|
|
|
|
|
; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return Google::Chart::Size->new( width => $width, height => $height ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has 'width' => ( |
39
|
|
|
|
|
|
|
is => 'rw', |
40
|
|
|
|
|
|
|
isa => 'Int', |
41
|
|
|
|
|
|
|
required => 1 |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has 'height' => ( |
45
|
|
|
|
|
|
|
is => 'rw', |
46
|
|
|
|
|
|
|
isa => 'Int', |
47
|
|
|
|
|
|
|
required => 1 |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
1
|
|
7
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
53
|
1
|
|
|
1
|
|
244
|
no Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub parameter_value { |
56
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
57
|
0
|
|
|
|
|
|
return join('x', $self->width, $self->height); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 NAME |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Google::Chart::Size - Google::Chart Size Specification |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SYNOPSIS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Google::Chart->new( |
71
|
|
|
|
|
|
|
size => "400x300" |
72
|
|
|
|
|
|
|
) |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Google::Chart->new( |
75
|
|
|
|
|
|
|
size => { |
76
|
|
|
|
|
|
|
width => 400, |
77
|
|
|
|
|
|
|
height => 300 |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 METHODS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 parameter_value |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |