From ebbd0eb37286fd24a8472198e5763073d4fa1c3f Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 5 Apr 2024 16:25:14 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(marimekko)=20drop=20entities=20?= =?UTF-8?q?without=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 2 +- .../grapher/src/stackedCharts/MarimekkoChart.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index a139eacf68f..20a26720fc8 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -701,7 +701,7 @@ export class Grapher // different; e.g. for scatterplots, the entity needs to (1) not be excluded and // (2) needs to have data for the x and y dimension. let table = - this.isScatter || this.isSlopeChart + this.isScatter || this.isMarimekko || this.isSlopeChart ? this.tableAfterAuthorTimelineAndActiveChartTransform : this.inputTable diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx index 5b40d4c5d30..f23795ce4f8 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx @@ -310,11 +310,14 @@ export class MarimekkoChart table = table.dropRowsWithErrorValuesForColumn(colorColumnSlug) } } - if (!manager.showNoDataArea) + + const hideNoDataArea = !manager.showNoDataArea || !xColumnSlug + if (hideNoDataArea) table = table.dropRowsWithErrorValuesForAllColumns(yColumnSlugs) if (xColumnSlug) table = table.dropRowsWithErrorValuesForColumn(xColumnSlug) + if (manager.isRelativeMode) { // TODO: this should not be necessary but we sometimes get NoMatchingValuesAfterJoin if both relative and showNoDataArea are set table = table.dropRowsWithErrorValuesForColumn(