New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualize task graphs using ipycytoscape #9091
Conversation
This is really cool! 🤩 Thanks for working on this Ian 🙏 |
dask/dot.py
Outdated
@@ -306,3 +308,237 @@ def graphviz_to_file(g, filename, format): | |||
f.write(data) | |||
|
|||
return display_cls(filename=full_filename) | |||
|
|||
|
|||
def to_cytoscape_json( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given dot
is the CLI for GraphViz, wonder if we should put this in a different module for organizational clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I waffled on whether to create a new module for this, but decided to keep them in the same module since they share some of the naming utilities.
What about changing this to dask/visualize.py
(with perhaps a dot.py
backwards compatibility shim)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ian-r-rose! This is cool to see. I'm not very familiar with the interactive-Jupyter-graph-visualization space -- are there other packages we should be considering?
Another benefit I of adding a cytoscape
engine is it helps avoid some of the pain around installing the system graphviz
package
Perhaps there are. I chose cytoscape for this primarily because (1) it is a well-supported JS library, (2) python bindings for it already exist through There is some discussion of alternatives in #7301, but cytoscape still seems like a reasonably safe choice. |
The only alternative that stood out to me from reading that issue was Martin also mentioned a Google doc with other alternatives, but the link appears to be broken. Asked if there was a more up-to-date link |
I didn't really evaluate it -- I looked at the screenshots and they looked less like the final result I wanted than the cytoscape ones. |
That was my impression as well, but didn't know if that was just a perception gotten from those screenshots or if that is really representative of all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. I love the implementation because it doesn't close us off from alternatives in the future. I also like that the default is configurable, really neat!
The only thing I would say this PR needs is some docs.
Good point, thanks @jacobtomlinson. I've added some docs. |
I took a look at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment -- apologies for not noticing before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ian-r-rose
Wow, this is incredibly awesome! @ian-r-rose 🚀 |
This adds a new graph visualization engine based on
ipycytoscape
. Right now it's pretty much a re-implementation of thegraphviz
visualizer, but with zooming and panning. However, there are a few things that this could be more useful for in the near future.graphviz
to WASM (cf. Dask in pyodide #9053)pre-commit run --all-files