#### Overview of this book

Master D3.js and create amazing visualizations with the Data Visualization with D3 4.x Cookbook. Written by professional data engineer Nick Zhu, this D3.js cookbook features over 65 recipes. ? Solve real-world visualization problems using D3.js practical recipes ? Understand D3 fundamentals ? Includes illustrations, ready-to-go code samples and pre-built chart recipes
Data Visualization with D3 4.x Cookbook - Second Edition
Credits
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
Getting Started with D3.js
Be Selective
Dealing with Data
Tipping the Scales
Playing with Axes
Transition with Style
Getting into Shape
Chart Them Up
Lay Them Out
Using Force
Building Interactive Analytics in Minutes

## 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.

### 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 &lt;= a*n + b &lt;= 20</span>
</div>
<div id="pow" class="clear"><span>n^2</span></div>
<div id="pow-capped" class="clear">
<span>1 &lt;= a*n^2 + b &lt;= 10</span>
</div>
<div id="log" class="clear"><span>log(n)</span></div>
&lt...```