-
-
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
Implement thumbnails for multidimensional data pages #4475
base: master
Are you sure you want to change the base?
Conversation
8fab58e
to
506271a
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 770 (7fc922) ❌ Edited: 2025-01-24 11:01:36 UTC |
We can't use a dynamic thumbnail, because the meta tags are generated during baking. We could switch to dynamic thumbnails if/when we move the Grapher pages to dynamic rendering, i.e Cloudflare functions.
9287b52
to
ec89e8c
Compare
site/multiDim/MultiDimDataPage.tsx
Outdated
} | ||
// Due to thumbnails not taking into account URL parameters, they are often inaccurate on | ||
// social media. We decided to remove them and use a single thumbnail for all charts. | ||
// See https://github.com/owid/owid-grapher/issues/1086 |
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.
Huh? We do show chart previews based on query params
See rewriteMetaTags
So at least one of us must be confused 😅
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.
Once we've resolved this, I'll actually test the PR 👍
(Though, I might need a refresher on how to get MDD's running locally 🙂)
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.
Oh, that's pretty cool that we do that. I copy-pasted the existing code from the data page, so I'll remove those comments in both places then. And, it works the same for mdims out of the box:
http://staging-site-mdim-thumbnails/grapher/mdd-demo-poverty?povertyLine=30&metric=share
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.
Testing mdims locally is quite complicated. You need a relatively fresh copy of the DB. The previews are available at an admin sub-path, e.g. http://localhost:3030/admin/grapher/mdd-demo-poverty
(even if the mdim is not published). Let me know if you'll need help with it.
We now rewrite the image meta tags dynamically in Cloudflare functions to take query params into consideration.
3839dfa
to
4bef1e1
Compare
We can't use a dynamic thumbnail for social media previews, because the meta tags are generated during baking. We could switch to dynamic thumbnails if/when we move the Grapher pages to dynamic rendering, i.e Cloudflare functions.
Resolves #4456