Skip to content

Instantly share code, notes, and snippets.

@erikhazzard
Created February 11, 2013 06:56
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 erikhazzard/4753039 to your computer and use it in GitHub Desktop.
Save erikhazzard/4753039 to your computer and use it in GitHub Desktop.
SVG Path Test 1
{"description":"SVG Path Test 1","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}
var svg = d3.select("svg");
//Uses the svg-path-generator class
//https://github.com/roundrobin/svg-path-generator
var path = new Path(svg)
path.add(['m',215,100]);
var x,y;
for(var i=0; i < 25;i++){
x = Math.sin(i/2)*---------63;
y = Math.cos(i/1)*100;
path.add(['l',x,y]);
}
path.render();
path.showPoints()
path.hidePoints()
path.hidePoints()
console.log(path.el().node().pathSegList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment