vega-selections
Advanced tools
Comparing version 5.1.1 to 5.1.2
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vega-util'), require('vega-expression')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'vega-util', 'vega-expression'], 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, vegaExpression) { '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-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})})); | ||
!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})})); |
{ | ||
"name": "vega-selections", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"description": "Vega expression functions for Vega-Lite selections.", | ||
@@ -26,6 +26,6 @@ "keywords": [ | ||
"dependencies": { | ||
"vega-expression": "^2.6.4", | ||
"vega-util": "^1.13.2" | ||
"vega-expression": "^2.6.6", | ||
"vega-util": "^1.15.0" | ||
}, | ||
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32" | ||
"gitHead": "28db83352e43e321dfe55fc5cb6489b211e45662" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23168
Updatedvega-expression@^2.6.6
Updatedvega-util@^1.15.0