1
package Bio::Graphics::Glyph::wave;
4
use base qw(Bio::Graphics::Glyph::generic);
19
my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
21
my $spread = defined $self->option('spread') ? $self->option('spread') : $self->default_spread();
23
my $fg = $self->fgcolor;
25
my $height = ($y2-$y1)/2;
26
my $midY = $y1 + $height;
28
if ($self->option('circle') == 1)
30
my $radius = defined $self->option('radius') ? $self->option('radius') : $self->default_radius();
31
$gd->ellipse($x1+$radius,$midY,2*$radius,2*$radius,$fg);
35
if ($self->option('line') == 1)
39
$gd->line($x1,$midY,$x2,$midY,$fg);
45
foreach my $x ($x1..$x2)
47
my $y = -$height * sin ($spread * ($x-$x1))+$midY;
50
$gd->line($oldX,$oldY,$x,$y,$fg);
64
Bio::Graphics::Glyph::wave - The "wave" glyph
68
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
72
This glyph draws a sine wave with an optional circle in the beginning.
73
The wave can also become a straight line.
77
In addition to the common options, the following glyph-specific
78
options are recognized:
80
Option Description Default
81
------ ----------- -------
83
-spread The "spread" of the sine curve 0.3
84
Values from 0.1 to 0.5 look best
86
-line Whether to draw a line 0
87
instead of a wave (1 or 0)
89
-circle Whether to draw a circle 0
90
in the left corner (1 or 0)
92
-radius The radius of the circle 5
101
L<Bio::Graphics::Panel>,
102
L<Bio::Graphics::Glyph>,
103
L<Bio::Graphics::Glyph::arrow>,
104
L<Bio::Graphics::Glyph::cds>,
105
L<Bio::Graphics::Glyph::crossbox>,
106
L<Bio::Graphics::Glyph::diamond>,
107
L<Bio::Graphics::Glyph::dna>,
108
L<Bio::Graphics::Glyph::dot>,
109
L<Bio::Graphics::Glyph::ellipse>,
110
L<Bio::Graphics::Glyph::extending_arrow>,
111
L<Bio::Graphics::Glyph::generic>,
112
L<Bio::Graphics::Glyph::graded_segments>,
113
L<Bio::Graphics::Glyph::heterogeneous_segments>,
114
L<Bio::Graphics::Glyph::line>,
115
L<Bio::Graphics::Glyph::pinsertion>,
116
L<Bio::Graphics::Glyph::primers>,
117
L<Bio::Graphics::Glyph::rndrect>,
118
L<Bio::Graphics::Glyph::segments>,
119
L<Bio::Graphics::Glyph::ruler_arrow>,
120
L<Bio::Graphics::Glyph::toomany>,
121
L<Bio::Graphics::Glyph::transcript>,
122
L<Bio::Graphics::Glyph::transcript2>,
123
L<Bio::Graphics::Glyph::translation>,
124
L<Bio::Graphics::Glyph::triangle>,
133
Vsevolod (Simon) Ilyushchenko E<lt>simonf@cshl.eduE<gt>.
135
Copyright (c) 2004 Cold Spring Harbor Laboratory
137
This library is free software; you can redistribute it and/or modify
138
it under the same terms as Perl itself. See DISCLAIMER.txt for
139
disclaimers of warranty.