Skip to content
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

Gdoc article Grapher embeds don't have SVG fallbacks #2354

Closed
Tracked by #3562
ikesau opened this issue Jun 21, 2023 · 5 comments · Fixed by #3635
Closed
Tracked by #3562

Gdoc article Grapher embeds don't have SVG fallbacks #2354

ikesau opened this issue Jun 21, 2023 · 5 comments · Fixed by #3635

Comments

@ikesau
Copy link
Member

ikesau commented Jun 21, 2023

I noticed this today after browsing our site with NoScript enabled.

https://ourworldindata.org/population-projections

image

It's still working with our WordPress articles, so this is due to how our Chart component renders charts.

As part of this, we should also restore the "Tap to load" functionality on mobile where it only loads the SVG by default.

@marcelgerber
Copy link
Member

For reference: The code that makes this work for WP baking is this one here:

const output = `
<figure data-grapher-src="${src}" class="${GRAPHER_PREVIEW_CLASS}">
<a href="${src}" target="_blank">
<div><img src="${chart.svgUrl}" width="${chart.width}" height="${chart.height}" loading="lazy" data-no-lightbox /></div>
<div class="interactionNotice">
<span class="icon">${INTERACTIVE_ICON_SVG}</span>
<span class="label">Click to open interactive version</span>
</div>
</a>
</figure>`

And then there's also some code ensuring that we have a svg version for every variant that we embed, i.e. the concrete query params that are being used in an embed.

@ikesau ikesau changed the title Gdoc article Grapher embeds don't fallback to SVG when JavaScript is disabled Gdoc article Grapher embeds don't have SVG fallbacks Aug 22, 2023
@danyx23
Copy link
Contributor

danyx23 commented Mar 12, 2024

When implementing this make sure to also check this for data pages and topic pages

@danyx23
Copy link
Contributor

danyx23 commented Mar 19, 2024

The issues #2992 is also related to this one and should probably fixed at the same time

@ikesau ikesau removed their assignment May 20, 2024
@rakyi rakyi self-assigned this May 21, 2024
@rakyi
Copy link
Contributor

rakyi commented May 21, 2024

As part of this, we should also restore the "Tap to load" functionality on mobile where it only loads the SVG by default.

@ikesau why would we want to do this? It makes me less likely to use the interactive chart as a user if I have to click to load it, and subjectively I'd prefer to be able to interact with the chart ASAP.

@rakyi
Copy link
Contributor

rakyi commented May 21, 2024

Now I see that some less powerful devices are probably not handling it well, fair enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants