MCPcopy
hub / github.com/plotly/plotly.js / drag

Function drag

test/jasmine/tests/select_test.js:37–65  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

35}
36
37function drag(path, options) {
38 var len = path.length;
39
40 if(!options) options = {type: 'mouse'};
41
42 Lib.clearThrottle();
43
44 if(options.type === 'touch') {
45 touchEvent('touchstart', path[0][0], path[0][1], options);
46
47 path.slice(1, len).forEach(function(pt) {
48 Lib.clearThrottle();
49 touchEvent('touchmove', pt[0], pt[1], options);
50 });
51
52 touchEvent('touchend', path[len - 1][0], path[len - 1][1], options);
53 return;
54 }
55
56 mouseEvent('mousemove', path[0][0], path[0][1], options);
57 mouseEvent('mousedown', path[0][0], path[0][1], options);
58
59 path.slice(1, len).forEach(function(pt) {
60 Lib.clearThrottle();
61 mouseEvent('mousemove', pt[0], pt[1], options);
62 });
63
64 mouseEvent('mouseup', path[len - 1][0], path[len - 1][1], options);
65}
66
67function assertSelectionNodes(cornerCnt, outlineCnt, _msg) {
68 var msg = _msg ? ' - ' + _msg : '';

Callers 15

ternary_test.jsFile · 0.70
dragAndReplotFunction · 0.70
_dragFunction · 0.70
_dragRadialFunction · 0.70
_dragAngularFunction · 0.70
testDragNodeFunction · 0.70
sankey_test.jsFile · 0.70
template_test.jsFile · 0.70
testAnnotationMoveLabelFunction · 0.70
testAnnotationMoveWholeFunction · 0.70
colorbar_test.jsFile · 0.70
mouseToFunction · 0.70

Calls 1

mouseEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…