Graph::Easy::Group - Represents a group of nodes in a simple graph
use Graph::Easy::Group; my $bonn = Graph::Easy::Node->new( name => 'Bonn', border => 'solid 1px black', ); my $berlin = Graph::Easy::Node->new( name => 'Berlin', ); my $cities = Graph::Easy::Group->new( name => 'Cities', ); $cities->add_nodes ($bonn); # $bonn will be ONCE in the group $cities->add_nodes ($bonn, $berlin);
A Graph::Easy::Node represents a node in a simple graph. Each node has contents (a text, an image or another graph), and dimension plus an origin. The origin is typically determined by a graph layouter module like Graph::Easy.
Graph::Easy::Node
my $group = Graph::Easy::Group->new( $options );
Create a new, empty group. $options are the possible options, see Graph::Easy::Node for a list.
$options
$last_error = $group->error(); $group->error($error); # set new messags $group->error(''); # clear error
Returns the last error message, or '' for no error.
my $ascii = $group->as_ascii();
Return the group as a little box drawn in ASCII art as a string.
my $name = $group->name();
Return the name of the group.
my $id = $group->id();
Returns the group's unique ID number.
$group->set_attribute('border-style', 'none');
Sets the specified attribute of this (and only this!) group to the specified value.
$group->add_node($node);
Add the specified node to this group.
$group->add_nodes($node, $node2, ... );
Add all the specified nodes to this group.
$group->add_cell($cell);
Add a cell to the list of cells this group covers.
my @cells = $group->cells();
Returns a list of all cells that belong to this group.
my @nodes = $group->nodes();
Returns a list of all nodes that belong to this group.
$group->clear_cells();
Clears the cells associated with this group.
my $txt = $group->as_txt();
Returns the group as Graph::Easy textual description.
None by default.
Graph::Easy.
Copyright (C) 2004 - 2005 by Tels http://bloodgate.com
See the LICENSE file for more details.
To install Graph::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graph::Easy
CPAN shell
perl -MCPAN -e shell install Graph::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.