https://github.com/ryanrudes/forceatlas
Gephi ForceAtlas2 with networkx compatibility and support for thread-based parallelism
https://github.com/ryanrudes/forceatlas
force-directed-graphs forceatlas2 graph-layout multithreading networkx
Last synced: 8 months ago
JSON representation
Gephi ForceAtlas2 with networkx compatibility and support for thread-based parallelism
- Host: GitHub
- URL: https://github.com/ryanrudes/forceatlas
- Owner: ryanrudes
- License: gpl-3.0
- Created: 2022-07-23T19:03:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T22:25:11.000Z (almost 2 years ago)
- Last Synced: 2025-10-14T05:57:56.568Z (8 months ago)
- Topics: force-directed-graphs, forceatlas2, graph-layout, multithreading, networkx
- Language: Python
- Homepage:
- Size: 57 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gephi ForceAtlas2
[](https://pypi.python.org/pypi/forceatlas/)
[](https://pypi.python.org/pypi/forceatlas/)
[](https://pypi.python.org/pypi/forceatlas/)

This package is a Python-friendly port of the multithreaded [Java implementation](https://github.com/klarman-cell-observatory/forceatlas2) of the Gephi ForceAtlas2 layout algorithm. It is compatible with [networkx](https://github.com/networkx/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.
```python
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")
```