owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.36k stars 228 forks source link

Unexpected issue caused by using `display.name` as a fallback title of an indicator #3099

Open pabloarosado opened 6 months ago

pabloarosado commented 6 months ago

Description

Ideally, display.name should only be used as an indicator's title in the legend of a chart. However, for backward compatibility, display.name is also a fallback for the indicator's title in other places, like the sources tab or in the full citation (and maybe in other places). This fallback choice was discussed in https://github.com/owid/owid-grapher/issues/3017

I just found one example where this fallback is clearly problematic. We have an indicator whose title is "Number of countries considering nuclear weapons". In ETL, it doesn't have a display.name or a title_public defined. But the display.name is changed in the grapher admin, to simply be "Considering". Because of this, now we see that the sources tab shows "Considering" as the title of the indicator. We also see that the full citation is:

Bleek (2017); Nuclear Threat Initiative (2024) – with major processing by Our World in Data. “Considering” [dataset]. Bleek, “Spread of Nuclear Weapons”; Nuclear Threat Initiative, “Nuclear Threat Initiative Overview” [original data].

When display.name is defined from ETL, a warning is raised if title_public is not defined. However, if display.name is defined from the grapher admin, we don't get any warning.

As a workaround, one can define title_public for the indicator. However, this is not a good solution: it forces us to always define title_public, just in case display.name is modified in the grapher admin.

We need to do some queries to figure out if the fallback that uses display.name as an indicator title is helping or rather causing problems.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a temporary pull request where the yaml file of this indicator doesn't define any title_public.
  2. Go to the created temporary staging server, and open this chart in the admin.
  3. Go to the sources tab and see that the indicator's title in the sources tab, as well as in the full citation, is just "Considering", which is a very uninformative title.
ikesau commented 5 months ago

Given that we have a way to deal with this for now (by setting titlePublic) we're considering this nice to have, though it hopefully wouldn't take too much effort to correctly derive the right indicator name in the sources tab without creating any regressions.