-
-
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
Add grapher image fallback to GDoc pages #3635
Conversation
@@ -14,3 +14,5 @@ export const POLYFILL_URL: string = `https://cdnjs.cloudflare.com/polyfill/v3/po | |||
)}` | |||
|
|||
export const DEFAULT_LOCAL_BAKE_DIR = "localBake" | |||
|
|||
export const GRAPHER_PREVIEW_CLASS = "grapherPreview" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved here to be importable from both client and server.
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 4530 (d2becb) Edited: 2024-05-28 11:16:42 UTC |
ab38742
to
bd55d70
Compare
@@ -105,7 +111,22 @@ export default function Chart({ | |||
border: "0px none", | |||
height: d.height, | |||
}} | |||
/> | |||
> | |||
{isExplorer ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have static images for explorers, and I'm not sure if it's worth it to make it work for them.
bd55d70
to
7587ede
Compare
Restore old functionality by adding image fallback for embedded graphers which will be shown by skipping the dynamic embedding in the following cases: * The user has JS disabled * The user doesn't have a powerful enough device, see `shouldProgressiveEmbed`, except on a grapher/data page - In this case we also show a note highlighting the possibility of opening the interactive chart on a separate page
7587ede
to
a766eaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Once you fix the resolvedUrl thing this'll be good to go. 🙂
I see you've started on the one for datapages, too. If there's a way to fix that that will also make collections work, that'd be a nice bonus, but we haven't really promoted collections at all and I don't think anyone uses them so no worries if you can't get those working (afaict, your changes for them in this PR only affect mobile loading, not no-JS loading)
site/InteractionNotice.tsx
Outdated
@@ -0,0 +1,20 @@ | |||
import React from "react" | |||
|
|||
// A modified FontAwesome icon. This is a string to be used outside of React |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what you mean by WordPress content here? Won't we be using this in gdocs baking too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded. Is it better now?
I didn't even realize collections don't work without JS. Will look into it as well. |
Now I'm confused, I thought collections worked without JS when I tried it locally, but then they didn't work on staging, but now it works on prod, e.g. https://ourworldindata.org/collection/top-charts |
Restore old functionality by adding image fallback for embedded graphers which will be shown by skipping the dynamic embedding in the following cases:
shouldProgressiveEmbed
, except on a grapher/data pageWP page:
GDoc page:
Fixes #2354