Skip to main content

DAGVIZ

DAGVIZ offers a "git log"-like visualization for DAGs represented in networkx.

Installation

DAGVIZ can be installed with pip:

pip install dagviz

Documentation

Documentation is available at https://wimyedema.github.io/dagviz/.

Usage

DAGVIZ relies on networkx for the representation and manipulation of the DAG. An SVG file can be generated as follows:

    import dagviz
    import networkx as nx
    # Create the DAG
    G = nx.DiGraph()
    for i in range(5):
        G.add_node(f"n{i}")
    G.add_edge(f"n0", f"n1")
    G.add_edge(f"n0", f"n2")
    G.add_edge(f"n0", f"n4")
    G.add_edge(f"n1", f"n3")
    G.add_edge(f"n2", f"n3")
    G.add_edge(f"n3", f"n4")
    # Create an SVG as a string
    r = dagviz.render_svg(G)
    with open("simple.svg", "wt") as fs:
        fs.write(r)

Custom styling

The Metro style can be customized using StyleConfig. This is especially useful for rendering on dark backgrounds:

    from dagviz.style.metro import svg_renderer, StyleConfig

    dark_style = svg_renderer(StyleConfig(
        node_stroke="black",
        label_font_color="white",
        bridge_color="black",
        label_arrow_stroke="grey",
    ))

    r = dagviz.render_svg(G, style=dark_style)

See the Metro styling notebook for a full overview of all available options.

Release files for dagviz 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dagviz 0.6.0
File Size Uploaded
dagviz-0.6.0.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dagviz 0.6.0
File Interpreter ABI Platform
dagviz-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / dagviz-0.6.0.tar.gz

Download URL dagviz-0.6.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f94bd0d745d042c4345a336abda9298928a81a9e4e042ef6c8cf930099c2ab8
BLAKE2b-256 checksum
How to use checksums
0206914b79ce7b37a4793ac247eaebc4d0a00b3b402ed7cfb3d301bb2cfd0f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / dagviz-0.6.0-py3-none-any.whl

Download URL dagviz-0.6.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
800ab8c93f6defe1a699d5c69317d17b7409944d7e93073967ee456bdaee829c
BLAKE2b-256 checksum
How to use checksums
3482618a099c8feb1feb16f12b05058c4359ade373a858ae2e052425bca20dca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page