Skip to content

Instantly share code, notes, and snippets.

@trinary
Created August 15, 2013 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trinary/6244713 to your computer and use it in GitHub Desktop.
Save trinary/6244713 to your computer and use it in GitHub Desktop.
filter to remove
{"description":"filter to remove","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/f6mhZjs.png"}
var data = d3.range(10);
var svg = d3.select("svg");
rects = svg.selectAll("rect")
.data(data)
rects.enter()
.append("rect").attr("x",function(d,i) { return i * 20 + 20}).attr("y", 20)
.attr("width", 15).attr("height",15);
rects.filter(":nth-child(even)").remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment