vega-event-selector
Advanced tools
Comparing version 2.0.6 to 3.0.0
@@ -223,3 +223,3 @@ (function (global, factory) { | ||
exports.selector = eventSelector; | ||
exports.parseSelector = eventSelector; | ||
@@ -226,0 +226,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -1,2 +0,2 @@ | ||
var vega=function(t){"use strict";const e="[",r="]",n=/[[\]{}]/,i={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let s,c;function o(t,e,r,n,i){const s=t.length;let c,o=0;for(;e<s;++e){if(c=t[e],!o&&c===r)return e;i&&i.indexOf(c)>=0?--o:n&&n.indexOf(c)>=0&&++o}return e}function l(t){const e=[],r=t.length;let n=0,i=0;for(;i<r;)i=o(t,i,",","[{","]}"),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function u(t){return"["===t[0]?function(t){const n=t.length;let i,s=1;if(s=o(t,s,r,e,r),s===n)throw"Empty between selector: "+t;if(i=l(t.substring(1,s)),2!==i.length)throw"Between selector must have two elements: "+t;if(">"!==(t=t.slice(s+1).trim())[0])throw"Expected '>' after between selector: "+t;i=i.map(u);const c=u(t.slice(1).trim());if(c.between)return{between:i,stream:c};c.between=i;return c}(t):function(t){const i={source:s},l=[];let u,h,f=[0,0],a=0,m=0,p=t.length,g=0;if("}"===t[p-1]){if(g=t.lastIndexOf("{"),!(g>=0))throw"Unmatched right brace: "+t;try{f=function(t){const e=t.split(",");if(!t.length||e.length>2)throw t;return e.map(e=>{const r=+e;if(r!=r)throw t;return r})}(t.substring(g+1,p-1))}catch(e){throw"Invalid throttle specification: "+t}p=(t=t.slice(0,g).trim()).length,g=0}if(!p)throw t;"@"===t[0]&&(a=++g);u=o(t,g,":"),u<p&&(l.push(t.substring(m,u).trim()),m=g=++u);if(g=o(t,g,e),g===p)l.push(t.substring(m,p).trim());else if(l.push(t.substring(m,g).trim()),h=[],m=++g,m===p)throw"Unmatched left bracket: "+t;for(;g<p;){if(g=o(t,g,r),g===p)throw"Unmatched left bracket: "+t;if(h.push(t.substring(m,g).trim()),g<p-1&&t[++g]!==e)throw"Expected left bracket: "+t;m=++g}if(!(p=l.length)||n.test(l[p-1]))throw"Invalid event selector: "+t;p>1?(i.type=l[1],a?i.markname=l[0].slice(1):(w=l[0],c[w]?i.marktype=l[0]:i.source=l[0])):i.type=l[0];var w;"!"===i.type.slice(-1)&&(i.consume=!0,i.type=i.type.slice(0,-1));null!=h&&(i.filter=h);f[0]&&(i.throttle=f[0]);f[1]&&(i.debounce=f[1]);return i}(t)}return t.selector=function(t,e,r){return s=e||"view",c=r||i,l(t.trim()).map(u)},t}({}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={})}(this,(function(e){"use strict";const t="[",r="]",n=/[[\]{}]/,i={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let o,s;function l(e,t,r,n,i){const o=e.length;let s,l=0;for(;t<o;++t){if(s=e[t],!l&&s===r)return t;i&&i.indexOf(s)>=0?--l:n&&n.indexOf(s)>=0&&++l}return t}function c(e){const t=[],r=e.length;let n=0,i=0;for(;i<r;)i=l(e,i,",","[{","]}"),t.push(e.substring(n,i).trim()),n=++i;if(0===t.length)throw"Empty event selector: "+e;return t}function f(e){return"["===e[0]?function(e){const n=e.length;let i,o=1;if(o=l(e,o,r,t,r),o===n)throw"Empty between selector: "+e;if(i=c(e.substring(1,o)),2!==i.length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(o+1).trim())[0])throw"Expected '>' after between selector: "+e;i=i.map(f);const s=f(e.slice(1).trim());if(s.between)return{between:i,stream:s};s.between=i;return s}(e):function(e){const i={source:o},c=[];let f,u,h=[0,0],a=0,p=0,m=e.length,g=0;if("}"===e[m-1]){if(g=e.lastIndexOf("{"),!(g>=0))throw"Unmatched right brace: "+e;try{h=function(e){const t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((t=>{const r=+t;if(r!=r)throw e;return r}))}(e.substring(g+1,m-1))}catch(t){throw"Invalid throttle specification: "+e}m=(e=e.slice(0,g).trim()).length,g=0}if(!m)throw e;"@"===e[0]&&(a=++g);f=l(e,g,":"),f<m&&(c.push(e.substring(p,f).trim()),p=g=++f);if(g=l(e,g,t),g===m)c.push(e.substring(p,m).trim());else if(c.push(e.substring(p,g).trim()),u=[],p=++g,p===m)throw"Unmatched left bracket: "+e;for(;g<m;){if(g=l(e,g,r),g===m)throw"Unmatched left bracket: "+e;if(u.push(e.substring(p,g).trim()),g<m-1&&e[++g]!==t)throw"Expected left bracket: "+e;p=++g}if(!(m=c.length)||n.test(c[m-1]))throw"Invalid event selector: "+e;m>1?(i.type=c[1],a?i.markname=c[0].slice(1):(b=c[0],s[b]?i.marktype=c[0]:i.source=c[0])):i.type=c[0];var b;"!"===i.type.slice(-1)&&(i.consume=!0,i.type=i.type.slice(0,-1));null!=u&&(i.filter=u);h[0]&&(i.throttle=h[0]);h[1]&&(i.debounce=h[1]);return i}(e)}e.parseSelector=function(e,t,r){return o=t||"view",s=r||i,c(e.trim()).map(f)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=vega-event-selector.min.js.map |
@@ -217,2 +217,2 @@ const VIEW = 'view', | ||
export { eventSelector as selector }; | ||
export { eventSelector as parseSelector }; |
@@ -1,1 +0,1 @@ | ||
export function selector(selectorName: string, source: string): any[]; | ||
export function parseSelector(selectorName: string, source: string): any[]; |
@@ -1,1 +0,1 @@ | ||
export {default as selector} from './src/event-selector'; | ||
export { default as parseSelector } from './src/event-selector'; |
{ | ||
"name": "vega-event-selector", | ||
"version": "2.0.6", | ||
"version": "3.0.0", | ||
"description": "A CSS-inspired language to select, sequence, and compose DOM events.", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "4affcbedb9d14815dbb6d3b250ed231b54fc95c0" | ||
"gitHead": "774165e29850b66ec8b79ba52a7955f1ab936ea6" | ||
} |
@@ -7,6 +7,6 @@ # vega-event-selector | ||
<a name="selector" href="#selector">#</a> | ||
vega.<b>selector</b>(<i>selector</i>[, <i>source</i>, <i>marks</i>]) | ||
<a name="parseSelector" href="#parseSelector">#</a> | ||
vega.<b>parseSelector</b>(<i>selector</i>[, <i>source</i>, <i>marks</i>]) | ||
[<>](https://github.com/vega/vega/blob/master/packages/vega-event-selector/src/event-selector.js "Source") | ||
Takes an [event _selector_ string](https://vega.github.io/vega/docs/event-streams/#selector) as input and returns a parsed [event stream object](https://vega.github.io/vega/docs/event-streams/#object) definition. The optional _source_ argument takes a string indicating the source value to use by default (normally `"view"`). The optional _marks_ argument takes an object whose keys will be treated as the legal mark types, so long as the corresponding values are truthy. For more, see the [Vega Event Stream documentation](https://vega.github.io/vega/docs/event-streams). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
28121
551