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

Function testObjectMove

test/jasmine/tests/domain_ref_interact_test.js:41–59  ·  view source on GitHub ↗
(objectColor, moveX, moveY, type)

Source from the content-addressed store, hash-verified

39}
40
41function testObjectMove(objectColor, moveX, moveY, type) {
42 var bboxBefore = getSVGElemScreenBBox(
43 domainRefComponents.findAROByColor(objectColor, undefined, type)
44 );
45 var pos = {
46 mouseStartX: bboxBefore.x + bboxBefore.width * 0.5,
47 mouseStartY: bboxBefore.y + bboxBefore.height * 0.5,
48 };
49 pos.mouseEndX = pos.mouseStartX + moveX;
50 pos.mouseEndY = pos.mouseStartY + moveY;
51 mouseEvent('mousemove', pos.mouseStartX, pos.mouseStartY);
52 mouseEvent('mousedown', pos.mouseStartX, pos.mouseStartY);
53 mouseEvent('mousemove', pos.mouseEndX, pos.mouseEndY);
54 mouseEvent('mouseup', pos.mouseEndX, pos.mouseEndY);
55 var bboxAfter = getSVGElemScreenBBox(
56 domainRefComponents.findAROByColor(objectColor, undefined, type)
57 );
58 checkBBox(bboxBefore, bboxAfter, moveX, moveY);
59}
60
61function dragPos0(bbox, corner) {
62 if(corner === 'bl') {

Callers 1

testObjectMoveItFunFunction · 0.85

Calls 3

getSVGElemScreenBBoxFunction · 0.85
mouseEventFunction · 0.85
checkBBoxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…