Skip to main content

Dash Interactive Graphviz

Dash Interactive Graphviz renders the graphviz or dot language in a dash component.

Graphviz is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.

It supports:

  • Displaying graphviz sources as a graph
  • Rendering is fully client side
  • Zooming and Panning around the graph (With a reset)
  • Selecting nodes
  • Animation between different graphs

Usage

You can install with pip (or anything else)

pip install dash_interactive_graphviz

Usage is simple, below shows how to instantiate the component on its own.

import dash_interactive_graphviz

dot_source = """
digraph  {
  node[style="filled"]
  a ->b->d
  a->c->d
}
"""

dash_interactive_graphviz.DashInteractiveGraphviz(
    id="graph",
    dot_source=dot_source
)

When a node or edge is clicked the selected_node or selected_edge property will change.

NOTE [Pending deprecation] selected is replaced by selected_node.

Hooks on selected graph elements allow you to change elements of your Dash app when a graph element is selected. For example:

@app.callback(
    Output( ..., ... ),
    [Input('graph', 'selected_node')]
)
def change_my_view(selected):
    # Do something with selected

You can see a basic example in usage.py.

Often you may want to update the dot_source based on the selected graph element. This is supported, and you can see an example in usage_highlighting.py.

You can change the layout engine through the engine prop. See https://github.com/magjac/d3-graphviz#graphviz_engine for more information.

Behaviour

The following behaviors are enabled:

  • When the dot_source is changed the graph will smoothly animate between the two states.
  • You can click and drag the graph around
  • You can zoom in and out with the scroll wheel
  • You can reset the graph position and zoom by clicking the reset icon in teh top right corner
  • The graph pane will size to whet ever it's parents size is, the graph will re-render but the re-render is debounced so as not to overload the browser.
  • You can select a graph element (node or edge) which will fire an update to any dash callbacks that are connected.
  • You can change the layout engine

Release files for dash-interactive-graphviz 0.3.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 dash-interactive-graphviz 0.3.0
File Size Uploaded
dash_interactive_graphviz-0.3.0.tar.gz 2.0 MB Details

Release files / dash_interactive_graphviz-0.3.0.tar.gz

Download URL dash_interactive_graphviz-0.3.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
84bf319e4272bc08a23e47a643c3c69a847c7e10418099a7e21f4f2588fc37b8
BLAKE2b-256 checksum
How to use checksums
1957f960449e985f7e0360d8b5c15e2fa7c80d0c0e5a6c4a5d3eac7ae747bac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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