The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GO::View::GD - a helper class for GO::View to deal with the image

SYNOPSIS

use GO::View::GD;

To instantiate a new GO::View::GD object, you may use following syntax:

    my $gd = GO::View::GD->new(width  => $imgWidth,
                               height => $imgHeight);               

my $im = $gd->im; my $white = $gd->white; my $red = $gd->red;

and more ......

new

  Title    : new
  Function : Creates a new GO::View::GD object
           : recognized named parameters are height and width
             both of which must be provided.
  Returns  : a GO::View::GD object
  Args     : the named parameters

im

This method returns the internal GD::Image object

height

This method returns the height that was used to instantiate the object

width

This method returns the width that was used to instantiate the object

white1 =head2 black

blue =head2 blue1 =head2 blue2 =head2 blue3 =head2 blue4 =head2 blue5

lightBlue =head2 darkBlue

darkGreen =head2 green =head2 green1 =head2 green2 =head2 green3 =head2 green4 =head2 green5

grey =head2 darkGrey =head2 lightGrey

magenta =head2 magenta1 =head2 magenta2 =head2 magenta3 =head2 magenta4 =head2 magenta5

maroon

orange =head2 orange1

red =head2 red1 =head2 red2 =head2 red3 =head2 red4

tan =head2 tan1

white

yellow =head2 yellow1 =head2 yellow2 =head2 yellow3

chartreuse

cenColor

sagecolor1 =head2 sagecolor2 =head2 sagecolor3 =head2 sagecolor4

drawFrameWithLabelAndDate

This method draws a blue frame around the image with date at the right bottom corner and image label on the left bottom corner if there is a label passed in. The date and label will be printed in red

Usage:

   $gd->drawFrameWithLabelAndDate;

Optional arguments:

'date', which is a string indicating the date, otherwise the current date will be determined and used. The date will be printed in red in the lower right hand corner.

'text', which is a string that can be used to label the image. This will printed in the lower left hand corner of the image.

drawBar

This method draws a rectangle for a given coordinate set and creates a link for the box if there is a linkUrl passed in. The link for the box is in the form of text that can be placed in an image map on an html page. The text for that is currently printed to STDOUT.

Usage:

  $gd->drawBar(barColor  => $gd->blue,
               numX1     => $X1,
               numX2     => $X2,
               numY      => $Y,
               linkUrl   => $linkUrl,
               barHeight => $barHeight,
               outline   => 1,
               arrow     => 'up');

Required Arguments:

barColor : The color of the box numX1 : The left-hand x-coordinate of the box numX2 : The right-hand x-coordinate of the box numY : The top y coorinate of the box

Optional Arguments:

strand : ??? - left over from use in SGDs ORF Map linkUrl : A url to which you would like the box to be linked barHeight : The height of the box - will be used to determine the bottom y-coordinate of the box - default is 4 pixels outlineColor : The color in which to outline the box onInfoText : Information text that can used for mouseovers

arrow : The type of arrowhead desired on the box. One of up, down, left, right, which indicates the direction in which the arrow head should point arrowHeight : The height of the arrowhead

drawName

This method draws a string and creates a link for it if there is a linkUrl passed in. The link is in the form of text that can be placed in an image map on an html page. The text for that is currently printed to STDOUT.

Usage:

    $gd->drawName(name=>" = GO term with child(ren)",
                  nameColor=>$gd->black,  
                  numX1=>$numX1,
                  numY=>$y-2);

Required Arguments:

name : The text that should be printed on the image nameColor : The color in which the text should be written numX1 : The X-coordinate where the text should be printed numY : The Y-coordinate where the text should be printed

Optional Arguments

linkUrl : A url to which you would like the text to be linked

imageMap

 Title    : imageMap
 Usage    : my $map = $goView->imageMap;
 Function : returns the text that constitutes an image map for the
            created image.

            During creation of various glyphs, that have had a URL
            passed in to which they could link, text that can be used
            as an image map for the image, within a web page, will be
            generated.  When all glyphs have been added to the image,
            you can retrieve the image map text.  It then needs to be
            wrapped in a <MAP>...</MAP> declaration, and the html that
            displays the image will need to refer to the image, eg:

            <MAP NAME='blah'>

            _IMAGE_MAP_TEXT_HERE_

            </MAP>
            <img src='http::/some.url.here/xxx/gif' usemap='#blah'>

            Note that the map and the usemap tag have the same name.

 Returns  : a string

_appendToMap

This protected method appends the passed in string onto the image map that is generated for the image that is also created by this module

Usage:

    $self->_appendToMap($text);

AUTHOR

Shuai Weng (shuai@genome.stanford.edu)