Skip to content

Instantly share code, notes, and snippets.

@ariaz
Created July 9, 2012 01:15
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 ariaz/3073694 to your computer and use it in GitHub Desktop.
Save ariaz/3073694 to your computer and use it in GitHub Desktop.
just another inlet to tributary
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+-20,d.gr+29,d.bl+72)})
.attr("stroke-width", 2)
.attr("stroke","#D0D0DD")
.attr("r",35);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment