The ‘scaleLinear()’ Scale
The linear scale is the simplest scale offered by D3. It can transform continuous data into other continuous data.
We'll cover the following
Let’s talk about the linear scale. It is the first scale we went over. Let’s quickly review what this scale does now that we have a better idea of what continuous and discrete data are.
The scaleLinear()
function is a scale for continuous datasets. The input domain for the linear scale should be continuous. As for the output range, it can be considered continuous, too. The concept of continuous and discrete datasets does not just apply to input domains. A scale function will transform our data into a new dataset which can then be categorized as continuous or discrete. In the case of the scaleLinear()
function, the range will be continuous.
Domain and Range
One more time, let’s look at this diagram.
Get hands-on with 1400+ tech skills courses.