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 image export function to viz classes #2

Closed
ryanbaumann opened this issue Aug 9, 2017 · 4 comments
Closed

Add image export function to viz classes #2

ryanbaumann opened this issue Aug 9, 2017 · 4 comments

Comments

@ryanbaumann
Copy link
Contributor

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 a viz 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.

@ryanbaumann
Copy link
Contributor Author

Related to #28

@ryanbaumann
Copy link
Contributor Author

ryanbaumann commented Feb 3, 2018

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

@akacarlyann
Copy link
Collaborator

Is there a way to leverage https://www.mapbox.com/help/static-api-playground/ without going through mapbox studio?

@ryanbaumann
Copy link
Contributor Author

@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.

@ryanbaumann ryanbaumann added this to the 0.8.0 milestone Mar 26, 2018
akacarlyann added a commit to akacarlyann/mapboxgl-jupyter that referenced this issue Nov 12, 2018
ryanbaumann pushed a commit that referenced this issue Nov 27, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants