Skip to content

Instantly share code, notes, and snippets.

@k-izzo
Created March 17, 2014 03:39
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 k-izzo/9593565 to your computer and use it in GitHub Desktop.
Save k-izzo/9593565 to your computer and use it in GitHub Desktop.
filter
{"description":"filter","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true}
data = [3, 2, 11, 4, 9, 6]
svg = d3.select('svg')
c = svg.selectAll('circle')
.data(data)
c.enter().append('circle')
.attr({
cx: (d, i) -> 30 + i*30
cy: 30
r: 9
fill: 'black'
})
c.filter((d) -> d < 6)
.attr('fill', 'orange')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment