Skip to content
New issue

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

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

Already on GitHub? # to your account

remove drag.container? #71

Open
Fil opened this issue May 13, 2020 · 1 comment
Open

remove drag.container? #71

Fil opened this issue May 13, 2020 · 1 comment
Labels

Comments

@Fil
Copy link
Member

Fil commented May 13, 2020

drag.container was introduced by 8277204 to solve #2, but it doesn't seem necessary for the case mentioned in the issue. In fact I couldn't find an example where it is used directly, and I'm a bit at a loss to create one where it might be useful.

Since event.x and y are computed as relative values (p[0] - initial p[0] + initial x), it does not seem to matter which container we choose. (Except when the container itself is moving during the gesture (!), but that's probably not a common case and would be handled by calling d3.mouse(container) or d3.pointer(event[, node]), for, I guess, a similar effect.)

Addendum: the only impact seems to be on determining the subject, which can certainly be done with the d3.pointer(event[, node]) method instead.

@Fil Fil added the idea label Jul 24, 2020
@Fil Fil changed the title remove drag.container ? remove drag.container? Jul 24, 2020
@Fil
Copy link
Member Author

Fil commented Jul 28, 2020

Here's an example "in the wild" where drag.container is used, but it can be removed with no ill effect.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

1 participant