-
-
Save Andrew-Reid/539c8ee99cbbabbf15b81ae1f5abb3e1 to your computer and use it in GitHub Desktop.
selection.call logging
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> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.0/d3.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var dataset = d3.range(10); | |
d3.select("body").selectAll("div") | |
.call(log,"body") | |
.data(dataset) | |
.call(log,"dataset") | |
.enter() | |
.call(log,"enter") | |
.append("div") | |
.call(log,"div") | |
.attr("class", "bar") | |
.call(log,"bar"); | |
function log(sel,msg) { | |
console.log(msg,sel); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment