MCPcopy Index your code
hub / github.com/plotly/plotly.js / assertAnnotationsXY

Function assertAnnotationsXY

test/jasmine/tests/gl3d_plot_interact_test.js:1616–1629  ·  view source on GitHub ↗
(expectations, msg)

Source from the content-addressed store, hash-verified

1614 }
1615
1616 function assertAnnotationsXY(expectations, msg) {
1617 var TOL = 2.5;
1618 var anns = d3SelectAll('g.annotation-text-g');
1619
1620 expect(anns.size()).toBe(expectations.length, msg);
1621
1622 anns.each(function(_, i) {
1623 var ann = d3Select(this).select('g');
1624 var translate = Drawing.getTranslate(ann);
1625
1626 expect(translate.x).toBeWithin(expectations[i][0], TOL, msg + ' - ann ' + i + ' x');
1627 expect(translate.y).toBeWithin(expectations[i][1], TOL, msg + ' - ann ' + i + ' y');
1628 });
1629 }
1630
1631 // more robust (especially on CI) than update camera via mouse events
1632 function updateCamera(x, y, z) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…