{
const c = html`<svg></svg>`
let data = [{"x": 10, "y": 11}, {"x": 20, "y": 25}, {"x": 50, "y": 100}]
let circle = d3.select(c)
.attr("width", 200)
.attr("height", 200)
.selectAll("circle")
.data(data)
circle.enter().append("circle")
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; })
.attr("style", "fill: red")
.attr("r", 0)
.transition()
.duration(750)
.attr("r", 5);
data = [{"x": undefined, "y":undefined}, {"x": 50, "y": 100}, {"x": 150, "y":150}, {"x": 150, "y":30}, ]
circle = d3.select(c).selectAll("circle")
.data(data);
circle.exit().transition()
.attr("r", 0)
.remove();
circle.enter().append("circle")
.attr("r", 5)
.attr("style", "fill: blue")
.merge(circle)
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; });
return c;
}