score:0

check out onmousedown and onmouseup to have a little more control.

A click is a full completion of both of these events (mouse down, then mouse up). I think you're looking for the mouse down even.

score:1

From this example, you can add if (d3.event.defaultPrevented) return; into your click event to prevent it from happening when a zoom is happening.

.on("click",function(){
  if (d3.event.defaultPrevented) return;
    alert("CLICKED!!")
  })

Here is an implementation, from your fiddle.


Related Query