Skip to content
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

Add tooltips to DAG visualization #56

Closed
jqmp opened this issue Nov 11, 2019 · 3 comments
Closed

Add tooltips to DAG visualization #56

jqmp opened this issue Nov 11, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jqmp
Copy link
Collaborator

jqmp commented Nov 11, 2019

Currently the Flow.render_dag() method returns a PNG image, which doesn't support tooltips or any other kind of interaction. However, it would be fairly straightforward to return an SVG image instead, in which case we could include tooltips for each node in the DAG. These tooltips would be a good place to show the docstring of the corresponding entity (once docstring integration is complete).

@lexi-squid-ding
Copy link
Collaborator

@jqmp I started looking into this and looks like as of today, Pillow does not support SVG. But it's straightforward to get a SVG from a pydot graph, so we can evaluate additional packages like Cairo and svglib to actually render the image.

Let me know if you have a preference

@jqmp
Copy link
Collaborator Author

jqmp commented Jan 6, 2020

Oh, good point. I'm cool with adding a dependency if necessary. That said, it seems to me that we want to support two main use cases:

# Saving to a file.
flow.render_dag(format='svg').save('my_dag.svg')

# Inside a Jupyter notebook, this should render the image.
flow.render_dag(format='svg')

I don't know offhand if those libraries provide a class that supports both of those. However, since Jupyter knows how to render SVGs already, it would probably be easy to define our own SvgImage class that implements save and _repr_svg_ methods. What do you think?

@lexi-squid-ding
Copy link
Collaborator

Will look into whether either library does this natively, otherwise adding the new class makes sense to me.

@lexi-squid-ding lexi-squid-ding self-assigned this Jan 22, 2020
@jqmp jqmp added the enhancement New feature or request label Feb 6, 2020
@jqmp jqmp closed this as completed Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants