[FEATURE] Predefined breaks for LinearColorMapper
See original GitHub issueI’m developing an application to analyze arbovirus infections in the neighborhoods of two cities. Heat maps are generated for each city, their color scheme varies according to the count of infections in the neighborhoods. One of the problems in generating color of these maps is the interest data distribution. The vector of infection counts for each city has very distant values, such as the vector v1 = [1, 2, 3, 3, 4, 7, 8, 9, 15, 20, 39, 40]
. The LinearColorMapper
with 4 colors would generate mapping intervals with size 10 breaks, such as [1, 10), ..., [30, 40]
. So, as we can see, more than half of v1
would be included in the break [1, 10)
, causing many neighborhoods to be mapped to a single color. An ideal set of intervals for this problem would be c = {[1, 4], [7, 9], [15, 20], [39, 40]}
, as it would allow for more color abundance on maps. An alternative to solve this problem would be allow the LinearColorMapper
function to receive externally generated intervals or to add a resource in the LinearColorMapper
function that allows selecting the algorithm for generating breaks, such as Fisher-Jenks and Jenks-Caspall.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (10 by maintainers)
Just to be clear I think viewport-based colormapping is out of scope. I think it is far more common for people to want to apply a colormap globally.
So I am personally 👎 on this sort of approach. It is limiting in the sense that the only algorithms that would be available would be the ones we happen to choose to support, and that will never satisfy everyone. I don’t want the project to be on the hook for curating which algorithms get added and which don’t, and I don’t want the project to be on the hook to maintain them, either.
I would propose something more generic that simply exposes the ability for users to specify piecewise linear maps explicitly. Then generating those maps (using whatever algorithm is desired) is the user’s responsibility.