Skip to content

Commit

Permalink
Rename "entity" variable to "place"
Browse files Browse the repository at this point in the history
  • Loading branch information
waldoj committed Mar 21, 2016
1 parent 9b14f7d commit 31e2782
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions public/grid/js/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ function mapInfo(data, tabletop) {
"wy": "Wyoming"
}
rawData = tabletop.sheets('Places').all();
var entity_scores = {};
var place_scores = {};
for (var key in rawData){
name = rawData[key]['Name'];
for (var key2 in state_abbreviations){
if (state_abbreviations[key2] == name){
abbreviation = key2;
}
}
entity_scores[abbreviation] = rawData[key]['Score']
place_scores[abbreviation] = rawData[key]['Score']
}

var score_colors = {
Expand All @@ -125,11 +125,11 @@ function mapInfo(data, tabletop) {
"90": "#084594",
}

var entity_colors = {};
for (var key in entity_scores){
score = Math.floor(entity_scores[key] / 10) * 10;
var place_colors = {};
for (var key in place_scores){
score = Math.floor(place_scores[key] / 10) * 10;
if (score < 20) score = 20;
entity_colors[key] = score_colors[score];
place_colors[key] = score_colors[score];
}

$('#vmap').vectorMap({
Expand All @@ -140,7 +140,7 @@ function mapInfo(data, tabletop) {
showLabels: true,
selectedColor: null,
hoverColor: "#f66",
colors: entity_colors,
colors: place_colors,
onRegionClick: function(event, code, region){
event.preventDefault();
window.location.href = "/datasets.html?state=" + region;
Expand Down

0 comments on commit 31e2782

Please sign in to comment.