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

vega-selections

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-selections - npm Package Compare versions

Comparing version 5.1.2 to 5.1.3

4

build/vega-selections.js

@@ -159,3 +159,3 @@ (function (global, factory) {

op = op || Union;
Object.keys(resolved).forEach(function (field) {
Object.keys(resolved).forEach(field => {
resolved[field] = Object.keys(resolved[field])

@@ -187,3 +187,3 @@ .map(unit => resolved[field][unit])

return !base.length ? value :
base.filter(function (v) { return value.indexOf(v) >= 0; });
base.filter(v => value.indexOf(v) >= 0);
},

@@ -190,0 +190,0 @@

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-expression")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.vega,e.vega)}(this,(function(e,t,n){"use strict";function r(e,n){for(var r,i,u=n.fields,o=n.values,a=u.length,f=0;f<a;++f)if((i=u[f]).getter=t.field.getter||t.field(i.field),r=i.getter(e),t.isDate(r)&&(r=t.toNumber(r)),t.isDate(o[f])&&(o[f]=t.toNumber(o[f])),t.isDate(o[f][0])&&(o[f]=o[f].map(t.toNumber)),"E"===i.type){if(t.isArray(o[f])?o[f].indexOf(r)<0:r!==o[f])return!1}else if("R"===i.type){if(!t.inrange(r,o[f]))return!1}else if("R-RE"===i.type){if(!t.inrange(r,o[f],!0,!1))return!1}else if("R-E"===i.type){if(!t.inrange(r,o[f],!1,!1))return!1}else if("R-LE"===i.type&&!t.inrange(r,o[f],!1,!0))return!1;return!0}var i={E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;n<r;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter((function(e){return t.indexOf(e)>=0})):t},R_union:function(e,n){var r=t.toNumber(n[0]),i=t.toNumber(n[1]);return r>i&&(r=n[1],i=n[0]),e.length?(e[0]>r&&(e[0]=r),e[1]<i&&(e[1]=i),e):[r,i]},R_intersect:function(e,n){var r=t.toNumber(n[0]),i=t.toNumber(n[1]);return r>i&&(r=n[1],i=n[0]),e.length?i<e[0]||e[1]<r?[]:(e[0]<r&&(e[0]=r),e[1]>i&&(e[1]=i),e):[r,i]}};e.selectionResolve=function(e,n,r){for(var u,o,a,f,l,s,c,d,g,p,v,h=this.context.data[e],y=h?h.values.value:[],b={},m={},x={},R=y.length,O=0;O<R;++O){for(f=(u=y[O]).unit,o=u.fields,a=u.values,p=0,v=o.length;p<v;++p)l=o[p],c=(s=b[l.field]||(b[l.field]={}))[f]||(s[f]=[]),x[l.field]=d=l.type.charAt(0),g=i[d+"_union"],s[f]=g(c,t.array(a[p]));r&&(c=m[f]||(m[f]=[])).push(t.array(a).reduce((e,t,n)=>(e[o[n].field]=t,e),{}))}return n=n||"union",Object.keys(b).forEach((function(e){b[e]=Object.keys(b[e]).map(t=>b[e][t]).reduce((t,r)=>void 0===t?r:i[x[e]+"_"+n](t,r))})),y=Object.keys(m),r&&y.length&&(b.vlMulti="union"===n?{or:y.reduce((e,t)=>(e.push.apply(e,m[t]),e),[])}:{and:y.map(e=>({or:m[e]}))}),b},e.selectionTest=function(e,t,n){for(var i,u,o,a,f,l=this.context.data[e],s=l?l.values.value:[],c=l?l["index:unit"]&&l["index:unit"].value:void 0,d="intersect"===n,g=s.length,p=0;p<g;++p)if(i=s[p],c&&d){if(-1===(o=(u=u||{})[a=i.unit]||0))continue;if(f=r(t,i),u[a]=f?-1:++o,f&&1===c.size)return!0;if(!f&&o===c.get(a).count)return!1}else if(d^(f=r(t,i)))return f;return g&&d},e.selectionVisitor=function(e,r,i,u){r[0].type!==n.Literal&&t.error("First argument to selection functions must be a string literal.");const o=r[0].value,a=":"+o;"intersect"!==(r.length>=2&&t.peek(r).value)||t.hasOwnProperty(u,"@unit")||(u["@unit"]=i.getData(o).indataRef(i,"unit")),t.hasOwnProperty(u,a)||(u[a]=i.getData(o).tuplesRef())},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util"),require("vega-expression")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-expression"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.vega,e.vega)}(this,(function(e,t,n){"use strict";const r="intersect",i="union";var u="index:unit";function o(e,n){for(var r,i,u=n.fields,o=n.values,a=u.length,f=0;f<a;++f)if((i=u[f]).getter=t.field.getter||t.field(i.field),r=i.getter(e),t.isDate(r)&&(r=t.toNumber(r)),t.isDate(o[f])&&(o[f]=t.toNumber(o[f])),t.isDate(o[f][0])&&(o[f]=o[f].map(t.toNumber)),"E"===i.type){if(t.isArray(o[f])?o[f].indexOf(r)<0:r!==o[f])return!1}else if("R"===i.type){if(!t.inrange(r,o[f]))return!1}else if("R-RE"===i.type){if(!t.inrange(r,o[f],!0,!1))return!1}else if("R-E"===i.type){if(!t.inrange(r,o[f],!1,!1))return!1}else if("R-LE"===i.type&&!t.inrange(r,o[f],!1,!0))return!1;return!0}var a={E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;n<r;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(e=>t.indexOf(e)>=0):t},R_union:function(e,n){var r=t.toNumber(n[0]),i=t.toNumber(n[1]);return r>i&&(r=n[1],i=n[0]),e.length?(e[0]>r&&(e[0]=r),e[1]<i&&(e[1]=i),e):[r,i]},R_intersect:function(e,n){var r=t.toNumber(n[0]),i=t.toNumber(n[1]);return r>i&&(r=n[1],i=n[0]),e.length?i<e[0]||e[1]<r?[]:(e[0]<r&&(e[0]=r),e[1]>i&&(e[1]=i),e):[r,i]}};e.selectionResolve=function(e,n,r){for(var u,o,f,l,s,c,d,g,p,v,h,y=this.context.data[e],b=y?y.values.value:[],m={},x={},R={},O=b.length,_=0;_<O;++_){for(l=(u=b[_]).unit,o=u.fields,f=u.values,v=0,h=o.length;v<h;++v)s=o[v],d=(c=m[s.field]||(m[s.field]={}))[l]||(c[l]=[]),R[s.field]=g=s.type.charAt(0),p=a[g+"_union"],c[l]=p(d,t.array(f[v]));r&&(d=x[l]||(x[l]=[])).push(t.array(f).reduce((e,t,n)=>(e[o[n].field]=t,e),{}))}return n=n||i,Object.keys(m).forEach(e=>{m[e]=Object.keys(m[e]).map(t=>m[e][t]).reduce((t,r)=>void 0===t?r:a[R[e]+"_"+n](t,r))}),b=Object.keys(x),r&&b.length&&(m.vlMulti=n===i?{or:b.reduce((e,t)=>(e.push.apply(e,x[t]),e),[])}:{and:b.map(e=>({or:x[e]}))}),m},e.selectionTest=function(e,t,n){for(var i,a,f,l,s,c=this.context.data[e],d=c?c.values.value:[],g=c?c[u]&&c[u].value:void 0,p=n===r,v=d.length,h=0;h<v;++h)if(i=d[h],g&&p){if(-1===(f=(a=a||{})[l=i.unit]||0))continue;if(s=o(t,i),a[l]=s?-1:++f,s&&1===g.size)return!0;if(!s&&f===g.get(l).count)return!1}else if(p^(s=o(t,i)))return s;return v&&p},e.selectionVisitor=function(e,i,u,o){i[0].type!==n.Literal&&t.error("First argument to selection functions must be a string literal.");const a=i[0].value,f="unit",l="@unit",s=":"+a;(i.length>=2&&t.peek(i).value)!==r||t.hasOwnProperty(o,l)||(o["@unit"]=u.getData(a).indataRef(u,f)),t.hasOwnProperty(o,s)||(o[s]=u.getData(a).tuplesRef())},Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "vega-selections",
"version": "5.1.2",
"version": "5.1.3",
"description": "Vega expression functions for Vega-Lite selections.",

@@ -26,6 +26,6 @@ "keywords": [

"dependencies": {
"vega-expression": "^2.6.6",
"vega-util": "^1.15.0"
"vega-expression": "^2.7.0",
"vega-util": "^1.15.1"
},
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662"
"gitHead": "8d6793f4ca7eaaf2d22186764e9ce2dae687cf52"
}

@@ -48,3 +48,3 @@ import {And, Or, Union, VlMulti} from './constants';

op = op || Union;
Object.keys(resolved).forEach(function (field) {
Object.keys(resolved).forEach(field => {
resolved[field] = Object.keys(resolved[field])

@@ -76,3 +76,3 @@ .map(unit => resolved[field][unit])

return !base.length ? value :
base.filter(function (v) { return value.indexOf(v) >= 0; });
base.filter(v => value.indexOf(v) >= 0);
},

@@ -79,0 +79,0 @@

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