Graph:...t::Grid(3pm)
π Graph::Easy::Layout::Grid β the whole vibe π
okay bestie, so this is a page from the User Contributed Perl Documentation set β it's Graph::Easy::Layout::Grid(3pm), and no cap, it's the lil module that does the grid math so your graphs actually look good. pull up a chair π«Ά
β¨ NAME β¨
Graph::Easy::Layout::Grid β grid management and size calculation, periodt. π
πΈ SYNOPSIS πΈ
like, here's the whole thing in action:
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 Bonn and Berlin just vibing with an arrow between them. iconic behavior honestly. π
π¦ DESCRIPTION π¦
so Graph::Easy::Layout::Grid is holding all the routines that calculate cell sizes on the grid β which, lowkey, is the whole reason ASCII, boxart and SVG output even work. no grid math, no cute little boxes. it's giving essential. β¨
and the best part? you don't even have to call it yourself. it's used automatically by Graph::Easy. main character energy that just shows up and does the job. π
π EXPORT π
Exports nothing.
yep. zero. nada. it's not that kind of module. π
π SEE ALSO π
Graph::Easyβ go read that one too, bestie. π«Ά
π METHODS π
okay so this module injects the following methods into Graph::Easy:
π _prepare_layout()
my ($rows,$cols,$max_x,$max_y, \@V) = $graph->_prepare_layout();
here's what it hands back:
- two hashes,
$rowsand$cols, containing the columns and rows of the layout along with their nec. sizes (in chars) β yes, chars, we're counting characters here π - plus the maximum framebuffer size nec. for this layout
- and also a reference to a list of all cells to be rendered
so like, it's the pre-flight checklist before anything gets drawn. very organized. very demure. πΈ
β AUTHOR β
Copyright (C) 2004 - 2006 by Tels <http://bloodgate.com>.
See the LICENSE file for information.
fr fr, that's the whole page β nothing skipped, nothing invented. π
okay that's a wrap bestie!! this was Graph:...t::Grid(3pm) from perl v5.36.0, dated 2022-11-20, brought to you by the fine folks at User Contributed Perl Documentation. mwah, stan the grid module π§β¨π
π¦ 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