-
Notifications
You must be signed in to change notification settings - Fork 155
download button #869
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
Comments
Related #906? |
For SVGs we have the classic crowbar extension. For automation we can rely on playwright screenshots. |
I think the purpose of the download button would be more for dashboard viewers to get easily access to a high resolution screenshot or svg file. Without the requirement of installing an extension or having access to the dev environment. Manual screenshots always shift a few pixels. Also, in Notebook, the PNG is saved in 2x resolution, which is great. The |
You can copy over the If you want to download data as xlsx, you can try SheetJS: https://observablehq.observablehq.cloud/pangea/party/xlsx-downloads For screenshots we recommend making them as data loaders, with "build-time rendering" (colloquially called server-side rendering, SSR). There are examples of that in https://github.com/observablehq/oss-analytics and in the d3-geo-polygon documentation (see https://github.com/d3/d3-geo-polygon/blob/main/docs/snapshots/%5Bsnapshot%5D.png.js). |
@Fil Thanks for these links. For various reasons I'm struggling to implement these into my project.
I'm not sure which part I am missing. With Observable notebooks, images are (almost) pixel perfect and double resolution (which is great). I guess, where I struggle is to create a blob from more complex SVG code/plots. Do you have recommendations where to get more code examples? Thanks! |
Let me try this first... This is probably what you mean with "build-time-rendering". I'm just afraid, that if the page offers the user some dynamic filters via select inputs, this won't work... will it? |
Correct. You could try with bubkoo/html-to-image though. |
Wow. html-to-image works surprisingly well. Together with In case someone is looking for the same functionality (straight from the doc + double resolution):
IMO, this is a very good solution. I let you decide if you really want to integrate this natively in Framework or not. |
A way for a user to point at a visual (figure, canvas, svg…) and download it as png (or maybe svg).
If activated, it should be available everywhere, but not get in the way.
maybe this should be a Chrome extension?
The text was updated successfully, but these errors were encountered: