Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active Apr 19, 2016
Embed
What would you like to do?
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