From b3eda9e423ee66c943a37249d3e53cd07bf61557 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 17 Dec 2024 16:32:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(admin)=20only=20evaluate=20char?= =?UTF-8?q?t=20series=20names=20once=20Grapher=20is=20ready?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/core-table/src/CoreTable.ts | 1 + packages/@ourworldindata/grapher/src/core/Grapher.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/@ourworldindata/core-table/src/CoreTable.ts b/packages/@ourworldindata/core-table/src/CoreTable.ts index c05d2def268..1bf2f7510cf 100644 --- a/packages/@ourworldindata/core-table/src/CoreTable.ts +++ b/packages/@ourworldindata/core-table/src/CoreTable.ts @@ -1142,6 +1142,7 @@ export class CoreTable< ): this { const newStore: CoreColumnStore = { ...this.columnStore } columnSlugs.forEach((slug) => { + console.log(slug, newStore[slug]) newStore[slug] = newStore[slug].map(replaceFn) }) return this.transform( diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index a880dc46079..726fd3ed455 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -885,6 +885,8 @@ export class Grapher } @computed get chartSeriesNames(): SeriesName[] { + if (!this.isReady) return [] + // collect series names from all chart instances when faceted if (this.isFaceted) { const facetChartInstance = new FacetChart({ manager: this })