May 2019
Beginner to intermediate
650 pages
14h 50m
English
A quantile scale maps a sampled set of discrete input values to a discrete range, dividing the sample into equal sized sets, according to the number of items in the range. Once the quantiles are set, the scale can receive continuous input that will place output values in each segment according to the quantiles that were computed from the sample.
In the following example, a 12-item sample is mapped to a 3-item range, computing segments that equally distribute the sample (placing 4 items in each). This computes quantile thresholds that will determine in which segment new values will be placed:
const sample = [0,8,19,25,65,98,120,170,320,440,800,910];const colors = ['blue','green','red']; const scaleBuckets = d3.scaleQuantile() ...
Read now
Unlock full access