owid / owid-grapher

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

Idea: Provide filter dropdown in entity selector #3599

Open marcelgerber opened 1 month ago

marcelgerber commented 1 month ago

Core problem

It is currently hard to discover the different kinds of entities available in a chart. For example, it is unclear at first sight that "special" entites and groupings like "Africa", "World", "Upper-middle income countries" are all part of the entity selector.

We have some of this information readily available in https://github.com/owid/owid-grapher/blob/104ca296e72a8222d184618c6f0d2eb3aba98376/packages/%40ourworldindata/utils/src/regions.json (although this information is arguably imperfect, as it doesn't include all historical countries, or groupings like Africa (FAO) - but we can strive to improve on that front!).

Proposed solution

One option would be to provide a dropdown in the entity selector, where the user can filter for the entity types they want to see, e.g.

Group name Example
Countries Zimbabwe
Historical countries & regions Austria-Hungary
Continents Asia
Income groups Low-income countries
Regions & groupings [other than continents & income groups] Americas (FAO), Asia (excl. China & India), European Union (27), World
Others International aviation, Eggs, BloombergGPT

Multi-select would probably be allowed in that dropdown.

Additional context

This dropdown could also be very handy on the table tab, providing a similar filtering function. And it could replace the current split into "Country/area" and "Other", thereby solving #3335.

Mockup

CleanShot 2024-05-10 at 00 46 28

danyx23 commented 1 month ago

This makes sense but we are a bit unsure if the drop down makes the entity selector too busy. Another approach that could also be considered is to turn the list of checkboxes under countries and regions into a list of notion style toggle triangle headings (i.e. one for Income groups, Continents etc) with the items inside it.

We think it would be good to discuss this with @mrwbkrm (maybe at the next data viz triage meeting)

mrwbkrm commented 1 month ago

Hey there! Yes, I did some discovery work on this back in the day! Here you can find some outdated sketches with some ideas there. Open to discussing whenever you like!