owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

Missing country name in title for faceted single-entity StackedAreaChart

Open marcelgerber opened this issue 2 years ago • 1 comments

Description

In a faceted-by-entity StackedAreaChart, with only a single entity selected, there is no mention of the country being shown, making it impossible to know what country one is looking at.

Expected behaviour

The country name should be visible somewhere, e.g. in the chart title.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://ourworldindata.org/explorers/population-and-demography?Metric=Population+by+broad+age+group&Sex=Both+sexes&Age+group=Total&Projection+Scenario=None&country=~CHN
  2. Notice that there is no mention of the country (China) we're looking at anywhere, aside from the entity selection sidebar.

Screenshots

image

Context

Originally mentioned by @CGiattino here: https://owid.slack.com/archives/C03KRR7TH0A/p1657138370093749

marcelgerber avatar Jul 12 '22 09:07 marcelgerber

  • Very related: https://github.com/owid/owid-grapher/issues/1124

danielgavrilov avatar Jul 12 '22 09:07 danielgavrilov

This is happening because addCountryMode == EntitySelectionMode.MultipleEntities in this case, and because of this line in Grapher.tsx: https://github.com/owid/owid-grapher/blob/1c1f54fc4be4c2d65ef277bfc8943fb3fe29c831/packages/%40ourworldindata/grapher/src/core/Grapher.tsx#L1215

It's not directly linked to faceting.

marcelgerber avatar Dec 05 '22 10:12 marcelgerber

Re-opening this because even though this issue has been fixed in explorers, it persists in grapher charts:

Screenshot 2023-03-31 at 14 48 09

(Note that there is no mention of the entity)

I came across this while working on #2063.

sophiamersmann avatar Mar 31 '23 13:03 sophiamersmann

Re-opening this because even though this issue has been fixed in explorers, it persists in grapher charts:

Is this happening on your local setup? Because I cannot easily repro on the live site, with the same chart.

marcelgerber avatar Mar 31 '23 13:03 marcelgerber

Ah sorry, my bad, this particular chart is published with single-entity selection. To reproduce:

  • go to https://owid.cloud/admin/charts/298/edit
  • go to the "Data" tab
  • change selection to "User can add and remove data"
  • notice that "Sweden" is not displayed in the title anymore

sophiamersmann avatar Mar 31 '23 13:03 sophiamersmann