// Generated by CoffeeScript 1.10.0 (function() { var arc_generator, bars, days, height, r, svg, width; days = d3.range(365).map(function(i) { return { min: 6 + 6 * Math.random(), max: 18 + 6 * Math.random() }; }); svg = d3.select('svg'); width = svg.node().getBoundingClientRect().width; height = svg.node().getBoundingClientRect().height; svg.attr({ viewBox: (-width / 2) + " " + (-height / 2) + " " + width + " " + height }); r = d3.scale.linear().domain([0, 24]).range([50, 200]); arc_generator = d3_shape.arc(); bars = svg.selectAll('.bar').data(days); bars.enter().append('path').attr({ "class": 'bar', d: function(d, i) { return arc_generator({ innerRadius: r(d.min), outerRadius: r(d.max), startAngle: i * 2 * Math.PI / 365, endAngle: (i + 1) * 2 * Math.PI / 365 }); } }); }).call(this);