I have an svg group upon which I call a drag function.
var container=d3.select("#id");
container.call(dragcontainer);
var dragcontainer = d3.drag()
.on("start", function () {})
.on("drag", function (d, i) {
//(d3.select(this)).select("rect");
})
.on("end", function () {});
Apparently, d3.select(this)
does not return the container
, however they are similar (checked through attributes), but just not exactly the same.
Why does this happen? How can I access container
within the called function?