score:1

Accepted answer

Minor change/typo:

You're assigning height and width to the body and not the svg. Interchanging those 2 lines:

let svg = d3.select("body")
  .append("svg")
  .attr("width", fullWidth)
  .attr("height", fullHeight)

And adding some CSS to the paths:

path.line {
  fill: none;
  stroke: #000; 
}

Here's a fork: https://codepen.io/shashank2104/pen/GwqjVK


More Query from same tag