From 73ac76bfe53c9c96a1914e4edf0fbe2ef24049a3 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Tue, 17 May 2016 12:57:02 -0700 Subject: [PATCH] Sample tomography distances to cap number around 360 --- ui/javascripts/app/helpers.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/javascripts/app/helpers.js b/ui/javascripts/app/helpers.js index c555088169..69b5e1ea3f 100644 --- a/ui/javascripts/app/helpers.js +++ b/ui/javascripts/app/helpers.js @@ -104,7 +104,6 @@ Ember.Handlebars.helper('tomographyGraph', function(tomography, size) { // if/when Handlebars fixes the underlying issues all of this can be cleaned // up drastically. - var n = tomography.n; var max = Math.max.apply(null, tomography.distances); var insetSize = size / 2 - 8; var buf = '' + @@ -118,7 +117,12 @@ Ember.Handlebars.helper('tomographyGraph', function(tomography, size) { ' ' + ' ' + ' '; - tomography.distances.forEach(function (distance, i) { + var sampling = 360 / tomography.n; + distances = tomography.distances.filter(function () { + return Math.random() < sampling + }); + var n = distances.length; + distances.forEach(function (distance, i) { buf += ' '; }); buf += '' +