I am using the d3.js v5.4.0
.
Here is the error I am getting: Uncaught Error: unknown type: dragend
.
It is because I am trying to do the following:
d3.drag()
.subject(function(d){
return {x: d.x, y: d.y};
})
.on("drag", function(args){
thisGraph.state.justDragged = true;
thisGraph.dragmove.call(thisGraph, args);
})
.on("dragend", function() {
// todo check if edge-mode is selected
});
And dragend
seems to be deprecated now.
I tried to find out the release notes which would describe the alternative to this in the newer versions over here, but was not able to do that.
Please, help me to tackle the problem.
The three events that you can listen for with a drag are currently (v4 & 5. v3 and prior were different):
So, you should just need to change dragend to end