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

✨ use dynamic thumbnails in GrapherImage #3746

Closed
wants to merge 3 commits into from

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Jun 25, 2024

Resolves #3661

image

Decided to go with an overload to support these 2 cases:

  • SSR where we can only ever know the slug
  • gdocs SSR where we have a full URL (potentially with a query string)

Seemed better than converting all the slugs to full URLs but I'm happy to change it if we don't like the overload pattern.

GrapherImage usage:

  • gdocs/blocks/Charts.tsx - works
  • GrapherPage.tsx - works
  • GrapherWithFallback.tsx - works
  • RelatedChart.tsx - works
  • AllChartsListItem.tsx - works
  • DynamicCollection.tsx - n/a, needs JS to function
  • StaticCollection.tsx - n/a, needs JS to function

@owidbot
Copy link
Contributor

owidbot commented Jun 25, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-gdoc-grapher-previews

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-06-25 22:51:39 UTC
Execution time: 1.12 seconds

@ikesau ikesau force-pushed the gdoc-grapher-previews branch from e75c5c4 to d888248 Compare June 26, 2024 20:10
@ikesau ikesau requested a review from marcelgerber June 26, 2024 21:18
@ikesau ikesau marked this pull request as ready for review June 26, 2024 21:18
@marcelgerber
Copy link
Member

marcelgerber commented Jul 2, 2024

Note: I've just pushed a commit to master that uses more reasonable font sizes for this (6214343), because I've just realized that fonts are a big toooo big here :)

Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is definitely a positive!

For whatever reason I don't see the "interactionNotice" here, but that's not too bad because with JS disabled, they can't really interact either way.

If you feel like it, you could let grapher / data pages handle query params using the CF Worker ;) but that's very much non-trivial...

@ikesau
Copy link
Member Author

ikesau commented Jul 9, 2024

TODO: improve the CSS for the failure case, and fix the spacing for the interaction notice

Copy link

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@github-actions github-actions bot added the stale label Jul 24, 2024
@github-actions github-actions bot closed this Jul 27, 2024
@ikesau
Copy link
Member Author

ikesau commented Aug 5, 2024

@marcelgerber taking a bit of this "cooldown" to look at this again. I feel like no one would miss the interaction notice if we got rid of it? 🤔

@ikesau ikesau reopened this Aug 5, 2024
@ikesau ikesau added site and removed stale labels Aug 5, 2024
@marcelgerber
Copy link
Member

I feel like it is still serving a purpose (for static previews on mobile, in particular), namely that there is an interactive version of this exact chart available if you click through.
It thereby also differentiates these from static charts.

On the other hand, it doesn't really serve a good purpose for no-JS cases, and will only lead to confusion in that case. Not sure if we can easily hide it in that case?

Copy link

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@ikesau ikesau force-pushed the gdoc-grapher-previews branch from 33e2964 to 1200c3e Compare October 8, 2024 20:58
Copy link

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@github-actions github-actions bot added the stale label Oct 23, 2024
@github-actions github-actions bot closed this Oct 27, 2024
@ikesau ikesau deleted the gdoc-grapher-previews branch December 6, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gdoc chart static previews can only show the default view of a chart
3 participants