});
color.domain(valid_fingerprints);
- var minTime = d3.min(raw_data.relays.map(function(d) { return d[direction][period] && parseTime(d[direction][period].first); }));
- var maxTime = d3.max(raw_data.relays.map(function(d) { return d[direction][period] && parseTime(d[direction][period].last); }));
+ var minTime = d3.max(raw_data.relays.map(function(d) { return d[direction][period] && parseTime(d[direction][period].first); }));
+ var maxTime = d3.min(raw_data.relays.map(function(d) { return d[direction][period] && parseTime(d[direction][period].last); }));
var maxTotalBandwidth = 0;
var data = stack(color.domain().map(function(fingerprint) {
var last = parseTime(history.last);
var i = 0;
for (var current = minTime; current <= maxTime; current = d3.time.second.offset(current, history.interval)) {
- var value;
- if (current < first || current > last) {
- value = 0;
- } else {
- value = history.factor * history.values[i++];
+ if (first <= current && current <= last) {
+ values.push({ date: current, y: history.factor * history.values[i++] });
}
- values.push({ date: current, y: value });
}
maxTotalBandwidth = maxTotalBandwidth + history.factor * d3.max(history.values);