From e65dbc1716dc6aa755f5ac7f200fe2e0fb7540fa Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Mon, 19 Aug 2024 20:49:32 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Use=20grapher=20config=20from=20API?= =?UTF-8?q?=20instead=20of=20from=20HTML=20in=20multiembedder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/multiembedder/MultiEmbedder.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/site/multiembedder/MultiEmbedder.tsx b/site/multiembedder/MultiEmbedder.tsx index 5dc2363dc95..59b1d843bfc 100644 --- a/site/multiembedder/MultiEmbedder.tsx +++ b/site/multiembedder/MultiEmbedder.tsx @@ -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 @@ -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