owid / owid-grapher

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

Marimekko: Entities with interpolated data points are not labelled #2141

Open saloni-nd opened 1 year ago

saloni-nd commented 1 year ago

Core problem

The Marimekko charts currently shows labels for small countries that can't be seen easily. But it's probably more useful to show labels for the biggest countries (e.g. China and India and others) because those are large blocks that might seem weird/confusing to people when they first see the chart.

When there’s a map view as well I think it doesn’t add much to see the small countries labelled, and people probably just want to know about the population overall.

For example in this chart.

cause-of-death-registration-population (2)

Proposed solution

Label the countries with a large population size, not the small countries.

Alternatives

Possibly add a 'select countries' button to find small countries if people want to see them, like how we have on dotplots such as this chart.

larsyencken commented 1 year ago

After discussion with Sophia, this is definitely a change we'd like to do that would make Marimekko charts better. For very small countries that can't really be selected, it's probably reasonable that you simple can't select or hover over them in this type of chart.

Guesstimating at 3h, but could be 1d.

sophiamersmann commented 1 year ago

I just did a little digging into this, and as a matter of fact, we already choose to show labels for the bigger countries: https://github.com/owid/owid-grapher/blob/2f410aa4dac005de454d941f92c9ce1b7efdbd4c/packages/%40ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx#L1279

However, we only consider labelling countries for which we have data for the latest year: https://github.com/owid/owid-grapher/blob/2f410aa4dac005de454d941f92c9ce1b7efdbd4c/packages/%40ourworldindata/grapher/src/stackedCharts/MarimekkoChart.tsx#L1209-L1211

For example, China is not picked to be labelled as its data point is inferred (but it would be labelled if we relied on xColumn instead of xColumnAtLastTimePoint):

Screenshot 2023-06-27 at 16 38 40

(cc @danyx23)

github-actions[bot] commented 2 months ago

This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.

saloni-nd commented 2 months ago

Should this be reopened?

sophiamersmann commented 2 months ago

Yes, let's keep it open!