owid / owid-grapher

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

feat: default entity selection in indicator-based explorers #2586

Open lucasrodes opened 1 year ago

lucasrodes commented 1 year ago

Description

For the history of war, we are creating an explorer. This explorer uses indicators from different sources. Each source has different entities, and there is zero overlap between some (except for 'World').

We recently were able to define the selectedEntityNames field directly from ETL, so that we can define this at the explorer view level. Before this, we would define a value for "selection" in the explorer config which would apply to all explorer views.

To this end, I have defined different default selections for different indicators. While this works as expected when loading a view, when switching between views from sources with different entities, the behaviour might not be optimal (although it follows the current logic).

Expected behaviour

When switching between views, we propagate the currently selected entities, which we sometimes want (we don't want the user to re-select the entities they are interested in each time they change the explorer view!). However, it'd probably be nice to also:

I am unsure what we'd want for intermediate situations like: "the user keeps all the default selected entities but one, and then switches to the new explorer view".

Steps to reproduce

Steps to reproduce the behaviour:

  1. Go to the explorer preview:https://owid.cloud/admin/explorers/preview/debug-conflict-data?facet=none&Conflict+type=All+wars&Metric=Deaths&Sub-metric=Ongoing&Sub-type=by+type&Source=Project+Mars
  2. Observe the selected entities
  3. Change the source (use the last dropdown): Project Mars ā†’ Correlates of War - Wars
  4. Observe the selected entities

Demo

Example when switching between views with different underlying sources: Project Mars ā†’ Correlates of War - Wars. These sources don't have overlapping entities (except for Asia).

https://github.com/owid/owid-grapher/assets/18101289/c739afb5-c847-4eb6-af0c-45fcec377d49

sophiamersmann commented 1 year ago

Thank you for the detailed write-up, Lucas. It's appreciated šŸ™šŸ»

larsyencken commented 10 months ago

(Wrote this in the wrong issue, migrating the comment here)

From discussion with Sophia, this is actually a bit of a complex change to understand and do on the explorer side, meaning it could take up to a cycle to do. That makes it harder to prioritise, and means we need a strategic steer to decide whether or not to tackle it.

If we were doing this next year, we'd hope to tackle this by making the explorer out of a bunch of indicators, instead of trying to squeeze them into this system which has a common selection paradigm. That could be a reason not to try to make it work for our explorers now. We'll discuss in Product/Engineering planning.

sophiamersmann commented 10 months ago

(I also migrated the tags just now)