I am using the D3 library to move an item within a Venn-diagram. When I stop dragging I want to determine the position of the item in the diagram.
item.call(
To keep reference to 'this' use arrow functions like this:
item.call(d3.drag() .on("start", (d, i) => this.dragstarted(d,i)) .on("drag", (d, i) => this.dragged(d, i)) .on("end", (d, i) => this.dragended(d, i)) );