2013-03-12 11:31:14 +00:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
|
|
|
<script src="springy.js"></script>
|
|
|
|
<script src="springyui.js"></script>
|
2013-03-12 13:38:12 +00:00
|
|
|
|
|
|
|
|
2013-03-12 11:31:14 +00:00
|
|
|
<script>
|
2013-03-12 13:38:12 +00:00
|
|
|
var graphJSON = {
|
2013-03-12 11:31:14 +00:00
|
|
|
"nodes": [
|
2013-03-12 14:33:42 +00:00
|
|
|
"Amphitryon",
|
|
|
|
"Alcmene",
|
|
|
|
"Iphicles",
|
|
|
|
"Heracles"
|
2013-03-12 12:46:41 +00:00
|
|
|
],
|
2013-03-12 11:31:14 +00:00
|
|
|
"edges": [
|
2013-03-12 14:33:42 +00:00
|
|
|
["Amphitryon", "Alcmene"],
|
|
|
|
["Alcmene", "Amphitryon"],
|
|
|
|
["Amphitryon", "Iphicles"],
|
|
|
|
["Amphitryon", "Heracles"]
|
2013-03-12 11:31:14 +00:00
|
|
|
]
|
2013-03-12 13:38:12 +00:00
|
|
|
};
|
2013-03-12 11:31:14 +00:00
|
|
|
|
|
|
|
jQuery(function(){
|
2013-03-12 13:38:12 +00:00
|
|
|
var graph = new Graph();
|
|
|
|
graph.loadJSON(graphJSON);
|
|
|
|
|
2013-03-12 12:46:41 +00:00
|
|
|
var springy = jQuery('#springydemo').springy({
|
|
|
|
graph: graph
|
|
|
|
});
|
2013-03-12 11:31:14 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<canvas id="springydemo" width="640" height="480" />
|
2013-03-12 13:38:12 +00:00
|
|
|
|
|
|
|
|
2013-03-12 11:31:14 +00:00
|
|
|
</body>
|
|
|
|
</html>
|