Skip to content

Instantly share code, notes, and snippets.

@englishm
Created October 26, 2012 17:16
Show Gist options
  • Save englishm/3960037 to your computer and use it in GitHub Desktop.
Save englishm/3960037 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var w = 500;
var h = 500;
var x = 4;
var dataset = [1*x, 2*x, 3*x, 4*x, 5*x];
var projects = [
{name: "project 1",
due: 10,
est: 40
},
{name: "project 2",
due: 5,
est: 2
}
];
var svg = d3.select("svg")
.attr("width", w)
.attr("height", h);
svg.data(dataset)
.enter()
.append("rect")
var rects = svg.selectAll("rect")
.data(dataset)
.enter()
.append("rect");
rects.attr("width", function(d, i){
return (i * 50) + 25;
})
.attr("height", h/2)
.attr("x", function(d,i){
return i*10;})
.attr("y", function(d,i){
return i*10;})
.attr("fill", "yellow")
.attr("stroke", "orange")
.attr("stroke-width", function(d){
return d/2;});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment