You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
springy/demo-json.html

39 lines
673 B

<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>
<script>
var graphJSON = {
"nodes": [
"Amphitryon",
"Alcmene",
"Iphicles",
"Heracles"
],
"edges": [
["Amphitryon", "Alcmene"],
["Alcmene", "Amphitryon"],
["Amphitryon", "Iphicles"],
["Amphitryon", "Heracles"]
]
};
jQuery(function(){
var graph = new Springy.Graph();
graph.loadJSON(graphJSON);
var springy = jQuery('#springydemo').springy({
graph: graph
});
});
</script>
<canvas id="springydemo" width="640" height="480" />
</body>
</html>