D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
mbostock
Full window
Github gist
Order
<!DOCTYPE html> <meta charset="utf-8"> <ul> <script src="//d3js.org/d3.v3.min.js"></script> <script> var data = [ ["A", "B", "C", "D", "E"], ["B", "C", "D", "A", "E"], ["C", "A", "D", "E", "B"], ["D", "A", "B", "E", "C"], ["E", "D", "B", "C", "A"] ]; var li = d3.select("ul").selectAll("li") .data(data[0]) .enter().append("li") .text(function(d) { return d; }) .on("click", reorder); function reorder(d, i) { li .data(data[i], function(d) { return d; }) .order(); } </script>
https://d3js.org/d3.v3.min.js