NAME
Graph::Drawing::Surface - 2D graph topology landscape
SYNOPSIS
This module does not need to be invoked explicitly, but rather, is called automatically by the parent.
Please see the Graph::Drawing
subclass SYNOPSIS
section documentation for usage.
DESCRIPTION
This module is a two dimensional graph topology landscape used by the parent to plot vertices, edges, axes and labels.
PUBLIC METHODS
- new %ARGUMENTS
-
Create and return a new surface object.
- image $OBJECT
-
An existing image object (currently a
GD::Image
object only), on which to draw the graph, may be provided.Please see the eg/image program, for an example of this in action.
- name $STRING
-
The file name (without the extension like ".png") to use when saving the image. This attribute is prepended to the
format
attribute to make the image filename.This object attribute is not required, and can be set manually with the
Graph::Drawing::Surface::write_image
method. - format 'png' | 'gif' | ...
-
The graphic file format to use when saving and is dependent upon the support with which your graphic module (as specified the
type
attribute) is compiled.This object attribute is appended (automatically) to the
name
attribute, as the "file extension", to make the image filename, if thename
attribute is provided. - type $MODULE
-
Specify the graphics module to use. Currently, this is only
GD
. (Imager
is next!) - size $PIXELS
-
The size of the (square) surface, in pixels.
If this is not set in the object construction, and there is a dataset, half the graph max weight will be used, otherwise zero (no visible image) is set as the default.
- grade $PIXELS
-
The gradation interval.
- layout ['circular' | 'rectangular']
-
The type of graph layout to use. Defaults to 'blank'.
- show_grid 0 | 1
-
Show the grid, or not. Defaults to 0.
- grid_labels 0 | 1
-
Show the grid labels or not. Defaults to 0.
* This functionality is pretty lame, right now. Labels are currently drawn in the middle of the chart, instead of on the outer edges.
- show_axes 0 | 1
-
Show the chart axes. Defaults to 0.
- show_arrows 0 | 1
-
Show edge arrows. Defaults to 1.
- vertex_labels 0 | 1
-
Show vertex labels. Defaults to 1.
- size
-
Return the
size
attribute. - write_image [$STRING]
-
Print the (binary) contents of the object's image attribute to a file, who's name, if not provided as an argument, is defined by the concatination of the object's name and format attributes.
PRIVATE METHODS
- _debug @STUFF
-
Print the contents of the argument array with a newline appended.
- draw_vertex $VERTEX
- draw_edge $VERTEX1, $VERTEX2
- draw_arrowhead $HEAD, $TAIL
SEE ALSO
TO DO
Uhh...
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2003 by Gene Boggs
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.