Last active
August 29, 2015 14:11
-
-
Save svenhofstede-zz/c7f4924bcb8ca117670a to your computer and use it in GitHub Desktop.
Random_circle_example
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
var svg = d3.select("svg") | |
var circle = svg.append("circle") | |
circle.attr("cx",500) | |
.attr("cy",300) | |
.attr("r",87) | |
.attr("fill","#ff6575") | |
.attr("stroke","#606060") | |
.attr("stroke-width",35) | |
circle.on("mouseover",function(){ | |
selected = d3.select(this); | |
var initialSize = selected.attr("r"); | |
selected | |
.attr("r",parseInt(initialSize,10)+50); | |
}) | |
circle.on("mouseout",function(){ | |
selected = d3.select(this); | |
var initialSize = selected.attr("r"); | |
selected | |
.attr("r",parseInt(initialSize,10)-50); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment