Skip to content

Commit

Permalink
🐛 allow single-entity selection for charts split by metric
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jan 22, 2025
1 parent 4d6453e commit dae2d28
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3692,16 +3692,11 @@ export class Grapher
if (this.addCountryMode === EntitySelectionMode.MultipleEntities)
return true

// if the chart is currently faceted by entity, then use multi-entity
// selection, even if the author specified single-entity-selection
if (
// we force multi-entity selection mode when the chart is faceted
this.addCountryMode === EntitySelectionMode.SingleEntity &&
this.facetStrategy !== FacetStrategy.none &&
// unless the author explicitly configured the chart to be split
// by metric and hid the facet control
!(
this.facetStrategy === FacetStrategy.metric &&
this.hideFacetControl
)
this.facetStrategy === FacetStrategy.entity
)
return true

Expand Down

0 comments on commit dae2d28

Please sign in to comment.