commit
d56d39efb0
@ -2,10 +2,12 @@ var _ = require('lodash');
|
|||||||
var d3 = require('d3');
|
var d3 = require('d3');
|
||||||
|
|
||||||
var MAX_HISTORY = 1000;
|
var MAX_HISTORY = 1000;
|
||||||
|
|
||||||
var MAX_PEER_PROPAGATION = 36;
|
var MAX_PEER_PROPAGATION = 36;
|
||||||
var MIN_PROPAGATION_RANGE = 0;
|
var MIN_PROPAGATION_RANGE = 0;
|
||||||
var MAX_PROPAGATION_RANGE = 20000;
|
var MAX_PROPAGATION_RANGE = 20000;
|
||||||
var MAX_UNCLE_BINS = 36;
|
|
||||||
|
var MAX_UNCLES_PER_BIN = 25;
|
||||||
var MAX_BINS = 40;
|
var MAX_BINS = 40;
|
||||||
|
|
||||||
var History = function History(data)
|
var History = function History(data)
|
||||||
@ -170,14 +172,14 @@ History.prototype.getUncleCount = function(id)
|
|||||||
|
|
||||||
console.log(uncles);
|
console.log(uncles);
|
||||||
|
|
||||||
var uncleBins = _.fill(Array(MAX_UNCLE_BINS), 0);
|
var uncleBins = _.fill(Array(MAX_BINS), 0);
|
||||||
|
|
||||||
var sumMapper = function(array, key) {
|
var sumMapper = function(array, key) {
|
||||||
uncleBins[key] = _.sum(array);
|
uncleBins[key] = _.sum(array);
|
||||||
return _.sum(array);
|
return _.sum(array);
|
||||||
};
|
};
|
||||||
|
|
||||||
_.map(_.chunk(uncles, MAX_BINS), sumMapper);
|
_.map(_.chunk(uncles, MAX_UNCLES_PER_BIN), sumMapper);
|
||||||
|
|
||||||
return uncleBins;
|
return uncleBins;
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,11 @@ div.small-title-miner {
|
|||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.small-title span.small {
|
||||||
|
letter-spacing: 0px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
.big-info .big-details {
|
.big-info .big-details {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
|
@ -135,7 +135,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
$scope.uncleCount = data;
|
$scope.uncleCount = data;
|
||||||
$scope.unclesInLast = data[0];
|
$scope.unclesInLast = data[0];
|
||||||
|
|
||||||
jQuery('.spark-uncles').sparkline($scope.uncleCount.reverse(), {type: 'bar'});
|
jQuery('.spark-uncles').sparkline($scope.uncleCount.reverse(), {type: 'bar', barSpacing: 1});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -77,7 +77,8 @@ block content
|
|||||||
|
|
||||||
div.col-xs-4.stat-holder
|
div.col-xs-4.stat-holder
|
||||||
div.big-info.chart
|
div.big-info.chart
|
||||||
span.small-title uncle count
|
span.small-title uncle count #[ ]
|
||||||
|
span.small (25 blocks per bar)
|
||||||
span.big-details.spark-uncles
|
span.big-details.spark-uncles
|
||||||
|
|
||||||
div.col-xs-4.stat-holder
|
div.col-xs-4.stat-holder
|
||||||
|
Loading…
Reference in New Issue
Block a user