|
@ -66,14 +66,11 @@ function addPersonToGraph(profileData) |
|
|
*/ |
|
|
*/ |
|
|
function addFriends(username, apiPath, page) |
|
|
function addFriends(username, apiPath, page) |
|
|
{ |
|
|
{ |
|
|
console.log(username + " page=" + page); |
|
|
|
|
|
updateProgress(); |
|
|
updateProgress(); |
|
|
return new Promise(function(resolve, reject) |
|
|
return new Promise(function(resolve, reject) |
|
|
{ |
|
|
{ |
|
|
queryAPIByUser(apiPath + "?page=" + page, username, function(data) |
|
|
queryAPIByUser(apiPath + "?page=" + page, username, function(data) |
|
|
{ |
|
|
{ |
|
|
console.log(data); |
|
|
|
|
|
console.log(data.length); |
|
|
|
|
|
for(var i = 0; i < data.length; i++) |
|
|
for(var i = 0; i < data.length; i++) |
|
|
{ |
|
|
{ |
|
|
if(!alreadyInGraph(data[i].id)) |
|
|
if(!alreadyInGraph(data[i].id)) |
|
@ -111,7 +108,6 @@ function addFriends(username, apiPath, page) |
|
|
*/ |
|
|
*/ |
|
|
function edgeInGraph(id1, id2) |
|
|
function edgeInGraph(id1, id2) |
|
|
{ |
|
|
{ |
|
|
console.log("edge check"); |
|
|
|
|
|
for(var i = 0;i < edges.length; i++) |
|
|
for(var i = 0;i < edges.length; i++) |
|
|
{ |
|
|
{ |
|
|
if(edges[i].from === id1 && edges[i].to === id2) |
|
|
if(edges[i].from === id1 && edges[i].to === id2) |
|
@ -305,7 +301,6 @@ function createFriendsGraph(username, containerName, graphsTitle) |
|
|
{ |
|
|
{ |
|
|
createConnections().then(function() |
|
|
createConnections().then(function() |
|
|
{ |
|
|
{ |
|
|
console.log("cleared div"); |
|
|
|
|
|
$("#" + progressID).html(""); |
|
|
$("#" + progressID).html(""); |
|
|
|
|
|
|
|
|
var container = document.getElementById(containerName); |
|
|
var container = document.getElementById(containerName); |
|
|