Graph::Easy::Layout::Force(3pm)

Graph::Easy::Layout::Force3pm

Force-based layouter for graph::easy

Usage

        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 |
        # +------+     +-----+     +--------+

Overview

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

Nodes repell each other, while edges connecting them draw them together.

The layouter calculates the forces on each node, then moves them around according to these forces until things have settled down.

Used automatically by Graph::Easy.

Export

Exports nothing.

Methods

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

_layout_force()

Calculates the node position with a force-based method.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 4 times.

  1. 6.0
  2. 7
  3. 8
  4. 9–11
  5. 12–13

Author

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

See the LICENSE file for information.

From libgraph-easy-perl 0.76-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.