Socket
Socket
Sign inDemoInstall

vega-runtime

Package Overview
Dependencies
21
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.1.0 to 6.1.1

2

build/vega-runtime.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vega-util'), require('vega-dataflow')) :
typeof define === 'function' && define.amd ? define(['exports', 'vega-util', 'vega-dataflow'], factory) :
(global = global || self, factory(global.vega = {}, global.vega, global.vega));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vega = {}, global.vega, global.vega));
}(this, (function (exports, vegaUtil, vegaDataflow) { 'use strict';

@@ -6,0 +6,0 @@

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-dataflow")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-dataflow"],t):t((e=e||self).vega={},e.vega,e.vega)}(this,(function(e,t,r){"use strict";const n=t.toSet(["rule"]),s=t.toSet(["group","image","rect"]);function a(e){return(e+"").toLowerCase()}function o(e,t,r){";"!==r[r.length-1]&&(r="return("+r+");");var n=Function.apply(null,t.concat(r));return e&&e.functions?n.bind(e.functions):n}var i={operator:(e,t)=>o(e,["_"],t.code),parameter:(e,t)=>o(e,["datum","_"],t.code),event:(e,t)=>o(e,["event"],t.code),handler:(e,t)=>o(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,r)=>{const{marktype:a,channels:i}=r;let c="var o=item,datum=o.datum,m=0,$;";for(const e in i){const r="o["+t.stringValue(e)+"]";c+=`$=${i[e].code};if(${r}!==$)${r}=$,m=1;`}return c+=function(e,t){let r="";return n[t]||(e.x2&&(e.x?(s[t]&&(r+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),r+="o.width=o.x2-o.x;"):r+="o.x=o.x2-(o.width||0);"),e.xc&&(r+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(s[t]&&(r+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),r+="o.height=o.y2-o.y;"):r+="o.y=o.y2-(o.height||0);"),e.yc&&(r+="o.y=o.yc-(o.height||0)/2;")),r}(i,a),c+="return m;",o(e,["item","_"],c)},codegen:{get(e){const r=`[${e.map(t.stringValue).join("][")}]`,n=Function("_",`return _${r};`);return n.path=r,n},comparator(e,t){let r;const n=Function("a","b","var u, v; return "+e.map((e,n)=>{const s=t[n];let a,o;return e.path?(a="a"+e.path,o="b"+e.path):((r=r||{})["f"+n]=e,a=`this.f${n}(a)`,o=`this.f${n}(b)`),function(e,t,r,n){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${r}\n : (u > v || v == null) && u != null ? ${n}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${r}\n : v !== v && u === u ? ${n} : `}(a,o,-s,s)}).join("")+"0;");return r?n.bind(r):n}}};function c(e,r,n){if(!e||!t.isObject(e))return e;for(let s,a=0,o=u.length;a<o;++a)if(s=u[a],t.hasOwnProperty(e,s.key))return s.parse(e,r,n);return e}var u=[{key:"$ref",parse:function(e,r){return r.get(e.$ref)||t.error("Operator not defined: "+e.$ref)}},{key:"$key",parse:function(e,r){const n="k:"+e.$key+"_"+!!e.$flat;return r.fn[n]||(r.fn[n]=t.key(e.$key,e.$flat,r.expr.codegen))}},{key:"$expr",parse:function(e,r,n){e.$params&&r.parseParameters(e.$params,n);const s="e:"+e.$expr.code+"_"+e.$name;return r.fn[s]||(r.fn[s]=t.accessor(r.parameterExpression(e.$expr),e.$fields,e.$name))}},{key:"$field",parse:function(e,r){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return r.fn[n]||(r.fn[n]=t.field(e.$field,e.$name,r.expr.codegen))}},{key:"$encode",parse:function(e,r){const n=e.$encode,s={};for(const e in n){const a=n[e];s[e]=t.accessor(r.encodeExpression(a.$expr),a.$fields),s[e].output=a.$output}return s}},{key:"$compare",parse:function(e,n){const s="c:"+e.$compare+"_"+e.$order,a=t.array(e.$compare).map(e=>e&&e.$tupleid?r.tupleid:e);return n.fn[s]||(n.fn[s]=t.compare(a,e.$order,n.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const r=e.$subflow;return function(e,n,s){const a=t.fork().parse(r),o=a.get(r.operators[0].id),i=a.signals.parent;return i&&i.set(s),o.detachSubflow=()=>t.detach(a),o}}},{key:"$tupleid",parse:function(){return r.tupleid}}];var p={skip:!0};function f(e,t,r,n){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=n||i,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},r&&(this.functions=Object.create(r),this.functions.context=this)}function d(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}f.prototype=d.prototype={fork(){const e=new d(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);const t=Object.keys(e.nodes);for(const r of t)e.nodes[r]._targets=null;for(const r of t)e.nodes[r].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const r=this,n=r.dataflow,s=e.value;if(r.set(e.id,t),"collect"===a(e.type)&&s&&(s.$ingest?n.ingest(t,s.$ingest,s.$format):s.$request?n.preload(t,s.$request,s.$format):n.pulse(t,n.changeset().insert(s))),e.root&&(r.root=t),e.parent){var o=r.get(e.parent.$ref);o?(n.connect(o,[t]),t.targets().add(o)):(r.unresolved=r.unresolved||[]).push(()=>{o=r.get(e.parent.$ref),n.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(r.signals[e.signal]=t),e.scale&&(r.scales[e.scale]=t),e.data)for(const n in e.data){const s=r.data[n]||(r.data[n]={});e.data[n].forEach(e=>s[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[a(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,r,n,s){this.dataflow.on(t,r,n,s,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,r=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),r.forEach(e=>t.parseOperator(e)),r.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function(e){const t=this;"operator"!==a(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const r=this;if(e.params){const n=r.get(e.id);n||t.error("Invalid operator id: "+e.id),r.dataflow.connect(n,n.parameters(r.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,r){r=r||{};const n=this;for(const s in e){const a=e[s];r[s]=t.isArray(a)?a.map(e=>c(e,n,r)):c(a,n,r)}return r},parseStream:function(e){var r,n=this,s=null!=e.filter?n.eventExpression(e.filter):void 0,a=null!=e.stream?n.get(e.stream):void 0;e.source?a=n.events(e.source,e.type,s):e.merge&&(a=(r=e.merge.map(e=>n.get(e)))[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(e=>n.get(e)),a=a.between(r[0],r[1])),e.filter&&(a=a.filter(s)),null!=e.throttle&&(a=a.throttle(+e.throttle)),null!=e.debounce&&(a=a.debounce(+e.debounce)),null==a&&t.error("Invalid stream definition: "+JSON.stringify(e)),e.consume&&a.consume(!0),n.stream(e,a)},parseUpdate:function(e){var r,n=t.isObject(n=e.source)?n.$ref:n,s=this.get(n),a=e.update,o=void 0;s||t.error("Source not defined: "+e.source),r=e.target&&e.target.$expr?this.eventExpression(e.target.$expr):this.get(e.target),a&&a.$expr&&(a.$params&&(o=this.parseParameters(a.$params)),a=this.handlerExpression(a.$expr)),this.update(e,s,r,a,o)},getState:function(e){var t=this,r={};if(e.signals){var n=r.signals={};Object.keys(t.signals).forEach(r=>{var s=t.signals[r];e.signals(r,s)&&(n[r]=s.value)})}if(e.data){var s=r.data={};Object.keys(t.data).forEach(r=>{var n=t.data[r];e.data(r,n)&&(s[r]=n.input.value)})}return t.subcontext&&!1!==e.recurse&&(r.subcontext=t.subcontext.map(t=>t.getState(e))),r},setState:function(e){var r=this,n=r.dataflow,s=e.data,a=e.signals;Object.keys(a||{}).forEach(e=>{n.update(r.signals[e],a[e],p)}),Object.keys(s||{}).forEach(e=>{n.pulse(r.data[e].input,n.changeset().remove(t.truthy).insert(s[e]))}),(e.subcontext||[]).forEach((e,t)=>{var n=r.subcontext[t];n&&n.setState(e)})}},e.context=function(e,t,r,n){return new f(e,t,r,n)},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-dataflow")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-dataflow"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.vega,e.vega)}(this,(function(e,t,r){"use strict";const n=t.toSet(["rule"]),s=t.toSet(["group","image","rect"]);function o(e){return(e+"").toLowerCase()}function a(e,t,r){";"!==r[r.length-1]&&(r="return("+r+");");var n=Function.apply(null,t.concat(r));return e&&e.functions?n.bind(e.functions):n}var i={operator:(e,t)=>a(e,["_"],t.code),parameter:(e,t)=>a(e,["datum","_"],t.code),event:(e,t)=>a(e,["event"],t.code),handler:(e,t)=>a(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,r)=>{const{marktype:o,channels:i}=r;let c="var o=item,datum=o.datum,m=0,$;";for(const e in i){const r="o["+t.stringValue(e)+"]";c+=`$=${i[e].code};if(${r}!==$)${r}=$,m=1;`}return c+=function(e,t){let r="";return n[t]||(e.x2&&(e.x?(s[t]&&(r+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),r+="o.width=o.x2-o.x;"):r+="o.x=o.x2-(o.width||0);"),e.xc&&(r+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(s[t]&&(r+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),r+="o.height=o.y2-o.y;"):r+="o.y=o.y2-(o.height||0);"),e.yc&&(r+="o.y=o.yc-(o.height||0)/2;")),r}(i,o),c+="return m;",a(e,["item","_"],c)},codegen:{get(e){const r=`[${e.map(t.stringValue).join("][")}]`,n=Function("_",`return _${r};`);return n.path=r,n},comparator(e,t){let r;const n=Function("a","b","var u, v; return "+e.map((e,n)=>{const s=t[n];let o,a;return e.path?(o="a"+e.path,a="b"+e.path):((r=r||{})["f"+n]=e,o=`this.f${n}(a)`,a=`this.f${n}(b)`),function(e,t,r,n){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${r}\n : (u > v || v == null) && u != null ? ${n}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${r}\n : v !== v && u === u ? ${n} : `}(o,a,-s,s)}).join("")+"0;");return r?n.bind(r):n}}};function c(e,r,n){if(!e||!t.isObject(e))return e;for(let s,o=0,a=u.length;o<a;++o)if(s=u[o],t.hasOwnProperty(e,s.key))return s.parse(e,r,n);return e}var u=[{key:"$ref",parse:function(e,r){return r.get(e.$ref)||t.error("Operator not defined: "+e.$ref)}},{key:"$key",parse:function(e,r){const n="k:"+e.$key+"_"+!!e.$flat;return r.fn[n]||(r.fn[n]=t.key(e.$key,e.$flat,r.expr.codegen))}},{key:"$expr",parse:function(e,r,n){e.$params&&r.parseParameters(e.$params,n);const s="e:"+e.$expr.code+"_"+e.$name;return r.fn[s]||(r.fn[s]=t.accessor(r.parameterExpression(e.$expr),e.$fields,e.$name))}},{key:"$field",parse:function(e,r){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return r.fn[n]||(r.fn[n]=t.field(e.$field,e.$name,r.expr.codegen))}},{key:"$encode",parse:function(e,r){const n=e.$encode,s={};for(const e in n){const o=n[e];s[e]=t.accessor(r.encodeExpression(o.$expr),o.$fields),s[e].output=o.$output}return s}},{key:"$compare",parse:function(e,n){const s="c:"+e.$compare+"_"+e.$order,o=t.array(e.$compare).map(e=>e&&e.$tupleid?r.tupleid:e);return n.fn[s]||(n.fn[s]=t.compare(o,e.$order,n.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const r=e.$subflow;return function(e,n,s){const o=t.fork().parse(r),a=o.get(r.operators[0].id),i=o.signals.parent;return i&&i.set(s),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return r.tupleid}}];var p={skip:!0};function f(e,t,r,n){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=n||i,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},r&&(this.functions=Object.create(r),this.functions.context=this)}function d(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}f.prototype=d.prototype={fork(){const e=new d(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);const t=Object.keys(e.nodes);for(const r of t)e.nodes[r]._targets=null;for(const r of t)e.nodes[r].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const r=this,n=r.dataflow,s=e.value;if(r.set(e.id,t),"collect"===o(e.type)&&s&&(s.$ingest?n.ingest(t,s.$ingest,s.$format):s.$request?n.preload(t,s.$request,s.$format):n.pulse(t,n.changeset().insert(s))),e.root&&(r.root=t),e.parent){var a=r.get(e.parent.$ref);a?(n.connect(a,[t]),t.targets().add(a)):(r.unresolved=r.unresolved||[]).push(()=>{a=r.get(e.parent.$ref),n.connect(a,[t]),t.targets().add(a)})}if(e.signal&&(r.signals[e.signal]=t),e.scale&&(r.scales[e.scale]=t),e.data)for(const n in e.data){const s=r.data[n]||(r.data[n]={});e.data[n].forEach(e=>s[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[o(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,r,n,s){this.dataflow.on(t,r,n,s,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,r=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),r.forEach(e=>t.parseOperator(e)),r.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function(e){const t=this;"operator"!==o(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const r=this;if(e.params){const n=r.get(e.id);n||t.error("Invalid operator id: "+e.id),r.dataflow.connect(n,n.parameters(r.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,r){r=r||{};const n=this;for(const s in e){const o=e[s];r[s]=t.isArray(o)?o.map(e=>c(e,n,r)):c(o,n,r)}return r},parseStream:function(e){var r,n=this,s=null!=e.filter?n.eventExpression(e.filter):void 0,o=null!=e.stream?n.get(e.stream):void 0;e.source?o=n.events(e.source,e.type,s):e.merge&&(o=(r=e.merge.map(e=>n.get(e)))[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(e=>n.get(e)),o=o.between(r[0],r[1])),e.filter&&(o=o.filter(s)),null!=e.throttle&&(o=o.throttle(+e.throttle)),null!=e.debounce&&(o=o.debounce(+e.debounce)),null==o&&t.error("Invalid stream definition: "+JSON.stringify(e)),e.consume&&o.consume(!0),n.stream(e,o)},parseUpdate:function(e){var r,n=t.isObject(n=e.source)?n.$ref:n,s=this.get(n),o=e.update,a=void 0;s||t.error("Source not defined: "+e.source),r=e.target&&e.target.$expr?this.eventExpression(e.target.$expr):this.get(e.target),o&&o.$expr&&(o.$params&&(a=this.parseParameters(o.$params)),o=this.handlerExpression(o.$expr)),this.update(e,s,r,o,a)},getState:function(e){var t=this,r={};if(e.signals){var n=r.signals={};Object.keys(t.signals).forEach(r=>{var s=t.signals[r];e.signals(r,s)&&(n[r]=s.value)})}if(e.data){var s=r.data={};Object.keys(t.data).forEach(r=>{var n=t.data[r];e.data(r,n)&&(s[r]=n.input.value)})}return t.subcontext&&!1!==e.recurse&&(r.subcontext=t.subcontext.map(t=>t.getState(e))),r},setState:function(e){var r=this,n=r.dataflow,s=e.data,o=e.signals;Object.keys(o||{}).forEach(e=>{n.update(r.signals[e],o[e],p)}),Object.keys(s||{}).forEach(e=>{n.pulse(r.data[e].input,n.changeset().remove(t.truthy).insert(s[e]))}),(e.subcontext||[]).forEach((e,t)=>{var n=r.subcontext[t];n&&n.setState(e)})}},e.context=function(e,t,r,n){return new f(e,t,r,n)},Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "vega-runtime",
"version": "6.1.0",
"version": "6.1.1",
"description": "Runtime support for Vega dataflows.",

@@ -27,4 +27,4 @@ "keywords": [

"dependencies": {
"vega-dataflow": "^5.7.0",
"vega-util": "^1.14.0"
"vega-dataflow": "^5.7.1",
"vega-util": "^1.15.0"
},

@@ -35,3 +35,3 @@ "devDependencies": {

},
"gitHead": "62565bbe084a422c4a0cbc6e19c6f7c45a3e5137"
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc