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

Function countVisibleTraces

test/jasmine/tests/map_test.js:1338–1366  ·  view source on GitHub ↗
(gd, modes)

Source from the content-addressed store, hash-verified

1336 });
1337
1338 function countVisibleTraces(gd, modes) {
1339 var mapInfo = getMapInfo(gd);
1340 var cnts = [];
1341
1342 // 'modes' are the ScatterMap layers names
1343 // e.g. 'fill', 'line', 'circle', 'symbol'
1344
1345 modes.forEach(function(mode) {
1346 var cntPerMode = 0;
1347
1348 mapInfo.traceLayers.forEach(function(l) {
1349 var info = mapInfo.layers[l];
1350
1351 if(l.indexOf(mode) === -1) return;
1352 if(info.visibility === 'visible') cntPerMode++;
1353 });
1354
1355 cnts.push(cntPerMode);
1356 });
1357
1358 var cnt = cnts.reduce(function(a, b) {
1359 return (a === b) ? a : null;
1360 });
1361
1362 // returns null if not all counter per mode are the same,
1363 // returns the counter if all are the same.
1364
1365 return cnt;
1366 }
1367
1368 function getStyle(gd, mode, prop) {
1369 var mapInfo = getMapInfo(gd);

Callers 1

map_test.jsFile · 0.85

Calls 1

getMapInfoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…