The ‘scaleQuantile()’ Scale
Explore the D3.js quantile scale to understand how it maps continuous input into discrete output buckets. Learn its application in distributing data evenly into color ranges, ideal for creating balanced visualizations like heatmaps. This lesson guides you through using the quantile scale effectively to represent data distribution in color-coded charts.
We'll cover the following...
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
The input domain for a quantile scale is ...