Untitled

mail@pastecode.io avatar
unknown
javascript
3 years ago
752 B
2
Indexable
Never
var birthDay = 14;
var birthMonth = Math.floor(Math.random() * 12) + 1;
var birthYear = 97;
var PI = Math.PI;
var ringCount = Math.floor(Math.random() * 12) + 1;;
var ringSegments = 360 / birthMonth
var randomStartAngle = Math.floor(Math.random() * 3) + 1;


var svg = d3.select("svg")
    .attr("width", 1000)
    .attr("height", 1000)
var g = svg.append("g")
	.attr("transform", "translate(500,500)");

for (var i = 1; i < ringCount+1; i++) {

	console.log("ran")
	var arc = d3.arc()
	.innerRadius(i*birthDay)
	.outerRadius(i*birthDay+birthDay)
	.startAngle(ringSegments *i * (Math.PI/180))
	.endAngle(1+i);
	g.append("path")
	.attr("class", "arc")
	.attr("d", arc)
	.attr("fill","#F7942F")
//	.attr("opacity", 5/i*0.5);
}