background-color: rgb(38, 38, 38);
<script src="/1wheel/raw/67b47524ed8ed829d021/d3-3.5.5.js"></script>
<script src="/1wheel/raw/67b47524ed8ed829d021/lodash-3.8.0.js"></script>
<script src='/1wheel/raw/1b6758978dc2d52d3a37/d3-jetpack.js'></script>
<script src='/1wheel/raw/1b6758978dc2d52d3a37/d3-starterkit.js'></script>
//offset from center for each num
var x2 = [ l, -l, -l, -l]
var svg = d3.select('body')
.attr({height: height + 0*2, width: width + 0*2})
d3.range(0, width + s, s*6).map(function(x, i){
d3.range(0, height + s, s*3).map(function(y, j){
d3.range(0, 4).map(function(sideNum){
svg.dataAppend(grid, 'circle')
var lines = svg.dataAppend(grid, 'path')
function cycleAnimation(){
grid.forEach(pushLinesOut)
.transition().delay(500).duration(1500)
// lines.attr('d', pointToPathReverse)
// grid.forEach(rotateLines)
// .transition().delay(2500).duration(1500)
// .attr('d', pointToPathReverse)
setTimeout(cycleAnimation, 4000)
function pushLinesOut(d){
d.y += d.n == 1 ? 3*s : -3*s
d.x += d.n == 0 ? 3*s : -3*s
return 'M' + [d.x + x1[d.n], d.y + y1[d.n]] +
'L' + [d.x + x2[d.n], d.y + y2[d.n]] + 'Z'
function pointToPathReverse(d){
return 'M' + [d.x + x2[d.n], d.y + y2[d.n]] +
'L' + [d.x + x1[d.n], d.y + y1[d.n]]