Cluster layout.
From D3 in Depth book by Peter Cook.
forked from d3indepth's block: Cluster layout
xxxxxxxxxx
<meta charset="utf-8">
<head>
<title>Cluster layout</title>
</head>
<style></style>
<body>
<div id = "id1"></div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.min.js"></script>
<script>
var s1 = d3.select("#id1");
s1
.style("background-color","blue")
.style("width","200px")
.style("height","200px");
s1
.transition()
.delay(1000)
.duration(1000)
.style("width", "500px");
s1.on("click", function(){ s1
.style("background-color","red")});
</script>
</html>
https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.min.js