1Graph::Easy::Layout(3)User Contributed Perl DocumentationGraph::Easy::Layout(3)
2
3
4
6 Graph::Easy::Layout - Layout the graph from Graph::Easy
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" contains just the actual layout code for
34 Graph::Easy.
35
37 "Graph::Easy::Layout" injects the following methods into the
38 "Graph::Easy" namespace:
39
40 layout()
41 $graph->layout();
42
43 Layout the actual graph.
44
45 _assign_ranks()
46 $graph->_assign_ranks();
47
48 Used by "layout()" to assign each node a rank, so they can be sorted
49 and grouped on these.
50
51 _optimize_layout
52 Used by "layout()" to optimize the layout as a last step.
53
55 Exports nothing.
56
58 Graph::Easy.
59
61 Copyright (C) 2004 - 2008 by Tels <http://bloodgate.com>
62
63 See the LICENSE file for information.
64
65
66
67perl v5.28.0 2016-06-06 Graph::Easy::Layout(3)