Bio-Graphics

 view release on metacpan or  search on metacpan

lib/Bio/Graphics/Glyph/fixedwidth.pm  view on Meta::CPAN


  -font         Glyph font		       gdSmallFont

  -connector    Connector type                 0 (false)

  -connector_color
                Connector color                black

  -label        Whether to draw a label	       0 (false)

  -description  Whether to draw a description  0 (false)

  -hilite       Highlight color                undef (no color)

The following additional options are available to the "fixedwidth" glyph:

  Option            Description                       Default
  ------            -----------                       -------

  -fixed_width      Width of the content                 0


  -fixed_height     Height of the content                Same as -height

  -fixed_gap        Vertical gap between the box         8
                    that shows the extent of the
                    feature and the fixed-width
                    content.

                    If -fixed_gap is less than 8
                    then the diagonal connecting
                    lines are not drawn.

=head2 EXAMPLE SUBCLASS

To draw something interesting in the fixed rectangle, override the
draw_contents method. It takes four arguments consisting of the GD
object, and the left, top, right and bottom coordinates of the fixed
rectangle. Example:

 package Bio::Graphics::Glyph::fixedexample;
 use strict;
 use base 'Bio::Graphics::Glyph::fixedwidth';

 sub draw_contents {
   my $self = shift;
   my ($gd,$left,$top,$right,$bottom) = @_;
   $self->unfilled_box($gd,$left,$top,$right,$bottom);
   $gd->line($left,$top,$right,$bottom,$self->fgcolor);
   $gd->line($left,$bottom,$right,$top,$self->fgcolor);
 }

 1;

This will draw the outline of the fixed rectangle. The rectangle will
contain two diagonal lines. Not very interesting, but an example,
nonetheless.

See the stackedplot glyph for a more interesting subclass.

=head1 BUGS AND LIMITATIONS

This glyph should used as the base for the image glyph, but
isn't. This will be fixed.

=head1 SEE ALSO

L<Bio::Graphics::Panel>,
L<Bio::Graphics::Glyph>,
L<Bio::Graphics::Glyph::arrow>,
L<Bio::Graphics::Glyph::cds>,
L<Bio::Graphics::Glyph::crossbox>,
L<Bio::Graphics::Glyph::diamond>,
L<Bio::Graphics::Glyph::dna>,
L<Bio::Graphics::Glyph::dot>,
L<Bio::Graphics::Glyph::ellipse>,
L<Bio::Graphics::Glyph::extending_arrow>,
L<Bio::Graphics::Glyph::generic>,
L<Bio::Graphics::Glyph::graded_segments>,
L<Bio::Graphics::Glyph::heterogeneous_segments>,
L<Bio::Graphics::Glyph::line>,
L<Bio::Graphics::Glyph::pinsertion>,
L<Bio::Graphics::Glyph::primers>,
L<Bio::Graphics::Glyph::rndrect>,
L<Bio::Graphics::Glyph::segments>,
L<Bio::Graphics::Glyph::ruler_arrow>,
L<Bio::Graphics::Glyph::toomany>,
L<Bio::Graphics::Glyph::transcript>,
L<Bio::Graphics::Glyph::transcript2>,
L<Bio::Graphics::Glyph::translation>,
L<Bio::Graphics::Glyph::triangle>,
L<Bio::DB::GFF>,
L<Bio::SeqI>,
L<Bio::SeqFeatureI>,
L<Bio::Das>,
L<GD>

=head1 AUTHOR

Lincoln Stein E<lt>lstein@cshl.orgE<gt>

Copyright (c) 2007 Cold Spring Harbor Laboratory

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.

=cut



( run in 1.415 second using v1.01-cache-2.11-cpan-39bf76dae61 )