Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created December 9, 2012 07:24
Show Gist options
  • Save roundrobin/4243757 to your computer and use it in GitHub Desktop.
Save roundrobin/4243757 to your computer and use it in GitHub Desktop.
Tributary
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"description":"Tributary","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"background.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.6674885724331932,"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}
//artwork by @baufofthenauf
var svg = d3.select("svg");
svg.select('#layer11').selectAll("path")
.style({
"stroke-width": 1,
fill: "#1F194B"
})
svg.select('#layer25').selectAll('path')
.attr('transform', function(d,i){
var xforms = d3.select(this).attr('transform');
console.log(xforms)
this.oldValues = xforms;
var val = Math.random(100)*1111;
return 'matrix(1,1,-4 0,10,5,-5)';
})
.transition()
.duration(2500)
.ease('elastic',3,1)
.attr('transform', function(d,i){
var val = Math.random(100)*1111;
var x = 0;//parseFloat(this.oldValues[1]);
var y = 0;//parseFloat(this.oldValues[2]);
//console.log(this.oldValues,'ff',typeOf this.oldValues)
//console.log('dd',typeof this.oldValues,this.oldValues)
return this.oldValues;
})
//#F81E2F"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment