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

Function _checkCalculatedAreaRatios

test/jasmine/tests/funnelarea_test.js:1350–1370  ·  view source on GitHub ↗
(expRatios)

Source from the content-addressed store, hash-verified

1348 afterEach(destroyGraphDiv);
1349
1350 function _checkCalculatedAreaRatios(expRatios) {
1351 return function() {
1352 var i;
1353 var areas = [];
1354 var totalArea = 0;
1355 for(i = 0; i < 4; i++) {
1356 var cdi = gd.calcdata[0][i];
1357
1358 var area = convexPolygonArea([cdi.TR, cdi.TL, cdi.BL, cdi.BR]);
1359 areas.push(area);
1360 totalArea += area;
1361 }
1362
1363 var ratios = [];
1364 for(i = 0; i < areas.length; i++) {
1365 ratios[i] = areas[i] / totalArea;
1366 }
1367
1368 expect(ratios).toBeCloseToArray(expRatios);
1369 };
1370 }
1371
1372 [
1373 {aspectratio: 0.25, baseratio: 0},

Callers 1

funnelarea_test.jsFile · 0.85

Calls 1

convexPolygonAreaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…