May 2019
Beginner to intermediate
650 pages
14h 50m
English
Sequential and diverging scales are commonly used to interpolate colors, which can be mapped to values for use in charts with interpolated scales. There are four groups of interpolated color schemes in the d3-scale-chromatic module: diverging, single-hue, multi-hue, and cyclic.
The most common way to use a color scheme is to use its interpolator to initialize a sequential or diverging scale, which has a default fixed range of [0,1]. For example, the following code draws a sequence of colored rectangles, which is used to generate a rainbow sequence by initializing a d3.scaleSequential() scale with a d3.interpolateRainbow interpolator function:
const scale = d3.scaleSequential(d3.interpolateRainbow) .domain([0,600]); ...
Read now
Unlock full access