Skip to content

Commit

Permalink
🐛 (marimekko) drop entities without data
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Apr 8, 2024
1 parent 4d398a7 commit ebbd0eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ebbd0eb

Please sign in to comment.