Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created January 28, 2013 21:48
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 tmcw/4659423 to your computer and use it in GitHub Desktop.
Save tmcw/4659423 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"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}
var svg = d3.select("svg")
.append("svg:g")
.attr('transform', 'translate(200,200)');
var tri = svg.selectAll('path')
.data(d3.range(0, 10))
.enter()
.append('path')
.attr('d', d3.svg.symbol().type('triangle-down')([0,0]))
.attr('transform', function(d) {
return 'scale(' + 10 * (3/Math.pow(Math.PI/2.16,d)) + ')' +
((d % 2) ? '' : 'rotate(180)');
})
.attr('fill', function(d) {
return d3.hsl(d * 40, 0.50, 0.50);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment