Back to index

Force Directed Graph

$(function() { var myCanvas = $('#3dcanvas').scene3d({ width:640, height:480, ViewpointPosition: '0 0 100', }); $.getJSON( "actors.json", function( myGraph ) { myCanvas.addGraph({ layout: 'forcedirected', forcedirected: { maxIterations: 100, timetick: 25 }, id: 'MyGraph', data: myGraph, radius: 2, width: 50, height: 50, depth: 50 }); }); nodeClickHandler = function( gObj ) { alert ( $(gObj).data('bio') ); } edgeClickHandler = function( gObj ) { alert ( $(gObj).data('movie') ); } });
Click on a node or on an edge for more info. Click here to view actors.json file