site/node_modules/d3-selection/src/pointers.js
2024-10-14 08:09:33 +02:00

12 lines
395 B
JavaScript

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));
}