owid / owid-grapher

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

Stacked area charts stack aggregates on top of countries #3608

Open sophiamersmann opened 1 month ago

sophiamersmann commented 1 month ago

Description

It's possible to stack aggregates on top of countries. In this chart, France is stacked on top of World although the World includes France. This is true for other entities as well where one entity includes another, e.g. continents and the "World" entity or "High-income countries" and "Europe".

Expected behaviour

It's a bit unclear what a good UX would look like that prevents users from stacking entities that shouldn't be stacked.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://ourworldindata.org/grapher/above-or-below-extreme-poverty-line-world-bank?facet=metric&country=FRA~Europe+and+Central+Asia~OWID_WRL
  2. Note that France is stacked on top of World
danyx23 commented 4 weeks ago

Probably a good approach would be to use the info in regions.json about what kind of entity an entity is (i.e. country, continent, ...) and, for stacked charts, only allow multi-select within the same group.

The UX of this is a bit fickly, because for stacked charts you would need to communicate to the user which entities they can click and which they can't click (or which add to the current selection or which reset the selection)