Skip to content

Commit

Permalink
Data pages: final tweaks (#2931)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 authored Nov 27, 2023
2 parents e2900b1 + 73b2ae2 commit 650eb7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ The following is an excerpt explaining the origin of this repo and what the alte

Cross-browser testing provided by <a href="https://www.browserstack.com"><img src="https://3fxtqy18kygf3on3bu39kh93-wpengine.netdna-ssl.com/wp-content/themes/browserstack/img/bs-logo.svg" /> BrowserStack</a>

Client-side bug tracking provided by <a href="http://www.bugsnag.com/"><img width="110" src="https://images.typeform.com/images/QKuaAssrFCq7/image/default" /></a>.
Client-side bug tracking provided by <a href="http://www.bugsnag.com/"><img width="110" src="https://images.typeform.com/images/QKuaAssrFCq7/image/default" /></a>
10 changes: 3 additions & 7 deletions baker/GrapherBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,16 @@ import { isEmpty } from "lodash"
/**
*
* Render a datapage if available, otherwise render a grapher page.
*
* Rendering a datapage requires a datapage JSON file to be present in the
* owid-content repository, and optionally a companion gdoc to be registered in
* the posts_gdocs table
*/
export const renderDataPageOrGrapherPage = async (
grapher: GrapherInterface,
publishedExplorersBySlug?: Record<string, ExplorerProgram>,
imageMetadataDictionary?: Record<string, Image>
) => {
// If we have a single Y variable and that one has a schema version >= 2,
// meaning it has the metadata to render a datapage, then we show the datapage
// based on this information. Otherwise we see if there is a legacy datapage.json
// available and if all else fails we render a classic Grapher page.
// meaning it has the metadata to render a datapage, AND if the metadata includes
// text for at least one of the description* fields or titlePublic, then we show the datapage
// based on this information.
const yVariableIds = grapher
.dimensions!.filter((d) => d.property === DimensionProperty.y)
.map((d) => d.variableId)
Expand Down

0 comments on commit 650eb7e

Please sign in to comment.