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