Graph:...:Force(3pm)

πŸ“¦
version 0.76 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Graph::Easy::Layout::Force πŸ’–

okay so bestie, welcome to Graph::Easy::Layout::Force, which is literally the force-based layouter for Graph::Easy β€” and yeah, this is the Graph:...:Force(3pm) page, we're just folding the manual name in up here like a cute lil name tag πŸŽ€

It's a Perl module, it's part of the User Contributed Perl Documentation, and it is obsessed with one thing: figuring out where your nodes should go. ✨


🌈 SYNOPSIS 🌈

here's the whole vibe, copy-paste ready, no cap:

use Graph::Easy;

my $graph = Graph::Easy->new();

$graph->add_edge ('Bonn', 'Berlin');
$graph->add_edge ('Bonn', 'Ulm');
$graph->add_edge ('Ulm', 'Berlin');

$graph->layout( type => 'force' );

print $graph->as_ascii( );

# prints:

#   +------------------------+
#   |                        v
# +------+     +-----+     +--------+
# | Bonn | --> | Ulm | --> | Berlin |
# +------+     +-----+     +--------+

look at that ASCII graph. iconic. it ate. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Graph::Easy::Layout::Force contains routines that calculate a force-based layout for a graph. periodt.

so here's the tea πŸ“ β€” nodes repell each other (yes, the original spells it that way and we respect the original spelling, fr fr), while the edges connecting them draw them together. it's giving magnets. it's giving "I love you but also please get out of my personal space."

The layouter calculates the forces on each node, then moves them around according to these forces until things have settled down. like, until everyone stops fidgeting and the graph chills out. ✨

and ngl, this whole thing is used automatically by Graph::Easy β€” so you don't even have to call it yourself, it just shows up and does the work like a true main character πŸ‘‘


✨ EXPORT ✨

Exports nothing.

literally nothing. zero. it's a humble queen. no exports, no drama, just vibes 🫢


🌸 SEE ALSO 🌸

  • Graph::Easy.

that's it, that's the whole list πŸ’œ


πŸ‘‘ METHODS πŸ‘‘

This module injects the following methods into Graph::Easy:

πŸ’« _layout_force()

Calculates the node position with a force-based method.

one method, one job, and she does it beautifully. πŸŽ€


πŸ’€ AUTHOR πŸ’€

Copyright (C) 2004 - 2007 by Tels <http://bloodgate.com>.

See the LICENSE file for information.

⚠️ okay bestie, real talk β€” if you're reusing this, go actually read the LICENSE file. the manpage says to, and the manpage is not playing around. πŸ™ˆ

and that's the whole page!! πŸ¦‹

cute lil sign-off time: this doc is from perl v5.36.0, dated 2022-11-20, and it lives at the Graph:...:Force(3pm) address β€” same as where we started, because everything comes full circle, slay πŸ’–βœ¨πŸŽ€