kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
31 lines (26 loc) • 830 B
JavaScript
var alter = require('../lib/alter.js');
var _ = require('lodash');
var Chainable = require('../lib/classes/chainable');
var loadFunctions = require('../lib/load_functions.js');
var fitFunctions = loadFunctions('fit_functions');
module.exports = new Chainable('fit', {
args: [
{
name: 'inputSeries',
types: ['seriesList']
},
{
name: 'mode',
types: ['string'],
help: 'The algorithm to use for fitting the series to the target. One of: ' + _.keys(fitFunctions).join(', ')
}
],
help: 'Fills null values using a defined fit function',
fn: function absFn(args) {
return alter(args, function (eachSeries, mode) {
var noNulls = _.filter(eachSeries.data, 1);
eachSeries.data = fitFunctions[mode](noNulls, eachSeries.data);
return eachSeries;
});
}
});