Skip to content

Commit

Permalink
✨ update embedded thumbnails with worker when query string params are…
Browse files Browse the repository at this point in the history
… specified
  • Loading branch information
ikesau committed Jan 22, 2025
1 parent b425637 commit 07a016b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ export function makeAxisLabel({
*/
export function generateGrapherImageSrcSet(defaultSrc: string): string {
const url = Url.fromURL(defaultSrc)
const existingQueryParams = url.queryParams
const imWidths = ["850", "1700"]
const srcSet = imWidths
.map(
(imWidth) =>
`${url.setQueryParams({ imWidth }).fullUrl} ${imWidth}w`
)
.map((imWidth) => {
return `${url.setQueryParams({ ...existingQueryParams, imWidth }).fullUrl} ${imWidth}w`
})
.join(", ")

return srcSet
Expand Down

0 comments on commit 07a016b

Please sign in to comment.