Using continuous scales
In this recipe, we will examine the most commonly used scales provided by D3: the continuous scales that map a continuous quantitative domain to a continuous range, including linear, power, logarithmic, and time scales.
Getting ready
Open your local copy of the following file in your web browser:
https://github.com/NickQiZhu/d3-cookbook-v2/blob/master/src/chapter4/continuous-scales.html .
How to do it...
Let's take a look at the following code example:
<div id="linear" class="clear"><span>n</span></div> <div id="linear-capped" class="clear"> <span>1 <= a*n + b <= 20</span> </div> <div id="pow" class="clear"><span>n^2</span></div> <div id="pow-capped" class="clear"> <span>1 <= a*n^2 + b <= 10</span> </div> <div id="log" class="clear"><span>log(n)</span></div> <...