added avg block propagation
This commit is contained in:
@@ -159,6 +159,7 @@ History.prototype.getNodePropagation = function(id)
|
||||
History.prototype.getBlockPropagation = function()
|
||||
{
|
||||
var propagation = [];
|
||||
var avgPropagation = 0;
|
||||
|
||||
_.forEach(this._items, function(n, key)
|
||||
{
|
||||
@@ -171,6 +172,11 @@ History.prototype.getBlockPropagation = function()
|
||||
});
|
||||
});
|
||||
|
||||
if(propagation.length > 0)
|
||||
{
|
||||
var avgPropagation = Math.round(_.sum(propagation) / propagation.length);
|
||||
}
|
||||
|
||||
var x = d3.scale.linear()
|
||||
.domain([MIN_PROPAGATION_RANGE, MAX_PROPAGATION_RANGE])
|
||||
.interpolate(d3.interpolateRound);
|
||||
@@ -187,7 +193,7 @@ History.prototype.getBlockPropagation = function()
|
||||
return {x: val.x, dx: val.dx, y: val.y, frequency: val.length, cumulative: freqCum, cumpercent: cumPercent};
|
||||
});
|
||||
|
||||
return histogram;
|
||||
return {histogram: histogram, avg: avgPropagation};
|
||||
}
|
||||
|
||||
History.prototype.getUncleCount = function()
|
||||
|
||||
Reference in New Issue
Block a user