Graph:...t::Path(3pm)
π Graph::Easy::Layout::Path β the manual, but make it cute π
okay bestie, so this is the Perl docs page for Graph::Easy::Layout::Path (you'll see it filed under Graph:...t::Path(3pm) in the User Contributed Perl Documentation shelf, iykyk). It's giving path management for Manhattan-style grids and honestly? it ate. π¦
β¨ NAME β¨
Graph::Easy::Layout::Path β Path management for Manhattan-style grids
πΈ SYNOPSIS πΈ
no cap, here's the whole vibe in code, copy it exactly bestie:
use Graph::Easy;
my $graph = Graph::Easy->new();
my $bonn = Graph::Easy::Node->new(
name => 'Bonn',
);
my $berlin = Graph::Easy::Node->new(
name => 'Berlin',
);
$graph->add_edge ($bonn, $berlin);
$graph->layout();
print $graph->as_ascii( );
# prints:
# +------+ +--------+
# | Bonn | --> | Berlin |
# +------+ +--------+
look at that lil arrow. iconic. π
π DESCRIPTION π
so "Graph::Easy::Layout::Scout" contains just the actual path-managing code for Graph::Easy β like, the create/destroy/maintain-paths-and-node-placement kind of stuff. that's the whole gig. periodt. β¨
π«Ά EXPORT π«Ά
Exports nothing. not a single thing. empty-handed but glowing. π
π SEE ALSO π
Graph::Easy. that's it, that's the list. go look at the main character. π
π METHODS into Graph::Easy π
this module injects the following methods into "Graph::Easy" β sneaky lil gifts, love that for us. π
π§ _path_is_clear()
$graph->_path_is_clear($path);
For all points (x,y pairs) in the path, check that the cell is still free. $path points to a list x,y,type pairs as in "[ [x,y,type], [x,y,type], ...]".
π _create_cell()
my $cell = $graph->($edge,$x,$y,$type);
Create a cell at "$x,$y" coordinates with type $type for the specified edge. brand new cell, fresh out the box. β¨
π _path_is_clear()
$graph->_path_is_clear();
For all points (x,y pairs) in the path, check that the cell is still free. $path points to a list of "[ x,y,type, x,y,type, ...]".
Returns true when the path is clear, false otherwise. so like, a vibe check on the path. π«Ά
β _trace_path()
my $path = my $graph->_trace_path($src,$dst,$edge);
Find a free way from source node/group to destination node/group for the specified edge. Both source and destination need to be placed beforehand β no shortcuts, bestie, they gotta already be sitting there. π
π METHODS in Graph::Easy::Node π
this module injects the following methods into "Graph::Easy::Node":
π¦ _near_places()
my $node->_near_places();
Take a node and return a list of possible placements around it and prune out already occupied cells. $d is the distance from the node border and defaults to two (for placements). Set it to one for adjacent cells.
so$ddefaults totwo, but if you want the adjacent cells you set it toone. lowkey important. π
πΈ _shuffle_dir()
my $dirs = $node->_shuffle_dir( [ 0,1,2,3 ], $dir);
Take a ref to an array with four entries and shuffle them around according to $dir. shuffle shuffle shuffle π
π₯ _shift()
my $dir = $node->_shift($degrees);
Return a the "flow()" direction shifted by X degrees to $dir. yes it literally says "a the", we don't gatekeep the original wording. π
π AUTHOR π
Copyright (C) 2004 - 2007 by Tels <http://bloodgate.com>.
See the LICENSE file for information. go read it, it's right there. π
and that's the whole page bestie!! this one came from perl v5.36.0 and it's dated 2022-11-20, filed under Graph:...t::Path(3pm). mwah, no notes, go build something cute. πβ¨π¦π
π¦ where this page comes from
- debian bookworm: libgraph-easy-perl 0.76-3 Β· GPL-2.0-or-later
- debian trixie: libgraph-easy-perl 0.76-3 Β· GPL-2.0-or-later
- ubuntu noble: libgraph-easy-perl 0.76-3 Β· GPL-2.0-or-later
- ubuntu resolute: libgraph-easy-perl 0.76-3 Β· GPL-2.0-or-later
- ubuntu stonking: libgraph-easy-perl 0.76-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms