<body>
  <svg id="mainSVG" width="500px"   height="500%">  
  </svg>
<body>
svg{
  border:1px solid black;
  width:500px;
  height:500px;
} 
let mainSVG = d3.select("#mainSVG")

let data = [
  [100,100],
  [400,400]
]

// let data = [
//   [50,60],
//   [100,80],
//   [160,220],
//   [160,280],
//   [330,360],
//   [420,120]
// ]

let lineGenerator = d3.line() 

mainSVG.append("path")
  .attr("d",lineGenerator(data))
  .style("stroke","black")
  .style("fill","none")

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.