[ Launch: Tributary inlet ] e6f770d6f51707fccb9d by jkeohan
-
-
Save jkeohan/e6f770d6f51707fccb9d to your computer and use it in GitHub Desktop.
EUE - Circles
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":"EUE - Circles","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/wvqpXTB.png"} |
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 data1 = [1,2.5,3,4,5,6] | |
| var data2 = [1,2,3,4,5] | |
| var svg = d3.select('svg') | |
| function render(data,color) { | |
| var circles = svg.selectAll("circle").data(data) | |
| //var circles = svg.selectAll("circle").data(data,function(d) {return d} ) | |
| circles.enter().append("circle") | |
| .attr("cx", function(d,i) { return d * 60 } ) | |
| .attr("cy", 50) | |
| .attr("r", 9) | |
| .attr("fill",color) | |
| circles.exit().remove() | |
| } | |
| render(data1,"blue") | |
| render(data2,"green") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment