diff --git a/explorer/Explorer.tsx b/explorer/Explorer.tsx index 70635d73e4d..d04cec71533 100644 --- a/explorer/Explorer.tsx +++ b/explorer/Explorer.tsx @@ -709,9 +709,15 @@ export class Explorer grapher.reset() this.updateGrapherFromExplorerCommon() grapher.updateFromObject(config) - await grapher.downloadLegacyDataFromOwidVariableIds( - inputTableTransformer - ) + if (dimensions.length === 0) { + // If dimensions are empty, explicitly set the table to an empty table + // so we don't end up confusingly showing stale data from a previous chart + grapher.receiveOwidData(new Map()) + } else { + await grapher.downloadLegacyDataFromOwidVariableIds( + inputTableTransformer + ) + } } @action.bound private updateGrapherFromExplorerUsingColumnSlugs() { diff --git a/packages/@ourworldindata/core-table/src/OwidTable.ts b/packages/@ourworldindata/core-table/src/OwidTable.ts index e1c224f5296..3c1568d6370 100644 --- a/packages/@ourworldindata/core-table/src/OwidTable.ts +++ b/packages/@ourworldindata/core-table/src/OwidTable.ts @@ -1051,10 +1051,7 @@ export class OwidTable extends CoreTable { } get isBlank(): boolean { - return ( - this.tableDescription.startsWith(BLANK_TABLE_MESSAGE) && - !this.numRows - ) + return !this.numRows } }