The missing 3D plotting functionality for networkx
Project description
nx3d
The missing 3D plotting functionality for the excellent networkx
Python package.
Installation
In your shell:
pip install nx3d
Quickstart
After installation,
From your shell
python -m nx3d
In your Python REPL
import nx3d
nx3d.demo()
Usage
In your Python code:
import networkx as nx
import nx3d
g = nx.frucht_graph()
nx3d.plot(g)
For more customization, use the nx3d.plot_nx3d()
function.
Contribute
Thank you for considering contributing to nx3d
.
Currently, there's no enforced testing, formatting, linting, or typechecking with CI. Let's say that's intentional to
keep this young project lightweight. With that in mind, the pre-commit hooks defined in .pre-commit-config.yaml
apply
linting and formatting to keep the project clean. Please use the pre-commit hooks before opening a PR.
Clone the code
Setup the development environment
You can do this as you like, though you might consider:
- Install
poetry
- Run
poetry shell
- Run
poetry install
- Verify the installation by running
python -m nx3d
Set up pre-commit
From this project's root, initialize pre-commit as follows:
pre-commit install
pre-commit run -a
Update the docs
- Update the inline docstrings and/or the files in the docs/ directory.
- Navigate to the docs/ dir and run
make html
to preview your changes. - When you cut a PR, the CI will trigger a ReadTheDocs build.
- When merged, the CD will publish those docs (3).
First time updating the docs
I used brew install python-sphinx
, see installation instructions on www.sphinx-doc.org.
Hack on some code
- heterogeneous sizes and colors
- node labels
- edge labels
- support for DiGraph and MultiDiGraph
- tests
- for the trig: add collision nodes to the ends of the edges and check that they collide with source and sink nodes
- for the API: fizzbuzz it, check some basic content of the ShowBase returned by
plot_nx3d
- CI running the tests and a badge
- interactive camera controls
- animation control via callbacks
- save video / snapshot to file (https://docs.panda3d.org/1.10/python/reference/direct.showbase.ShowBase?highlight=screenshot#direct.showbase.ShowBase.ShowBase.movie)
Open a PR
- fork this repo
- push your code to your repo
- open a pull request against this repo
When it merges, CD will push to PyPi.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nx3d-22.9.3.tar.gz
.
File metadata
- Download URL: nx3d-22.9.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.9.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97fb3b8778eb857c3537c3e356daa811bc99f8fe413e50ec95f7d255df2562a |
|
MD5 | 734f46fb80fa26b6f1a8e53cbd73ba8d |
|
BLAKE2b-256 | b06b8dedec0bfda0a6f8c0e45e07138d46b27f6b222f94914321681666004a67 |
File details
Details for the file nx3d-22.9.3-py3-none-any.whl
.
File metadata
- Download URL: nx3d-22.9.3-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.9.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7530ab4436f30988d49dfd6a88c9b8660f36613706eb1fba81bc955b733c158b |
|
MD5 | 5fce5641a618731c1352a55304103e7e |
|
BLAKE2b-256 | 9769d6f16c44a7c3c21ba472f845a04e8bddcfa8e17a5a8ac6ce71c49cb29b80 |