https://github.com/twosigma/nxv
Render NetworkX graphs using GraphViz
https://github.com/twosigma/nxv
draw graph graphviz network networkx python render tree visualization visualize
Last synced: 12 months ago
JSON representation
Render NetworkX graphs using GraphViz
- Host: GitHub
- URL: https://github.com/twosigma/nxv
- Owner: twosigma
- License: apache-2.0
- Created: 2020-09-16T19:35:50.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-09-27T21:52:37.000Z (over 5 years ago)
- Last Synced: 2024-10-30T12:09:24.389Z (over 1 year ago)
- Topics: draw, graph, graphviz, network, networkx, python, render, tree, visualization, visualize
- Language: Python
- Homepage: https://nxv.readthedocs.io
- Size: 168 KB
- Stars: 5
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# nxv
[](https://pypi.python.org/pypi/nxv)
[](https://github.com/twosigma/nxv/actions)
[](https://nxv.readthedocs.io/en/latest/?badge=latest)
[](https://codecov.io/gh/twosigma/nxv)
Render NetworkX graphs using GraphViz.
# Documentation
https://nxv.readthedocs.io/
# 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](https://python-poetry.org/) and
[Nox](https://nox.thea.codes/en/stable/)
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