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),
shape = this.value,
as = _.as || 'shape',
flag = out.ADD;
if (!shape || _.modified()) {
// parameters updated, reset and reflow
this.value = shape = shapeGenerator(
getProjectionPath(_.projection),
_.field || field('datum'),
_.pointRadius
);
out.materialize().reflow();
flag = out.SOURCE;
}
out.visit(flag, function(t) { t[as] = shape; });
return out.modifies(as);
};
prototype.transform = function(_, pulse) {
var out = pulse.fork(pulse.ALL),
path = this.value,
field = _.field || identity,
as = _.as || 'path',
flag = out.SOURCE;
function set(t) { t[as] = path(field(t)); }
if (!path || _.modified()) {
// parameters updated, reset and reflow
this.value = path = getProjectionPath(_.projection);
out.materialize().reflow();
} else {
flag = field === identity || pulse.modified(field.fields)
? out.ADD_MOD
: out.ADD;
}
var prev = initPath(path, _.pointRadius);
out.visit(flag, set);
path.pointRadius(prev);
return out.modifies(as);
};