MCPcopy Create free account
hub / github.com/microsoft/SandDance / Facet

Function Facet

docs/app/js/sanddance-app.js:117168–117178  ·  view source on GitHub ↗

* Facets a dataflow into a set of subflows based on a key. * @constructor * @param {object} params - The parameters for this operator. * @param {function(Dataflow, string): Operator} params.subflow - A function * that generates a subflow of operators and returns its root operator. * @param {f

(params)

Source from the content-addressed store, hash-verified

117166 * that generates a subflow of operators and returns its root operator.
117167 * @param {function(object): *} params.key - The key field to facet by.
117168 */ function Facet(params) {
117169 (0, _vegaDataflow.Transform).call(this, {}, params);
117170 this._keys = (0, _vegaUtil.fastmap)(); // cache previously calculated key values
117171 // keep track of active subflows, use as targets array for listeners
117172 // this allows us to limit propagation to only updated subflows
117173 const a = this._targets = [];
117174 a.active = 0;
117175 a.forEach = (f)=>{
117176 for(let i = 0, n = a.active; i < n; ++i)f(a[i], i, a);
117177 };
117178}
117179(0, _vegaUtil.inherits)(Facet, (0, _vegaDataflow.Transform), {
117180 activate (flow) {
117181 this._targets[this._targets.active++] = flow;

Callers 1

parseFacetFunction · 0.70

Calls 1

fFunction · 0.70

Tested by

no test coverage detected