Skip to content

Commit

Permalink
enhance: basic config to hide some grapher elements
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Dec 18, 2024
1 parent b3eb0ed commit 1214752
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion site/multiembedder/MultiEmbedder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
extractMultiDimChoicesFromQueryStr,
fetchWithRetry,
NarrativeViewInfo,
queryParamsToStr,
} from "@ourworldindata/utils"
import { action } from "mobx"
import React from "react"
Expand Down Expand Up @@ -281,9 +282,18 @@ class MultiEmbedder {

const configUrl = `${GRAPHER_DYNAMIC_CONFIG_URL}/by-uuid/${viewConfig.chartConfigId}.config.json`

const queryStr = queryParamsToStr(viewConfig.queryParamsForParentChart)

await this._renderGrapherComponentIntoFigure(figure, {
configUrl,
additionalConfig: {},
additionalConfig: {
hideRelatedQuestion: true,
hideShareButton: true, // always hidden since the original chart would be shared, not the customized one
hideExploreTheDataButton: false,
manager: {
canonicalUrl: `${BAKED_GRAPHER_URL}/${viewConfig.parentChartSlug}${queryStr}`,
},
},
})
}

Expand Down

0 comments on commit 1214752

Please sign in to comment.