Move getBinsCount function to a class method

This commit is contained in:
Daniel García Aubert 2017-09-06 15:45:51 +02:00
parent 49a60caffc
commit e84f30488f

View File

@ -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;