Created
December 12, 2013 23:44
-
-
Save ryanpitts/7937646 to your computer and use it in GitHub Desktop.
Mike Bostock tip on moving elements in front of siblings. https://groups.google.com/forum/#!msg/d3-js/eUEJWSSWDRY/EMmufH2KP8MJ
This file contains hidden or 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.selection.prototype.moveToFront = function() { | |
return this.each(function() { | |
this.parentNode.appendChild(this); | |
}); | |
}; | |
Then you can say: | |
d3.select("p").moveToFront().style("color", "red"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment