2013-03-12 12:46:41 +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>
|
|
|
|
<script>
|
2013-03-14 13:30:14 +00:00
|
|
|
var graph = new Springy.Graph();
|
2013-03-12 12:46:41 +00:00
|
|
|
graph.addNodes('Dennis', 'Michael', 'Jessica', 'Timothy', 'Barbara')
|
|
|
|
graph.addNodes('Amphitryon', 'Alcmene', 'Iphicles', 'Heracles');
|
|
|
|
|
|
|
|
graph.addEdges(
|
|
|
|
['Dennis', 'Michael', {color: '#00A0B0', label: 'Foo bar'}],
|
|
|
|
['Michael', 'Dennis', {color: '#6A4A3C'}],
|
|
|
|
['Michael', 'Jessica', {color: '#CC333F'}],
|
|
|
|
['Jessica', 'Barbara', {color: '#EB6841'}],
|
|
|
|
['Michael', 'Timothy', {color: '#EDC951'}],
|
|
|
|
['Amphitryon', 'Alcmene', {color: '#7DBE3C'}],
|
|
|
|
['Alcmene', 'Amphitryon', {color: '#BE7D3C'}],
|
|
|
|
['Amphitryon', 'Iphicles'],
|
|
|
|
['Amphitryon', 'Heracles'],
|
|
|
|
['Barbara', 'Timothy', {color: '#6A4A3C'}]
|
|
|
|
);
|
|
|
|
|
|
|
|
jQuery(function(){
|
|
|
|
var springy = jQuery('#springydemo').springy({
|
|
|
|
graph: graph
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<canvas id="springydemo" width="640" height="480" />
|
|
|
|
</body>
|
|
|
|
</html>
|