owid / owid-grapher

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

Improve map bracket tool in chart admin #3641

Open pabloarosado opened 4 months ago

pabloarosado commented 4 months ago

Core problem

Picking map brackets is painful and could be simplified. Also, our chart admin allows for binning strategies that are not consistent with our map bracket guidelines.

NOTE: This issue is simply about improving our current tool. We already have a separate issue to decide on the optimal default strategy (which may require further discussion and experimenting).

Proposed solution

Currently, grapher has the following binning strategies: "Equal-interval", "Quantiles", "CKmeans", and "Manual". My intuition is that at least over 90% are "Manual" (maybe some are "Equal-interval"), but I haven't checked.

Instead, we need only the options that are consistent with our guidelines, namely:

To pick the free parameters, we could have:

https://github.com/owid/owid-grapher/assets/12246978/5832a4ca-3d85-499f-9871-4aef29877e75

Additionally, we need to input whether the left and right edges are open or closed. Ideally, this could happen by clicking on each of the grabbable edges of the slider (but this may be complicated).

According to the guidelines, the number of brackets should always be between 4 and 10 (except in special, custom cases). So, if the user chose fewer than 4 or more than 10, we could get a warning (similar to when the text of the subtitle is too long).

NOTE: For indicator-based explorer, we would need a totally separate tool, since they can't be tweaked from the admin. But that would probably require a separate issue.

danyx23 commented 3 months ago

Makes sense but I think it would be useful to first decide on our ideal default strategy in #3640 and then think about what other options we should still offer in the admin.