Created
August 26, 2011 01:25
-
-
Save caged/1172470 to your computer and use it in GitHub Desktop.
census block heatmap
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
$.getJSON '/data/mn-blks.json', (data) -> | |
values = _.uniq(_.map(data.features, (d) -> d.counts[prop])) | |
color = d3.scale.quantile() | |
.domain(values) | |
.range(d3.range(4)) | |
# Add and clasify block-level geography | |
map.add po.geoJson() | |
.features(data.features) | |
.on 'load', (d) -> | |
_.each(d.features, (f) -> | |
e = f.element | |
col = color(f.data.counts[prop]) | |
e.setAttribute('class', "nh q5-#{col}") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment