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.0 to 5.1.1

2

build/vega-selections.min.js

@@ -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=e||self).vega={},e.vega,e.vega)}(this,(function(e,t,n){"use strict";const r="intersect",i="union",u="vlMulti",o="or",a="and";var f="E",s="R",l="R-E",c="R-LE",d="R-RE",g="index:unit";function v(e,n){for(var r,i,u=n.fields,o=n.values,a=u.length,g=0;g<a;++g)if((i=u[g]).getter=t.field.getter||t.field(i.field),r=i.getter(e),t.isDate(r)&&(r=t.toNumber(r)),t.isDate(o[g])&&(o[g]=t.toNumber(o[g])),t.isDate(o[g][0])&&(o[g]=o[g].map(t.toNumber)),i.type===f){if(t.isArray(o[g])?o[g].indexOf(r)<0:r!==o[g])return!1}else if(i.type===s){if(!t.inrange(r,o[g]))return!1}else if(i.type===d){if(!t.inrange(r,o[g],!0,!1))return!1}else if(i.type===l){if(!t.inrange(r,o[g],!1,!1))return!1}else if(i.type===c&&!t.inrange(r,o[g],!1,!0))return!1;return!0}var p={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]}};const h=":",y="@";e.selectionResolve=function(e,n,r){for(var f,s,l,c,d,g,v,h,y,m,b,x=this.context.data[e],R=x?x.values.value:[],O={},_={},E={},N=R.length,j=0;j<N;++j){for(c=(f=R[j]).unit,s=f.fields,l=f.values,m=0,b=s.length;m<b;++m)d=s[m],v=(g=O[d.field]||(O[d.field]={}))[c]||(g[c]=[]),E[d.field]=h=d.type.charAt(0),y=p[h+"_union"],g[c]=y(v,t.array(l[m]));r&&(v=_[c]||(_[c]=[])).push(t.array(l).reduce((e,t,n)=>(e[s[n].field]=t,e),{}))}return n=n||i,Object.keys(O).forEach((function(e){O[e]=Object.keys(O[e]).map(t=>O[e][t]).reduce((t,r)=>void 0===t?r:p[E[e]+"_"+n](t,r))})),R=Object.keys(_),r&&R.length&&(O[u]=n===i?{[o]:R.reduce((e,t)=>(e.push.apply(e,_[t]),e),[])}:{[a]:R.map(e=>({[o]:_[e]}))}),O},e.selectionTest=function(e,t,n){for(var i,u,o,a,f,s=this.context.data[e],l=s?s.values.value:[],c=s?s[g]&&s[g].value:void 0,d=n===r,p=l.length,h=0;h<p;++h)if(i=l[h],c&&d){if(-1===(o=(u=u||{})[a=i.unit]||0))continue;if(f=v(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=v(t,i)))return f;return p&&d},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=i.length>=2&&t.peek(i).value,s=y+"unit",l=h+a;f!==r||t.hasOwnProperty(o,s)||(o[s]=u.getData(a).indataRef(u,"unit")),t.hasOwnProperty(o,l)||(o[l]=u.getData(a).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=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,s,l,c,d,g,p,v,h=this.context.data[e],y=h?h.values.value:[],m={},b={},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)s=o[p],c=(l=m[s.field]||(m[s.field]={}))[f]||(l[f]=[]),x[s.field]=d=s.type.charAt(0),g=i[d+"_union"],l[f]=g(c,t.array(a[p]));r&&(c=b[f]||(b[f]=[])).push(t.array(a).reduce((e,t,n)=>(e[o[n].field]=t,e),{}))}return n=n||"union",Object.keys(m).forEach((function(e){m[e]=Object.keys(m[e]).map(t=>m[e][t]).reduce((t,r)=>void 0===t?r:i[x[e]+"_"+n](t,r))})),y=Object.keys(b),r&&y.length&&(m.vlMulti="union"===n?{or:y.reduce((e,t)=>(e.push.apply(e,b[t]),e),[])}:{and:y.map(e=>({or:b[e]}))}),m},e.selectionTest=function(e,t,n){for(var i,u,o,a,f,s=this.context.data[e],l=s?s.values.value:[],c=s?s["index:unit"]&&s["index:unit"].value:void 0,d="intersect"===n,g=l.length,p=0;p<g;++p)if(i=l[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})}));
{
"name": "vega-selections",
"version": "5.1.0",
"version": "5.1.1",
"description": "Vega expression functions for Vega-Lite selections.",

@@ -21,3 +21,3 @@ "keywords": [

"pretest": "yarn prebuild && yarn rollup",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"test": "tape 'test/**/*-test.js'",
"prepublishOnly": "yarn test && yarn build",

@@ -27,6 +27,6 @@ "postpublish": "git push && git push --tags"

"dependencies": {
"vega-expression": "^2.6.1",
"vega-util": "^1.11.0"
"vega-expression": "^2.6.4",
"vega-util": "^1.13.2"
},
"gitHead": "8180e8ca9379dec7f1722ce0ebd2aa01083be7b2"
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32"
}

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

import {Union, VlMulti, Or, And} from './constants';
import {And, Or, Union, VlMulti} from './constants';
import {array, toNumber} from 'vega-util';

@@ -3,0 +3,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