-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Enable server-side csv download for all charts #3648
Labels
Comments
When implementing Marwa's new designs make sure to also fix the style leak described here: #3872 |
@danyx23 to create a new follow-up issue for Marcel for the next cylce |
This was referenced Oct 4, 2024
danyx23
added a commit
that referenced
this issue
Oct 10, 2024
This PR adds functionality to generate a CSV file on the server in a CF worker for the data of any chart. It also allows downloading a metadata.json file, a readme.md and a zip file of all three of these things. This is in preparation of surfacing these things in the download UI of grapher in the upcoming cycle 2024.6 (#4015). This PR does not make any use of the new CF functions endpoints yet and the download UI is not yet changed. This PR implements #3648 ## Testing To test this, try http get requests against `/grapher/SLUG.zip`, `/grapher/SLUG.csv`, `/grapher/SLUG.metadata.json` at localhost:8788, or at the staging server linked below. There is also an observable notebook that lets you browse the generated readme files in an easier way: https://observablehq.com/d/d410e9b2d2b7c330
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Our mission is to make the data we need to make progress on the world’s biggest problems accessible. For most of our pro users, accessibility means working with data tools – but getting data from our website to those tools is currently quite annoying.
It’s currently hard to quickly reuse data from a chart in an analytics environment. This is because the current CSV download is created in the browser, making it impossible to offer a single-line code snippet for analytics environments.
Solution
We want to create the ability to download the data for a chart. Technically, this will re-use the infrastructure that we created to render dynamic thumbnails to render a CSV.
The URL scheme should be
https://ourworldindata.org/grapher/life-expectancy.csv - for the data
https://ourworldindata.org/grapher/life-expectancy.metadata.json - for the metadata
https://ourworldindata.org/grapher/life-expectancy.zip - for a zip file of csv, metadata.json and a README.md
and maybe
https://ourworldindata.org/grapher/life-expectancy.xlsx - for an excel file with 3 sheets, one with description text, one with metadata and one with the data
Additionally, we want to offer two download options:
This issue is only about creating the CF functions necessary to fetch this data. The UI changes will be handled in the follow-up issue #4015.
We also want to have two options for the column names:
Must have
Can have
Checklist before publishing
The text was updated successfully, but these errors were encountered: