Skip to content

Instantly share code, notes, and snippets.

@ariaz
Created July 9, 2012 00:22
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/3073535 to your computer and use it in GitHub Desktop.
Save ariaz/3073535 to your computer and use it in GitHub Desktop.
just another inlet to tributary
var ariel=[];
d3.json('/static/obface.json', function(data){ ariel = data._ArrayData_;});
var data = [];
for (var i=0; i< 2070; i++)
{
var x = i, y=0;
var colr = 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:col
})
}
d = [20,40,23, 35, 10, 20, 5];
var width = 994,
height = 937,
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 t})
.attr("r",10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment