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

Add d3.pointers. #255

Merged
merged 7 commits into from
Aug 4, 2020
Merged

Add d3.pointers. #255

merged 7 commits into from
Aug 4, 2020

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Aug 3, 2020

Alternative to #253 per #253 (comment).

@mbostock mbostock requested a review from Fil August 3, 2020 15:53
import sourceEvent from "./sourceEvent.js";

export default function(events, node) {
if (events.target) { // i.e., instanceof Event, not TouchList or iterable
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I’d prefer events instanceof Event here, but our current custom events in d3-drag etc. don’t extend Event, so that isn’t possible. It might be possible to change them to extend Event, although for all I know, that may introduce other problems.

Copy link
Member

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think this is the correct approach. Thank you!

In #256 I added the missing import in src/index.js and fixed sourceEvent.currentTarget

src/pointer.js Show resolved Hide resolved
src/pointers.js Show resolved Hide resolved
Fil and others added 5 commits August 3, 2020 21:33
Co-authored-by: Mike Bostock <mbostock@gmail.com>
Co-authored-by: Mike Bostock <mbostock@gmail.com>
Co-authored-by: Mike Bostock <mbostock@gmail.com>
@Fil Fil merged commit f0c3a69 into two Aug 4, 2020
@Fil Fil deleted the two-pointers branch August 4, 2020 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants