Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prototype.evaluate = function(input) {
log.debug(input, ["collecting"]);
// Create a new output changeset to prevent pollution when the Graph
// merges reflow and regular changesets.
var output = ChangeSet.create(input);
if (input.rem.length) {
this._data = Tuple.idFilter(this._data, input.rem);
output.rem = input.rem.slice(0);
}
if (input.add.length) {
this._data = this._data.concat(input.add);
output.add = input.add.slice(0);
}
if (input.mod.length) {
prototype.batchTransform = function(input, data) {
log.debug(input, ['rank']);
var rank = this._output.rank,
norm = this.param('normalize'),
field = this.param('field').accessor,
keys = {},
i, len = data.length, klen, d, f;
// If we have a field accessor, first compile distinct keys.
if (field) {
for (i=0, klen=0; i
input.evaluate = function(input) {
log.debug(input, ['input', ds._name]);
var delta = ds._input,
out = ChangeSet.create(input), f;
// Delta might contain fields updated through API
for (f in delta.fields) {
out.fields[f] = 1;
}
// update data
if (delta.rem.length) {
ds._data = Tuple.idFilter(ds._data, delta.rem);
}
if (delta.add.length) {
ds._data = ds._data.concat(delta.add);
prototype.batchTransform = function(input, data) {
log.debug(input, ['hierarchy layout']);
// get variables
var layout = this._layout,
output = this._output,
mode = this.param('mode'),
sort = this.param('sort'),
nodesz = this.param('nodesize'),
parent = this.param('parent').accessor,
root = data.filter(function(d) { return parent(d) === null; })[0];
if (mode !== this._mode) {
this._mode = mode;
if (mode === 'tidy') mode = 'tree';
layout = (this._layout = d3.layout[mode]());
}
function buildGroup(input, group) {
log.debug(input, ["building group", group._id]);
group._scales = group._scales || {};
group.scale = scale.bind(group);
group.items = group.items || [];
this._children[group._id] = this._children[group._id] || [];
group.axes = group.axes || [];
group.axisItems = group.axisItems || [];
group.legends = group.legends || [];
group.legendItems = group.legendItems || [];
// Index group by ID to enable safe scoped scale lookups.
this._graph.group(group._id, group);
}
prototype.transform = function(input) {
log.debug(input, ['sorting']);
if (input.add.length || input.mod.length || input.rem.length) {
input.sort = dl.comparator(this.param('by').field);
}
return input;
};
prototype.done = function(pulse) {
log.debug(pulse, ['bookkeeping']);
for (var d in pulse.data) { this.data(d).synchronize(); }
return this;
};
prototype.done = function(pulse) {
log.debug(pulse, ['bookkeeping']);
for (var d in pulse.data) { this.data(d).synchronize(); }
return this;
};