Built with blockbuilder.org
Created
September 13, 2018 18:48
-
-
Save aendra-rininsland/077f28bdb3d553b5b4bed91788eb1ad8 to your computer and use it in GitHub Desktop.
d3-party
This file contains hidden or 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 hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<script src="https://unpkg.com/d3-party"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<script> | |
const w = 960; | |
const h = 500; | |
// Feel free to change or delete any of the code you see in this editor! | |
var svg = d3.select("body").append("svg") | |
.attr("width", w) | |
.attr("height", h) | |
const party = d3.party(svg); | |
d3.selectAll('circle').data(Array(100).fill(null)).enter().append('circle') | |
.attr('cx', d3.randomUniform(0, w)()) | |
.attr('cy', d3.randomUniform(0, h)()) | |
.attr('r', d3.randomUniform(1, 100)()) | |
.call(party); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment