-
-
Save mbostock/15a9eecf0b29db92f12ca823cfbbce0a to your computer and use it in GitHub Desktop.
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> | |
<meta charset="utf-8"> | |
<style> | |
.overlay { | |
fill: green; | |
} | |
</style> | |
<body> | |
<script src="https://d3js.org/d3.v4.0.0-alpha.45.min.js"></script> | |
<script> | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", 960) | |
.attr("height", 500); | |
svg.append("g") | |
.call(d3.brush() | |
.on("start brush end", function() { | |
text | |
.interrupt() | |
.text(d3.event.type) | |
.style("fill-opacity", 1) | |
.transition() | |
.delay(500) | |
.style("fill-opacity", 0); | |
})); | |
var text = svg.append("text") | |
.attr("x", "50%") | |
.attr("y", "50%") | |
.attr("dy", ".35em") | |
.attr("font-size", 20) | |
.attr("pointer-events", "none"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment