[ Launch: bouncing_circles ] 7002500 by jshumakerpruitt
-
-
Save jshumakerpruitt/7002500 to your computer and use it in GitHub Desktop.
bouncing_circles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"bouncing_circles","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":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/7KwOtYl.gif","ajax-caching":true} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg = d3.select("svg"); | |
var data = [38, 57,87]; | |
var groups = svg.selectAll("g") | |
.data(data) | |
.enter() | |
.append("g"); | |
groups.attr("transform", function(d,i){ | |
var x = 4 * d ; | |
var y = 625 - 4 * (d % 15) ; | |
return "translate(" + [x, y] + ")"; | |
}); | |
var circles = groups.append("circle") | |
.attr({ | |
cx: function(d,i) { | |
return 0; | |
}, | |
cy: function(d,i) { | |
return 0; | |
}, | |
r: function(d,i){return d;}, | |
fill: "#C8C5CC", | |
"stroke-width": 2, | |
stroke: "#E21748"}); | |
var label = groups.append("text") | |
.text( function(d) {return d }) | |
.attr("alignment-baseline","middle") | |
.attr("text-anchor","middle") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment