1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1 1 1 3 3 3 7 3 3 | 'use strict';
require('../globals');
module.exports = binning;
function binning(dataTable, encoding, opt) {
opt = opt || {};
Eif (!dataTable.transform) dataTable.transform = [];
encoding.forEach(function(field, encType) {
if (encoding.bin(encType)) {
dataTable.transform.push({
type: 'bin',
field: encoding.fieldRef(encType, {nofn: true}),
output: encoding.fieldRef(encType),
maxbins: encoding.bin(encType).maxbins
});
}
});
return dataTable;
}
|