Graph::D3(3pm)
β¨ Graph::D3 π
okay bestie, so this is the manual page for Graph::D3(3pm), from the User Contributed Perl Documentation section. yes it's a Perl module. yes it slays. let's get into it π¦
πΈ NAME πΈ
Graph::D3 β literally just "Create ref/json to show node-edge graph with D3.js". that's the whole job. it makes the thing, you make it pretty. π
β¨ SYNOPSIS β¨
here's the vibe, copy-paste ready, no cap:
use Graph;
use Graph::D3;
my $g = new Graph(
vertices => [qw/1 2 3 4 5/],
edges => [[qw/1 2/], [qw/2 3/], [qw/3 5/], [qw/4 1/]]
);
my $d3 = new Graph::D3(graph => $g);
my $output = $d3->force_directed_graph(); #output is hash reference
$output = $d3->hierarchical_edge_bundling(); #output is hash reference
$d3 = new Graph::D3(graph => $g, type => json);
my $json = $d3->force_directed_graph(); # output is json format
$json = $d3->hierarchical_edge_bundling(); # output is json format
so like β pass your graph in, get a hash ref back. or pass type => json and get actual json instead. both methods, both formats, chef's kiss π
π DESCRIPTION π
Graph::D3 is a moudle β okay yes the original says "moudle", it's a typo and it's iconic, we keep it β that coverts a Graph object into the format that d3.js uses. that's it. that's the whole personality. the d3.js link, for the record, is http://d3js.org/ π¦
this module simply supports node-edge graph in the example. that's the scope, bestie. don't come asking it to do your taxes. π
π METHODS π
β force_directed_graph β
this one outputs the format that's used for Force Directed Graph, which is described right here:
https://gist.github.com/mbostock/4062045,http://bl.ocks.org/mbostock/4062045
note: yes, those two urls are separated by a comma with no space. that's how the original wrote it. we respect it. π«Ά
the input graph should be directed grpah β again, original spelling, keeping it, it's part of the lore now π
a Node in Graph can have a 'group' attribute so you can give it different node colors. and the default for that? all 1. β¨
also an Edge in Graph can have a 'value' attribe β the original says "attribe", we love a typo era β and its defalut (yes, another one) is all 1. π
π hierarchical_edge_bundling π
http://mbostock.github.io/d3/talk/20111116/bundle.html
the input graph shoudl be a directed graph. (spelling: preserved. drama: maintained.) π₯
a Node in Graph can have a 'size' attribute β and the Default is all 1. simple. clean. iconic. π
π AUTHOR π
Shohei Kameda <shoheik@cpan.org> β the main character who wrote all this, fr fr π«Ά
πΈ COPYRIGHT πΈ
Copyright 2013- Shohei Kameda
π LICENSE π
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt. β¨
π¦ SEE ALSO π¦
...and that's it. nothing listed. an empty section. a little void, a little mystery, very main character energy of it honestly. π
and that's the whole page bestie!! this was perl v5.34.0, dated 2022-06-14 β thank you for coming to my TED talk, now go make some graphs πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- debian bookworm: libgraph-d3-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraph-d3-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraph-d3-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraph-d3-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraph-d3-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms