Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function(view, event, item) {
var el = view._renderer.element(),
p, e, pad;
if (el) {
pad = view.padding();
e = event.changedTouches ? event.changedTouches[0] : event;
p = point(e, el);
p[0] -= pad.left;
p[1] -= pad.top;
}
return event.vega = extension(view, item, p), event.item = item, event;
}
prototype.extendEvent = function(event, item) {
event.dataflow = this;
event.item = item;
var el = this._renderer.element(), e, p, pad;
if (el) {
pad = this.padding();
e = event.changedTouches ? event.changedTouches[0] : event;
p = point(e, el);
event.viewX = p[0] - pad.left;
event.viewY = p[1] - pad.top;
}
return event;
};
export default function(view, event, item) {
var el = view._renderer.canvas(),
p, e, translate;
if (el) {
translate = offset(view);
e = event.changedTouches ? event.changedTouches[0] : event;
p = point(e, el);
p[0] -= translate[0];
p[1] -= translate[1];
}
event.dataflow = view;
event.vega = extension(view, item, p);
event.item = item;
return event;
}