owid / owid-grapher

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

Charts with projections do not do multiple entities well #3750

Open larsyencken opened 3 months ago

larsyencken commented 3 months ago

Background

Sometimes our data sources include projections into the future. Grapher handles this by using two indicators, one for the "stem" of the chart containing actual measurements, and one for the projections. The projection indicator has isProjection: true set, causing it to be displayed as a dotted line.

Problem

Our approach makes all lines with projections into multi-indicator charts. But when charts are both multi-indicator and multi-entity, then every line needs a double-label, which is super ugly.

Impact

This tends to impact only a few charts, but quite important ones.

We have workarounds, but they require us to either

Screenshot 2024-06-27 at 16 51 41

Possible approaches

larsyencken commented 3 months ago

/cc @lucasrodes

larsyencken commented 3 months ago

Here's a good example of a benefit of keeping projections in different indicators, at least as one of our options: https://ourworldindata.org/grapher/comparison-of-world-population-projections

comparison-of-world-population-projections

marcelgerber commented 3 months ago

Another related issue we have is that currently, there is a visible gap between when the observed data ends and when the projections begin.

CleanShot 2024-06-27 at 17 22 17

danyx23 commented 2 months ago

The problem of upper and lower confidence intervals is also a bit related (two more time series that are closely related but lead to some odd behaviour e.g. in facetting).

Probably it makes sense to keep these as different variables as they can then also have different sources (e.g. the historic data might come from a different institute than the projection?).

The relationship of different variables/indicators to each other is something that Grapher is very bad at. If it were better with this then this could also have big benefits for doing drillup/-down.