-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholdcytoscape script
More file actions
34 lines (32 loc) · 1.11 KB
/
oldcytoscape script
File metadata and controls
34 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$(document).ready(function(){
$.ajax({
url: "/modsuites/" + $('#current_id').val()+"/graph",
method: "get",
success: function(graph){
cytoscape.use( 'cytoscape-cose-bilkent'); // register extension
console.log("graph was got");
cose = cytoscape-cose-bilkent
var cy = cytoscape({
container: document.getElementById("cy"),
headless:false,
style: [
{
selector: 'node',
style: {
shape: 'hexagon',
'background-color': 'red',
label: 'data(id)'
}
}]
});
cy.json(JSON.parse(graph));
var layout = cy.layout({name: 'concentric',
directed:true,
avoidOverlap: true,
roots:["iron-ore", "stone", "uranium-ore"],
maximalAdjustments: 100});
layout.run();
console.log("cytoscape ran")
}
})
})