Skip to main content

Directed bubble-graph visualisation with curved arrows

Project description

netbubbles

Directed bubble-graph visualisation with curved arrows

PyPI License Python 3.10+


netbubbles is a Python library for creating publication-quality bubble-graph visualisations of directed weighted networks. It uses circular nodes with curved arrow edges, supports multiple layout algorithms, and comes with domain-specific presets for biology, bibliometrics, software engineering, and more.

netbubbles preview

Features

  • Multiple layouts - circular, focus (hub-and-spoke), bilayer (concentric rings), grid, manual
  • Curved arrow edges with automatic angle spreading and arrowheads
  • Weighted edges with configurable colour/size tiers
  • Self-loop support for recursive relationships
  • Domain presets - LIANA cell-cell communication, citation networks, software dependencies, data pipelines, web graphs, social networks
  • Fully customizable - colours, fonts, shadows, highlights, background, edge styles
  • Multi-panel figures - compose multiple graphs in a single figure
  • Legend support for node colour keys
  • Graph operations - subgraph extraction, edge filtering, aggregation, node merging
  • Built on matplotlib - integrates with any matplotlib workflow

Installation

pip install netbubbles

For preset modules that use pandas:

pip install netbubbles[presets]

Quick Start

import netbubbles as nb

g = nb.BubbleGraph.from_weighted_edges(
    {("A", "B"): 10, ("B", "C"): 7, ("C", "A"): 5, ("B", "A"): 3},
    colors={"A": "#E41A1C", "B": "#377EB8", "C": "#4DAF4A"},
)

ax = nb.draw(g, title="My Network")
ax.figure.savefig("network.png", dpi=150, bbox_inches="tight")

For layouts, presets, customization and graph operations see docs/usage.md.

Gallery

Circular Layout Focus Layout Bilayer Layout
Custom Style Citation Network Social Network

Examples

15 runnable scripts covering all layouts and presets - see docs/examples.md for the full list with previews.

cd examples && python generate_all.py

Citation

If you use netbubbles in a publication, please cite it:

APA:

dam2452. (2026). netbubbles: Directed bubble-graph visualisation with curved arrows (Version 0.2.0). https://github.com/dam2452/netbubbles

BibTeX:

@software{netbubbles2026,
  title   = {netbubbles: Directed bubble-graph visualisation with curved arrows},
  author  = {dam2452},
  year    = {2026},
  version = {0.2.0},
  url     = {https://github.com/dam2452/netbubbles}
}

Contributing

Contributions are welcome! Here's how you can help:

  1. Bug reports - Open an issue with a minimal reproducible example
  2. Feature requests - Open an issue describing the use case
  3. Code contributions - Fork, create a feature branch, and open a pull request
  4. New presets - Add a new submodule under netbubbles/presets/ with a to_graph() function and an example

Development setup

git clone https://github.com/dam2452/netbubbles.git
cd netbubbles
pip install -e ".[dev]"
pytest tests/

License

This project is licensed under CC BY-NC-SA 4.0 - Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

  • Use it freely - for research, education, personal projects
  • Cite the author - attribution required in publications and derivative works
  • No commercial use - you may not sell or monetize this software
  • Share changes back - modifications must be distributed under the same license (pull requests welcome!)

See LICENSE for full details.

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

netbubbles-0.2.1.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbubbles-0.2.1-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file netbubbles-0.2.1.tar.gz.

File metadata

  • Download URL: netbubbles-0.2.1.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for netbubbles-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ad47a20c2344b3b508eba9cd4b608ed1954e7f344a69638ab5bf557977833a50
MD5 06cc48117ee221e1daecf67e44b9172e
BLAKE2b-256 becc08751d3237ef02f4881c79f7463ef1b93bbb82a00eac9284e07c99896350

See more details on using hashes here.

File details

Details for the file netbubbles-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: netbubbles-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for netbubbles-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c40e612824fa08ec19dfd7d47f4609ded9a2eb571a8e30e1462b097e4e163f7a
MD5 18bfa00572422b5baf0a75b7e3f5434d
BLAKE2b-256 8b935a249bb5d740df2da6a03796c92736ba89e4c7e34ab408aaa24d6382cb44

See more details on using hashes here.

Supported by

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