Last active
August 29, 2015 14:26
-
-
Save masakick/d79a427020ec10ed656e to your computer and use it in GitHub Desktop.
TOKYO2020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var width = 480, | |
height = 480; | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
var a = 160; | |
svg.append("rect") | |
.attr("x",0) | |
.attr("y",0) | |
.attr("width",a) | |
.attr("height",a) | |
.attr("fill","#FFD700"); | |
svg.append("rect") | |
.attr("x",2*a) | |
.attr("y",2*a) | |
.attr("width",a) | |
.attr("height",a) | |
.attr("fill","#808080"); | |
var r = Math.sqrt(1.5*1.5+0.5*0.5)*a; | |
svg.append("circle") | |
.attr("cx",1.5*a) | |
.attr("cy",1.5*a) | |
.attr("r",r) | |
.attr("fill","#FFFFFF"); | |
svg.append("rect") | |
.attr("x",a) | |
.attr("y",0) | |
.attr("width",a) | |
.attr("height",a*3) | |
.attr("fill","#000000"); | |
svg.append("circle") | |
.attr("cx",2.5*a) | |
.attr("cy",0.5*a) | |
.attr("r",0.5*a) | |
.attr("fill","#FF0000"); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment