1Graph::Easy::Layout::GrUisde(r3)Contributed Perl DocumenGtraatpiho:n:Easy::Layout::Grid(3)
2
3
4
6 Graph::Easy::Layout::Grid - Grid management and size calculation
7
9 use Graph::Easy;
10
11 my $graph = Graph::Easy->new();
12
13 my $bonn = Graph::Easy::Node->new(
14 name => 'Bonn',
15 );
16 my $berlin = Graph::Easy::Node->new(
17 name => 'Berlin',
18 );
19
20 $graph->add_edge ($bonn, $berlin);
21
22 $graph->layout();
23
24 print $graph->as_ascii( );
25
26 # prints:
27
28 # +------+ +--------+
29 # | Bonn | --> | Berlin |
30 # +------+ +--------+
31
33 "Graph::Easy::Layout::Grid" contains routines that calculate cell sizes
34 on the grid, which is necessary for ASCII, boxart and SVG output.
35
36 Used automatically by Graph::Easy.
37
39 Exports nothing.
40
42 Graph::Easy.
43
45 This module injects the following methods into Graph::Easy:
46
47 _prepare_layout()
48 my ($rows,$cols,$max_x,$max_y, \@V) = $graph->_prepare_layout();
49
50 Returns two hashes ($rows and $cols), containing the columns and rows
51 of the layout with their nec. sizes (in chars) plus the maximum
52 framebuffer size nec. for this layout. Also returns reference of a list
53 of all cells to be rendered.
54
56 Copyright (C) 2004 - 2006 by Tels <http://bloodgate.com>.
57
58 See the LICENSE file for information.
59
60
61
62perl v5.38.0 2023-07-20 Graph::Easy::Layout::Grid(3)