site/node_modules/d3-selection/src/pointers.js

12 lines
395 B
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
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));
}