Created
July 25, 2012 08:35
-
-
Save roundrobin/3175102 to your computer and use it in GitHub Desktop.
Watch!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"description":"Watch!","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.7,"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,"hidepanel":false} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var rect = g.append("rect") | |
| .attr("width",200) | |
| .attr("height",200) | |
| .attr("x",0) | |
| .attr("y",0) | |
| .attr("fill",0) | |
| .attr('transform','translate(100,100)') | |
| for (var i = 0; i < 360; i++){ | |
| if(i % 9 == 0){ | |
| var rect = g.append("rect") | |
| .attr("width",200) | |
| .attr("height",200) | |
| .attr("x",0) | |
| .attr("y",0) | |
| .attr("fill",'#'+Math.floor(Math.random()*16777215).toString(16)) | |
| .attr('transform','translate(100,100)rotate('+i+',100,100)') | |
| } | |
| } | |
| var rect = g.append("rect") | |
| .attr("width",200) | |
| .attr("height",200) | |
| .attr("x",0) | |
| .attr("y",0) | |
| .attr("fill","#FF00FF") | |
| .attr('transform','translate(100,100)rotate(10,100,100)') | |
| var rect = g.append("rect") | |
| .attr("width",200) | |
| .attr("height",200) | |
| .attr("x",0) | |
| .attr("y",0) | |
| .attr("fill",'#ff00ff') | |
| .attr('transform','translate(100,100)rotate(20,100,100)') | |
| var rect = g.append("rect") | |
| .attr("width",200) | |
| .attr("height",200) | |
| .attr("x",0) | |
| .attr("y",0) | |
| .attr("fill","#492549") | |
| .attr('transform','translate(100,100)rotate(30,100,100)') | |
| var path = g.append('path') | |
| .attr("stroke","red") | |
| .attr("stroke-width",3) | |
| .attr("fill","none") | |
| .attr("d","M100,100 L0,0") | |
| .attr('transform','translate(100,100)') | |
| var path = g.append('path') | |
| .attr("stroke","red") | |
| .attr("stroke-width",3) | |
| .attr("fill","none") | |
| .attr("d","M100,100 L0,0") | |
| .attr('transform','translate(100,100)rotate(60,100,100)') | |
| var t; | |
| var last; | |
| var i = 0; | |
| d3.timer(function(elapsed) { | |
| t = (t + (elapsed - last) / 2000) % 1; | |
| last = elapsed; | |
| i++; | |
| path.attr('transform','translate(100,100)rotate('+(i%360)+',100,100)') | |
| update(); | |
| }); | |
| function update() { | |
| //console.log('dd') | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment