Last active
September 9, 2015 02:21
-
-
Save erikhazzard/7e830bd65ad749237e4d to your computer and use it in GitHub Desktop.
data yoga 1
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
</head> | |
<body> | |
<svg width=960 height=500 > | |
</svg> | |
<script> | |
var svg = d3.select('svg'); | |
var rect = svg.append('rect') | |
.attr({ | |
x: 0, | |
y: 0, | |
width: 960, | |
height: 300 | |
}) | |
.style({ | |
fill: "#336699" | |
}); | |
function breathe(){ | |
rect.transition().duration(1200).attr({ | |
transform: 'scale(' + Math.random() + ')' | |
}).each('end', breathe); | |
} | |
breathe(); | |
</script> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment