npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dash_interactive_graphviz

v0.2.1

Published

An interactive graphviz viewer for Dash

Downloads

154

Readme

Dash Interactive Graphviz

Dash Interactive Graphviz renders the graphviz or dot language in a 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 is clicked the selected property will change, this allows you to change elements of your Dash app when a node is selected. For example:

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

Often you may want to update the dot_source based on the selected node. This is supported by Dash. You can see a more complex example in usage.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 node which will fire an update to any dash callbacks that are connected.
  • You can change the layout engine