Last active
November 3, 2018 19:09
-
-
Save jsrath/5866ee3ea7ca5f6f4a7b78c8aec8e0d6 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
const values = data.map(element => element[1]); | |
const scaleColors = getColor(); | |
let color = d3.scaleLinear() | |
.domain([d3.min(values), d3.max(values)]) | |
.range(scaleColors); | |
data.forEach(district => { | |
d3.select('g#' + district[0]) | |
.attr('fill', color(district[1])) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment