Using line curve

By default, the D3 line generator uses the linear curve mode; however, D3 supports a number of different curve factories. The curve function determines how data points will be connected, for example, by a straight line (linear) or a curved line (B-spline). In this recipe, we will show you how these curve modes can be set along with their effects.

Getting ready

Open your local copy of the following file in your web browser:

https://github.com/NickQiZhu/d3-cookbook-v2/blob/master/src/chapter7/line-curve.html

This recipe is built on top of what we did in the previous recipe, so if you are not

yet familiar with basic line generator functions, please refer to the previous recipe first

before proceeding.

How to do it...

Now, let's take a ...

Get Data Visualization with D3 4.x Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.