{
let ctx = DOM.context2d(width, width);
ctx.fillStyle = "white"
const nPts = 100
const scale = d3.scaleLinear()
.domain([0, nPts])
.range([0, width])
const xPts = d3.range(nPts).map(pt => {
const x = 5,
y = scale(pt)
ctx.moveTo(x, y);
ctx.arc(x, y, 4, 0, 2*Math.PI);
return {x,y}
})
const yPts = d3.range(nPts).map(pt => {
const x = scale(pt),
y = 5
ctx.moveTo(x, y);
ctx.arc(x, y, 4, 0, 2*Math.PI);
return {x,y}
})
console.log(yPts)
ctx.fillStyle = "black"
ctx.fill()
for (let i = 0 ; i < nPts ; i++) {
const start = xPts[i]
const end = yPts[nPts-1-i]
ctx.beginPath();
ctx.moveTo(start.x, start.y);
ctx.lineTo(end.x, end.y);
ctx.stroke();
}
return ctx.canvas
}