owid / owid-grapher

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

Discrete bar chart URL opens chart with non-existing entities #3704

Closed pabloarosado closed 2 weeks ago

pabloarosado commented 2 weeks ago

Description

The URL https://ourworldindata.org/grapher/dietary-choices-uk?country=18-24~25-49~50-64~65%2B opens the chart with non-existing entities.

Expected behaviour

The chart should only show entities for "18-24", "25-49", "50-64", "+65". But, instead, it shows those plus "18", "18", "25", "25", "50", and "50".

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to this URL: https://ourworldindata.org/grapher/dietary-choices-uk?country=18-24~25-49~50-64~65%2B
  2. See error

Screenshots

dietary-choices-uk (3)

Additional context

See this and this slack threads for more context and related issues.

Maybe the issue is how the "-" is parsed in the URL, and a workaround could be to rename the entities, to be, e.g. "18 to 25"?