block by mbostock 1440766

selection.order

Full Screen

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>

var div = d3.select("body").selectAll("div")
    .data(["a", "b", "f"])
  .enter().append("div")
    .text(String);

var div = d3.select("body").selectAll("div")
    .data(["a", "b", "c", "d", "e", "f"], String);

div.enter().append("div")
    .text(String);

div.order();

</script>