| 1 |
NAME |
| 2 |
Graph::D3 - Create ref/json to show node-edge graph with D3.js |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Graph; |
| 6 |
use Graph::D3; |
| 7 |
my $g = new Graph( |
| 8 |
vertices => [qw/1 2 3 4 5/], |
| 9 |
edges => [[qw/1 2/], [qw/2 3/], [qw/3 5/], [qw/4 1/]] |
| 10 |
); |
| 11 |
my $d3 = new Graph::D3(graph => $g); |
| 12 |
my $output = $d3->force_directed_graph(); #output is hash reference |
| 13 |
$output = $d3->hierarchical_edge_bundling(); #output is hash reference |
| 14 |
|
| 15 |
$d3 = new Graph::D3(graph => $g, type => json); |
| 16 |
my $json = $d3->force_directed_graph(); # output is json format |
| 17 |
$json = $d3->hierarchical_edge_bundling(); # output is json format |
| 18 |
|
| 19 |
DESCRIPTION |
| 20 |
Graph::D3 is a moudle to covert Graph object to the format which is used |
| 21 |
in d3.js(http://d3js.org/). This module simply supports node-edge graph |
| 22 |
in the example. |
| 23 |
|
| 24 |
METHODS |
| 25 |
force_directed_graph |
| 26 |
This outputs the format which is used for Force Directed Graph described |
| 27 |
below. |
| 28 |
|
| 29 |
https://gist.github.com/mbostock/4062045,http://bl.ocks.org/mbostock/406 |
| 30 |
2045 |
| 31 |
|
| 32 |
The input graph should be directed grpah. Node in Graph can have 'group' |
| 33 |
attribute (Default is all 1) to have different node color. Also Edge in |
| 34 |
Graph can have 'value' attribe(defalut is all 1). |
| 35 |
|
| 36 |
hierarchical_edge_bundling |
| 37 |
http://mbostock.github.io/d3/talk/20111116/bundle.html |
| 38 |
|
| 39 |
The input graph shoudl be directed graph. Node in Graph can have 'size' |
| 40 |
attribute (Default is all 1). |
| 41 |
|
| 42 |
AUTHOR |
| 43 |
Shohei Kameda <[email protected]> |
| 44 |
|
| 45 |
COPYRIGHT |
| 46 |
Copyright 2013- Shohei Kameda |
| 47 |
|
| 48 |
LICENSE |
| 49 |
This library is free software; you can redistribute it and/or modify it |
| 50 |
under the same terms as Perl itself. |
| 51 |
|
| 52 |
SEE ALSO |