From 820dc786f643942cc8aba928d5d0fc6f149c4927 Mon Sep 17 00:00:00 2001 From: cubedro Date: Fri, 24 Apr 2015 06:37:52 +0300 Subject: [PATCH] changed uncle count range --- models/history.js | 8 +++++--- public/css/style.css | 5 +++++ public/js/controllers.js | 2 +- views/index.jade | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/models/history.js b/models/history.js index 5071c1b..883a958 100644 --- a/models/history.js +++ b/models/history.js @@ -2,10 +2,12 @@ var _ = require('lodash'); var d3 = require('d3'); var MAX_HISTORY = 1000; + var MAX_PEER_PROPAGATION = 36; var MIN_PROPAGATION_RANGE = 0; var MAX_PROPAGATION_RANGE = 20000; -var MAX_UNCLE_BINS = 36; + +var MAX_UNCLES_PER_BIN = 25; var MAX_BINS = 40; var History = function History(data) @@ -170,14 +172,14 @@ History.prototype.getUncleCount = function(id) console.log(uncles); - var uncleBins = _.fill(Array(MAX_UNCLE_BINS), 0); + var uncleBins = _.fill(Array(MAX_BINS), 0); var sumMapper = function(array, key) { uncleBins[key] = _.sum(array); return _.sum(array); }; - _.map(_.chunk(uncles, MAX_BINS), sumMapper); + _.map(_.chunk(uncles, MAX_UNCLES_PER_BIN), sumMapper); return uncleBins; } diff --git a/public/css/style.css b/public/css/style.css index 08d8015..e0e1e62 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -114,6 +114,11 @@ div.small-title-miner { color: #aaa; } +span.small-title span.small { + letter-spacing: 0px; + color: #666; +} + .big-info .big-details { display: block; font-weight: 200; diff --git a/public/js/controllers.js b/public/js/controllers.js index dcb1c52..906df4a 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -135,7 +135,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { $scope.uncleCount = data; $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; diff --git a/views/index.jade b/views/index.jade index d0a835a..3dacb3a 100644 --- a/views/index.jade +++ b/views/index.jade @@ -77,7 +77,8 @@ block content div.col-xs-4.stat-holder 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 div.col-xs-4.stat-holder