Compute fast network layouts. Intended as the upstream companion for iplotx.
NOTE: This software is alpha quality. The API is very much in flux, and the documentation is sparse. Use at your own risk.
pip install ilayoutxTo include support for fast arithmetic, parallelisation, and visualisation:
pip install ilayoutx[all]- Documentation: https://ilayoutx.readthedocs.io/en/main
- Issues: https://todo.sr.ht/~iosonofabio/ilayoutx
- Mailing list: https://lists.sr.ht/~iosonofabio/ilayoutx-dev
- Pull Requests: This project prefers patches via the mailing list, however PRs on GitHub are currently accepted.
import networkx as nx
import ilayoutx as ilx
G = nx.circulant_graph(4, [1])
layout = ilx.layouts.multidimensional_scaling(G)-
Shapes:
- line
- circle (supports vertex sizes)
- shell
- spiral
-
Grid or lattice:
- square
- triangular
-
Force-directed:
-
Directed acyclic graphs (DAGs):
- Sugiyama including edge routing (only for directed graphs ATM).
-
Machine learning:
- UMAP (supports arbitrary graphs, not just knn graphs)
-
Other:
- bipartite
- multipartite
- random (supports vertex sizes)
- multidimensional scaling (MDS)
- Circular packing (via circlify)
- Rectangular packing (via rectangle-packer)
ilayoutx includes routines to route edges in a visually pleasing way. This is generally tricky not only because
aesthetics are subjective, but also because the task is somewhat dependent on the level of zoom of the downstream
visualisation (intuitively, when zoomed out, things tend to look more crowded). Edge routing can be used in
iplotx via the waypoints keyword argument of the network function.
The following edge routing algorithms are implemented:
- Sugiyama edge routing for DAGs.
- Tree-like:
- Reingold-Tilford
The layout code is in Rust and exposed to Python via the amazing PyO3, with the goal to combine speed (by the machine) with comfort (for the user).
I'm a rust beginner, please be kind when judging this codebase. Feel free to open an issue on SourceHut if you have questions.
Fabio Zanini (https://fabilab.org)