-
Notifications
You must be signed in to change notification settings - Fork 136
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 image export function to viz classes #2
Comments
Related to #28 |
Adding a help-wanted label here - I'd love to get this feature into a 1.0 release (Targeting end of February 2018) to allow distribution of Notebooks with lightweight static visualizations |
Is there a way to leverage https://www.mapbox.com/help/static-api-playground/ without going through mapbox studio? |
@akacarlyann the Mapbox Static API would work for small data use cases, but not large ones. The good news is that rendering an image from a gl context (which is the rendered Mapboxgl map) is pretty straightforward - for this use case, if we're running in Jupyter I'm envisioning just a button you can push to save the rendered map to a JPEG or PNG file. Supporting a headless python function to render the map would be the next step, which is a fair bit more work. |
* Add optional download buttons for map snapshot and legend snapshot; addresses #2 * Update map export button group style; set default map behavior preserveDrawingBuffer to False; add example to notebook
A common data science workflow is to include a static image version of a visual for sharing or screen shot creating.
This could be added as a
saveImage()
HTML button on aviz
class object that downloads the current map viewport as a PNG, or it could be a viz.toImage() python function that outputs a PNG of the viz at the stated zoom, center, pitch, and bearing.The text was updated successfully, but these errors were encountered: