Created
July 8, 2012 22:45
-
-
Save ariaz/3073289 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 ariel=[]; | |
d3.json('/static/img.json', function(data){ ariel = data._ArrayData_;}); | |
var data = []; | |
for (var i=0; i< 11040; i++) | |
{ | |
var x = i; | |
while(x>240){x-=240;y+=1}; | |
data.push({ | |
cx:x, | |
cy:y, | |
r:ariel[i], | |
g:ariel[i+11040], | |
b:ariel[i+2*11040] | |
}) | |
} | |
d = [20,40,23, 35, 10, 20, 5]; | |
var width = 2550, | |
height = 392, | |
margin = 10; | |
var x_scale = d3.scale.linear() | |
.range([margin, width-margin]) | |
.domain([0,240]); | |
var y_scale = d3.scale.linear() | |
.range([height-margin, margin]) | |
.domain([0,46]); | |
var svg = d3.select("svg") | |
.attr("width", width) | |
.attr("height",height) | |
.append("svg:g"); | |
var circle = svg.selectAll("g.circle") | |
.data(d) | |
.enter().append("circle"); | |
t = d3.rgb(32,22345,130); | |
d3.selectAll("circle") | |
.attr("cx", function(d){return x_scale(d);}) | |
.attr("cy", function(d){return y_scale(d);}) | |
.attr("r",10) | |
.attr("fill",function(d){return t}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment