Skip to content

Instantly share code, notes, and snippets.

@masakick
Last active August 28, 2015 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masakick/65af1b6fe8a4f888561c to your computer and use it in GitHub Desktop.
Save masakick/65af1b6fe8a4f888561c to your computer and use it in GitHub Desktop.
TOKYO2020 first proposal
<!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;
var p1 = [0, 0];
var p2 = [0, a];
var p3 = [a, 0];
var point = [p1,p2,p3];
var line = d3.svg.line()
.x(function(d) {return d[0];})
.y(function(d) {return d[1];});
svg.append("path")
.attr({
'd': line(point),
'stroke': 'none',
'fill': '#FFD700'
});
p1 = [a * 2, 0];
p2 = [a * 3, 0];
p3 = [a * 3, a];
point = [p1,p2,p3];
svg.append("path")
.attr({
'd': line(point),
'stroke': 'none',
'fill': '#808080'
});
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",2.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