Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created February 15, 2013 18:33
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 roundrobin/4962338 to your computer and use it in GitHub Desktop.
Save roundrobin/4962338 to your computer and use it in GitHub Desktop.
Path animation - complex
{"description":"Path animation - complex","endpoint":"","display":"svg","public":true,"require":[{"name":"Helpers","url":"https://raw.github.com/roundrobin/svg-path-generator/master/svg-path-generator.js"}],"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":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/w5HWTKi.png"}
//Uses the svg-path-generator class
//https://github.com/roundrobin/svg-path-generator
var svg = d3.select("svg");
svg.append('path')
.attr({
stroke: "black",
"stroke-width": 3,
fill: "none",
d: "M0,0 L100,100 L200,200",
transform: "translate("+[0,0]+")"
})
.transition()
.duration(2000)
.attr('d','M0,0 Q12,12,100,100')
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment