owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.38k stars 230 forks source link

Cycle 2024.6: index indicator-based explorers and MD indicators in data catalog search #4002

Open larsyencken opened 1 week ago

larsyencken commented 1 week ago

Ensure that the data catalog covers most of our data.

Motivation

We recently shipped the friendly data catalog, which provides an index over all Grapher charts. However, it's not at a solid resting place until it has coverage over the bulk of our explorers.

Proposed scope

Must do

Should do

Won't do

Technical notes

Technical notes from Ike and Daniel:

3 moving parts to make explorer thumbnails:

  1. Explorer.tsx has to be able to run inside a worker, which should serve the html file that we bake, but rewrite the og:image value to point to another new worker that we've added. It needs to parse the query params and understand what kind of explorer it is (csv-based we won't be able to render), grapher-based and indicator-based will work
  2. We'll need a dictionary of view (represented as queryparams) -> uuid-config (marcel did this for MDMs https://github.com/owid/owid-grapher/pull/3922)
  3. Use the existing functions that, given a uuid, render a thumbnail

We need a new worker to handle /explorers/ (which requires extracting explorers into a lerna package)

grapherConfigEtl is when there's a partial config from the ETL (as YAML)

grapherConfigAdmin is when there's a partial config from the admin e.g. under "Grapher Config (edited in the admin)" on https://admin.owid.io/admin/variables/985021

https://admin.owid.io/admin/explorers/sample-indicator-explorer

when there's 1 yVariableId, that ID can be used to lookup the indicator's grapher config via the variables->grapher_configs UUID join

As a stretch goal: when there's more than 1 yVariableId (e.g. a scatterplot) the grapher config that needs to be used is defined in the explorer config for that particular view, and so the grapher config can be constructed from that (there is presumably something in Explorer.tsx somewhere that does this)

Open questions

danyx23 commented 1 week ago

The open question here is a good one - I think we should treat this as it's own litte project to create these UUID charts for explorer views (and also mdim views). I created #4013 to track this effort. I found it a bit hard to explain it well in text, it's probably easier to chat about it next week.