d3-scale-chromatic provides D3 color interpolators for visualizing continuous values. A sequential interpolator maps low values through a color progression to high values. section 13.2.3
Use a sequential scheme when:
- A continuous measure, such as country-level Nobel laureate counts, needs color encoding. section 13.2.3
- An extreme value would flatten differences, so the scale domain can be capped at a useful upper limit. section 13.2.3
Coloring a choropleth map
Import scaleSequential from d3-scale and interpolateYlGnBu from d3-scale-chromatic, then create countryColorScale with domain([1, 100]). Apply countryColorScale(country.properties.laureates.length) to each country with data, and use a pale fallback for countries without laureates.
