[ Launch: Pointer events ] 5215694 by RobinL
-
-
Save RobinL/5215694 to your computer and use it in GitHub Desktop.
Pointer events
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
{"description":"Pointer events","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
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
d3.select("body").style("background-color", "black"); | |
var sampleSVG = d3.select("svg") | |
.append("svg") | |
.attr("width", 400) | |
.attr("height", 200); | |
sampleSVG.append("circle") | |
.style("fill", "grey") | |
.style("stroke-width", 2) | |
.attr("r", 60) | |
.attr("cx", 150) | |
.attr("cy", 100) | |
.on("mouseover", function(){d3.select(this).style("fill", "red");}) | |
.on("mouseout", function(){d3.select(this).style("fill", "grey");}); | |
sampleSVG.append("circle") | |
.style("stroke", "yellow") | |
.style("opacity", 0.5) | |
.style("stroke-width", 2) | |
.attr("r", 100) | |
.attr("cx", 250) | |
.attr("cy", 100) | |
.style("pointer-events", "none"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment