Skip to main content

Experimental library to visualize complex networks

Project description

Build Test and Publish

Helios

Helios is a python library implemented in C for layouting and visualizing complex networks.

Layout

Helios implements a force layout algorithm based on the FR algorithm [1].

Install

Requires python headers and a C11 compatible compiler, such as gcc or clang.

To install it, simply run:

pip install helios

or clone this repository and install it from master by running:

pip install git+git://github.com/heliosnet/helios-core.git

Usage

Currently only the FR layout interface is implemented.

Example initialization with a small network.

import numpy as np
import helios

positions = np.random.random((4, 3))

edges = np.array([
  [0,1],
  [2,3]
],dtype=np.uint64)

# positions is required to be an contiguous float32 numpy array
positions = np.ascontiguousarray(positions,dtype=np.float32)

# edges is required to be an contiguous uint64 numpy array
edges = np.ascontiguousarray(edges,dtype=np.uint64)

# speeds is required to be an contiguous uint64 numpy array
speeds = np.zeros(positions.shape,dtype=np.float32)

layout = helios.FRLayout(edges,positions,speeds)

Two APIS are available to iterate the layouts, synchronized and aynchronous.

Example of the synchronized API:

print("Initial positions:")
print(layout.positions)
layout.iterate(iterations=100)
print("Final positions:")
print(layout.positions)

Example using the aynchronous API:

print("Initial positions:")
print(layout.positions)
if(layout.running()): #False
  print("It is running...")
else:
  print("Not running...")
layout.start()
time.sleep(1)
print("Current positions:")
print(layout.positions)
time.sleep(1)
print("Current positions:")
print(layout.positions)
if(layout.running()): #True
  print("It is running...")
else:
  print("Not running...")
layout.stop()
print("Final positions:")
print(layout.positions)

You can restart the layout once it stopped. Subsequent calls to the start method have no effect if the layout is running.

Compiling on windows:

You need m2w64 and libpython to compile it.

conda install -c anaconda libpython
conda install -c msys2 m2w64-toolchain

You can now use pip install:

pip install ./

or compile distribs:

python setup.py sdist bdist_wheel

Creating a build environment using:

conda create -n buildpy36 -c default -c anaconda -c msys2 python=3.6 numpy libpython m2w64-toolchain 

change python=3.6 and buildpy36 to the version of python you would like to use.

References

[1] Fruchterman, T. M. J., & Reingold, E. M. (1991). Graph Drawing by Force-Directed Placement. Software: Practice and Experience, 21(11).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helios-0.2.3.tar.gz (63.7 kB view hashes)

Uploaded Source

Built Distributions

helios-0.2.3-pp37-pypy37_pp73-manylinux2010_x86_64.whl (136.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

helios-0.2.3-pp36-pypy36_pp73-manylinux2010_x86_64.whl (136.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

helios-0.2.3-cp39-cp39-win_amd64.whl (97.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

helios-0.2.3-cp39-cp39-manylinux2010_x86_64.whl (325.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

helios-0.2.3-cp39-cp39-manylinux2010_i686.whl (286.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

helios-0.2.3-cp39-cp39-macosx_10_14_x86_64.whl (59.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

helios-0.2.3-cp38-cp38-win_amd64.whl (97.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

helios-0.2.3-cp38-cp38-manylinux2010_x86_64.whl (325.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

helios-0.2.3-cp38-cp38-manylinux2010_i686.whl (286.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

helios-0.2.3-cp38-cp38-macosx_10_14_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

helios-0.2.3-cp37-cp37m-win_amd64.whl (97.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

helios-0.2.3-cp37-cp37m-manylinux2010_x86_64.whl (326.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

helios-0.2.3-cp37-cp37m-manylinux2010_i686.whl (286.2 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

helios-0.2.3-cp37-cp37m-macosx_10_14_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

helios-0.2.3-cp36-cp36m-win_amd64.whl (97.2 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

helios-0.2.3-cp36-cp36m-manylinux2010_x86_64.whl (324.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

helios-0.2.3-cp36-cp36m-manylinux2010_i686.whl (285.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

helios-0.2.3-cp36-cp36m-macosx_10_14_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page