skieffer / hola

Human-like Orthogonal Layout Algorithm
47 stars 10 forks source link

ATTENTION:

This repository is no longer the recommended way to use HOLA. The algorithm is now included in the Adaptagrams C++ library.

There are no plans to update to Python3. If you wish to use HOLA via Python it is recommended that you use SWIG in combination with Adaptagrams.


HOLA

HOLA ("Human-like Orthogonal Layout Algorithm") is a new graph layout algorithm developed by Steve Kieffer, Tim Dwyer, Kim Marriott, and Michael Wybrow, in the MArVL: Monash Adaptive Visualisation Lab at Monash University in Melbourne, Australia. The Python library was written by Steve Kieffer.

In order to use this library you need SWIG, as well as Adapaca, which is an experimental fork of the Adaptagrams layout library.

Currently the HOLA library provides read/write support only for the GML file format. It comes bundled with SPARK, which it uses to parse GML.

How to cite?

If you refer to HOLA in your own research or publications, please cite the following reference:

Installing

The following steps can be taken on Linux or Mac; Windows users should be able to do something similar.

  1. Clone the HOLA repository into a directory of your choice, HOLADIR.

  2. Clone Adapaca into a directory of your choice, ADAPDIR.

  3. Follow the instructions at the Adaptagrams repository page to build Adaptagrams.

  4. As mentioned at that page, Python bindings for Adaptagrams can be generated using SWIG. After building Adaptagrams you should be able to create the SWIG bindings with the following commands:

    $ cd ADAPDIR/cola
    $ make -f Makefile-swig-python
  5. Finally, you need to create a link from the HOLA library to Adaptagrams:

    $ cd ADAPDIR/cola
    $ touch __init__.py
    $ cd HOLADIR
    $ ln -s ADAPDIR/cola adaptagrams

Using HOLA

For the sake of running a quick test with basic configuration, HOLA can be used from the command line as follows:

$ HOLADIR/hola_basic < input.gml > output.gml

For more serious use of the library you may add HOLADIR to your PYTHONPATH. You can then import the main algorithm with

from hola.hola import hola

and the configuration class with

from hola.hola import HolaConfig

For further help please see the docstrings in the hola and other modules of the library.