Skip to content

Instantly share code, notes, and snippets.

@ariaz
Created July 8, 2012 22:20
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/3073160 to your computer and use it in GitHub Desktop.
Save ariaz/3073160 to your computer and use it in GitHub Desktop.
just another inlet to tributary
var ariel;
d3.json('/static/img.json', function(data){ ariel = data;});
// findCx = function(i){
// x = 0, y=0, z=0;
//
// while(i>11040){i-=11040;z+=1};
// while(i>240){i-=240;y+=1};
// x = i;
// return
// }
d = [20,40,296, 335, 100, 120, -95];
var width = 500,
height = 112,
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", 500)
.attr("height",505)
.append("svg:g");
var circle = svg.selectAll("g.circle")
.data(ariel)
.enter().append("circle");
t = d3.rgb(32,22345,130);
d3.selectAll("circle")
.attr("cx", function(d){return x_scale(d._ArrayData_);})
.attr("cy", function(d){return y_scale(d._ArrayData_);})
.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