NAME

Graph::Simple::Cluster - Nodes positioned relatively to each other

SYNOPSIS

        use Graph::Simple::Cluster;

	my $bonn = Graph::Simple::Node->new(
		name => 'Bonn',
		border => 'solid 1px black',
		pos => '0,0',
	);
	my $berlin = Graph::Simple::Node->new(
		name => 'Berlin',
		pos => '1,0',
	);
	my $cities = Graph::Simple::Cluster->new();

	$cities->add_node ($bonn);
	# $bonn will be ONCE in the group
	$cities->add_nodes ($bonn, $berlin);
	$cities->set_center($bonn);

DESCRIPTION

A Graph::Simple::Cluster represents a group of nodes that are all positioned relatively to each other.

METHODS

new()

my $group = Graph::Simple::Group->new( $options );

Create a new, empty group. $options are the possible options, see Graph::Simple::Node for a list.

error()

$last_error = $group->error();

$group->error($error);			# set new messags
$group->error('');			# clear error

Returns the last error message, or '' for no error.

as_ascii()

my $ascii = $group->as_ascii();

Return the group as a little box drawn in ASCII art as a string.

name()

my $name = $group->name();

Return the name of the group.

contents()

my $contents = $node->contents();

For nested nodes, returns the contents of the node.

width()

my $width = $node->width();

Returns the width of the node. This is a unitless number.

height()

my $height = $node->height();

Returns the height of the node. This is a unitless number.

pos()

my ($x,$y) = $node->pos();

Returns the position of the node. Initially, this is undef, and will be set from Graph::Simple::layout.

x()

my $x = $node->x();

Returns the X position of the node. Initially, this is undef, and will be set from Graph::Simple::layout.

y()

my $y = $node->y();

Returns the Y position of the node. Initially, this is undef, and will be set from Graph::Simple::layout.

id()

my $id = $node->id();

Returns the node's unique ID number.

predecessors()

my @pre = $node->predecessors();

Returns all nodes (as objects) that link to us.

successors()

my @suc = $node->successors();

Returns all nodes (as objects) that we are linking to.

EXPORT

None by default.

SEE ALSO

Graph::Simple.

AUTHOR

Copyright (C) 2004 - 2005 by Tels http://bloodgate.com

See the LICENSE file for more details.