Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$('tr').map(function(iter,row){
var max = _.max($(row).children('td').map(function(iter,cell){ return $(cell).text().replace(/,/g,'') }))
var min = _.min($(row).children('td').map(function(iter,cell){ return $(cell).text().replace(/,/g,'') }))
var color = d3.scale.linear()
.domain([min, max])
.range(["#c33", "#0fc"]);
$(this).children('td').map(function(iter,cell){
$(cell).css('background-color', color($(cell).text().replace(/,/g,'')))
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.