D3 bl.ocks.org javascript template.
See it in action at WrongEntertainment/5676532
Last active
December 17, 2015 21:39
-
-
Save paulvollmer/5676532 to your computer and use it in GitHub Desktop.
bl.ocks.org javascript template
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> | |
<meta charset="utf-8"> | |
<!-- The stylecheet ------------------------------------------------------- --> | |
<style> | |
/* HTML style */ | |
/* SVG style */ | |
rect { | |
fill: black; | |
stroke: red; | |
} | |
</style> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<!-- The javascript ------------------------------------------------------- --> | |
<script> | |
var width = 960, | |
height = 500; | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
svg.append("rect") | |
.attr("x", 10) | |
.attr("y", 10) | |
.attr("width", width-20) | |
.attr("height", height-20); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment