Website for visualizing a persons github network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

92 lines
2.0 KiB

var nodes;
var edges;
function addFollowers(username)
{
return new Promise(function(resolve, reject)
{
queryAPIByUser(API_FOLLOWERS, username, function(data)
{
for(var i = 0; i < data.length; i++)
{
nodes.push(
{
id:data[i].id,
shape: 'circularImage',
image:data[i].avatar_url
});
}
resolve();
},
function(error)
{
reject(error);
})
});
}
function addFollowing(username)
{
return new Promise(function(resolve, reject)
{
});
}
function createFriendsGraph(username, containerName, graphsTitle)
{
nodes = [];
edges = [];
var network = null;
addFollowers(username).then(function()
{
var container = document.getElementById(containerName);
var data = {
nodes: nodes,
edges: edges
};
var options = {
nodes: {
borderWidth:4,
size:30,
color: {
border: '#222222',
background: '#666666'
},
font:{color:'#eeeeee'}
},
edges: {
color: 'lightgray'
}
};
network = new vis.Network(container, data, options);
});
// // create connections between people
// // value corresponds with the amount of contact between two people
// edges = [
// {from: 1, to: 2},
// {from: 2, to: 3},
// {from: 2, to: 4},
// {from: 4, to: 5},
// {from: 4, to: 10},
// {from: 4, to: 6},
// {from: 6, to: 7},
// {from: 7, to: 8},
// {from: 8, to: 9},
// {from: 8, to: 10},
// {from: 10, to: 11},
// {from: 11, to: 12},
// {from: 12, to: 13},
// {from: 13, to: 14},
// {from: 9, to: 16}
// ];
}