Skip to content

Instantly share code, notes, and snippets.

@benheb
Created February 14, 2013 20:23
Show Gist options
  • Save benheb/4956061 to your computer and use it in GitHub Desktop.
Save benheb/4956061 to your computer and use it in GitHub Desktop.
//create the bins
while (min < this.visibleTimeExtent[1]) {
res_stops[min] = 0;
min = min+step;
}
res_stops[this.visibleTimeExtent[1]] = 0;
//fill the bins
for (time in this.timeHash) {
for (stop in res_stops) {
if (time > prev && time <= stop) {
var val = res_stops[stop];
res_stops[stop] = parseInt(val) + parseInt(this.timeHash[time].length);
}
prev = stop;
}
}
//hash
hash = res_stops;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment