Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function send(){
  2. $.post("/", {adj_data: JSON.stringify(adj_list)}, function(data, status) {
  3. colorify_graph(JSON.parse(data));
  4. });
  5. }
  6.  
  7. function colorify_graph (data){
  8. for (var i=0; i<=node_set.length; i++){
  9. ctx.fillStyle = colorset[data[i+1]];
  10. ctx.beginPath();
  11. ctx.arc(node_set[i].x, node_set[i].y, 10, 0 , 2 * Math.PI, false);
  12. ctx.fill();
  13. ctx.closePath();
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement