使用GraphViz渲染NetworkX图形
nxv的Python项目详细描述
nxv公司
使用GraphViz呈现NetworkX图形。在
文件
基本用途
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)
安装
^{pr2}$发展
此存储库使用 Poetry和 Nox 管理开发环境和构建。在
列出所有Nox会话:
python -m nox --list-sessions
要运行黑色代码格式化程序:
python -m nox -rs black
要使用flake8起绒:
python -m nox -rs lint
要运行测试套件:
python -m nox -rs tests
要构建文档:
python -m nox -rs docs
- 项目
标签: