Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prototype.transform = function(_, pulse) {
var out = pulse.fork(pulse.ALL),
impute = getValue(_),
field = getField(_),
fName = accessorName(_.field),
kName = accessorName(_.key),
gNames = (_.groupby || []).map(accessorName),
groups = partition(pulse.source, _.groupby, _.key, _.keyvals),
curr = [],
prev = this.value,
m = groups.domain.length,
group, value, gVals, kVal, g, i, j, l, n, t;
for (g=0, l=groups.length; g
prototype.transform = function(_, pulse) {
var out = pulse.fork(pulse.ALL),
impute = getValue(_),
field = getField(_),
fName = accessorName(_.field),
kName = accessorName(_.key),
gNames = (_.groupby || []).map(accessorName),
groups = partition(pulse.source, _.groupby, _.key, _.keyvals),
curr = [],
prev = this.value,
m = groups.domain.length,
group, value, gVals, kVal, g, i, j, l, n, t;
for (g=0, l=groups.length; g
ops.forEach(function(op, i) {
let field = fields[i],
mname = accessorName(field),
name = measureName(op, mname, as[i]);
visitInputs(field);
outputs.push(name);
// Window operation
if (hasOwnProperty(WindowOps, op)) {
windows.push(WindowOp(op, fields[i], params[i], name));
}
// Aggregate operation
else {
if (field == null && op !== 'count') {
error('Null aggregate field specified.');
}
if (op === 'count') {
this._dnames = this._dims.map(function(d) {
var dname = accessorName(d);
inputVisit(d);
outputs.push(dname);
return dname;
});
this.cellkey = _.key ? _.key : groupkey(this._dims);
this._dnames = this._dims.map(function(d) {
var dname = accessorName(d);
inputVisit(d);
outputs.push(dname);
return dname;
});
this.cellkey = _.key ? _.key : groupkey(this._dims);
n = fields.length,
map = {},
field, op, m, mname, outname, i;
if (n !== ops.length) {
error('Unmatched number of fields and aggregate ops.');
}
for (i=0; i
prototype.transform = function(_, pulse) {
var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);
if (!this.value || pulse.changed() || _.modified()) {
const source = pulse.materialize(pulse.SOURCE).source,
groups = partition(source, _.groupby),
names = (_.groupby || []).map(accessorName),
method = _.method || 'linear',
order = _.order || 3,
dof = degreesOfFreedom(method, order),
as = _.as || [accessorName(_.x), accessorName(_.y)],
fit = Methods[method],
values = [];
let domain = _.extent;
if (!hasOwnProperty(Methods, method)) {
error('Invalid regression method: ' + method);
}
if (domain != null) {
if (method === 'log' && domain[0] <= 0) {
pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');
domain = null;
}
}
if (v == null) {
return null;
} else {
v = Math.max(start, Math.min(+v, stop - step));
return start + step * Math.floor((v - start) / step);
}
};
f.start = start;
f.stop = stop;
f.step = step;
return this.value = accessor(
f,
accessorFields(field),
_.name || 'bin_' + accessorName(field)
);
};
return fields.map(function(f, i) {
return as[i] || accessorName(f);
});
}