Ubigraph - Perl client of Ubigraph software


Ubigraph documentation Contained in the Ubigraph distribution.

Index


Code Index:

NAME

Top

Ubigraph - Perl client of Ubigraph software

SYNOPSIS

Top

    use Ubigraph;

    my $u = new Ubigraph();

    my $v1 = $u->Vertex();
    my $v2 = $u->Vertex(shape=>"sphere");

    my $e1 = $u->Edge($v1, $v2);

    $v1->shape("torus");
    $v1->size(3.5);

    sleep(2);

    $u->clear();

    my @v;
    for (0..100){
        $v[$_] = $u->Vertex();
    }

    for (0..100){
        $u->Edge($v[int(rand(100))], $v[int(rand(100))]);
        select(undef, undef, undef, 0.05);
    }







DESCRIPTION

Top

Ubigraph is a Perl client interface for the UbiGraph software (http://ubietylab.net/ubigraph/) with object-oriented abstraction over the XML-RPC calls. UbiGraph is a client-server software for 3D visualization and layout of graph-theoretical network diagrams. This module hides the XML-RPC calls and allows visualization through object-oriented access to Vertex and Edge objects, similar to Python and Ruby APIs.

EXPORT

None by default.

Ubigraph class

Top

$u = new Ubigraph()
$u = new Ubigraph($url)

The constructor of Ubigraph class starts the XML::RPC binding to Ubigraph server. Default url to bind is 'http://127.0.0.1:20738/RPC2'.

$u->clear()

This method clears all entities.

$vertex = $u->Vertex()
$vertex = $u->newVertex()
$vertex = $u->Vertex(%parameters)
$vertex = $u->newVertex(%parameters)

These class methods create a vertex (Ubigraph::Vertex instance), optionally with hash of parameters.

$edge = $u->Edge($v1, $v2)
$edge = $u->newEdge($v1, $v2)
$edge = $u->Edge($v1, $v2, %parameters)
$edge = $u->newEdge($v1, $v2, %parameters)

These class methods create an edge (Ubigraph::Edge instance), optionally with hash of parameters.

Ubigraph::Vertex class

Top

The following method removes the vertex.

$vertex->remove()

The following methods change the corresponding vertex parameters.

$vertex->color($color)
$vertex->shape($shape)
$vertex->shapedetail($shapedetail)
$vertex->label($label)
$vertex->size($size)
$vertex->fontcolor($fontcolor)
$vertex->fontfamily($fontfamily)
$vertex->fontsize($fontsize)
$vertex->callback_left_doubleclick($url)

Ubigraph::Edge class

Top

The following method removes the edge.

$edge->remove()

The following methods change the corresponding edge parameters.

$edge->arrow($arrow)
$edge->arrow_position($arrow_position)
$edge->arrow_radius($arrow_radius)
$edge->arrow_length($arrow_length)
$edge->arrow_reverse($arrow_reverse)
$edge->color($color)
$edge->label($label)
$edge->fontcolor($fontcolor)
$edge->fontfamily($fontfamily)
$edge->fontsize($fontsize)
$edge->oriented($oriented)
$edge->spline($spline)
$edge->showstrain($showstrain)
$edge->stroke($stroke)
$edge->strength($strength)
$edge->visible($visible)
$edge->width($width)

SEE ALSO

Top

For the details of the parameters, users should refer to the UbiGraph XML-RPC Manual (http://ubietylab.net/ubigraph/content/Docs/index.html).

AUTHOR

Top

Kazuharu Arakawa <gaou@sfc.keio.ac.jp> Kazuki Oshita <cory@g-language.org>

COPYRIGHT AND LICENSE

Top


Ubigraph documentation Contained in the Ubigraph distribution.

package Ubigraph;

use 5.006;
use strict;
use warnings;
use Frontier::Client;

use Ubigraph::Edge;
use Ubigraph::Vertex;

our $VERSION = '0.05';


sub new {
    my $pkg = shift;
    my $url = shift || 'http://127.0.0.1:20738/RPC2';
    my $this = {};
    bless $this;

    $this->{'client'} = Frontier::Client->new(url=>$url);
    $this->clear();

    return $this;
}


sub clear {
    my $this = shift;
    $this->{'client'}->call('ubigraph.clear', 0);
}


sub Vertex{
    return new Ubigraph::Vertex(@_);
}

sub newVertex{
    return new Ubigraph::Vertex(@_);
}

sub Edge{
    return new Ubigraph::Edge(@_);
}

sub newEdge{
    return new Ubigraph::Edge(@_);
}



1;
__END__
# Below is stub documentation for your module. You'd better edit it!