Built with blockbuilder.org
Last active
April 28, 2019 05:28
-
-
Save romsson/1e1cd0f8af1c2c043ff54299ce8fa13f to your computer and use it in GitHub Desktop.
minimalistic circle grid #d3-gridding
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
license: mit |
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="https://d3js.org/d3.v4.js"></script> | |
<script src="https://romsson.github.io/d3-gridding/build/d3-gridding.js"></script> | |
<script> | |
d3.select("body").append("svg") | |
.attr("width", 800) | |
.attr("height", 600) | |
.selectAll("circle") | |
.data( | |
d3.gridding() | |
.size([800, 600]) | |
.mode("vertical")(d3.range(10)) | |
) | |
.enter().append("circle") | |
.attr("r", 10) | |
.attr("transform", function(d) { | |
return "translate(" + d.cx + "," + d.cy + ")"; | |
}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment