Gtk2::Ex::GraphViz - A Gtk2 wrapper to the GraphViz.pm module.


Gtk2-Ex-GraphViz documentation  | view source Contained in the Gtk2-Ex-GraphViz distribution.

Index


NAME

Top

Gtk2::Ex::GraphViz - A Gtk2 wrapper to the GraphViz.pm module.

DESCRIPTION

Top

GraphViz can be used to produce good-looking network graphs. Wrapping with Gtk2 allows those images to respond to events such as mouse-over, clicked etc.

By implementing callbacks to the respective signals, you can create fairly interactive network graphs. For example, when the user double-clicks a node, you can open up a widget that contains information on that node.

SYNOPSIS

Top

	use GraphViz;
	use Gtk2::Ex::GraphViz;
	my $g = GraphViz->new; # First do all the work in GraphViz.pm
	$g->add_node('London', shape => 'box', fillcolor =>'lightblue', style =>'filled',);
	$g->add_node('Paris', label => 'City of\nlurve', );
	$g->add_edge('London' => 'Paris');
	# Now the actual Gtk2::Ex::GraphViz portion takes over
	my $graphviz = Gtk2::Ex::GraphViz->new($g);
	$graphviz->signal_connect ('mouse-enter-node' => 
		sub {
			my ($self, $x, $y, $nodename) = @_;
			my $nodetitle = $graphviz->{svgdata}->{g}->{g}->{$nodename}->{title};
			print "Node : $nodetitle : $x, $y\n";
		}
	);




METHODS

Top

new;

The constructor accepts a GraphViz object as the first argument.

	my $g = GraphViz->new; # First do all the work in GraphViz.pm
	my $graphviz = Gtk2::Ex::GraphViz->new($g);

get_widget;

Returns the widget that can be added to any container and presented in a window.

signal_connect($signal, $callback);

See the SIGNALS section to see the supported signals.

SIGNALS

Top

mouse-enter-node;

mouse-exit-node;

mouse-enter-edge;

mouse-exit-edge;

SEE ALSO

Top

GraphViz

COPYRIGHT & LICENSE

Top


Gtk2-Ex-GraphViz documentation  | view source Contained in the Gtk2-Ex-GraphViz distribution.