1
package Bio::Graphics::Glyph::ragged_ends;
4
use base qw(Bio::Graphics::Glyph::generic);
9
my $fg = $self->fgcolor;
10
my $bg = $self->option('bgcolor');
12
my($x1,$y1,$x2,$y2) = $self->bounds(@_);
14
my $zig = $self->option('zig') || 4;
15
my $zag = $self->option('zag') || 4;
17
my $polygon = GD::Polygon->new;
19
$polygon->addPt($x1, $y1);
20
my $yoff = $y1 + $zig;
22
if ($self->option("ragged_left")) {
23
while ($yoff <= $y2) {
24
$polygon->addPt( $x1 + ($i * $zag),
30
$polygon->addPt($x1, $y2);
32
$polygon->addPt($x2, $y2);
35
if ($self->option("ragged_right")) {
36
while ($yoff >= $y1) {
37
$polygon->addPt( $x2 - ($i * $zag),
43
$polygon->addPt($x2, $y1);
45
$polygon->addPt($x1, $y1); # close the polygon
47
$gd->polygon($polygon, $fg);
48
$gd->filledPolygon($polygon, $bg) if $bg;
55
Bio::Graphics::Glyph::ragged_ends - The "ragged ends" glyph
59
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
63
This is identical to the "box" glyph except that it will draw the
64
subparts of features that contain subfeatures. The subparts are not
65
connected -- use the "segments" glyph for that. "Generic" is the
66
default glyph used when not otherwise specified.
70
This glyph provides two extra options to control whether the right
71
and/or left ends of the drawn box are to be drawn "raggedly" with
72
zigzags instead of vertical lines.
80
The following options are standard among all Glyphs. See
81
L<Bio::Graphics::Glyph> for a full explanation.
83
Option Description Default
84
------ ----------- -------
86
-fgcolor Foreground color black
88
-outlinecolor Synonym for -fgcolor
90
-bgcolor Background color turquoise
92
-fillcolor Synonym for -bgcolor
94
-linewidth Line width 1
96
-height Height of glyph 10
98
-font Glyph font gdSmallFont
100
-connector Connector type 0 (false)
103
Connector color black
105
-pad_top Top padding 0
107
-pad_bottom Bottom padding 0
109
-label Whether to draw a label 0 (false)
111
-description Whether to draw a description 0 (false)
113
-strand_arrow Whether to indicate 0 (false)
116
-hilite Highlight color undef (no color)
118
-pad_top and -pad_bottom allow you to insert some blank space between
119
the glyph's boundary and its contents. This is useful if you are
120
changing the glyph's height dynamically based on its feature's score.
128
L<Bio::Graphics::Panel>,
129
L<Bio::Graphics::Glyph>,
130
L<Bio::Graphics::Glyph::arrow>,
131
L<Bio::Graphics::Glyph::cds>,
132
L<Bio::Graphics::Glyph::crossbox>,
133
L<Bio::Graphics::Glyph::diamond>,
134
L<Bio::Graphics::Glyph::dna>,
135
L<Bio::Graphics::Glyph::dot>,
136
L<Bio::Graphics::Glyph::ellipse>,
137
L<Bio::Graphics::Glyph::extending_arrow>,
138
L<Bio::Graphics::Glyph::generic>,
139
L<Bio::Graphics::Glyph::graded_segments>,
140
L<Bio::Graphics::Glyph::heterogeneous_segments>,
141
L<Bio::Graphics::Glyph::line>,
142
L<Bio::Graphics::Glyph::pinsertion>,
143
L<Bio::Graphics::Glyph::primers>,
144
L<Bio::Graphics::Glyph::rndrect>,
145
L<Bio::Graphics::Glyph::segments>,
146
L<Bio::Graphics::Glyph::ruler_arrow>,
147
L<Bio::Graphics::Glyph::toomany>,
148
L<Bio::Graphics::Glyph::transcript>,
149
L<Bio::Graphics::Glyph::transcript2>,
150
L<Bio::Graphics::Glyph::translation>,
151
L<Bio::Graphics::Glyph::triangle>,
152
L<Bio::Graphics::Glyph::xyplot>,
161
Aaron J Mackey E<lt>amackey@pcbi.upenn.eduE<gt>.
163
This library is free software; you can redistribute it and/or modify
164
it under the same terms as Perl itself. See DISCLAIMER.txt for
165
disclaimers of warranty.