ooni / explorer

OONI Explorer: uncover evidence of internet censorship worldwide
https://explorer.ooni.org
BSD 3-Clause "New" or "Revised" License
74 stars 38 forks source link

mat: add support for downloading the chart data as CSV and JSON #697

Closed hellais closed 1 year ago

hellais commented 2 years ago

We should add buttons at the bottom of the MAT chart that allows users to download the data used to plot the chart in CSV and JSON format.

This should be pretty easy as the API already supports exporting data as CSV (you just append format=CSV) and it's basically just a matter of adding some links pointing to those URLs.

GermaVinsmoke commented 2 years ago

@sarathms I would like to take this. Have few questions.

  1. What is MAT
  2. Which page is having this chart
  3. Is there any API documentation from where we can check all the API endpoints?
hellais commented 2 years ago

Thanks for offering to take this on!

The MAT page is the following: https://explorer.ooni.org/experimental/mat?test_name=web_connectivity&since=2022-02-14&until=2022-03-17&axis_x=measurement_start_day&axis_y=probe_cc

The API endpoint it uses for fetching the metadata of the chart is the following: https://api.ooni.io/apidocs/#/default/get_api_v1_aggregation.

What needs to be done to implement this, is looking at the aggregation API query that is being issued for the chart and creating a link button at the bottom of the page to that API query with the format=CSV suffix. When a user will click on that they will get the data for the chart in CSV format.

hellais commented 1 year ago

This has been implemented since a while inside of https://github.com/ooni/explorer/pull/741