Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vega-runtime

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-runtime - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

build/vega-runtime.js

@@ -285,2 +285,7 @@ (function (global, factory) {

// parse event configuration
if (spec.eventConfig) {
ctx.eventConfig = spec.eventConfig;
}
// parse operators

@@ -287,0 +292,0 @@ operators.forEach(function(entry) {

2

build/vega-runtime.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],e):e(t.vega=t.vega||{},t.vega)}(this,function(t,e){"use strict";function n(t,e,n){";"!==e[e.length-1]&&(e="return("+e+");");var r=Function.apply(null,t.concat(e));return n&&n.functions?r.bind(n.functions):r}function r(t,e){return n(["_"],t,e)}function a(t,e){return n(["datum","_"],t,e)}function s(t,e){return n(["event"],t,e)}function o(t,e){return n(["_","event"],t,e)}function i(t,e){return n(["item","_"],t,e)}function u(t,n,r){r=r||{};var a,s;for(a in t)(s=t[a])&&s.$expr&&s.$params&&u(s.$params,n,r),r[a]=e.isArray(s)?s.map(function(t){return c(t,n)}):c(s,n);return r}function c(t,n){if(!t||!e.isObject(t))return t;for(var r,a=0,s=p.length;a<s;++a)if(r=p[a],t.hasOwnProperty(r.key))return r.parse(t,n);return t}function f(t,n){var r,a;t.params&&((r=n.get(t.id))||e.error("Invalid operator id: "+t.id),a=u(t.params,n),n.dataflow.connect(r,r.parameters(a)))}function d(t,e,n){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function l(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}var p=[{key:"$ref",parse:function(t,n){return n.get(t.$ref)||e.error("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,n){var r="k:"+t.$key;return n.fn[r]||(n.fn[r]=e.key(t.$key))}},{key:"$expr",parse:function(t,n){var r="e:"+t.$expr;return n.fn[r]||(n.fn[r]=e.accessor(a(t.$expr,n),t.$fields,t.$name))}},{key:"$field",parse:function(t,n){var r="f:"+t.$field+"_"+t.$name;return n.fn[r]||(n.fn[r]=e.field(t.$field,t.$name))}},{key:"$encode",parse:function(t,n){var r,a,s=t.$encode,o={};for(r in s)a=s[r],o[r]=e.accessor(i(a.$expr,n),a.$fields),o[r].output=a.$output;return o}},{key:"$compare",parse:function(t,n){var r="c:"+t.$compare+"_"+t.$order;return n.fn[r]||(n.fn[r]=e.compare(t.$compare,t.$order))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,a){var s=$(n,e.fork()),o=s.get(n.operators[0].id),i=s.signals.parent;return i&&i.set(a),o}}}],h=function(t,e){"Operator"!==t.type&&t.type?e.transform(t,t.type):e.operator(t,t.update?r(t.update,e):null)},v=function(t,n){var r,a=null!=t.filter?s(t.filter,n):void 0,o=null!=t.stream?n.get(t.stream):void 0;t.source?o=n.events(t.source,t.type,a):t.merge&&(o=(r=t.merge.map(n.get.bind(n)))[0].merge.apply(r[0],r.slice(1))),t.between&&(r=t.between.map(n.get.bind(n)),o=o.between(r[0],r[1])),t.filter&&(o=o.filter(a)),null!=t.throttle&&(o=o.throttle(+t.throttle)),null!=t.debounce&&(o=o.debounce(+t.debounce)),null==o&&e.error("Invalid stream definition: "+JSON.stringify(t)),t.consume&&o.consume(!0),n.stream(t,o)},g=function(t,n){var r=n.get(t.source),a=null,i=t.update,c=void 0;r||e.error("Source not defined: "+t.source),a=t.target&&t.target.$expr?s(t.target.$expr,n):n.get(t.target),i&&i.$expr&&(i.$params&&(c=u(i.$params,n)),i=o(i.$expr,n)),n.update(t,r,a,i,c)},$=function(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),n.forEach(function(t){h(t,e)}),n.forEach(function(t){f(t,e)}),(t.streams||[]).forEach(function(t){v(t,e)}),(t.updates||[]).forEach(function(t){g(t,e)}),e.resolve()},m={skip:!0};d.prototype=l.prototype={fork:function(){var t=new l(this);return(this.subcontext||(this.subcontext=[])).push(t),t},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n,r=this,a=r.dataflow;if(r.set(t.id,e),"Collect"===t.type&&(n=t.value)&&(n.$ingest?a.ingest(e,n.$ingest,n.$format):n.$request?a.request(e,n.$request,n.$format):a.pulse(e,a.changeset().insert(n))),t.root&&(r.root=e),t.parent){var s=r.get(t.parent.$ref);s?(a.connect(s,[e]),e.targets().add(s)):(r.unresolved=r.unresolved||[]).push(function(){s=r.get(t.parent.$ref),a.connect(s,[e]),e.targets().add(s)})}if(t.signal&&(r.signals[t.signal]=e),t.scale&&(r.scales[t.scale]=e),t.data)for(var o in t.data)n=r.data[o]||(r.data[o]={}),t.data[o].forEach(function(t){n[t]=e})},resolve:function(){return(this.unresolved||[]).forEach(function(t){t()}),delete this.unresolved,this},operator:function(t,e,n){this.add(t,this.dataflow.add(t.value,e,n,t.react))},transform:function(t,e,n){this.add(t,this.dataflow.add(this.transforms[e],n))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,a){this.dataflow.on(e,n,r,a,t.options)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(function(n){var a=e.signals[n];t.signals(n,a)&&(r[n]=a.value)})}if(t.data){var a=n.data={};Object.keys(e.data).forEach(function(n){var r=e.data[n];t.data(n,r)&&(a[n]=r.input.value)})}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map(function(e){return e.getState(t)})),n},setState:function(t){var n=this,r=n.dataflow,a=t.data,s=t.signals;Object.keys(s||{}).forEach(function(t){r.update(n.signals[t],s[t],m)}),Object.keys(a||{}).forEach(function(t){r.pulse(n.data[t].input,r.changeset().remove(e.truthy).insert(a[t]))}),(t.subcontext||[]).forEach(function(t,e){var r=n.subcontext[e];r&&r.setState(t)})}},t.parse=$,t.context=function(t,e,n){return new d(t,e,n)},t.expression=n,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],e):e(t.vega=t.vega||{},t.vega)}(this,function(t,e){"use strict";function n(t,e,n){";"!==e[e.length-1]&&(e="return("+e+");");var r=Function.apply(null,t.concat(e));return n&&n.functions?r.bind(n.functions):r}function r(t,e){return n(["_"],t,e)}function a(t,e){return n(["datum","_"],t,e)}function o(t,e){return n(["event"],t,e)}function s(t,e){return n(["_","event"],t,e)}function i(t,e){return n(["item","_"],t,e)}function u(t,n,r){r=r||{};var a,o;for(a in t)(o=t[a])&&o.$expr&&o.$params&&u(o.$params,n,r),r[a]=e.isArray(o)?o.map(function(t){return c(t,n)}):c(o,n);return r}function c(t,n){if(!t||!e.isObject(t))return t;for(var r,a=0,o=p.length;a<o;++a)if(r=p[a],t.hasOwnProperty(r.key))return r.parse(t,n);return t}function f(t,n){var r,a;t.params&&((r=n.get(t.id))||e.error("Invalid operator id: "+t.id),a=u(t.params,n),n.dataflow.connect(r,r.parameters(a)))}function d(t,e,n){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function l(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}var p=[{key:"$ref",parse:function(t,n){return n.get(t.$ref)||e.error("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,n){var r="k:"+t.$key;return n.fn[r]||(n.fn[r]=e.key(t.$key))}},{key:"$expr",parse:function(t,n){var r="e:"+t.$expr;return n.fn[r]||(n.fn[r]=e.accessor(a(t.$expr,n),t.$fields,t.$name))}},{key:"$field",parse:function(t,n){var r="f:"+t.$field+"_"+t.$name;return n.fn[r]||(n.fn[r]=e.field(t.$field,t.$name))}},{key:"$encode",parse:function(t,n){var r,a,o=t.$encode,s={};for(r in o)a=o[r],s[r]=e.accessor(i(a.$expr,n),a.$fields),s[r].output=a.$output;return s}},{key:"$compare",parse:function(t,n){var r="c:"+t.$compare+"_"+t.$order;return n.fn[r]||(n.fn[r]=e.compare(t.$compare,t.$order))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,a){var o=$(n,e.fork()),s=o.get(n.operators[0].id),i=o.signals.parent;return i&&i.set(a),s}}}],h=function(t,e){"Operator"!==t.type&&t.type?e.transform(t,t.type):e.operator(t,t.update?r(t.update,e):null)},v=function(t,n){var r,a=null!=t.filter?o(t.filter,n):void 0,s=null!=t.stream?n.get(t.stream):void 0;t.source?s=n.events(t.source,t.type,a):t.merge&&(s=(r=t.merge.map(n.get.bind(n)))[0].merge.apply(r[0],r.slice(1))),t.between&&(r=t.between.map(n.get.bind(n)),s=s.between(r[0],r[1])),t.filter&&(s=s.filter(a)),null!=t.throttle&&(s=s.throttle(+t.throttle)),null!=t.debounce&&(s=s.debounce(+t.debounce)),null==s&&e.error("Invalid stream definition: "+JSON.stringify(t)),t.consume&&s.consume(!0),n.stream(t,s)},g=function(t,n){var r=n.get(t.source),a=null,i=t.update,c=void 0;r||e.error("Source not defined: "+t.source),a=t.target&&t.target.$expr?o(t.target.$expr,n):n.get(t.target),i&&i.$expr&&(i.$params&&(c=u(i.$params,n)),i=s(i.$expr,n)),n.update(t,r,a,i,c)},$=function(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),n.forEach(function(t){h(t,e)}),n.forEach(function(t){f(t,e)}),(t.streams||[]).forEach(function(t){v(t,e)}),(t.updates||[]).forEach(function(t){g(t,e)}),e.resolve()},m={skip:!0};d.prototype=l.prototype={fork:function(){var t=new l(this);return(this.subcontext||(this.subcontext=[])).push(t),t},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n,r=this,a=r.dataflow;if(r.set(t.id,e),"Collect"===t.type&&(n=t.value)&&(n.$ingest?a.ingest(e,n.$ingest,n.$format):n.$request?a.request(e,n.$request,n.$format):a.pulse(e,a.changeset().insert(n))),t.root&&(r.root=e),t.parent){var o=r.get(t.parent.$ref);o?(a.connect(o,[e]),e.targets().add(o)):(r.unresolved=r.unresolved||[]).push(function(){o=r.get(t.parent.$ref),a.connect(o,[e]),e.targets().add(o)})}if(t.signal&&(r.signals[t.signal]=e),t.scale&&(r.scales[t.scale]=e),t.data)for(var s in t.data)n=r.data[s]||(r.data[s]={}),t.data[s].forEach(function(t){n[t]=e})},resolve:function(){return(this.unresolved||[]).forEach(function(t){t()}),delete this.unresolved,this},operator:function(t,e,n){this.add(t,this.dataflow.add(t.value,e,n,t.react))},transform:function(t,e,n){this.add(t,this.dataflow.add(this.transforms[e],n))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,a){this.dataflow.on(e,n,r,a,t.options)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(function(n){var a=e.signals[n];t.signals(n,a)&&(r[n]=a.value)})}if(t.data){var a=n.data={};Object.keys(e.data).forEach(function(n){var r=e.data[n];t.data(n,r)&&(a[n]=r.input.value)})}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map(function(e){return e.getState(t)})),n},setState:function(t){var n=this,r=n.dataflow,a=t.data,o=t.signals;Object.keys(o||{}).forEach(function(t){r.update(n.signals[t],o[t],m)}),Object.keys(a||{}).forEach(function(t){r.pulse(n.data[t].input,r.changeset().remove(e.truthy).insert(a[t]))}),(t.subcontext||[]).forEach(function(t,e){var r=n.subcontext[e];r&&r.setState(t)})}},t.parse=$,t.context=function(t,e,n){return new d(t,e,n)},t.expression=n,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "vega-runtime",
"version": "1.0.1",
"version": "1.0.2",
"description": "Runtime support for Vega dataflows.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -16,2 +16,7 @@ import {default as parseOperator, parseOperatorParameters} from './operator';

// parse event configuration
if (spec.eventConfig) {
ctx.eventConfig = spec.eventConfig;
}
// parse operators

@@ -18,0 +23,0 @@ operators.forEach(function(entry) {

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