[ Launch: Tributary inlet ] 9394124 by samselikoff
-
-
Save samselikoff/9394124 to your computer and use it in GitHub Desktop.
Tributary inlet
This file contains 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},"_.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,"inline-console":false,"thumbnail":"http://i.imgur.com/rY7YQh5.png"} |
This file contains 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 line = d3.svg.line(), | |
points = [[0,0],[74,0]]; | |
var wind = d3.select('svg') | |
.datum(points) | |
.append('g').attr('transform', 'translate(300,300)') | |
.append('path') | |
.attr('d', line) | |
.style('stroke', 'green') | |
.style('stroke-width', '3px') | |
.call(transition); | |
wind.transition().duration(500).style('stroke-width', '11px'); | |
/* | |
.append('g').attr('transform', 'translate(200,200)') | |
.append('line') | |
.attr('class', 'wind') | |
.attr('x1', 0) | |
.attr('y1', 0) | |
.attr('x2', 74) | |
.attr('y2', 0) | |
.style('stroke', 'green') | |
.style('stroke-width', '3px') | |
.style("stroke-dasharray", "4,15") | |
// .call(transition) | |
; | |
*/ | |
var intensity = 1; | |
/* | |
setInterval(function() { | |
line.style('opacity', 1) | |
.attr('x2', 0) | |
.attr('y2', 0) | |
.transition().duration((11 -intensity)*100).delay(function(d, i) {return 100*i;}) | |
.attr('x2', 40) | |
.attr('y2', 40) | |
.style('opacity', 0); | |
}, (11 -intensity)*100 - 1);*/ | |
function tweenDash() { | |
console.log('hi'); | |
var l = this.getTotalLength(), | |
i = d3.interpolateString("0," + l, l + "," + l); | |
return function(t) { return i(t); }; | |
} | |
//wind.transition().duration(500).style('opacity', 0); | |
function transition(path) { | |
path.transition().duration(500).style('opacity', 0); | |
/* | |
path.transition() | |
.duration(7500) | |
// .attrTween("stroke-dasharray", tweenDash) | |
.attrTween("stroke-dasharray", function() { | |
console.log('hi'); | |
}) | |
.each("end", function() {d3.select(this).call(transition); }); | |
*/ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment