Skip to content

Instantly share code, notes, and snippets.

@getsetbro
Created October 8, 2012 04:21
Show Gist options
  • Save getsetbro/3850707 to your computer and use it in GitHub Desktop.
Save getsetbro/3850707 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"endpoint":"tributary","public":true}
var svg = d3.select("svg"),
data2 = [{n:11,txt:"text"},{n:22,txt:"text two"},{n:33,txt:"text three"},
{n:44,txt:"text"},{n:55,txt:"text five"},{n:66,txt:"text six"},
{n:77,txt:"text"},{n:88,txt:"text eight"}
],
groups = svg.selectAll().data(data2).enter().append("g")
.attr("transform", function(d,i) {
var a = (i+9)*(i*3.5) +33,b = (i+1)*(i*9) +55;
return "translate(" + [ a, b ] + ")";
}),
circles = groups.append("circle").attr({cx:0,cy:0,
r:(function(d) {return d.n}),fill:'orange',opacity:.5
}),
label = groups.append("text").attr({"alignment-baseline": "middle",
"text-anchor": "middle","font-size":function(d){return d.n/2}
}),
tspans = label.append("tspan")
.text(function(d,i){return d.txt}
);
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment