I have a certain behavior in a d3 visualization that occurs on mouseover. It's a force layout, with elements that can be clicked and dragged. Right now if I mouseover one element while dragging another, the mouseover behavior is triggered. I want to suppress that while dragging. How can I make the behavior on one event conditional on the status of another event?
The code right now looks something like:
selection
.call(force.drag) // allows you to drag and drop elements of the force layout
.on("mouseover", function() {
// behavior I want to suppress during click and drag
})
.on("mouseout", function() {
// return layout to pre-mouseover state
});