Skip to content

Instantly share code, notes, and snippets.

@dgwyer
Created July 11, 2017 17:25
Show Gist options
  • Save dgwyer/c2cba1cdea59c4e01bf9f029527de5b1 to your computer and use it in GitHub Desktop.
Save dgwyer/c2cba1cdea59c4e01bf9f029527de5b1 to your computer and use it in GitHub Desktop.
fresh block
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<script>
var svg = d3.select("body").append("svg");
svg.selectAll("circle")
.data([32, 57, 112, 293, 123, 45])
.enter().append("circle")
.style("stroke", "hotpink")
.style("fill", "pink")
.attr("cy", 60)
.attr("cx", function(d, i) { return i * 100 + 30; })
.attr("r", function(d) { return Math.sqrt(d); });
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment