Hypatia::GraphViz2 - Hypatia Bindings for GraphViz2
version 0.015
use strict; use warnings; use Hypatia; my $hypatia=Hypatia->new({ back_end=>"GraphViz2", dbi=>{ dsn=>"dbi:Pg:dbname=some_db;host=localhost", username=>"bob", password=>"dole", query=>"select a.user_id as user_1,b.user_id as user_2 from users a join users b on (a.id = b.frend_id) where a.user_id != b.user_id" } ,columns=>{v1=>"user_1",v2=>"user2"} ,directed=>1 }); # $gv2 is now a GraphViz2 object, with all of the default label, color, shape, etc settings, # except for the fact that the graph is directed my $gv2 = $hypatia->graph; $gv2->run(format=>"png",output_file=>"user_social_graph.png");
As with the other Hypatia plugins, this module extends Hypatia::Base. The API is mostly the same as that for Hypatia::Chart::Clicker, with the biggest exception being that only two column types are allowed: v1 and v2 (see below).
v1
v2
For the other attributes and methods, look at Hypatia::Base.
For now, the only acceptable column types are v1 and v2. If this attribute is not provided, then column guessing works as follows: if there are two columns, then the first is assigned to v1 and the second to v2, otherwise an error is thrown.
This boolean value determines whether or not the GraphViz2 object emitted from the graph method (see below) will represent a directed graph. The default value is 0.
graph
Returns the GraphViz2 object represented by the data, with edges represented by (non-null) (v1,v2) pairs.
(v1,v2)
Jack Maney <jack@jackmaney.com>
This software is copyright (c) 2012 by Jack Maney.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Hypatia::GraphViz2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hypatia::GraphViz2
CPAN shell
perl -MCPAN -e shell install Hypatia::GraphViz2
For more information on module installation, please visit the detailed CPAN module installation guide.