Skip to content

Commit

Permalink
Updating to use UTC data.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmaril committed Jun 19, 2012
1 parent a14c820 commit ed32014
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions country-dashboard/data/combine.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ load_normalized = (data)->
load_utc = (data)->
rawData = []
csv()
.fromPath(__dirname+'/contractor_activity_over_time_local.csv')
.fromPath(__dirname+'/contractor_activity_over_time_UTC.csv')
.toPath(__dirname+'/sample.out')
.transform((data)->
data.unshift(data.pop())
Expand All @@ -126,8 +126,7 @@ load_utc = (data)->
)
.on('end',(count)->
addToData = (item)->
[total, country, day, hour, relative, absolute] = item
console.log(item) if country is "United States"
[country, absolute, total, relative, day, hour] = item
relative = +relative
absolute = +absolute

Expand Down
5 changes: 2 additions & 3 deletions country-dashboard/data/combine.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ load_normalized = function(data) {

load_utc = function(data) {
rawData = [];
return csv().fromPath(__dirname + '/contractor_activity_over_time_local.csv').toPath(__dirname + '/sample.out').transform(function(data) {
return csv().fromPath(__dirname + '/contractor_activity_over_time_UTC.csv').toPath(__dirname + '/sample.out').transform(function(data) {
data.unshift(data.pop());
return data;
}).on('data', function(data, index) {
Expand All @@ -134,8 +134,7 @@ load_utc = function(data) {
var addToData;
addToData = function(item) {
var absolute, country, day, hour, i, morezeroes, relative, total, zero;
total = item[0], country = item[1], day = item[2], hour = item[3], relative = item[4], absolute = item[5];
if (country === "United States") console.log(item);
country = item[0], absolute = item[1], total = item[2], relative = item[3], day = item[4], hour = item[5];
relative = +relative;
absolute = +absolute;
if (country === "country" || country.length === 0) return;
Expand Down
2 changes: 1 addition & 1 deletion country-dashboard/data/working_data.json

Large diffs are not rendered by default.

0 comments on commit ed32014

Please sign in to comment.