Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Created July 30, 2012 01:47
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 gabrielflorit/3203258 to your computer and use it in GitHub Desktop.
Save gabrielflorit/3203258 to your computer and use it in GitHub Desktop.
created by livecoding - http://livecoding.gabrielflor.it
svg {
background: #000000;
}
path {
stroke: red;
}
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
var g = svg.append('g');
var line;
//var branches = [];
//var trunk = {
//};
//branches.push(trunk);
svg
.attr('width', width)
.attr('height', height);
line = d3.svg.line()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; })
.interpolate('basis');
g.append('path')
.attr('d', line([
{
'x': 1,
'y': 1
},
{
'x': 100,
'y': 100
}
]));
/*svg.selectAll('rect')
.data(branches)
.enter().append('rect')
.attr('x', function(d) { return d.x; })
.attr('y', function(d) { return d.y; })
.attr('height', function(d) { return d.height; })
.attr('width', function(d) { return d.width; })
.attr('transform', function(d) {
return 'rotate('
+ d.angle + ', '
+ d.rotation_x + ', '
+ d.rotation_y + ')';
});
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment