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:
Linear: Similar to equal-interval, but allowing for more "rounded" intervals, e.g. instead of [0, 4, 8, 12> -> [0, 5, 10, 15>. Here, we'd need to choose three parameters: the left and right edges, as well as the increment (which could be any number).
Log: (to be precise, log or log-like) Here, the free parameters would be the left and right edges, as well as the factor, which ould be one of the following:
x2, e.g. <1, 2, 5, 10, 20, 50, 100, 200, 500, 1000> (following the sequence x2, x2.5, x2, x2.5...).
x3, e.g. <1, 3, 10, 30, 100, 300> (following the sequence x3, x10/3, x3, x10/3...).
x10, e.g. <1, 10, 100, 1000> (this is actually a true log scale, not log-like, but to simplify we could put them together).
Custom: For special cases like poverty lines. This would be what we currently have.
To pick the free parameters, we could have:
If log, a dropdown to choose the factor (x2, x3, or x10), and then let the user tweak the left edge and right edge with a slider, similar to the one grapher charts have:
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).
If linear, a text field to insert the increment (e.g. 1), as well as the same slider above.
If custom, let the user define each bracket value, as we currently do.
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.
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.
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.