Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Last active August 29, 2015 14:25
Show Gist options
  • Save roundrobin/736a3da5626e8bff40d3 to your computer and use it in GitHub Desktop.
Save roundrobin/736a3da5626e8bff40d3 to your computer and use it in GitHub Desktop.
test
{"description":"test","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}},"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,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Z4ghHZY.png","fullscreen":false,"ajax-caching":true}
var svg = d3.select("svg")
var matrix = [
2,
3,
4,
5
];
function update(data){
var circle = svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr('opacity', 0)
.attr('cx', 30)
.attr('cy', function(d, i){
return 100 + i * 20;
})
.attr('r', function(d, i){
return d;
})
.attr('transform', function(){
return 'translate()'
})
.transition()
.duration(2000)
.attr('opacity', 1)
}
update(matrix)
setTimeout(function(){
matrix.push(23);
update(matrix);
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment