Created
July 9, 2012 01:10
-
-
Save ariaz/3073683 to your computer and use it in GitHub Desktop.
just another inlet to tributary
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 data = []; | |
for (var i=0; i< 2070; i++) | |
{ | |
var x = i, y=0; | |
var colr = parseInt(ariel[i]); | |
var colg = ariel[i+2070]; | |
var colb = ariel[i+2070*2]; | |
while(x>46){x-=46;y+=1}; | |
data.push({ | |
cx:x, | |
cy:y, | |
re:colr, | |
gr:colg, | |
bl:colb | |
}) | |
} | |
var width = 981, | |
height = 949, | |
margin = 10; | |
var x_scale = d3.scale.linear() | |
.range([margin, width-margin]) | |
.domain([0,46]); | |
var y_scale = d3.scale.linear() | |
.range([height-margin, margin]) | |
.domain([0,45]); | |
var svg = d3.select("svg") | |
.attr("width", width) | |
.attr("height",height) | |
.append("svg:g"); | |
var circle = svg.selectAll("g.circle") | |
.data(data) | |
.enter().append("circle"); | |
k=data[21].re; | |
t = d3.rgb(22,19733,28); | |
d3.selectAll("circle") | |
.attr("cx", function(d){return x_scale(d.cx);}) | |
.attr("cy", function(d){return y_scale(d.cy);}) | |
.attr("fill",function(d){return d3.rgb(d.re+36,d.gr+29,d.bl+233)}) | |
.attr("r",9); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment