[ Launch: Tributary inlet ] 5905273 by trinary
-
-
Save trinary/5905273 to your computer and use it in GitHub Desktop.
Tributary inlet
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":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"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} |
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 data = []; | |
| var g = d3.select("svg").append("g") | |
| g.attr("transform","translate("+ [tributary.sw/2, tributary.sh/2] + ")"); | |
| function draw() { | |
| data.push([(Math.random() * 140)- 70, (Math.random() * 140)- 70]); | |
| g.selectAll(".edge").data(data).enter() | |
| .append("path") | |
| .classed("edge",true) | |
| .transition() | |
| .duration(200) | |
| .attr("d", function(d,i) { | |
| var p0 = data[i-2] || [0,0], | |
| p1 = data[i-1] || [5,5], | |
| p2 = data[i]; | |
| return "M"+ p0 + " l " + p1 + " l " + p2 + " Z"; | |
| }); | |
| } | |
| draw(); | |
| draw(); | |
| draw(); | |
| draw(); | |
| draw(); | |
| draw(); | |
| draw(); |
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
| .edge { | |
| fill: none; | |
| stroke: grey; | |
| stroke-width: 1px; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment