Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts with projections do not do multiple entities well #3750

Closed
larsyencken opened this issue Jun 27, 2024 · 7 comments
Closed

Charts with projections do not do multiple entities well #3750

larsyencken opened this issue Jun 27, 2024 · 7 comments

Comments

@larsyencken
Copy link
Contributor

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

  • We could disable dual-labelling of lines, when a chart has only two indicators and one is a projection
  • We could provide the ability to mark-up that an indicator is a projection after a certain year (e.g. "projectionAfter": 2023)
@larsyencken
Copy link
Contributor Author

/cc @lucasrodes

@larsyencken
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor

danyx23 commented Jul 9, 2024

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.

@sophiamersmann
Copy link
Member

@lucasrodes can you help me understand the core of this issue?

Enabling multiple entity selection for the Population Growth Rates chart (the first example) looks ok to me in its default view. What am I missing?

Screenshot

Image

Of course facetting wouldn't work. Is that what this issue is about?

Or is it about these 'dual-labels' (+ incorrect colours) for multi-entity multi-indicators charts?

Screenshot

Image

@lucasrodes
Copy link
Member

lucasrodes commented Jan 7, 2025

I don't remember the root problem at the moment. They may have been resolved during the year. But I am not sure.

I checked the examples that Lars mentioned:

(a) configure the chart to disallow multiple entity selection (e.g. population-growth-rates); or

As you mention, I don't see a problem with the chart when enabling the multi-choice selector.

(b) fold projections into a single indicator and hide the fact that it's a projection (e.g. Population and Demography explorer)

I am unsure if it is related, but I don't know how to show projected (i.e., dashed) lines in an explorer view.


Anyhow, I think the issue, if any, is about plotting charts with multiple entities and projected/non-projected lines, as in your second example. I think that's a rare case, but ideally we would want to keep the same colors per-entity.

In general, I think it'd be nice if we improved the workflow with projections. Anyway, I think this sounds more like a bigger thing, so it would create a separate issue for that.


I've noticed the issue raised by Marcel, too.

And as Daniel says,

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.

I think there is room to improve this a bit, but also a separate issue.

@sophiamersmann
Copy link
Member

Thanks for taking the time to look into this, @lucasrodes!

I'll close this issue then and create new issues for more specific problems instead.

Re explorers: I don't think there is a way to have projected data in explorers, but it should be relatively straightforward to support that. I'll create an issue for it!

@sophiamersmann sophiamersmann closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants