null values getting classified and symbolized with numeric attributes
See original GitHub issueCurrent behavior
Currently, null values are being included in both continuous and classed maps.
In the example dataset, (poverty by census tract in Brooklyn), there are null values in the data that are getting colored as if they have actual numeric values.
After speaking with @elenatorro yesterday, we did some digging and found that if null
a value of 0
is returned. In the numeric context, since 0
is actually a value, this isn’t the desired behavior.
Example
In the gif below, you’ll see that I highlight some polygons that are getting colored even though they have null values:
At the end of the gif, you will see that there are also polygon values of 0.
Sample map here: https://bl.ocks.org/makella/bc8837f53a07ea0b6730ccbd342a6308
Expected behavior
In this context, null
could be equivalent to:
- no value so don’t show
- or “no data”, which is important to be able to highlight on both the map and legend where appropriate:
To satisfy both, default behavior should be similar to category/symbol/etc. ramps where “other values” are sent to an others “category” and colored with our others gray. Similar to those ramps, the other color should have the option to be overwritten, for example, to not symbolize, a user could set the default other color to something like rgba(0,0,0,0)
or modify our default gray to a color that better suits their map.
cc @andy-esch
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top GitHub Comments
This is fixed in the new CF version using WebSDK. It will be available on the next 1.1 release.
Yes. I think we are all aligned now. We know the possible use cases and we need to discuss more to find the best solution.
However, as Elena said, we could prioritize the rest of the tickets for the release (size legends, helpers, docs), and keep this one for the next iteration 👍