Last active
December 22, 2015 22:09
-
-
Save jgoodall/6538221 to your computer and use it in GitHub Desktop.
intro to d3: skeleton
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"> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
console.log('append the svg to the body of the page'); | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", 650) | |
.attr("height", 500) | |
.append("g") | |
.attr("transform", "translate(" + 100 + "," + 240 + ")"); // add some margins | |
svg.append('text') | |
.style('font-size', '60px') // make the text big | |
.style('fill', 'green') // to color svg text, use fill | |
.text('d3 v' + d3.version + ' is loaded...'); // write some text | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment