diff --git a/app/js/graph.js b/app/js/graph.js index 26b846c..21f124e 100644 --- a/app/js/graph.js +++ b/app/js/graph.js @@ -31,6 +31,13 @@ class Graph 'height': ((node.height == undefined) ? '50px' : node.height), }); + changeColor(element,colour) + { + this.cy.css({ + 'background-color': (for(var j = 0;j < element.length;j++) + (ele.isNode() == 1)?node.color = colour:edge.color = colour) + }); + } //Print the nodes console.log(this.cy.nodes()); } @@ -40,4 +47,4 @@ class Graph // var g = new Graph('cy'); // console.log(g); // obj = {name:'saurabh', shape: 'octagon', color: 'cyan', width: '300px', height: '400px'}; -// g.addNode(obj); \ No newline at end of file +// g.addNode(obj);