Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active March 26, 2016 03:36
Show Gist options
  • Save StevenJL/d00906f940dfcbfaabdb to your computer and use it in GitHub Desktop.
Save StevenJL/d00906f940dfcbfaabdb to your computer and use it in GitHub Desktop.
d3.selectAll("circle.a").style("fill", "red")
// select every circle with class "a" and fill it red.
d3.select("circle").style("fill") // => "red"
// Note that calling .style without the second argument will
// return the current value.
d3.select("circle").remove() // delete the circle
d3.selectAll(“div.sales”).data([1,5,11,3])
// binds the elements in the array [1,5,11,3] to <div> elements with the class "sales"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment