JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://dhotson.github.io/springy/springy.js"></script>
<script src="http://dhotson.github.io/springy/springyui.js"></script>
<canvas id="my_canvas" width="600" height="400" />
JavaScript
// make a new graph
var graph = new Springy.Graph();
// make some nodes
var spruce = graph.newNode({label: 'Norway Spruce'});
var fir = graph.newNode({label: 'Sicilian Fir'});
// connect them with an edge
graph.newEdge(spruce, fir);
$('#my_canvas').springy({ graph: graph, nodeSelected: function(node) {
alert(node.data.label);
} });
//now, I let the user update the dataset with ajax and re-render the graph.
graph = null;
graph = new Springy.Graph();
// make some nodes
var kittens = graph.newNode({label: 'Furry Baby Cats'});
var puppies = graph.newNode({label: 'Fluffy Baby Dogs'});
// connect them with an edge
graph.newEdge(kittens,puppies);
$('#my_canvas').springy({ graph: graph });