selection merge error: is not a function
amandaXCY opened this issue · comments
Amanda commented
D3 version is : "d3": "^5.9.1"
this my code,run error: u.enter(...).append(...).merge is not a function
var myData = ["A", "B", "C", "D", "E"];
var u = d3
.select("body")
.selectAll("div")
.data(myData);
u.exit().remove(); // EXIT
u.enter()
.append("div")
.merge(u)
.text(function(d) {
return d;
});
Mike Bostock commented
I’m unable to reproduce this issue. Here is a working version:
https://observablehq.com/d/8c213b6894b3b087
Also, I highly recommend the new selection.join. I’ve adapted your code to use selection.join in the linked notebook.