Skip to content

Instantly share code, notes, and snippets.

@RobinL
Last active June 5, 2016 12:32
Show Gist options
  • Save RobinL/bb5e8353df7d7a9cb472be82ae123d10 to your computer and use it in GitHub Desktop.
Save RobinL/bb5e8353df7d7a9cb472be82ae123d10 to your computer and use it in GitHub Desktop.
Experiment2
{"description":"Experiment2","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,"ajax-caching":true,"thumbnail":"http://i.imgur.com/eBwgZ2c.png"}
my_array = d3.range(16)
my_array = my_array.map(function(d) { return Math.sin(d/3)})
var svg = d3.select("svg")
svg.selectAll(".my_rectangles")
.data(my_array)
.enter()
.append("rect")
.attr({
width: 10,
height: 130,
x: function(d,i) {return 10 + i*20},
y: function(d) {return 50+ d * 100},
fill: "#3BA360"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment