Skip to content

Instantly share code, notes, and snippets.

@seliopou
Created March 21, 2015 15:40
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 seliopou/069b8d52819c00165d37 to your computer and use it in GitHub Desktop.
Save seliopou/069b8d52819c00165d37 to your computer and use it in GitHub Desktop.
work box
{"description":"work box","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"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/7wwY4wq.png"}
var work = d3.svg.area()
.y0(function (d) { return d[2]; });
var svg = d3.select('svg');
svg.append('path')
.attr('d', work([[0, 0, 60], [60, 0, 60]]))
.style('fill', 'grey')
.transition()
.duration(500)
.attr('d', work([[0, 0, 60], [60, 20, 40]]))
.transition()
.duration(500)
.attr('d', work([[100, 20, 40], [140, 20, 40]]))
/*
svg.append('rect')
.attr('y', 20)
.attr('width', 100)
.attr('height', 69)
.style('fill', 'grey')
.transition()
.attr('x', 100)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment