MCPcopy Create free account
hub / github.com/idank/explainshell / touchstart

Function touchstart

explainshell/web/static/js/d3.v3.js:1196–1213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1194 dispatch(event.of(this, arguments));
1195 }
1196 function touchstart() {
1197 var touches = d3.touches(this), now = Date.now();
1198 scale0 = scale;
1199 translate0 = {};
1200 touches.forEach(function(t) {
1201 translate0[t.identifier] = location(t);
1202 });
1203 d3_eventCancel();
1204 if (touches.length === 1) {
1205 if (now - touchtime < 500) {
1206 var p = touches[0], l = location(touches[0]);
1207 scaleTo(scale * 2);
1208 translateTo(p, l);
1209 dispatch(event.of(this, arguments));
1210 }
1211 touchtime = now;
1212 }
1213 }
1214 function touchmove() {
1215 var touches = d3.touches(this), p0 = touches[0], l0 = translate0[p0.identifier];
1216 if (p1 = touches[1]) {

Callers

nothing calls this directly

Calls 5

locationFunction · 0.85
d3_eventCancelFunction · 0.85
scaleToFunction · 0.85
translateToFunction · 0.85
dispatchFunction · 0.85

Tested by

no test coverage detected