Skip to content

Instantly share code, notes, and snippets.

@RobinL
Created May 19, 2016 07:56
Show Gist options
  • Save RobinL/9b9f338271b8d522fb34c9cff32125b5 to your computer and use it in GitHub Desktop.
Save RobinL/9b9f338271b8d522fb34c9cff32125b5 to your computer and use it in GitHub Desktop.
Experiment
{"description":"Experiment","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"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}
my_array = d3.range(16)
var svg = d3.select("svg")
svg.selectAll(".my_rectangles")
.data(my_array)
.enter()
.append("rect")
.attr({
width: 10,
height: 130,
x: function(d) {return 10+ d*20},
y: function(d) {return 50+ Math.sin(d/3) * 100},
fill: "#3BA360"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment