Skip to content

Commit

Permalink
✨ Use grapher config from API instead of from HTML in multiembedder
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 authored and sophiamersmann committed Sep 3, 2024
1 parent 76cbaac commit 3e0a1c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions site/multiembedder/MultiEmbedder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ class MultiEmbedder {
dataApiUrl: DATA_API_URL,
}

const html = await fetchText(fullUrl)

if (isExplorer) {
const html = await fetchText(fullUrl)
let grapherConfigs = deserializeJSONFromHTML(
html,
EMBEDDED_EXPLORER_GRAPHER_CONFIGS
Expand Down Expand Up @@ -202,7 +201,9 @@ class MultiEmbedder {
} else {
figure.classList.remove(GRAPHER_PREVIEW_CLASS)

const grapherPageConfig = deserializeJSONFromHTML(html)
const grapherPageConfig = await fetch(
`${fullUrl}.config.json`
).then((res) => res.json())

const figureConfigAttr = figure.getAttribute(
GRAPHER_EMBEDDED_FIGURE_CONFIG_ATTR
Expand Down

0 comments on commit 3e0a1c5

Please sign in to comment.