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

Function checkShapes

test/jasmine/tests/template_test.js:261–278  ·  view source on GitHub ↗
(layoutCount, recty0)

Source from the content-addressed store, hash-verified

259
260 it('makes a new shape or edits the existing one as necessary', function(done) {
261 function checkShapes(layoutCount, recty0) {
262 expect(gd.layout.shapes.length).toBe(layoutCount);
263 expect(gd._fullLayout.shapes.length).toBe(2);
264 var shapeElements = document.querySelectorAll('.shapelayer path[fill-rule=\'evenodd\']');
265 var rectElement = shapeElements[1];
266 expect(shapeElements.length).toBe(2);
267
268 if(recty0) {
269 var rectItem = gd.layout.shapes[layoutCount - 1];
270 expect(rectItem.templateitemname).toBe('outline');
271 expect(rectItem.x0).toBeWithin(-0.15, 0.001);
272 expect(rectItem.y0).toBeWithin(recty0, 0.001);
273 expect(rectItem.x1).toBeWithin(1.2, 0.001);
274 expect(rectItem.y1).toBeWithin(1.1, 0.001);
275 }
276
277 return rectElement;
278 }
279
280 var rectDragger = checkShapes(1);
281

Callers 1

template_test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…