This choropleth uses a threshold scale for quantization, mapping arbitrary slices of a continuous domain to discrete values in the range. Unemployment rates ranging from 2 to 10% are quantized into different shades of purple.
var color = d3.scale.threshold()
.domain([0.02, 0.04, 0.06, 0.08, 0.10])
.range(["#f2f0f7", "#dadaeb", "#bcbddc", "#9e9ac8", "#756bb1", "#54278f"]);
hi! I'm playing around with chorpleths, unfortunately my data is not "that nice". I was wondering if there's an elegant solution for the scale functions itself to handle null values. The only solution I have so far is something like:
many thanks.