Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var init = function() {
- //.. do some overall initialization
- $.ajax({
- url: '/url/',
- method: 'GET',
- dataType: 'json',
- data: {}, //probably you have some parameters
- success: displaygraph,
- error: function() {alert('error getting data');}
- });
- }
- var displaygraph = function(data) {
- $('#cy').cytoscape({
- style: // ...
- elements: {
- nodes: data.nodes,
- edges: data.edges
- },
- ready: function(){
- //...
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement