score:3

Accepted answer

jsfiddle.net/kds6wkh0

The update selection:

let dot = svg
        .selectAll('.dot')
    .data(data,d=>d.id)
  dot.select('circle')
    .attr('cx', d => SCALES.x(d.x))
    .attr('cy', d => SCALES.y(d.y))
    dot.select('text')
    .attr('x', d => SCALES.x(d.x))
    .attr('y', d => SCALES.y(d.y))

Related Query

More Query from same tag