This is a variation of Mike Bostock's Polar Plot using D3 v4. In this example, the radial line generator is used to draw the red line and to plot the function 1 + cos(t) over the domain [0,2π].
forked from cforney's block: Polar Plot (v4)
forked from vikkya's block: Polar Plot (v4)
https://d3js.org/d3.v4.min.js