UNPKG

d3-selection

Version:

Data-driven DOM manipulation: select elements and join them to data.

12 lines (10 loc) 395 B
import pointer from "./pointer.js"; import sourceEvent from "./sourceEvent.js"; export default function(events, node) { if (events.target) { // i.e., instanceof Event, not TouchList or iterable events = sourceEvent(events); if (node === undefined) node = events.currentTarget; events = events.touches || [events]; } return Array.from(events, event => pointer(event, node)); }