图形可视化ArborJS

时间:2013-12-11 13:16:31

标签: arbor.js

我想在我的php页面添加图形可视化,为此我已编写代码,但我不知道为什么它没有显示任何内容。任何人都可以帮我解决我的问题。

提前致谢

<html>
<head>

<script language="javascript" type="text/javascript" src="arbor_files/jquery.js">       </script>
<script language="javascript" type="text/javascript" src="arbor_files/arbor.js"></script>
<script language="javascript" type="text/javascript" src="arbor_files/arbor-tween.js"></script>
<script language="javascript" type="text/javascript" src="arbor_files/graphics.js"></script>
<script language="javascript" type="text/javascript" src="arbor_files/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 animals = sys.addNode('Animals',{'color':'red','shape':'dot','label':'Animals'});

var dog = sys.addNode('dog',{'color':'green','shape':'dot','label':'dog'});
var cat = sys.addNode('cat',{'color':'blue','shape':'dot','label':'cat'});

sys.addEdge(animals, dog);
sys.addEdge(animals, cat);

</script>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

我移植了你的代码,它加载得很好。

Animals Graph

您可以查看保存js文件的位置吗?