Skip to content

Commit

Permalink
fixing choro styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Smith committed Aug 18, 2014
1 parent 6d9a245 commit 8ff5a91
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
26 changes: 20 additions & 6 deletions app/scripts/views/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,26 @@ WHO.Views = WHO.Views || {};
};
// get color depending on response level
function getColor(d) {
return d == 2 ? 'rgb(255,252,224)' :
d == 3 ? 'rgb(250,175,78)' :
d == 4 ? 'rgb(249,145,77)' :
d == 5 ? 'rgb(247,117,77)' :
d == 6 ? 'rgb(246, 104, 61)' :
'#fff';
console.log(feature.id);
console.log(d);
if (feature.id.substr(7,1) == 0) {
// for admin0 geoids with different scale
return d == 1 ? '#fff' :
d == 2 ? 'rgb(255,252,224)' :
d == 3 ? 'rgb(252,202,78)' :
d == 4 ? 'rgb(250,175,78)' :
d == 5 ? 'rgb(249,145,77)' :
d == 6 ? 'rgb(246,104,61)' :
'#fff';
}
else {
return d == 1 ? '#fff' :
d == 2 ? 'rgb(252,202,78)' :
d == 3 ? 'rgb(250,175,78)' :
d == 4 ? 'rgb(249,145,77)' :
d == 5 ? 'rgb(246,104,61)' :
'#fff';
}
};
},

Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"topojson": "~1.6.15",
"queue-async": "~1.0.7",
"d3-tip": "~0.6.4",
"d3": "~3.4.11"
"d3": "~3.4.11",
"firebase": "~1.0.19"
},
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ <h5 class="who-title">Response level and cases</h5>

</div>

<script src="scripts/c3fe213f.vendor.js"></script>
<script src="scripts/828851d3.vendor.js"></script>

<script src="https://assets-datawrapper.s3.amazonaws.com/vendor/chroma-js/0.5.2/chroma.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js"></script>

<script src="scripts/347e9a6f.main.js"></script>
<script src="scripts/428f2505.main.js"></script>
</body>
</html>
1 change: 0 additions & 1 deletion dist/scripts/347e9a6f.main.js

This file was deleted.

Loading

0 comments on commit 8ff5a91

Please sign in to comment.