Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the drag behavior independent of the target element’s data? #2

Closed
mbostock opened this issue May 6, 2016 · 1 comment
Closed
Assignees

Comments

@mbostock
Copy link
Member

mbostock commented May 6, 2016

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).

@mbostock mbostock self-assigned this May 6, 2016
@mbostock
Copy link
Member Author

mbostock commented May 6, 2016

We’ll also need to observe multiple changedTouches during a touchstart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant