diff --git a/baker/siteRenderers.tsx b/baker/siteRenderers.tsx index 678d1685c11..4730d236056 100644 --- a/baker/siteRenderers.tsx +++ b/baker/siteRenderers.tsx @@ -811,7 +811,13 @@ export const renderExplorerPage = async ( config: row.grapherConfigETL as string, }) : {} - return mergeGrapherConfigs(etlConfig, adminConfig) + const mergedConfig = mergeGrapherConfigs(etlConfig, adminConfig) + // explorers set their own dimensions, so we don't need to include them here + const mergedConfigWithoutDimensions = lodash.omit( + mergedConfig, + "dimensions" + ) + return mergedConfigWithoutDimensions }) const wpContent = transformedProgram.wpBlockId diff --git a/explorer/Explorer.tsx b/explorer/Explorer.tsx index ade08649379..42837cab502 100644 --- a/explorer/Explorer.tsx +++ b/explorer/Explorer.tsx @@ -588,22 +588,13 @@ export class Explorer // set given variable IDs as dimensions to make Grapher // download the data and metadata for these variables - const dimensions = config.dimensions ?? [] - const variablesToLoad = yVariableIdsList - // Filter out variableIds that are already present in the dimensions array - .filter( - (yVariableId) => - !dimensions.some( - (d) => - d.property === DimensionProperty.y && - d.variableId === yVariableId - ) - ) - .map((yVariableId) => ({ + const dimensions = config.dimensions?.slice() ?? [] + yVariableIdsList.forEach((yVariableId) => { + dimensions.push({ variableId: yVariableId, property: DimensionProperty.y, - })) - dimensions.push(...variablesToLoad) + }) + }) if (xVariableId) { const maybeXVariableId = parseIntOrUndefined(xVariableId)