Im using cytoscape for the first time and was trying to load a simple connection network from database info. I just grabbed demo html code to see if the js was ready to use and then (as the visualization was performed with no problems) I customize the "data: {" portion from function.
Seems like the problem regards execution time, as network_json variable needs to be ready for call at page load not allowing server side the time to retrieve these values...
var network_json = {
// you need to specify a data schema for custom attributes!
dataSchema: {
nodes: [ { name: "label", type: "string" },
{ name: "id", type: "string" }
],
edges: [ { name: "label", type: "string" },
{ name: "bar", type: "string" }
]
},
// NOTE the custom attributes on nodes and edges
<%
objRS.Open strQ, objCon
If Not objRS.eof then
Response.Write "data: {"
Do while not objRS.eof
Response.Write " nodes: [ { id: "&objRS("id")&", label:..........."
%>
// initialization options
var options = {
swfPath: "swf/CytoscapeWeb",
flashInstallerPath: "swf/playerProductInstall"
};