drawPts={
svg.selectAll("circle")
.data(pts)
.join("circle")
.attr("cx", d => xScale(d.x))
.attr("cy", d => yScale(d.y))
.attr("r", ptRad)
.style("fill", "red")
.call(d3.drag()
.subject(function(event, d) { return {x: xScale(d.x), y: yScale(d.y)}; })
.on("drag", function(event, d) {
d.x = xScale.invert(event.x);
d.y = yScale.invert(event.y);
svg.property('value', pts).dispatch('input');
d3.select(this).attr("cx", event.x).attr("cy", event.y);}));
}