The ‘scaleQuantile()’ Scale

The quantile scale transforms continuous data into discrete data. The distribution is based on equally dividing the domain.

The next scale we will learn about is called the quantile scale. It is another scale that can perform a similar task to the quantize scale. We are going to use it for mapping our data to colors.

The quantile scale will accept a continuous input domain, and it will transform the data into discrete data. Since we are transforming the data into discrete data, we need to provide a list of possible values.

We are going to be using three colors like last time. They will be white, pink, and red. Overall, the quantile scale seems similar to the quantize scale. The difference between the two scales is how data is divided into buckets.

How the quantile scale works

Get hands-on with 1200+ tech skills courses.