-
Notifications
You must be signed in to change notification settings - Fork 62
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
Static Image Export in Python #627
Comments
Can you explain how that would work from python and how interactivity works with that? I'm also not sure whether we can even support python since we just support widgets in Jupyter and so maybe the functionality should be there? Or are you saying you want a feature to get a rendered chart in a notebook environment? Right now, I'd recommend printing the website which you can also do from something like playwright. |
Apologies for the ambiguity I'll try expand. "Or are you saying you want a feature to get a rendered chart in a notebook environment?"Once the chart has been rendered in a notebook environment I am envisioning the below. While I can get a one off screenshot say using devtools or just manually the use case was that if I share the notebook with someone is there an easy way for them to grab a particular image. "I'm also not sure whether we can even support python since we just support widgets in Jupyter and so maybe the functionality should be there? "I don't know enough about anywidget to know if it should live there but it certainly could be a broadly applicable feature. Assuming that was what you meant. "Can you explain how that would work from python and how interactivity works with that?"Not sure what the cleanest way to achieve this would look like... The behaviour could be something like: MosaicWidget(spec, data = {"weather": weather}, path = "output.png") Where if a path is provided it simply exports a static image. Or: fig = MosaicWidget(spec, data = {"weather": weather}, path = "output.png") Of course this is foregoing any interactivity it just takes the initial view. This to me is still useful as it means I can work with one tool and syntax for both interactive work and when needing to compile figures for print. Hope that provides some more clarity. These could be split into two separate issues if helpful. |
Ahh, thanks for the details. I think we could support a button in the web view to download an image with something like https://stackoverflow.com/questions/6887183/how-to-take-screenshot-of-a-div-with-javascript. |
Hi,
Would it be possible to have static image export functionality similar to that found in Plotly (https://plotly.com/python/static-image-export/)?
There was some similar work done on the great package pyobsplot which also interacts with Observable Plot if of help. juba/pyobsplot#32
The text was updated successfully, but these errors were encountered: