You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here you say that the ngraph generated from a .gexf file could also easily be rendered by using e.g. ngraph.three as the renderer. I changed ngraph.pixi to ngraph.three, but it doesn't seem to work. Could you please help?
The text was updated successfully, but these errors were encountered:
Here is some raw code doing what you're (were) looking for
module.exports.main=asyncfunction(){letquery=require('query-string').parse(window.location.search.substring(1));letgraph=awaitgetGraphFromDisk(query);letcreateThree=require('ngraph.three');letgraphics=createThree(graph,{interactive: true});graphics.run();// begin animation loop:graphics.camera.position.z=getNumber(query.z,2000);};functiongetGraphFromDisk(query){letgexf=require('ngraph.gexf');letfilename=query.filename||'graph.gexf';returnnewPromise(function(resolve){letreq=newXMLHttpRequest();req.open('GET',filename);req.onload=function(){letcontent=this.responseText;letgraph=gexf.load(content);resolve(graph);};req.send();});}functiongetNumber(string,defaultValue){letnumber=parseFloat(string);return(typeofnumber==='number')&&!isNaN(number) ? number : (defaultValue||10);}
Starting a local web server like python3 -m http.server and browsing to http://localhost:8000
First of all: amazing work!
here you say that the ngraph generated from a .gexf file could also easily be rendered by using e.g.
ngraph.three
as the renderer. I changedngraph.pixi
tongraph.three
, but it doesn't seem to work. Could you please help?The text was updated successfully, but these errors were encountered: