Online decision support tool to create local energy situations for neighbourhoods, cities and regions with a time resolution of 15 minutes created and maintained by Quintel – Not maintained
it would be nice to not trigger the drag behaviour if the mousedown target is a node/popup
It doesn't do this when it's a popup 👍 . It does do it when it's a node 👎 . I'm able to capture the event target when I'm zooming like this:
if (d3.event.sourceEvent.originalTarget.nodeName === "svg") {
...
}
This means that I only apply the transition of the svg when my initial mousedown was on the svg. However when I hold my mousedown on the circle and even barely move out of the circle my zoomListener does go into effect resulting in a really stuttery zoom (because I'm moving in and out of the circle).
Another approach would be to remove all zoom listeners from a certain d3 element like this:
d3.select("circle").on(".zoom", null);
However, the zoomListener is attached to the svg and therefor to all the elements inside the svg. So I'm a bit fiddling still but thought I might give you a status update 😄
It doesn't do this when it's a popup 👍 . It does do it when it's a node 👎 . I'm able to capture the event target when I'm zooming like this:
This means that I only apply the transition of the
svg
when my initial mousedown was on thesvg
. However when I hold my mousedown on thecircle
and even barely move out of thecircle
myzoomListener
does go into effect resulting in a really stuttery zoom (because I'm moving in and out of thecircle
).Another approach would be to remove all
zoom
listeners from a certain d3 element like this:However, the
zoomListener
is attached to thesvg
and therefor to all the elements inside thesvg
. So I'm a bit fiddling still but thought I might give you a status update 😄