(gd, modes)
| 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); |
no test coverage detected
searching dependent graphs…