Render NetworkX graphs using GraphViz
Project description
nxv
Render NetworkX graphs using GraphViz.
Documentation
Basic Usage
import networkx as nx
import nxv
graph = nx.Graph()
graph.add_edge("A", "B")
graph.add_edge("B", "C")
graph.add_edge("C", "D")
graph.add_edge("B", "E")
style = nxv.Style(
graph={"rankdir": "LR"},
node=lambda u, d: {"shape": "circle" if u in "AEIOU" else "square"},
edge=lambda u, v, d: {"style": "dashed", "label": u + v},
)
nxv.render(graph, style)
Installation
pip install nxv
Development
This repository uses Poetry and Nox to manage the development environment and builds.
To list all Nox sessions:
python -m nox --list-sessions
To run the black code formatter:
python -m nox -rs black
To lint using flake8:
python -m nox -rs lint
To run the test suite:
python -m nox -rs tests
To build the documentation:
python -m nox -rs docs
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
nxv-0.1.3.tar.gz
(16.2 kB
view hashes)
Built Distribution
nxv-0.1.3-py3-none-any.whl
(26.2 kB
view hashes)