score:1

A simple way to handle special cases in your colour scale is to not pass the scale directly to d3.attr / d3.style, but wrap it in an anonymous function and check there:

counties
    .attr('fill', d => d === null ? 'grey' : color(d))

Related Query

More Query from same tag