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

Function assertLayout

test/jasmine/tests/map_test.js:463–474  ·  view source on GitHub ↗
(center, zoom, dims)

Source from the content-addressed store, hash-verified

461 });
462
463 function assertLayout(center, zoom, dims) {
464 var mapInfo = getMapInfo(gd);
465
466 expect([mapInfo.center.lng, mapInfo.center.lat])
467 .toBeCloseToArray(center);
468 expect(mapInfo.zoom).toBeCloseTo(zoom);
469
470 var divStyle = mapInfo.div.style;
471 ['left', 'top', 'width', 'height'].forEach(function(p, i) {
472 expect(parseFloat(divStyle[p])).toBeWithin(dims[i], 8);
473 });
474 }
475
476 assertLayout([-4.710, 19.475], 1.234, [80, 100, 908, 270]);
477

Callers 1

map_test.jsFile · 0.70

Calls 1

getMapInfoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…