vega-dataflow
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "vega-dataflow", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Vega streaming dataflow graph.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -68,5 +68,3 @@ var log = require('vega-logging'), | ||
prototype.values = function(data) { | ||
if (!arguments.length) { | ||
return this._collector ? this._collector.data() : this._data; | ||
} | ||
if (!arguments.length) return this._collector.data(); | ||
@@ -73,0 +71,0 @@ // Replace backing data |
@@ -40,33 +40,25 @@ var dl = require('datalib'), | ||
prototype.dataValues = function(names) { | ||
var data = this._data, k; | ||
if (!arguments.length) { | ||
names = []; | ||
for (k in data) names.push(k); | ||
} | ||
if (Array.isArray(names)) { | ||
return names.reduce(function(db, name) { | ||
return (db[name] = data[name].values(), db); | ||
}, {}); | ||
prototype.signal = function(name, init) { | ||
if (arguments.length === 1) { | ||
var m = this; | ||
return Array.isArray(name) ? | ||
name.map(function(n) { return m._signals[n]; }) : | ||
this._signals[name]; | ||
} else { | ||
return data[names].values(); | ||
return (this._signals[name] = new Signal(this, name, init)); | ||
} | ||
}; | ||
function signal(names) { | ||
var m = this; | ||
if (Array.isArray(names)) { | ||
return names.map(function(name) { | ||
return m._signals[name]; | ||
}); | ||
} else { | ||
return this._signals[names]; | ||
} | ||
} | ||
prototype.dataValues = function(names) { | ||
var data = this._data, | ||
n = arguments.length ? names : dl.keys(data), | ||
name, db, i; | ||
prototype.signal = function(name, init) { | ||
if (arguments.length === 1) { | ||
return signal.call(this, name); | ||
if (Array.isArray(n)) { | ||
for (db={}, i=0; i<n.length; ++i) { | ||
db[(name=n[i])] = data[name].values(); | ||
} | ||
return db; | ||
} else { | ||
return (this._signals[name] = new Signal(this, name, init)); | ||
return data[n].values(); | ||
} | ||
@@ -77,14 +69,13 @@ }; | ||
prototype.signalValues = function(names) { | ||
if (!arguments.length) { | ||
names = []; | ||
for (var k in this._signals) names.push(k); | ||
} | ||
if (Array.isArray(names)) { | ||
var values = {}; | ||
for (var i=0, n=names.length; i<n; ++i) { | ||
values[names[i]] = this._signals[names[i]].value(); | ||
var sig = this._signals, | ||
n = arguments.length ? names : dl.keys(sig), | ||
vals, i; | ||
if (Array.isArray(n)) { | ||
for (vals={}, i=0; i<n.length; ++i) { | ||
vals[n[i]] = sig[n[i]].value(); | ||
} | ||
return values; | ||
return vals; | ||
} else { | ||
return this._signals[names].value(); | ||
return sig[n].value(); | ||
} | ||
@@ -118,5 +109,6 @@ }; | ||
var pq = new Heap(function(a, b) { | ||
// Topological sort on qrank as rank may change during propagation. | ||
return a.qrank() - b.qrank(); | ||
}); | ||
// Sort on qrank (queue-rank). | ||
// Rank can change during propagation due to rewiring. | ||
return a._qrank - b._qrank; | ||
}); | ||
@@ -123,0 +115,0 @@ if (pulse.stamp) throw Error('Pulse already has a non-zero stamp.'); |
@@ -13,3 +13,3 @@ function Heap(comparator) { | ||
prototype.clear = function() { | ||
this.nodes = []; | ||
return (this.nodes = [], this); | ||
}; | ||
@@ -16,0 +16,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
520640
6973
12