Created
July 31, 2012 17:06
-
-
Save gabrielflorit/3218561 to your computer and use it in GitHub Desktop.
created by livecoding - http://livecoding.gabrielflor.it
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
svg { | |
background: #000000; | |
} |
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 width = $('svg').width(); | |
var height = $('svg').height(); | |
var svg = d3.select('svg'); | |
var g = svg.append('g'); | |
var line; | |
var createBranches; | |
var trunk; | |
var trunk_width; | |
var branches; | |
var flowers; | |
svg | |
.attr('width', width) | |
.attr('height', height); | |
line = d3.svg.line() | |
.x(function(d) { return d.x; }) | |
.y(function(d) { return d.y; }); | |
g.selectAll('branches') | |
.data(branches) | |
.enter().append('path') | |
.attr('d', line) | |
.style('stroke-width', function(d) { return d[1].width; } ) | |
.attr('class', function(d) { | |
return 'branch'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment