Graph::Easy::Cluster - Nodes positioned relatively to each other
use Graph::Easy::Cluster; my $bonn = Graph::Easy::Node->new( name => 'Bonn', border => 'solid 1px black', pos => '0,0', ); my $berlin = Graph::Easy::Node->new( name => 'Berlin', pos => '1,0', ); my $cities = Graph::Easy::Cluster->new(); $cities->add_node ($bonn); # $bonn will be ONCE in the group $cities->add_nodes ($bonn, $berlin); $cities->set_center($bonn);
A Graph::Easy::Cluster represents a group of nodes that are all positioned relatively to each other.
Graph::Easy::Cluster
my $cluster = Graph::Easy::Group->new( $options );
Create a new, empty cluster. $options are the possible options, see Graph::Easy::Node for a list. At least an unique name should be passed as option.
$options
name
$last_error = $group->error(); $group->error($error); # set new messags $group->error(''); # clear error
Returns the last error message, or '' for no error.
my $name = $cluster->name();
Return the name of the cluster.
my @nodes = $cluster->nodes();
Return all nodes in the cluster.
my $center = $cluster->center_node(); $cluster->center_node($new_center);
Get or set the center node. All other nodes will be positioned relatively to the position of the center node.
$cluster->add_node( $node );
Add one node to the cluster.
Note: You need to call $node-add_to_cluster($cluster)> afterwards, too.
$node-
$cluster->add_nodes( @nodes );
Add one or more nodes to the cluster.
Note: You need to call $node-add_to_cluster($cluster)> for each node, too.
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.