Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active April 19, 2016 18:07
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mbostock/1440766 to your computer and use it in GitHub Desktop.
selection.order
license: gpl-3.0
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment