Re: Announcing Gtk2::Ex::GraphViz - 0.01
- From: ofey aikon <ofey aikon gmail com>
- To: GTK2-Perl List <gtk-perl-list gnome org>
- Subject: Re: Announcing Gtk2::Ex::GraphViz - 0.01
- Date: Sat, 29 Oct 2005 11:15:58 -0500
The package is available in CPAN.
http://search.cpan.org/~ofeyaikon/Gtk2-Ex-GraphViz-0.01/
The source can also be found at
http://cvs.sourceforge.net/viewcvs.py/gtk2-perl-ex/Gtk2-Ex/GraphViz/
On 10/29/05, ofey aikon <ofey aikon gmail com> wrote:
Gtk2::Ex::GraphViz is a Gtk2 wrapper to the GraphViz.pm module.
GraphViz package can be used to produce good-looking network graphs.
Wrapping with Gtk2 allows those graph 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.
use GraphViz;
use Gtk2::Ex::GraphViz;
# First do all the work in GraphViz.pm
my $g = GraphViz->new;
$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";
}
);
TODO:
This is just an alpha release. Only mouse-enter, mouse-exit events are
implemented. I plan to implement clicked events soon. Also performance
kinda sucks on low end machines. I'll throw in a better search
algorithm to improve the performance.
And, by the way, its LGPL.
Feedback / Suggestions welcome.
Regards,
_Ofey.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]