Skip to content

Instantly share code, notes, and snippets.

@Wanagram
Last active May 5, 2016 13:47
Show Gist options
  • Save Wanagram/560ba13406b065af6a1e0f741ebd4f2b to your computer and use it in GitHub Desktop.
Save Wanagram/560ba13406b065af6a1e0f741ebd4f2b to your computer and use it in GitHub Desktop.
final exam question 1
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
svg { width:100%; height: 100% }
</style>
</head>
<body>
<script>
// Feel free to change or delete any of the code you see!
var svg = d3.select("body").append("svg")
svg.append("rect")
.attr({x: 50, y: 50, width: 400, height: 400})
.style({ fill: "white", stroke: "black"})
svg.append("rect")
.attr({x: 90, y: 200, width: 320, height: 100})
.style({ fill: "red"})
svg.append("rect")
.attr({x: 200, y: 90, width: 100, height: 320})
.style({ fill: "red"})
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment