Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Better notebook support for visualizing DAGs #205

Closed
skrawcz opened this issue Oct 10, 2022 · 4 comments · Fixed by #286
Closed

Better notebook support for visualizing DAGs #205

skrawcz opened this issue Oct 10, 2022 · 4 comments · Fixed by #286
Labels
enhancement New feature or request

Comments

@skrawcz
Copy link
Collaborator

skrawcz commented Oct 10, 2022

Is your feature request related to a problem? Please describe.
If you are using Hamilton in a jupyter notebook, we should enable creating a visualization easily when you request a DAG visualized.

Describe the solution you'd like
In simplest terms, doing something like dask does for visualizing its DAGs in a notebook would be sweet.

Requirements:

  1. Able to display in a notebook.
  2. Able to handle really large graphs -- or some way to help people wrangle them to display.

e.g.

dr = driver.Driver(...)
dr.visualize_execution(...)
# this creates an image that is displayed

Thought - the solution here might be as simple as returning the graphviz object...

Perhaps having a default print out of a driver object could also be useful?

dr = driver.Driver(...)
dr
# this prints out some information about the DAG created -- perhaps even a rough visualization, much like dask does?

Describe alternatives you've considered
You save the image, and then load it -- I don't believe this will be the best experience though:

from IPython.display import Image
...
dr.visualize_execution(..., 'my_dag.png', ...)
...
Image('my_dag.png')
# this would then display

Additional context
For ideas/inspiration:

@skrawcz skrawcz added the enhancement New feature or request label Oct 10, 2022
@elijahbenizzy
Copy link
Collaborator

elijahbenizzy commented Oct 18, 2022

On my phone but I've prototyped some examples

Non-interactive
image

Interactive image

These run after the hello world view in the notebook. Planning to add examples.

@skrawcz
Copy link
Collaborator Author

skrawcz commented Oct 31, 2022

Nice -- but is there a way we just return the graphviz/networkx object?

@elijahbenizzy
Copy link
Collaborator

Nice -- but is there a way we just return the graphviz/networkx object?

Currently it doesn't but I think we should change it to-- makes the above code much easier to work with.

@skrawcz skrawcz linked a pull request Jan 31, 2023 that will close this issue
7 tasks
@skrawcz
Copy link
Collaborator Author

skrawcz commented Jan 31, 2023

Implemented in #286

@skrawcz skrawcz closed this as completed Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants