{
const svgHTML = html `<svg height="300" width="500" style="border: 1px solid #ccc" />`
const svg = d3.select(svgHTML)
const rects = svg.selectAll('path')
const data = [ [[0, -100], [0, 100]], [[5, -50], [5, 50]], [[ 10, -25], [ 10, 25]], [[15, -150], [15, 150]]]
const xScale = d3.scaleLinear().domain([0, 20]).rangeRound([0, 500])
const yScale = d3.scaleLinear().domain([-100, 100]).rangeRound([100, 200])
const line = d3.line()
.x((d, i, arr) => {
console.log(d)
return xScale(d[0])
})
.y((d, i) => {
return yScale(d[1])
})
rects
.data( data )
.enter()
.append('path')
.attr("fill", "none")
.attr("stroke-width", 1.5)
.attr("stroke", '#000')
.attr('d', d => line(d))
return svgHTML
}