Skip to content

Instantly share code, notes, and snippets.

Last active February 8, 2016 23:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Circular Layout
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
<script src="//"></script>
var svg ="body").append("svg")
.attr("width", 960)
.attr("height", 500)
.attr("transform", "translate(480,250)");
var g = svg.selectAll("g")
.data(d3.range(0, 360, 2))
.attr("transform", function(d) { return "rotate(" + d + ")"; });
var circle = g.selectAll("circle")
.attr("cx", d3.scale.linear().domain([0, 9]).range([180, 240]))
.attr("r", 4.5)
.attr("fill", d3.scale.linear().domain([0, 9]).range(["brown", "steelblue"]))
.attr("stroke", "black");
Copy link

Kreozot commented Aug 18, 2015

Please replace the d3 reference to this:
Because now the example is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment