From e84f30488fb14f97d2b1697578938b09a770e523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 6 Sep 2017 15:45:51 +0200 Subject: [PATCH] Move getBinsCount function to a class method --- lib/cartodb/models/dataview/histogram.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/cartodb/models/dataview/histogram.js b/lib/cartodb/models/dataview/histogram.js index 01b62148..c2df2c5f 100644 --- a/lib/cartodb/models/dataview/histogram.js +++ b/lib/cartodb/models/dataview/histogram.js @@ -583,7 +583,7 @@ module.exports = class Histogram extends BaseWidget { override = override || {}; var buckets = []; - var binsCount = getBinsCount(override); + var binsCount = this.getBinsCount(override); var width = getWidth(override); var binsStart = this.getBinStart(override); var nulls = 0; @@ -694,6 +694,9 @@ module.exports = class Histogram extends BaseWidget { return override.end || 0; } + getBinsCount (override) { + return override.bins || 0; + } }; var DATE_AGGREGATIONS = { @@ -707,10 +710,6 @@ var DATE_AGGREGATIONS = { 'year': true }; -function getBinsCount(override) { - return override.bins || 0; -} - function getWidth(override) { var width = 0; var binsCount = override.bins;