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 committed Aug 24, 2024
1 parent 845c2ab commit 4f6ed11
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 4f6ed11

Please sign in to comment.