forceatlas

Python-friendly ForceAtlas2 library with networkx compatibility and support for thread-based parallelism


Keywords
multithreading, networkx, forceatlas2, graph-layout, force-directed-graphs
License
GPL-3.0+
Install
pip install forceatlas==0.1.0

Documentation

Gephi ForceAtlas2

PyPI download month PyPI - Status PyPI GitHub

This package is a Python-friendly port of the multithreaded Java implementation of the Gephi ForceAtlas2 layout algorithm. It is compatible with networkx and supports both 2D and 3D layout.

Installation

It can be installed with the default Python package manager via the command

pip install forceatlas

Example

The package is consistent with networkx in documentation-style and function arguments. See the documentation for more details.

import matplotlib.pyplot as plt
import forceatlas as fa2
import networkx as nx

G = nx.fast_gnp_random_graph(100, 0.1)
pos = fa2.fa2_layout(G, iterations = 10000, threshold = 1e-3)

nx.draw(G)
plt.savefig("graph.png")