package Graph::D3;
use strict;
use 5.008_005;
our $VERSION = '0.03';
use Moo;
use JSON;
use Graph;
has graph => (
is => 'ro',
required => 1
);
has type => (
is => 'ro',
default =>
}
my $output = { nodes => \@nodes, links => \@links };
return $self->type eq 'json' ? encode_json $output : $output;
}
# http://mbostock.github.io/d3/talk/20111116/bundle.html
sub hierar
mports };
}
return $self->type eq 'json' ? encode_json \@bundle : \@bundle;
}
1;
__END__
=encoding utf-8
=head1 NAME
Graph::D3 - Create ref/json to show node-edge graph with D3.js
=head