You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What if you wanted to use d3-drag on Canvas to drag circles? In that case, you wouldn’t be able to listen for mousedown on a specific element, since it would always be dragging on the Canvas element. But maybe there’s still a way to do it: the drag behavior could track the coordinates relative to the first click (and maybe there’s an equivalent to drag.origin in D3 3.x that lets you offset the coordinates to something more natural). You’d also presumably need something like drag.filter that lets you test whether you clicked on something before initiating the drag. And, when a drag event is dispatched, to know that’s being dragged (since there could be multiple things in motion).
The text was updated successfully, but these errors were encountered:
What if you wanted to use d3-drag on Canvas to drag circles? In that case, you wouldn’t be able to listen for mousedown on a specific element, since it would always be dragging on the Canvas element. But maybe there’s still a way to do it: the drag behavior could track the coordinates relative to the first click (and maybe there’s an equivalent to drag.origin in D3 3.x that lets you offset the coordinates to something more natural). You’d also presumably need something like drag.filter that lets you test whether you clicked on something before initiating the drag. And, when a drag event is dispatched, to know that’s being dragged (since there could be multiple things in motion).
The text was updated successfully, but these errors were encountered: