doevisualizations
Version:
Data Visualization Library based on RequireJS and D3.js (v4+)
15 lines (11 loc) • 407 B
JavaScript
import sourceEvent from "./sourceEvent";
import point from "./point";
export default function(node, touches, identifier) {
if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;
for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {
if ((touch = touches[i]).identifier === identifier) {
return point(node, touch);
}
}
return null;
}