Create a gist now

Instantly share code, notes, and snippets.

<html>
<head>
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="http://localhost/arbor/lib/arbor.js" ></script>
<script language="javascript" type="text/javascript" src="http://localhost/arbor/demos/_/graphics.js" ></script>
<script language="javascript" type="text/javascript" src="http://localhost/arbor/demos/halfviz/src/renderer.js" ></script>
</head>
<body>
<canvas id="viewport" width="800" height="600"></canvas>
<script language="javascript" type="text/javascript">
var sys = arbor.ParticleSystem(1000, 400,1);
sys.parameters({gravity:true});
sys.renderer = Renderer("#viewport") ;
var data = {
nodes:{
animals:{'color':'red','shape':'dot','label':'Animals'},
dog:{'color':'green','shape':'dot','label':'dog'},
cat:{'color':'blue','shape':'dot','label':'cat'}
},
edges:{
animals:{ dog:{}, cat:{} }
}
};
sys.graft(data);
setTimeout(function(){
var postLoadData = {
nodes:{
joe:{'color':'orange','shape':'dot','label':'joe'},
fido:{'color':'green','shape':'dot','label':'fido'},
fluffy:{'color':'blue','shape':'dot','label':'fluffy'}
},
edges:{
dog:{ fido:{} },
cat:{ fluffy:{} },
joe:{ fluffy:{},fido:{} }
}
};
sys.graft(postLoadData);
},10000);
</script>
</body>
</html>
@RC1140
Owner

Please ensure that you change the paths to suit your local setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment