Skip to content

Instantly share code, notes, and snippets.

@trinary
Last active April 9, 2017 21:24
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 trinary/d5252820161c9b1ee340511c763583f3 to your computer and use it in GitHub Desktop.
Save trinary/d5252820161c9b1ee340511c763583f3 to your computer and use it in GitHub Desktop.
dots
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/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>
<svg></svg>
<script>
var myData = [1, 2, 4, 11, 5.5, 6];
var svg = d3.select("svg")
var circles = svg.selectAll("circle").data(myData);
circles
.enter()
.append("circle")
.attr("cx", function(d) { return d * 50})
.attr("cy", 111)
.attr("r", 10)
.style("fill", "#9C9393")
.style("stroke", "#D8A3A3")
.style("stroke-width", "2px");
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment