Using a linear generator is relatively simple. You can use it with default parameters and specify everything in such data:
d3.svg.line.radial()([[4,Math.PI/4],[7,Math.PI/4]]);
As an alternative, you can only provide data that changes, and everything else is by default:
var line = d3.svg.line.radial() .angle(Math.PI/4) .radius(function(d) { return d; }); line([4,7]);
source share