Labels on filled maps

Why doesn’t the filled map allow for any data labels?

I know it seems silly, but the 2 char state is more useful that the names of a couple of cities in the state. And given the continuous min-max color scale, it’s difficult to differentiate the count. I’d like to plot it.

  • I’d really like to be able to set stepped color boundaries. 3, 4, or 5 segments would be terrific.
  • we only have one option for the min-max color-- default is a progressive light to dark. But we also needed a divergent scale “bad” to “good”. We are forced to choose one over the other. Authors need both.
  • Finally, I’d like to be able to switch the direction of the min and max legend. When horizontal it goes max to min instead of min to max. The latter makes more sense without our data.

Hi @aseaman,
In regards to your color scale, what if you created a custom scale based on the count size? It could look something like this:

ifelse(
    {count} <= 3, '1', 
    {count} > 3 AND <= 6, '2', 
    {count} > 6 AND <= 9, '3', 
    {count} >9 AND <= 12, '4',
    {count} > 12, '5',
    NULL)

Or, another option you could do would be to essentially categorize all 50 states in to a set amount of groups (example below broke down to 5 groups) and then rank them by your measure (count). Which could look something like the below:

ifelse(
rank <= maxOver({count}, [], PRE_AGG)*0.2, '1',
rank > maxOver({count}, [], PRE_AGG)*0.2  AND rank <= maxOver({count}, [], PRE_AGG)*0.4, '2',
rank >  maxOver({count}, [], PRE_AGG)*0.4 AND rank <= maxOver({count}, [], PRE_AGG)*0.6, '3',
rank >  maxOver({count}, [], PRE_AGG)*0.6 AND rank <= maxOver({count}, [], PRE_AGG)*0.8, '4',
rank > maxOver({count}, [], PRE_AGG)*0.8, '5',
NULL
)

This second option would also require a denserank calculation to be made as well.

In regards to your second comment about setting up 2 scales; currently this map visual type only allows for one field to be used so you may need 2 separate visuals to accomplish.

Last, for the gradient question; I believe that switching the gradient scale on the legend is a current limitation.
You can change the gradient scale colors if you want to switch those, but the legend on the visual will not be affected by this. You can achieve this by going to ‘Edit’ at the top and then ‘Themes’.
image

The second 2 options would be great additions to this visual type so I’ll go ahead and mark this as a feature request so that our support team can get visibility.

If you have any additional questions, feel free to let me know!

1 Like

Thank you very much for the detailed suggestions.
I figured I’d have to do a calc for the step-sizing and I really appreciate the leg up on writing it.

1 Like