Socket
Socket
Sign inDemoInstall

vega-dataflow

Package Overview
Dependencies
Maintainers
2
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-dataflow - npm Package Compare versions

Comparing version 5.7.1 to 5.7.2

2

build/vega-dataflow.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-loader"),require("vega-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-loader","vega-format"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={},t.vega,t.vega,t.vega)}(this,(function(t,e,n,r){"use strict";function s(t){const n=t||e.identity,r=[],s={};return r.add=t=>{const e=n(t);return s[e]||(s[e]=1,r.push(t)),r},r.remove=t=>{const e=n(t);if(s[e]){s[e]=0;const n=r.indexOf(t);n>=0&&r.splice(n,1)}return r},r}async function i(t,e){try{await e(t)}catch(e){t.error(e)}}const o=Symbol("vega_id");let a=1;function u(t){return t[o]}function l(t,e){return t[o]=e,t}function h(t){const e=t===Object(t)?t:{data:t};return u(e)?e:l(e,a++)}function c(t,e){for(const n in t)e[n]=t[n];return e}function d(t){return t&&t.constructor===f}function f(){let t=[],n=[],r=[],s=[],i=[],o=null,a=!1;return{constructor:f,insert(n){let r=e.array(n),s=0,i=r.length;for(;s<i;++s)t.push(r[s]);return this},remove(t){let r=e.isFunction(t)?s:n,i=e.array(t),o=0,a=i.length;for(;o<a;++o)r.push(i[o]);return this},modify(t,n,s){let o={field:n,value:e.constant(s)};return e.isFunction(t)?(o.filter=t,i.push(o)):(o.tuple=t,r.push(o)),this},encode(t,n){return e.isFunction(t)?i.push({filter:t,field:n}):r.push({tuple:t,field:n}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(e,l){let c,d,f,p,g,m,_={},v={};for(c=0,d=l.length;c<d;++c)_[u(l[c])]=1;for(c=0,d=n.length;c<d;++c)g=n[c],_[u(g)]=-1;for(c=0,d=s.length;c<d;++c)p=s[c],l.forEach(t=>{p(t)&&(_[u(t)]=-1)});for(c=0,d=t.length;c<d;++c)g=t[c],m=u(g),_[m]?_[m]=1:e.add.push(h(t[c]));for(c=0,d=l.length;c<d;++c)g=l[c],_[u(g)]<0&&e.rem.push(g);function y(t,n,r){r?t[n]=r(t):e.encode=n,a||(v[u(t)]=t)}for(c=0,d=r.length;c<d;++c)f=r[c],g=f.tuple,p=f.field,m=_[u(g)],m>0&&(y(g,p,f.value),e.modifies(p));for(c=0,d=i.length;c<d;++c)f=i[c],p=f.filter,l.forEach(t=>{p(t)&&_[u(t)]>0&&y(t,f.field,f.value)}),e.modifies(f.field);if(a)e.mod=n.length||s.length?l.filter(t=>_[u(t)]>0):l.slice();else for(m in v)e.mod.push(v[m]);return(o||null==o&&(n.length||s.length))&&e.clean(!0),e}}}function p(){Object.defineProperty(this,"_:mod:_",{writable:!0,value:{}})}p.prototype={set(t,n,r,s){const i=this,o=i[t],a=i["_:mod:_"];return null!=n&&n>=0?(o[n]!==r||s)&&(o[n]=r,a[n+":"+t]=-1,a[t]=-1):(o!==r||s)&&(i[t]=r,a[t]=e.isArray(r)?1+r.length:-1),i},modified(t,n){let r,s=this["_:mod:_"];if(!arguments.length){for(r in s)if(s[r])return!0;return!1}if(e.isArray(t)){for(r=0;r<t.length;++r)if(s[t[r]])return!0;return!1}return null!=n&&n>=0?n+1<s[t]||!!s[n+":"+t]:!!s[t]},clear(){return this["_:mod:_"]={},this}};let g=0;const m=new p;function _(t,e,n,r){this.id=++g,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function v(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}_.prototype={targets(){return this._targets||(this._targets=s(e.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:v(1),modified:v(2),parameters(t,n,r){n=!1!==n;let s,i,o,a,u=this._argval=this._argval||new p,l=this._argops=this._argops||[],h=[];const c=(t,e,r)=>{r instanceof _?(r!==this&&(n&&r.targets().add(this),h.push(r)),l.push({op:r,name:t,index:e})):u.set(t,e,r)};for(s in t)if(i=t[s],"pulse"===s)e.array(i).forEach(t=>{t instanceof _?t!==this&&(t.targets().add(this),h.push(t)):e.error("Pulse parameters must be operator instances.")}),this.source=i;else if(e.isArray(i))for(u.set(s,-1,Array(o=i.length)),a=0;a<o;++a)c(s,a,i[a]);else c(s,-1,i);return this.marshall().clear(),r&&(l.initonly=!0),h},marshall(t){let e,n,r,s,i,o=this._argval||m,a=this._argops;if(a){for(n=0,r=a.length;n<r;++n)e=a[n],s=e.op,i=s.modified()&&s.stamp===t,o.set(e.name,e.index,s.value,i);if(a.initonly){for(n=0;n<r;++n)e=a[n],e.op.targets().remove(this);this._argops=null,this._update=null}}return o},detach(){let t,e,n,r,s=this._argops;if(s)for(t=0,e=s.length;t<e;++t)n=s[t],r=n.op,r._targets&&r._targets.remove(this)},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let y=0;function k(t,e,n){this.id=++y,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function w(t,e,n){return new k(t,e,n)}k.prototype={_filter:e.truthy,_apply:e.identity,targets(){return this._targets||(this._targets=s(e.id))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){let e=this.value=this._apply(t),n=this._targets,r=n?n.length:0,s=0;for(;s<r;++s)n[s].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=w(t);return this.targets().add(e),e},apply(t){const e=w(null,t);return this.targets().add(e),e},merge(){const t=w();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter(()=>{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const n=w();return this.targets().add(w(null,null,e.debounce(t,t=>{const e=t.dataflow;n.receive(t),e&&e.run&&e.run()}))),n},between(t,e){let n=!1;return t.targets().add(w(null,null,()=>n=!0)),e.targets().add(w(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const F={skip:!0};function A(t,n,r,s,i,o){let a,u,l=e.extend({},o,F);e.isFunction(r)||(r=e.constant(r)),void 0===s?a=e=>t.touch(r(e)):e.isFunction(s)?(u=new _(null,s,i,!1),a=e=>{u.evaluate(e);const n=r(e),s=u.value;d(s)?t.pulse(n,s,o):t.update(n,s,l)}):a=e=>t.update(r(e),s,l),n.apply(a)}function D(t,n,r,s,i,o){if(void 0===s)n.targets().add(r);else{const a=o||{},u=new _(null,function(t,n){return n=e.isFunction(n)?n:e.constant(n),t?function(e,r){const s=n(e,r);return t.skip()||(t.skip(s!==this.value).value=s),s}:n}(r,s),i,!1);u.modified(a.force),u.rank=n.rank,n.targets().add(u),r&&(u.skip(!0),u.value=r.value,u.targets().add(r),t.connect(r,[u]))}}const E={};function P(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function b(t,n){const r=[];return e.visitArray(t,n,t=>r.push(t)),r}function q(t,e){const n={};return t.visit(e,(function(t){n[u(t)]=1})),t=>n[u(t)]?null:t}function O(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function M(t,e,n,r){let s,i,o,a,u,l=this,h=0;for(this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n,o=0,a=n.length;o<a;++o)if(s=n[o],s.stamp===e){if(s.fields)for(u in i=l.fields||(l.fields={}),s.fields)i[u]=1;s.changed(l.ADD)&&(h|=l.ADD),s.changed(l.REM)&&(h|=l.REM),s.changed(l.MOD)&&(h|=l.MOD)}this.changes=h}function S(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}P.prototype={StopPropagation:E,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new P(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new P(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,q(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const n=this.fields||(this.fields={});return e.isArray(t)?t.forEach(t=>n[t]=!0):n[t]=!0,this},modified(t,n){const r=this.fields;return!(!n&&!this.mod.length||!r)&&(arguments.length?e.isArray(t)?t.some(t=>r[t]):r[t]:!!r)},filter(t,e){const n=this;return 1&t&&(n.addF=O(n.addF,e)),2&t&&(n.remF=O(n.remF,e)),4&t&&(n.modF=O(n.modF,e)),16&t&&(n.srcF=O(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=b(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=b(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=b(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,n){let r,s,i=this,o=n;return 16&t?(e.visitArray(i.source,i.srcF,o),i):(1&t&&e.visitArray(i.add,i.addF,o),2&t&&e.visitArray(i.rem,i.remF,o),4&t&&e.visitArray(i.mod,i.modF,o),8&t&&(r=i.source)&&(s=i.add.length+i.mod.length,s===r.length||(s?e.visitArray(r,q(i,5),o):e.visitArray(r,i.srcF,o))),i)}},e.inherits(M,P,{fork(t){const e=new P(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,t=>e.add.push(t)),t&e.REM&&this.visit(e.REM,t=>e.rem.push(t)),t&e.MOD&&this.visit(e.MOD,t=>e.mod.push(t))),e},changed(t){return this.changes&t},modified(t){const n=this,r=n.fields;return r&&n.changes&n.MOD?e.isArray(t)?t.some((function(t){return r[t]})):r[t]:0},filter(){e.error("MultiPulse does not support filtering.")},materialize(){e.error("MultiPulse does not support materialization.")},visit(t,e){let n=this,r=n.pulses,s=r.length,i=0;if(t&n.SOURCE)for(;i<s;++i)r[i].visit(t,e);else for(;i<s;++i)r[i].stamp===n.stamp&&r[i].visit(t,e);return n}});const L={skip:!1,force:!1};function R(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),x(e,0,e.length-1,t)),pop:()=>{let n,r=e.pop();return e.length?(n=e[0],e[0]=r,function(t,e,n){let r,s=e,i=t.length,o=t[e],a=1+(e<<1);for(;a<i;)r=a+1,r<i&&n(t[a],t[r])>=0&&(a=r),t[e]=t[a],a=1+((e=a)<<1);t[e]=o,x(t,s,e,n)}(e,0,t)):n=r,n}}}function x(t,e,n,r){let s,i,o;for(s=t[n];n>e&&(o=n-1>>1,i=t[o],r(s,i)<0);)t[n]=i,n=o;return t[n]=s}function C(){this.logger(e.logger()),this.logLevel(e.Error),this._clock=0,this._rank=0,this._locale=r.defaultLocale();try{this._loader=n.loader()}catch(t){}this._touched=s(e.id),this._input={},this._pulse=null,this._heap=R((t,e)=>t.qrank-e.qrank),this._postrun=[]}function z(t){return function(){return this._log[t].apply(this,arguments)}}function T(t,e){_.call(this,t,null,e)}C.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:z("error"),warn:z("warn"),info:z("info"),debug:z("debug"),logLevel:z("level"),cleanThreshold:1e4,add:function(t,n,r,s){let i,o=1;return t instanceof _?i=t:t&&t.prototype instanceof _?i=new t:e.isFunction(t)?i=new _(null,t):(o=0,i=new _(t,n)),this.rank(i),o&&(s=r,r=n),r&&this.connect(i,i.parameters(r,s)),this.touch(i),i},connect:function(t,e){let n,r,s=t.rank;for(n=0,r=e.length;n<r;++n)if(s<e[n].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){let n,r,s,i=[t];for(;i.length;)if(this.rank(n=i.pop()),r=n._targets)for(s=r.length;--s>=0;)i.push(n=r[s]),n===t&&e.error("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||L);const r=new P(this,this._clock+(this._pulse?0:1)),s=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,s),this},touch:function(t,e){const n=e||L;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||L;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:f,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const r=this.locale();return n.read(t,e,r.timeParse,r.utcParse)},preload:async function(t,n,r){const s=this,i=s._pending||function(t){let e,n=new Promise(t=>e=t);return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(s);i.requests+=1;const o=await s.request(n,r);return s.pulse(t,s.changeset().remove(e.truthy).insert(o.data||[])),i.done(),o},request:async function(t,e){const r=this;let s,i=0;try{s=await r.loader().load(t,{context:"dataflow",response:n.responseType(e&&e.type)});try{s=r.parse(s,e)}catch(e){i=-2,r.warn("Data ingestion failed",t,e)}}catch(e){i=-1,r.warn("Loading failed",t,e)}return{data:s,status:i}},events:function(t,n,r,s){let i,o=this,a=w(r,s),u=function(t){t.dataflow=o;try{a.receive(t)}catch(t){o.error(t)}finally{o.run()}};i="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):e.array(t);for(let t=0,e=i.length;t<e;++t)i[t].addEventListener(n,u);return a},on:function(t,e,n,r,s){return(t instanceof _?D:A)(this,t,e,n,r,s),this},evaluate:async function(t,n,r){const o=this,a=[];if(o._pulse)return S(o);if(o._pending&&await o._pending,n&&await i(o,n),!o._touched.length)return o.debug("Dataflow invoked, but nothing to do."),o;const u=++o._clock;o._pulse=new P(o,u,t),o._touched.forEach(t=>o._enqueue(t,!0)),o._touched=s(e.id);let l,h,c,d=0;try{for(;o._heap.size()>0;)l=o._heap.pop(),l.rank===l.qrank?(h=l.run(o._getPulse(l,t)),h.then?h=await h:h.async&&(a.push(h.async),h=E),h!==E&&l._targets&&l._targets.forEach(t=>o._enqueue(t)),++d):o._enqueue(l,!0)}catch(t){o._heap.clear(),c=t}if(o._input={},o._pulse=null,o.debug(`Pulse ${u}: ${d} operators`),c&&(o._postrun=[],o.error(c)),o._postrun.length){const t=o._postrun.sort((t,e)=>e.priority-t.priority);o._postrun=[];for(let e=0;e<t.length;++e)await i(o,t[e].callback)}return r&&await i(o,r),a.length&&Promise.all(a).then(t=>o.runAsync(null,()=>{t.forEach(t=>{try{t(o)}catch(t){o.error(t)}})})),o},run:function(t,e,n){return this._pulse?S(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,n){const r=t.source,s=this._clock;return r&&e.isArray(r)?new M(this,s,r.map(t=>t.pulse),n):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==E&&(t.source=e.source);return t}(this._pulse,r&&r.pulse)}},e.inherits(T,_,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then(t=>this.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const U={};function j(t){return t=t&&t.toLowerCase(),e.hasOwnProperty(U,t)?U[t]:null}t.Dataflow=C,t.EventStream=k,t.MultiPulse=M,t.Operator=_,t.Parameters=p,t.Pulse=P,t.Transform=T,t.UniqueList=s,t.asyncCallback=i,t.changeset=f,t.definition=function(t){const e=j(t);return e&&e.Definition||null},t.derive=function(t){return c(t,h({}))},t.ingest=h,t.isChangeSet=d,t.isTuple=function(t){return!(!t||!u(t))},t.rederive=c,t.replace=function(t,e){return l(e,u(t))},t.stableCompare=function(t,e){return t?e?(n,r)=>t(n,r)||u(e(n))-u(e(r)):(e,n)=>t(e,n)||u(e)-u(n):null},t.transform=j,t.transforms=U,t.tupleid=u,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-loader"),require("vega-format")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-loader","vega-format"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={},t.vega,t.vega,t.vega)}(this,(function(t,e,n,r){"use strict";function s(t){const n=t||e.identity,r=[],s={};return r.add=t=>{const e=n(t);return s[e]||(s[e]=1,r.push(t)),r},r.remove=t=>{const e=n(t);if(s[e]){s[e]=0;const n=r.indexOf(t);n>=0&&r.splice(n,1)}return r},r}async function i(t,e){try{await e(t)}catch(e){t.error(e)}}const o=Symbol("vega_id");let a=1;function l(t){return t[o]}function u(t,e){return t[o]=e,t}function h(t){const e=t===Object(t)?t:{data:t};return l(e)?e:u(e,a++)}function c(t,e){for(const n in t)e[n]=t[n];return e}function d(t){return t&&t.constructor===f}function f(){const t=[],n=[],r=[],s=[],i=[];let o=null,a=!1;return{constructor:f,insert(n){const r=e.array(n),s=r.length;for(let e=0;e<s;++e)t.push(r[e]);return this},remove(t){const r=e.isFunction(t)?s:n,i=e.array(t),o=i.length;for(let t=0;t<o;++t)r.push(i[t]);return this},modify(t,n,s){const o={field:n,value:e.constant(s)};return e.isFunction(t)?(o.filter=t,i.push(o)):(o.tuple=t,r.push(o)),this},encode(t,n){return e.isFunction(t)?i.push({filter:t,field:n}):r.push({tuple:t,field:n}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(e,u){const c={},d={};let f,p,g,m,_,v;for(f=0,p=u.length;f<p;++f)c[l(u[f])]=1;for(f=0,p=n.length;f<p;++f)_=n[f],c[l(_)]=-1;for(f=0,p=s.length;f<p;++f)m=s[f],u.forEach(t=>{m(t)&&(c[l(t)]=-1)});for(f=0,p=t.length;f<p;++f)_=t[f],v=l(_),c[v]?c[v]=1:e.add.push(h(t[f]));for(f=0,p=u.length;f<p;++f)_=u[f],c[l(_)]<0&&e.rem.push(_);function y(t,n,r){r?t[n]=r(t):e.encode=n,a||(d[l(t)]=t)}for(f=0,p=r.length;f<p;++f)g=r[f],_=g.tuple,m=g.field,v=c[l(_)],v>0&&(y(_,m,g.value),e.modifies(m));for(f=0,p=i.length;f<p;++f)g=i[f],m=g.filter,u.forEach(t=>{m(t)&&c[l(t)]>0&&y(t,g.field,g.value)}),e.modifies(g.field);if(a)e.mod=n.length||s.length?u.filter(t=>c[l(t)]>0):u.slice();else for(v in d)e.mod.push(d[v]);return(o||null==o&&(n.length||s.length))&&e.clean(!0),e}}}const p="_:mod:_";function g(){Object.defineProperty(this,p,{writable:!0,value:{}})}g.prototype={set(t,n,r,s){const i=this,o=i[t],a=i[p];return null!=n&&n>=0?(o[n]!==r||s)&&(o[n]=r,a[n+":"+t]=-1,a[t]=-1):(o!==r||s)&&(i[t]=r,a[t]=e.isArray(r)?1+r.length:-1),i},modified(t,n){const r=this[p];if(!arguments.length){for(const t in r)if(r[t])return!0;return!1}if(e.isArray(t)){for(let e=0;e<t.length;++e)if(r[t[e]])return!0;return!1}return null!=n&&n>=0?n+1<r[t]||!!r[n+":"+t]:!!r[t]},clear(){return this[p]={},this}};let m=0;const _=new g;function v(t,e,n,r){this.id=++m,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function y(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}v.prototype={targets(){return this._targets||(this._targets=s(e.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:y(1),modified:y(2),parameters(t,n,r){n=!1!==n;const s=this._argval=this._argval||new g,i=this._argops=this._argops||[],o=[];let a,l,u,h;const c=(t,e,r)=>{r instanceof v?(r!==this&&(n&&r.targets().add(this),o.push(r)),i.push({op:r,name:t,index:e})):s.set(t,e,r)};for(a in t)if(l=t[a],"pulse"===a)e.array(l).forEach(t=>{t instanceof v?t!==this&&(t.targets().add(this),o.push(t)):e.error("Pulse parameters must be operator instances.")}),this.source=l;else if(e.isArray(l))for(s.set(a,-1,Array(u=l.length)),h=0;h<u;++h)c(a,h,l[h]);else c(a,-1,l);return this.marshall().clear(),r&&(i.initonly=!0),o},marshall(t){const e=this._argval||_,n=this._argops;let r,s,i,o;if(n){const a=n.length;for(s=0;s<a;++s)r=n[s],i=r.op,o=i.modified()&&i.stamp===t,e.set(r.name,r.index,i.value,o);if(n.initonly){for(s=0;s<a;++s)r=n[s],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,s;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],s=r.op,s._targets&&s._targets.remove(this)},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let k=0;function w(t,e,n){this.id=++k,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function F(t,e,n){return new w(t,e,n)}w.prototype={_filter:e.truthy,_apply:e.identity,targets(){return this._targets||(this._targets=s(e.id))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=F(t);return this.targets().add(e),e},apply(t){const e=F(null,t);return this.targets().add(e),e},merge(){const t=F();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter(()=>{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const n=F();return this.targets().add(F(null,null,e.debounce(t,t=>{const e=t.dataflow;n.receive(t),e&&e.run&&e.run()}))),n},between(t,e){let n=!1;return t.targets().add(F(null,null,()=>n=!0)),e.targets().add(F(null,null,()=>n=!1)),this.filter(()=>n)},detach(){}};const A={skip:!0};function D(t,n,r,s,i,o){const a=e.extend({},o,A);let l,u;e.isFunction(r)||(r=e.constant(r)),void 0===s?l=e=>t.touch(r(e)):e.isFunction(s)?(u=new v(null,s,i,!1),l=e=>{u.evaluate(e);const n=r(e),s=u.value;d(s)?t.pulse(n,s,o):t.update(n,s,a)}):l=e=>t.update(r(e),s,a),n.apply(l)}function E(t,n,r,s,i,o){if(void 0===s)n.targets().add(r);else{const a=o||{},l=new v(null,function(t,n){return n=e.isFunction(n)?n:e.constant(n),t?function(e,r){const s=n(e,r);return t.skip()||(t.skip(s!==this.value).value=s),s}:n}(r,s),i,!1);l.modified(a.force),l.rank=n.rank,n.targets().add(l),r&&(l.skip(!0),l.value=r.value,l.targets().add(r),t.connect(r,[l]))}}const P={};function b(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function q(t,n){const r=[];return e.visitArray(t,n,t=>r.push(t)),r}function O(t,e){const n={};return t.visit(e,t=>{n[l(t)]=1}),t=>n[l(t)]?null:t}function M(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function S(t,e,n,r){const s=this,i=n.length;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let t=0;t<i;++t){const r=n[t];if(r.stamp===e){if(r.fields){const t=s.fields||(s.fields={});for(const e in r.fields)t[e]=1}r.changed(s.ADD)&&(o|=s.ADD),r.changed(s.REM)&&(o|=s.REM),r.changed(s.MOD)&&(o|=s.MOD)}}this.changes=o}function L(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}b.prototype={StopPropagation:P,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new b(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new b(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,O(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const n=this.fields||(this.fields={});return e.isArray(t)?t.forEach(t=>n[t]=!0):n[t]=!0,this},modified(t,n){const r=this.fields;return!(!n&&!this.mod.length||!r)&&(arguments.length?e.isArray(t)?t.some(t=>r[t]):r[t]:!!r)},filter(t,e){const n=this;return 1&t&&(n.addF=M(n.addF,e)),2&t&&(n.remF=M(n.remF,e)),4&t&&(n.modF=M(n.modF,e)),16&t&&(n.srcF=M(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=q(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=q(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=q(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,n){const r=this,s=n;if(16&t)return e.visitArray(r.source,r.srcF,s),r;1&t&&e.visitArray(r.add,r.addF,s),2&t&&e.visitArray(r.rem,r.remF,s),4&t&&e.visitArray(r.mod,r.modF,s);const i=r.source;if(8&t&&i){const t=r.add.length+r.mod.length;t===i.length||(t?e.visitArray(i,O(r,5),s):e.visitArray(i,r.srcF,s))}return r}},e.inherits(S,b,{fork(t){const e=new b(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,t=>e.add.push(t)),t&e.REM&&this.visit(e.REM,t=>e.rem.push(t)),t&e.MOD&&this.visit(e.MOD,t=>e.mod.push(t))),e},changed(t){return this.changes&t},modified(t){const n=this,r=n.fields;return r&&n.changes&n.MOD?e.isArray(t)?t.some(t=>r[t]):r[t]:0},filter(){e.error("MultiPulse does not support filtering.")},materialize(){e.error("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,s=r.length;let i=0;if(t&n.SOURCE)for(;i<s;++i)r[i].visit(t,e);else for(;i<s;++i)r[i].stamp===n.stamp&&r[i].visit(t,e);return n}});const R={skip:!1,force:!1};function x(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),C(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,s=t.length,i=t[e];let o,a=1+(e<<1);for(;a<s;)o=a+1,o<s&&n(t[a],t[o])>=0&&(a=o),t[e]=t[a],a=1+((e=a)<<1);t[e]=i,C(t,r,e,n)}(e,0,t)):r=n,r}}}function C(t,e,n,r){let s,i;const o=t[n];for(;n>e&&(i=n-1>>1,s=t[i],r(o,s)<0);)t[n]=s,n=i;return t[n]=o}function z(){this.logger(e.logger()),this.logLevel(e.Error),this._clock=0,this._rank=0,this._locale=r.defaultLocale();try{this._loader=n.loader()}catch(t){}this._touched=s(e.id),this._input={},this._pulse=null,this._heap=x((t,e)=>t.qrank-e.qrank),this._postrun=[]}function T(t){return function(){return this._log[t].apply(this,arguments)}}function U(t,e){v.call(this,t,null,e)}z.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:T("error"),warn:T("warn"),info:T("info"),debug:T("debug"),logLevel:T("level"),cleanThreshold:1e4,add:function(t,n,r,s){let i,o=1;return t instanceof v?i=t:t&&t.prototype instanceof v?i=new t:e.isFunction(t)?i=new v(null,t):(o=0,i=new v(t,n)),this.rank(i),o&&(s=r,r=n),r&&this.connect(i,i.parameters(r,s)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let s=0;s<r;++s)if(n<e[s].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const n=[t];let r,s,i;for(;n.length;)if(this.rank(r=n.pop()),s=r._targets)for(i=s.length;--i>=0;)n.push(r=s[i]),r===t&&e.error("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||R);const r=new b(this,this._clock+(this._pulse?0:1)),s=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,s),this},touch:function(t,e){const n=e||R;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||R;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:f,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const r=this.locale();return n.read(t,e,r.timeParse,r.utcParse)},preload:async function(t,n,r){const s=this,i=s._pending||function(t){let e;const n=new Promise(t=>e=t);return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(s);i.requests+=1;const o=await s.request(n,r);return s.pulse(t,s.changeset().remove(e.truthy).insert(o.data||[])),i.done(),o},request:async function(t,e){const r=this;let s,i=0;try{s=await r.loader().load(t,{context:"dataflow",response:n.responseType(e&&e.type)});try{s=r.parse(s,e)}catch(e){i=-2,r.warn("Data ingestion failed",t,e)}}catch(e){i=-1,r.warn("Loading failed",t,e)}return{data:s,status:i}},events:function(t,n,r,s){const i=this,o=F(r,s),a=function(t){t.dataflow=i;try{o.receive(t)}catch(t){i.error(t)}finally{i.run()}};let l;l="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):e.array(t);const u=l.length;for(let t=0;t<u;++t)l[t].addEventListener(n,a);return o},on:function(t,e,n,r,s){return(t instanceof v?E:D)(this,t,e,n,r,s),this},evaluate:async function(t,n,r){const o=this,a=[];if(o._pulse)return L(o);if(o._pending&&await o._pending,n&&await i(o,n),!o._touched.length)return o.debug("Dataflow invoked, but nothing to do."),o;const l=++o._clock;o._pulse=new b(o,l,t),o._touched.forEach(t=>o._enqueue(t,!0)),o._touched=s(e.id);let u,h,c,d=0;try{for(;o._heap.size()>0;)u=o._heap.pop(),u.rank===u.qrank?(h=u.run(o._getPulse(u,t)),h.then?h=await h:h.async&&(a.push(h.async),h=P),h!==P&&u._targets&&u._targets.forEach(t=>o._enqueue(t)),++d):o._enqueue(u,!0)}catch(t){o._heap.clear(),c=t}if(o._input={},o._pulse=null,o.debug(`Pulse ${l}: ${d} operators`),c&&(o._postrun=[],o.error(c)),o._postrun.length){const t=o._postrun.sort((t,e)=>e.priority-t.priority);o._postrun=[];for(let e=0;e<t.length;++e)await i(o,t[e].callback)}return r&&await i(o,r),a.length&&Promise.all(a).then(t=>o.runAsync(null,()=>{t.forEach(t=>{try{t(o)}catch(t){o.error(t)}})})),o},run:function(t,e,n){return this._pulse?L(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,n){const r=t.source,s=this._clock;return r&&e.isArray(r)?new S(this,s,r.map(t=>t.pulse),n):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==P&&(t.source=e.source);return t}(this._pulse,r&&r.pulse)}},e.inherits(U,v,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then(t=>this.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const j={};function N(t){return t=t&&t.toLowerCase(),e.hasOwnProperty(j,t)?j[t]:null}t.Dataflow=z,t.EventStream=w,t.MultiPulse=S,t.Operator=v,t.Parameters=g,t.Pulse=b,t.Transform=U,t.UniqueList=s,t.asyncCallback=i,t.changeset=f,t.definition=function(t){const e=N(t);return e&&e.Definition||null},t.derive=function(t){return c(t,h({}))},t.ingest=h,t.isChangeSet=d,t.isTuple=function(t){return!(!t||!l(t))},t.rederive=c,t.replace=function(t,e){return u(e,l(t))},t.stableCompare=function(t,e){return t?e?(n,r)=>t(n,r)||l(e(n))-l(e(r)):(e,n)=>t(e,n)||l(e)-l(n):null},t.transform=N,t.transforms=j,t.tupleid=l,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "vega-dataflow",
"version": "5.7.1",
"version": "5.7.2",
"description": "Reactive dataflow processing.",

@@ -28,7 +28,7 @@ "keywords": [

"dependencies": {
"vega-format": "^1.0.2",
"vega-loader": "^4.3.1",
"vega-util": "^1.15.0"
"vega-format": "^1.0.3",
"vega-loader": "^4.3.2",
"vega-util": "^1.15.1"
},
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
"gitHead": "8d6793f4ca7eaaf2d22186764e9ce2dae687cf52"
}

@@ -9,8 +9,8 @@ import {ingest, tupleid} from './Tuple';

export default function changeset() {
let add = [], // insert tuples
rem = [], // remove tuples
mod = [], // modify tuples
remp = [], // remove by predicate
modp = [], // modify by predicate
clean = null,
const add = [], // insert tuples
rem = [], // remove tuples
mod = [], // modify tuples
remp = [], // remove by predicate
modp = []; // modify by predicate
let clean = null,
reflow = false;

@@ -21,14 +21,15 @@

insert(t) {
let d = array(t), i = 0, n = d.length;
for (; i<n; ++i) add.push(d[i]);
const d = array(t), n = d.length;
for (let i = 0; i < n; ++i) add.push(d[i]);
return this;
},
remove(t) {
let a = isFunction(t) ? remp : rem,
d = array(t), i = 0, n = d.length;
for (; i<n; ++i) a.push(d[i]);
const a = isFunction(t) ? remp : rem,
d = array(t),
n = d.length;
for (let i = 0; i < n; ++i) a.push(d[i]);
return this;
},
modify(t, field, value) {
let m = {field: field, value: constant(value)};
const m = {field: field, value: constant(value)};
if (isFunction(t)) {

@@ -57,6 +58,7 @@ m.filter = t;

pulse(pulse, tuples) {
let cur = {}, out = {}, i, n, m, f, t, id;
const cur = {}, out = {};
let i, n, m, f, t, id;
// build lookup table of current tuples
for (i=0, n=tuples.length; i<n; ++i) {
for (i = 0, n = tuples.length; i < n; ++i) {
cur[tupleid(tuples[i])] = 1;

@@ -66,3 +68,3 @@ }

// process individual tuples to remove
for (i=0, n=rem.length; i<n; ++i) {
for (i = 0, n = rem.length; i < n; ++i) {
t = rem[i];

@@ -73,3 +75,3 @@ cur[tupleid(t)] = -1;

// process predicate-based removals
for (i=0, n=remp.length; i<n; ++i) {
for (i = 0, n = remp.length; i < n; ++i) {
f = remp[i];

@@ -82,3 +84,3 @@ tuples.forEach(t => {

// process all add tuples
for (i=0, n=add.length; i<n; ++i) {
for (i = 0, n = add.length; i < n; ++i) {
t = add[i];

@@ -97,3 +99,3 @@ id = tupleid(t);

// populate pulse rem list
for (i=0, n=tuples.length; i<n; ++i) {
for (i = 0, n = tuples.length; i < n; ++i) {
t = tuples[i];

@@ -114,3 +116,3 @@ if (cur[tupleid(t)] < 0) pulse.rem.push(t);

// process individual tuples to modify
for (i=0, n=mod.length; i<n; ++i) {
for (i = 0, n = mod.length; i < n; ++i) {
m = mod[i];

@@ -127,3 +129,3 @@ t = m.tuple;

// process predicate-based modifications
for (i=0, n=modp.length; i<n; ++i) {
for (i = 0, n = modp.length; i < n; ++i) {
m = modp[i];

@@ -130,0 +132,0 @@ f = m.filter;

@@ -10,5 +10,6 @@ /**

export default function(target, sources) {
let targetRank = target.rank, i, n;
const targetRank = target.rank,
n = sources.length;
for (i=0, n=sources.length; i<n; ++i) {
for (let i = 0; i < n; ++i) {
if (targetRank < sources[i].rank) {

@@ -15,0 +16,0 @@ this.rerank(target);

@@ -16,16 +16,16 @@ import {stream} from '../EventStream';

export default function(source, type, filter, apply) {
let df = this,
s = stream(filter, apply),
send = function(e) {
e.dataflow = df;
try {
s.receive(e);
} catch (error) {
df.error(error);
} finally {
df.run();
}
},
sources;
const df = this,
s = stream(filter, apply),
send = function(e) {
e.dataflow = df;
try {
s.receive(e);
} catch (error) {
df.error(error);
} finally {
df.run();
}
};
let sources;
if (typeof source === 'string' && typeof document !== 'undefined') {

@@ -37,3 +37,4 @@ sources = document.querySelectorAll(source);

for (let i=0, n=sources.length; i<n; ++i) {
const n = sources.length;
for (let i = 0; i < n; ++i) {
sources[i].addEventListener(type, send);

@@ -40,0 +41,0 @@ }

@@ -73,4 +73,4 @@ import {read, responseType} from 'vega-loader';

function loadPending(df) {
let accept,
pending = new Promise(a => accept = a);
let accept;
const pending = new Promise(a => accept = a);

@@ -77,0 +77,0 @@ pending.requests = 0;

@@ -40,3 +40,4 @@ import Operator from '../Operator';

function onStream(df, stream, target, update, params, options) {
let opt = extend({}, options, SKIP), func, op;
const opt = extend({}, options, SKIP);
let func, op;

@@ -43,0 +44,0 @@ if (!isFunction(target)) target = constant(target);

@@ -19,4 +19,4 @@ import {error} from 'vega-util';

export function rerank(op) {
let queue = [op],
cur, list, i;
const queue = [op];
let cur, list, i;

@@ -23,0 +23,0 @@ while (queue.length) {

@@ -54,8 +54,7 @@ import UniqueList from './util/UniqueList';

if (this._filter(evt)) {
let val = (this.value = this._apply(evt)),
const val = (this.value = this._apply(evt)),
trg = this._targets,
n = trg ? trg.length : 0,
i = 0;
n = trg ? trg.length : 0;
for (; i<n; ++i) trg[i].receive(val);
for (let i = 0; i < n; ++i) trg[i].receive(val);

@@ -62,0 +61,0 @@ if (this._consume) {

@@ -17,5 +17,5 @@ import Pulse from './Pulse';

export default function MultiPulse(dataflow, stamp, pulses, encode) {
let p = this,
c = 0,
pulse, hash, i, n, f;
const p = this,
n = pulses.length;
let c = 0;

@@ -28,9 +28,9 @@ this.dataflow = dataflow;

for (i=0, n=pulses.length; i<n; ++i) {
pulse = pulses[i];
for (let i = 0; i < n; ++i) {
const pulse = pulses[i];
if (pulse.stamp !== stamp) continue;
if (pulse.fields) {
hash = p.fields || (p.fields = {});
for (f in pulse.fields) { hash[f] = 1; }
const hash = p.fields || (p.fields = {});
for (const f in pulse.fields) { hash[f] = 1; }
}

@@ -69,3 +69,3 @@

return !(fields && (p.changes & p.MOD)) ? 0
: isArray(_) ? _.some(function(f) { return fields[f]; })
: isArray(_) ? _.some(f => fields[f])
: fields[_];

@@ -83,13 +83,13 @@ },

visit(flags, visitor) {
let p = this,
pulses = p.pulses,
n = pulses.length,
i = 0;
const p = this,
pulses = p.pulses,
n = pulses.length;
let i = 0;
if (flags & p.SOURCE) {
for (; i<n; ++i) {
for (; i < n; ++i) {
pulses[i].visit(flags, visitor);
}
} else {
for (; i<n; ++i) {
for (; i < n; ++i) {
if (pulses[i].stamp === p.stamp) {

@@ -96,0 +96,0 @@ pulses[i].visit(flags, visitor);

@@ -117,6 +117,6 @@ import Parameters from './Parameters';

react = react !== false;
let argval = (this._argval = this._argval || new Parameters()),
argops = (this._argops = this._argops || []),
deps = [],
name, value, n, i;
const argval = (this._argval = this._argval || new Parameters()),
argops = (this._argops = this._argops || []),
deps = [];
let name, value, n, i;

@@ -150,3 +150,3 @@ const add = (name, index, value) => {

argval.set(name, -1, Array(n = value.length));
for (i=0; i<n; ++i) add(name, i, value[i]);
for (i = 0; i < n; ++i) add(name, i, value[i]);
} else {

@@ -169,8 +169,9 @@ add(name, -1, value);

marshall(stamp) {
let argval = this._argval || NO_PARAMS,
argops = this._argops,
item, i, n, op, mod;
const argval = this._argval || NO_PARAMS,
argops = this._argops;
let item, i, op, mod;
if (argops) {
for (i=0, n=argops.length; i<n; ++i) {
const n = argops.length;
for (i = 0; i < n; ++i) {
item = argops[i];

@@ -183,3 +184,3 @@ op = item.op;

if (argops.initonly) {
for (i=0; i<n; ++i) {
for (i = 0; i < n; ++i) {
item = argops[i];

@@ -200,7 +201,7 @@ item.op.targets().remove(this);

detach() {
let argops = this._argops,
i, n, item, op;
const argops = this._argops;
let i, n, item, op;
if (argops) {
for (i=0, n=argops.length; i<n; ++i) {
for (i = 0, n = argops.length; i < n; ++i) {
item = argops[i];

@@ -207,0 +208,0 @@ op = item.op;

@@ -55,8 +55,8 @@ import {isArray} from 'vega-util';

modified(name, index) {
let mod = this[CACHE], k;
const mod = this[CACHE];
if (!arguments.length) {
for (k in mod) { if (mod[k]) return true; }
for (const k in mod) { if (mod[k]) return true; }
return false;
} else if (isArray(name)) {
for (k=0; k<name.length; ++k) {
for (let k = 0; k < name.length; ++k) {
if (mod[name[k]]) return true;

@@ -63,0 +63,0 @@ }

@@ -62,3 +62,3 @@ import {tupleid} from './Tuple';

const map = {};
pulse.visit(flags, function(t) { map[tupleid(t)] = 1; });
pulse.visit(flags, t => { map[tupleid(t)] = 1; });
return t => map[tupleid(t)] ? null : t;

@@ -398,3 +398,3 @@ }

visit(flags, visitor) {
let p = this, v = visitor, src, sum;
const p = this, v = visitor;

@@ -410,4 +410,5 @@ if (flags & SOURCE) {

if ((flags & REFLOW) && (src = p.source)) {
sum = p.add.length + p.mod.length;
const src = p.source;
if ((flags & REFLOW) && src) {
const sum = p.add.length + p.mod.length;
if (sum === src.length) {

@@ -414,0 +415,0 @@ // do nothing

@@ -12,3 +12,4 @@ export default function Heap(cmp) {

pop: () => {
let last = nodes.pop(), item;
const last = nodes.pop();
let item;
if (nodes.length) {

@@ -27,5 +28,5 @@ item = nodes[0];

function siftdown(array, start, idx, cmp) {
let item, parent, pidx;
let parent, pidx;
item = array[idx];
const item = array[idx];
while (idx > start) {

@@ -45,6 +46,6 @@ pidx = (idx - 1) >> 1;

function siftup(array, idx, cmp) {
let start = idx,
end = array.length,
item = array[idx],
cidx = (idx << 1) + 1, ridx;
const start = idx,
end = array.length,
item = array[idx];
let cidx = (idx << 1) + 1, ridx;

@@ -51,0 +52,0 @@ while (cidx < end) {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc