owid / owid-grapher

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

Additional color scales that indicate 'this is bad', even at lower brackets of the scale #3488

Open maxroser opened 5 months ago

maxroser commented 5 months ago

Core problem

Sometimes our color scales don't get across how serious an issue is. We need color scales that signal 'this is bad' even at the lower end of the color scale.

This map is an example. The data shows that almost every third child in South Africa was stunted at that time, but I think the map doesn't quite convey this — the shad of light orange conveys 'it's pretty okay here'. share-of-children-younger-than-5-who-suffer-from-stunting(1)

Proposed solution

I would like to have each of these sequential color schemes in a version that gets to 'more serious', darker colors earlier.

I sometimes do this manually by copying the hex code from a higher bracket to a lower bracket and adding darker colors for the top bracket.

Here is a sketch of how I do it — the arrow indicate where the colors are taken from:

Screenshot 2024-04-13 at 19 28 14

It'd be great to create such additional 'steeper' color scales for the Grapher backend. They are especially needed for the color scales that are used for showing bad metrics — the color scales in shades of orange and red.

Screenshot 2024-04-13 at 19 31 44

(The screenshot is from ColorBrewer, the origin of our color scales.)

paarriagadap commented 5 months ago

I think this is something that could be done by setting the "center value" I describe here: https://github.com/owid/owid-grapher/issues/2166, so we can define when the color changes to bad levels.

maxroser commented 5 months ago

Very true, these two issues are closely related.

danyx23 commented 4 months ago

We'll probably try to fix this with a center point first and then see if we need to do more here.