Created
January 21, 2012 18:33
-
-
Save jescalan/1653520 to your computer and use it in GitHub Desktop.
jQuery-style css selector for d3 library
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: a data visualization library for javascript --http://mbostock.github.com/d3/ | |
// Allows you to set multiple css properties at once | |
// Add this into the d3 source. Use like this d3.select('p').css({ color: 'red', 'font-size': '24px' }); | |
d3_selectionPrototype.css = function(args) { | |
for (var key in args) { | |
var val = args[key] | |
this.style(key, val) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment