line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Chart::Clicker::Decoration::MarkerOverlay; |
2
|
|
|
|
|
|
|
$Chart::Clicker::Decoration::MarkerOverlay::VERSION = '2.88'; |
3
|
8
|
|
|
8
|
|
58509
|
use Moose; |
|
8
|
|
|
|
|
631200
|
|
|
8
|
|
|
|
|
79
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Chart::Clicker::Decoration'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Component for drawing markers |
8
|
|
|
|
|
|
|
|
9
|
8
|
|
|
8
|
|
62147
|
use Graphics::Primitive::Operation::Stroke; |
|
8
|
|
|
|
|
455479
|
|
|
8
|
|
|
|
|
234
|
|
10
|
8
|
|
|
8
|
|
2817
|
use Graphics::Primitive::Operation::Fill; |
|
8
|
|
|
|
|
99686
|
|
|
8
|
|
|
|
|
265
|
|
11
|
8
|
|
|
8
|
|
3076
|
use Graphics::Primitive::Paint::Solid; |
|
8
|
|
|
|
|
118699
|
|
|
8
|
|
|
|
|
4675
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
override('finalize', sub { |
15
|
|
|
|
|
|
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $width = $self->width; |
18
|
|
|
|
|
|
|
my $height = $self->height; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $clicker = $self->clicker; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
foreach my $cname ($clicker->context_names) { |
23
|
|
|
|
|
|
|
my $ctx = $clicker->get_context($cname); |
24
|
|
|
|
|
|
|
foreach my $marker (@{ $ctx->markers }) { |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $key = $marker->key; |
27
|
|
|
|
|
|
|
my $key2 = $marker->key2; |
28
|
|
|
|
|
|
|
my $value = $marker->value; |
29
|
|
|
|
|
|
|
my $value2 = $marker->value2; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
if($key && $value) { |
32
|
|
|
|
|
|
|
} elsif(defined($key)) { |
33
|
|
|
|
|
|
|
my $domain = $ctx->domain_axis; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $x = $domain->mark($self->width, $key); |
36
|
|
|
|
|
|
|
my $x2; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
if($key2) { |
39
|
|
|
|
|
|
|
$x2 = $domain->mark($self->width, $key2); |
40
|
|
|
|
|
|
|
$self->move_to($x, 0); |
41
|
|
|
|
|
|
|
$self->rectangle(($x2 - $x), $height); |
42
|
|
|
|
|
|
|
my $fillop = Graphics::Primitive::Operation::Fill->new( |
43
|
|
|
|
|
|
|
paint => Graphics::Primitive::Paint::Solid->new( |
44
|
|
|
|
|
|
|
color => $marker->inside_color |
45
|
|
|
|
|
|
|
), |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
$self->do($fillop); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
$self->move_to($x, 0); |
51
|
|
|
|
|
|
|
$self->rel_line_to(0, $height); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
if($x2) { |
54
|
|
|
|
|
|
|
$self->move_to($x2, 0); |
55
|
|
|
|
|
|
|
$self->rel_line_to(0, $height); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my $op = Graphics::Primitive::Operation::Stroke->new; |
59
|
|
|
|
|
|
|
$op->brush($marker->brush); |
60
|
|
|
|
|
|
|
$op->brush->color($marker->color); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$self->do($op); |
63
|
|
|
|
|
|
|
} elsif(defined($value)) { |
64
|
|
|
|
|
|
|
my $range = $ctx->range_axis; |
65
|
|
|
|
|
|
|
# |
66
|
|
|
|
|
|
|
my $y = $height - $range->mark($height, $value); |
67
|
|
|
|
|
|
|
my $y2; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
if($value2) { |
70
|
|
|
|
|
|
|
$y2 = $height - $range->mark($self->height, $value2); |
71
|
|
|
|
|
|
|
$self->move_to(0, $y); |
72
|
|
|
|
|
|
|
$self->rectangle($width, ($y2 - $y)); |
73
|
|
|
|
|
|
|
my $fillop = Graphics::Primitive::Operation::Fill->new( |
74
|
|
|
|
|
|
|
paint => Graphics::Primitive::Paint::Solid->new( |
75
|
|
|
|
|
|
|
color => $marker->inside_color |
76
|
|
|
|
|
|
|
), |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
$self->do($fillop); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
$self->move_to(0, $y); |
83
|
|
|
|
|
|
|
$self->rel_line_to($width, 0); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
if($y2) { |
86
|
|
|
|
|
|
|
$self->move_to(0, $y2); |
87
|
|
|
|
|
|
|
$self->rel_line_to($width, 0); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $op = Graphics::Primitive::Operation::Stroke->new; |
91
|
|
|
|
|
|
|
$op->brush($marker->brush); |
92
|
|
|
|
|
|
|
$op->brush->color($marker->color); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
$self->do($op); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
}); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
101
|
|
|
|
|
|
|
|
102
|
8
|
|
|
8
|
|
68
|
no Moose; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
56
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
__END__ |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=pod |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 NAME |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Chart::Clicker::Decoration::MarkerOverlay - Component for drawing markers |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 VERSION |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
version 2.88 |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 DESCRIPTION |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
A Component that handles the rendering of Markers. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 AUTHOR |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Cory G Watson <gphat@cpan.org> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Cold Hard Code, LLC. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
131
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |