Skip to content

Instantly share code, notes, and snippets.

@mayhewsw
Last active August 29, 2015 14:23
Show Gist options
  • Save mayhewsw/2570119e161dc6247503 to your computer and use it in GitHub Desktop.
Save mayhewsw/2570119e161dc6247503 to your computer and use it in GitHub Desktop.
D3 Test
<html>
<head>
<title>Put stuff here</title>
</head>
<body>
<h2>This is my block/gist!</h2>
<div id="putstuffhere"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script>
var svg = d3.select("#putstuffhere").append("svg")
.attr("width", 500)
.attr("height", 300);
var data = [3, 5, 1, 3, 9, 10];
var circles = svg.selectAll("myrects")
.data(data).enter().append("circle")
.attr("r", function(d) {return d})
.attr("x", function(d) {return d})
.attr("y", function(d) {return d})
.attr("fill", "blue");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment