Graph::D3(3pm)

πŸ“¦
version 0.03 Β· 2 versions
  • 0.03 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.03 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 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