In D3, pan works both in (left or right click) + drag. However, in my case I want to reserve the (left click + drag) for other actions while (right click + drag) do the panning.
How can I disable panning on left click?
Thanks.
Add check on mouse down in your function where you handle the drag.
function doDrag(){
if(d3.event.sourceEvent.button == 0){
d3.event.stopImmediatePropagation();
return;
}
//other drag work
}
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With