Why doesn't show anything in my Cytoscape Web?

31 views
Skip to first unread message

Runpeng Chen

unread,
Jan 28, 2016, 2:54:03 PM1/28/16
to cytoscapeweb-discuss
I am using the Cytoscape Web. However, even when I use the tutorial, it didn't show anything. I am sure that my lib location is correct. Because, there is a loading bar. But it doesn't show anything.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>

<head>
<title>Cytoscape Web example</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<!-- JSON support for IE (needed to use JS API) -->
<script type="text/javascript" src="js/min/json2.min.js"></script>

<!-- Flash embedding utility (needed to embed Cytoscape Web) -->
<script type="text/javascript" src="js/min/AC_OETags.min.js"></script>

<!-- Cytoscape Web JS API (needed to reference org.cytoscapeweb.Visualization) -->
<script type="text/javascript" src="js/min/cytoscapeweb.min.js"></script>

<script type="text/javascript">
window.onload=function() {
// id of Cytoscape Web container div
var div_id = "cytoscapeweb";

// you could also use other formats (e.g. GraphML) or grab the network data via AJAX
var networ_json = {
data: {
nodes: [ { id: "1" }, { id: "2" } ],
edges: [ { id: "2to1", target: "1", source: "2" } ]
}
};

// initialization options
var options = {
// where you have the Cytoscape Web SWF
swfPath: "swf/CytoscapeWeb",
// where you have the Flash installer SWF
flashInstallerPath: "swf/playerProductInstall"
};

// init and draw
var vis = new org.cytoscapeweb.Visualization(div_id, options);
vis.draw({ network: networ_json });
};
</script>

<style>
/* The Cytoscape Web container must have its dimensions set. */
html, body { height: 100%; width: 100%; padding: 0; margin: 0; }
#cytoscapeweb { width: 100%; height: 100%; }
</style>
</head>

<body>
<div id="cytoscapeweb">
Cytoscape Web will replace the contents of this div with your graph.
</div>
</body>

</html>

Reply all
Reply to author
Forward
0 new messages