Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created December 9, 2012 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roundrobin/4243655 to your computer and use it in GitHub Desktop.
Save roundrobin/4243655 to your computer and use it in GitHub Desktop.
Tributary
Display the source blob
Display the rendered blob
Raw
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.5073323224331932,"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 = this.getAttribute('transform');
var parts = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(xforms);
this.oldValues = parts;
var val = Math.random(100)*1111;
return 'translate('+(-val)+',0)';
})
.transition()
.duration(2000)
.attr('transform', function(d,i){
var val = Math.random(100)*1111;
console.log('val',this.oldValues)
return 'translate('+(-val)+',0)';
})
//#F81E2F"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment