Graph.as

This program implements force-directed graph layout by ActionScript.
This program is based on Graph Drawing by Force-directed Placement / THOMAS M. J. FRUCHTERMAN AND EDWARD M. REINGOLD(pdf)

Typical usage is here.
import Graph;
import Node;

var graph:Graph = new Graph();
addChild(graph);

var n1:Node = graph.createNode(100,100); // create first node with x:100, y:100
var n2:Node = n1.add(200,200);  // add another node connected to the node

var n3:Node = graph.addNode(300,300); // create another node
n1.connect(n3); // then connect it to first node

Souce

To try,download all files above then

$ mxmlc Sample.as

VERSION HISTORY

2007-06-28 ver1.0

KNOWN BUGS

some..

Author

Masaki SAWAMURA < masaki a sawamuland.com >

if you can read japanese see my blog.

This work is licensed under the Creative Commons Attribution 3.0 License.
http://creativecommons.org/licenses/by/3.0/