about arbor

Arbor is a graph visualization library built with web workers and jQuery. Rather than trying to be an all-encompassing framework, arbor provides an efficient, force-directed layout algorithm plus abstractions for graph organization and screen refresh handling.

It leaves the actual screen-drawing to you. This means you can use it with canvas, SVG, or even positioned HTML elements; whatever display approach is appropriate for your project and your performance needs.

As a result, the code you write with it can be focused on the things that make your project unique – the graph data and your visual style – rather than spending time on the physics math that makes the layouts possible.

installation

To use the particle system, get jQuery and add the file at lib/arbor.js to your path somewhere and include them in your HTML:

<script src="path/to/jquery.min.js"></script>

<script src="path/to/arbor.js"></script>

If you want to let arbor handle realtime color and value tweens for you, include the arbor-tween.js file as well. this will add a pair of new tweening methods to the ParticleSystem object (see the docs to decide if this appeals to you or not).

<script src="path/to/jquery.min.js"></script>

<script src="path/to/arbor.js"></script>

<script src="path/to/arbor-tween.js"></script>

getting started

The source distribution contains a sample project that demonstrates some of the basic idioms for working with the library to build a visualization. More detailed documentation can be found in the reference section.

In addition, the demos folder of the source distribution contains standalone versions of the demos on the site. But since all of them use xhr to fetch their data, you'll still need to view them from an http server. If you don't have a copy of apache handy, use the demo-server.sh script to create a local server.

Contribute

Code submissions are greatly appreciated and highly encouraged. Please send pull requests with fixes, enhancements, etc. to samizdatco on github. The oldschool may also pipe their diff -u output to gro.sjrobra@ofni .

license

Arbor is released under the MIT license.

colophon

Arbor’s design is heavily influenced by Jeffrey Bernstein’s excellent Traer Physics library for Processing. In addition, much of the brute-force physics code was originally adapted from Dennis Hotson’s springy.js.

The Barnes-Hut n-body implementation is based on Tom Ventimiglia and Kevin Wayne’s vivid description of the algorithm. Thanks to all for such elegantly simple and comprehensible code.