Created
October 21, 2015 06:43
-
-
Save philrenaud/dcc2ac93878f83e4fe7a 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
$('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