vega-dataflow
Advanced tools
Comparing version 1.4.1 to 1.4.2
{ | ||
"name": "vega-dataflow", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Vega streaming dataflow graph.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -123,9 +123,10 @@ var dl = require('datalib'), | ||
var data = this.values(), | ||
indexes = this._indexes, | ||
fields = this._indexFields, | ||
f = dl.$(field), | ||
index, i, len, value; | ||
if (!this._indexes[field]) { | ||
index = {}; | ||
this._indexes[field] = index; | ||
this._indexFields.push(field); | ||
if (!indexes[field]) { | ||
indexes[field] = index = {}; | ||
fields.push(field); | ||
for (i=0, len=data.length; i<len; ++i) { | ||
@@ -137,3 +138,3 @@ value = f(data[i]); | ||
} | ||
return this._indexes[field]; | ||
return indexes[field]; | ||
}; | ||
@@ -140,0 +141,0 @@ |
@@ -22,2 +22,3 @@ var dl = require('datalib'), | ||
this._signals = {}; | ||
this._requestedIndexes = {}; | ||
@@ -95,2 +96,26 @@ this.doNotPropagate = {}; | ||
prototype.requestIndex = function(data, field) { | ||
var ri = this._requestedIndexes, | ||
reg = ri[data] || (ri[data] = {}); | ||
return (reg[field] = true, this); | ||
}; | ||
prototype.buildIndexes = function() { | ||
var ri = this._requestedIndexes, | ||
data = dl.keys(ri), | ||
i, len, j, jlen, d, src, fields, f; | ||
for (i=0, len=data.length; i<len; ++i) { | ||
src = this.data(d=data[i]); | ||
if (!src) throw Error('Data source '+dl.str(d)+' does not exist.'); | ||
fields = dl.keys(ri[d]); | ||
for (j=0, jlen=fields.length; j<jlen; ++j) { | ||
if ((f=fields[j]) === null) continue; | ||
src.getIndex(f); | ||
ri[d][f] = null; | ||
} | ||
} | ||
}; | ||
// Stamp should be specified with caution. It is necessary for inline datasources, | ||
@@ -97,0 +122,0 @@ // which need to be populated during the same cycle even though propagation has |
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
524309
7084