Created
August 11, 2019 11:52
-
-
Save nidhinp/ed0aebe21a32e56fe80691b2f7e638a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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