owid / owid-grapher

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

Gdoc chart static previews can only show the default view of a chart #3661

Open ikesau opened 4 months ago

ikesau commented 4 months ago

We fixed gdoc charts not having a noscript fallback in https://github.com/owid/owid-grapher/pull/3635, but did so using the old WP method of replacing the interactive graphers with static export imgs.

This was good enough in the past, but because it wasn't working correctly for a year, authors got used to being able to embed two views of the same grapher side-by-side on mobile, which isn't supported with the static export fallback strategy (instead, the exact same chart is shown twice)

static exports

I think there are two things we could do here:

  1. Better detect when it's appropriate to show static charts by default (many phones can handle multiple grapher embeds just fine)
  2. Use the Cloudflare worker to show these previews instead, so that they can be configured
danyx23 commented 3 months ago

Probably switching to dynamic makes sense here and probably in more parts of the website as well. I think it would be worth spiking a bit what it would mean to do this for the entire site and get rid of statically baked thumbnails for grapher charts altogether.