Skip to content

Instantly share code, notes, and snippets.

@nidhinp
Created August 11, 2019 11:52
Show Gist options
  • Save nidhinp/ed0aebe21a32e56fe80691b2f7e638a0 to your computer and use it in GitHub Desktop.
Save nidhinp/ed0aebe21a32e56fe80691b2f7e638a0 to your computer and use it in GitHub Desktop.
function send(){
$.post("/", {adj_data: JSON.stringify(adj_list)}, function(data, status) {
colorify_graph(JSON.parse(data));
});
}
function colorify_graph (data){
for (var i=0; i<=node_set.length; i++){
ctx.fillStyle = colorset[data[i+1]];
ctx.beginPath();
ctx.arc(node_set[i].x, node_set[i].y, 10, 0 , 2 * Math.PI, false);
ctx.fill();
ctx.closePath();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment