Comparing version 1.11.1 to 1.11.2
@@ -702,3 +702,3 @@ (function (global, factory) { | ||
function span(array) { | ||
return (peek(array) - array[0]) || 0; | ||
return array && (peek(array) - array[0]) || 0; | ||
} | ||
@@ -705,0 +705,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).vega={})}(this,function(n){"use strict";function t(n,t,r){return n.fields=t||[],n.fname=r,n}function r(n){return null==n?null:n.fields}function e(n){throw Error(n)}function u(n){var t,r,u,o=[],i=null,c=0,f=n.length,l="";function a(){o.push(l+n.substring(t,r)),l="",t=r+1}for(n+="",t=r=0;r<f;++r)if("\\"===(u=n[r]))l+=n.substring(t,r),t=++r;else if(u===i)a(),i=null,c=-1;else{if(i)continue;t===c&&'"'===u?(t=r+1,i=u):t===c&&"'"===u?(t=r+1,i=u):"."!==u||c?"["===u?(r>t&&a(),c=t=r+1):"]"===u&&(c||e("Access path missing open bracket: "+n),c>0&&a(),c=0,t=r+1):r>t?a():t=r+1}return c&&e("Access path missing closing bracket: "+n),i&&e("Access path missing closing quote: "+n),r>t&&(r++,a()),o}var o=Array.isArray;function i(n){return n===Object(n)}function c(n){return"string"==typeof n}function f(n){return o(n)?"["+n.map(f)+"]":i(n)||c(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function l(n,r){var e=u(n),o="return _["+e.map(f).join("][")+"];";return t(Function("_",o),[n=1===e.length?e[0]:n],r||n)}var a=[],s=l("id"),p=t(function(n){return n},a,"identity"),h=t(function(){return 0},a,"zero"),g=t(function(){return 1},a,"one"),v=t(function(){return!0},a,"true"),m=t(function(){return!1},a,"false");function y(n,t,r){var e=[t].concat([].slice.call(r));console[n].apply(console,e)}var b=0,d=1,M=2,j=3,O=4;function x(n){return n[n.length-1]}function w(n){return null==n||""===n?null:+n}function z(n){return function(t){return n*Math.exp(t)}}function D(n){return function(t){return Math.log(n*t)}}function k(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function A(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function E(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function S(n,t,r,e){var u=r(n[0]),o=r(x(n)),i=(o-u)*t;return[e(u-i),e(o-i)]}function N(n,t,r,e,u){var o=e(n[0]),i=e(x(n)),c=null!=t?e(t):(o+i)/2;return[u(c+(o-c)*r),u(c+(i-c)*r)]}function R(n){return null!=n?o(n)?n:[n]:[]}function F(n){return"function"==typeof n}const P=Object.prototype.hasOwnProperty;function _(n,t){return P.call(n,t)}var L={};function q(n){return"[object Date]"===Object.prototype.toString.call(n)}function B(n){return"number"==typeof n}function I(n,t){for(var r="";--t>=0;)r+=n;return r}function T(n){return B(n)?n:q(n)?n:Date.parse(n)}n.Debug=O,n.Error=d,n.Info=j,n.None=b,n.Warn=M,n.accessor=t,n.accessorFields=r,n.accessorName=function(n){return null==n?null:n.fname},n.array=R,n.clampRange=function(n,t,r){var e,u=n[0],o=n[1];return o<u&&(e=o,o=u,u=e),(e=o-u)>=r-t?[t,r]:[u=Math.min(Math.max(u,t),r-e),u+e]},n.compare=function(n,e){var o,i,c,l,a,s,p,h,g,v=[],m=(n=R(n)).map(function(n,t){return null==n?null:(v.push(t),F(n)?n:u(n).map(f).join("]["))}),y=v.length-1,b=R(e),d="var u,v;return ";if(y<0)return null;for(i=0;i<=y;++i)F(c=m[o=v[i]])?(l="(u=this."+(s="f"+o)+"(a))",a="(v=this."+s+"(b))",(p=p||{})[s]=c):(l="(u=a["+c+"])",a="(v=b["+c+"])"),s="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==b[o]?(g=1,h=-1):(g=-1,h=1),d+="("+l+"<"+a+"||u==null)&&v!=null?"+h+":(u>v||v==null)&&u!=null?"+g+":"+s+"!==u&&v===v?"+h+":v!==v&&u===u?"+g+(o<y?":":":0");return c=Function("a","b",d+";"),p&&(c=c.bind(p)),n=n.reduce(function(n,t){return F(t)?(r(t)||[]).forEach(function(t){n[t]=1}):null!=t&&(n[t+""]=1),n},{}),t(c,Object.keys(n))},n.constant=function(n){return F(n)?n:function(){return n}},n.debounce=function(n,t){var r,e;function u(){t(e),r=e=null}return function(t){e=t,r&&clearTimeout(r),r=setTimeout(u,n)}},n.error=e,n.extend=function(n){for(var t,r,e=1,u=arguments.length;e<u;++e)for(r in t=arguments[e])n[r]=t[r];return n},n.extent=function(n,t){var r,e,u,o,i=0;if(n&&(r=n.length))if(null==t){for(e=n[i];null==e||e!=e;e=n[++i]);for(u=o=e;i<r;++i)null!=(e=n[i])&&(e<u&&(u=e),e>o&&(o=e))}else{for(e=t(n[i]);null==e||e!=e;e=t(n[++i]));for(u=o=e;i<r;++i)null!=(e=t(n[i]))&&(e<u&&(u=e),e>o&&(o=e))}return[u,o]},n.extentIndex=function(n,t){var r,e,u,o,i,c=-1,f=n.length;if(null==t){for(;++c<f;)if(null!=(e=n[c])&&e>=e){r=u=e;break}for(o=i=c;++c<f;)null!=(e=n[c])&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=t(n[c],c,n))&&e>=e){r=u=e;break}for(o=i=c;++c<f;)null!=(e=t(n[c],c,n))&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}return[o,i]},n.falsy=m,n.fastmap=function(n){var t,r,e={};function u(n){return _(e,n)&&e[n]!==L}return t={size:0,empty:0,object:e,has:u,get:function(n){return u(n)?e[n]:void 0},set:function(n,r){return u(n)||(++t.size,e[n]===L&&--t.empty),e[n]=r,this},delete:function(n){return u(n)&&(--t.size,++t.empty,e[n]=L),this},clear:function(){t.size=t.empty=0,t.object=e={}},test:function(n){return arguments.length?(r=n,t):r},clean:function(){var n,u,o={},i=0;for(n in e)(u=e[n])===L||r&&r(u)||(o[n]=u,++i);t.size=i,t.empty=0,t.object=e=o}},n&&Object.keys(n).forEach(function(r){t.set(r,n[r])}),t},n.field=l,n.flush=function(n,t,r,e,u,o){if(!r&&0!==r)return o;var i,c,f=n[0],l=x(n),a=+r;return l<f&&(i=f,f=l,l=i),(i=Math.abs(t-f))<(c=Math.abs(l-t))&&i<=a?e:c<=a?u:o},n.hasOwnProperty=_,n.id=s,n.identity=p,n.inherits=function(n,t){var r=n.prototype=Object.create(t.prototype);return r.constructor=n,r},n.inrange=function(n,t,r,e){var u,o=t[0],i=t[t.length-1];return o>i&&(u=o,o=i,i=u),e=void 0===e||e,((r=void 0===r||r)?o<=n:o<n)&&(e?n<=i:n<i)},n.isArray=o,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=q,n.isFunction=F,n.isNumber=B,n.isObject=i,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=c,n.key=function(n,r){return n&&(n=r?R(n).map(function(n){return n.replace(/\\(.)/g,"$1")}):R(n)),t(n&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+(r?f(n):u(n).map(f).join("]["))+"]"}).join("+'|'+")+";"):function(){return""},n,"key")},n.lerp=function(n,t){const r=n[0],e=x(n),u=+t;return u?1===u?e:r+u*(e-r):r},n.logger=function(n,t){var r=n||b;return{level:function(n){return arguments.length?(r=+n,this):r},error:function(){return r>=d&&y(t||"error","ERROR",arguments),this},warn:function(){return r>=M&&y(t||"warn","WARN",arguments),this},info:function(){return r>=j&&y(t||"log","INFO",arguments),this},debug:function(){return r>=O&&y(t||"log","DEBUG",arguments),this}}},n.merge=function(n,t,r,e){var u=t.length,o=r.length;if(!o)return t;if(!u)return r;for(var i=e||new t.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(t[c],r[f])>0?r[f++]:t[c++];for(;c<u;++c,++l)i[l]=t[c];for(;f<o;++f,++l)i[l]=r[f];return i},n.one=g,n.pad=function(n,t,r,e){var u=r||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===e?I(u,i)+o:"center"===e?I(u,~~(i/2))+o+I(u,Math.ceil(i/2)):o+I(u,i)},n.panLinear=function(n,t){return S(n,t,w,p)},n.panLog=function(n,t){var r=Math.sign(n[0]);return S(n,t,D(r),z(r))},n.panPow=function(n,t,r){return S(n,t,E(r),E(1/r))},n.panSymlog=function(n,t,r){return S(n,t,k(r),A(r))},n.peek=x,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=I,n.span=function(n){return x(n)-n[0]||0},n.splitAccessPath=u,n.stringValue=f,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||T,null==n||""===n?null:t(n)},n.toNumber=w,n.toSet=function(n){for(var t={},r=0,e=n.length;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,r,e){var u=null!=e?e:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===r?u+o.slice(i-c):"center"===r?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.truthy=v,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,r){if(n){var e,u=0,o=n.length;if(t)for(;u<o;++u)(e=t(n[u]))&&r(e,u,n);else n.forEach(r)}},n.zero=h,n.zoomLinear=function(n,t,r){return N(n,t,r,w,p)},n.zoomLog=function(n,t,r){var e=Math.sign(n[0]);return N(n,t,r,D(e),z(e))},n.zoomPow=function(n,t,r,e){return N(n,t,r,E(e),E(1/e))},n.zoomSymlog=function(n,t,r,e){return N(n,t,r,k(e),A(e))},Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).vega={})}(this,(function(n){"use strict";function t(n,t,r){return n.fields=t||[],n.fname=r,n}function r(n){return null==n?null:n.fields}function e(n){throw Error(n)}function u(n){var t,r,u,o=[],i=null,c=0,f=n.length,l="";function a(){o.push(l+n.substring(t,r)),l="",t=r+1}for(n+="",t=r=0;r<f;++r)if("\\"===(u=n[r]))l+=n.substring(t,r),t=++r;else if(u===i)a(),i=null,c=-1;else{if(i)continue;t===c&&'"'===u?(t=r+1,i=u):t===c&&"'"===u?(t=r+1,i=u):"."!==u||c?"["===u?(r>t&&a(),c=t=r+1):"]"===u&&(c||e("Access path missing open bracket: "+n),c>0&&a(),c=0,t=r+1):r>t?a():t=r+1}return c&&e("Access path missing closing bracket: "+n),i&&e("Access path missing closing quote: "+n),r>t&&(r++,a()),o}var o=Array.isArray;function i(n){return n===Object(n)}function c(n){return"string"==typeof n}function f(n){return o(n)?"["+n.map(f)+"]":i(n)||c(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function l(n,r){var e=u(n),o="return _["+e.map(f).join("][")+"];";return t(Function("_",o),[n=1===e.length?e[0]:n],r||n)}var a=[],s=l("id"),p=t((function(n){return n}),a,"identity"),h=t((function(){return 0}),a,"zero"),g=t((function(){return 1}),a,"one"),v=t((function(){return!0}),a,"true"),m=t((function(){return!1}),a,"false");function y(n,t,r){var e=[t].concat([].slice.call(r));console[n].apply(console,e)}var b=0,d=1,M=2,j=3,O=4;function x(n){return n[n.length-1]}function w(n){return null==n||""===n?null:+n}function z(n){return function(t){return n*Math.exp(t)}}function D(n){return function(t){return Math.log(n*t)}}function k(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function A(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function E(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function S(n,t,r,e){var u=r(n[0]),o=r(x(n)),i=(o-u)*t;return[e(u-i),e(o-i)]}function N(n,t,r,e,u){var o=e(n[0]),i=e(x(n)),c=null!=t?e(t):(o+i)/2;return[u(c+(o-c)*r),u(c+(i-c)*r)]}function R(n){return null!=n?o(n)?n:[n]:[]}function F(n){return"function"==typeof n}const P=Object.prototype.hasOwnProperty;function _(n,t){return P.call(n,t)}var L={};function q(n){return"[object Date]"===Object.prototype.toString.call(n)}function B(n){return"number"==typeof n}function I(n,t){for(var r="";--t>=0;)r+=n;return r}function T(n){return B(n)?n:q(n)?n:Date.parse(n)}n.Debug=O,n.Error=d,n.Info=j,n.None=b,n.Warn=M,n.accessor=t,n.accessorFields=r,n.accessorName=function(n){return null==n?null:n.fname},n.array=R,n.clampRange=function(n,t,r){var e,u=n[0],o=n[1];return o<u&&(e=o,o=u,u=e),(e=o-u)>=r-t?[t,r]:[u=Math.min(Math.max(u,t),r-e),u+e]},n.compare=function(n,e){var o,i,c,l,a,s,p,h,g,v=[],m=(n=R(n)).map((function(n,t){return null==n?null:(v.push(t),F(n)?n:u(n).map(f).join("]["))})),y=v.length-1,b=R(e),d="var u,v;return ";if(y<0)return null;for(i=0;i<=y;++i)F(c=m[o=v[i]])?(l="(u=this."+(s="f"+o)+"(a))",a="(v=this."+s+"(b))",(p=p||{})[s]=c):(l="(u=a["+c+"])",a="(v=b["+c+"])"),s="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==b[o]?(g=1,h=-1):(g=-1,h=1),d+="("+l+"<"+a+"||u==null)&&v!=null?"+h+":(u>v||v==null)&&u!=null?"+g+":"+s+"!==u&&v===v?"+h+":v!==v&&u===u?"+g+(o<y?":":":0");return c=Function("a","b",d+";"),p&&(c=c.bind(p)),n=n.reduce((function(n,t){return F(t)?(r(t)||[]).forEach((function(t){n[t]=1})):null!=t&&(n[t+""]=1),n}),{}),t(c,Object.keys(n))},n.constant=function(n){return F(n)?n:function(){return n}},n.debounce=function(n,t){var r,e;function u(){t(e),r=e=null}return function(t){e=t,r&&clearTimeout(r),r=setTimeout(u,n)}},n.error=e,n.extend=function(n){for(var t,r,e=1,u=arguments.length;e<u;++e)for(r in t=arguments[e])n[r]=t[r];return n},n.extent=function(n,t){var r,e,u,o,i=0;if(n&&(r=n.length))if(null==t){for(e=n[i];null==e||e!=e;e=n[++i]);for(u=o=e;i<r;++i)null!=(e=n[i])&&(e<u&&(u=e),e>o&&(o=e))}else{for(e=t(n[i]);null==e||e!=e;e=t(n[++i]));for(u=o=e;i<r;++i)null!=(e=t(n[i]))&&(e<u&&(u=e),e>o&&(o=e))}return[u,o]},n.extentIndex=function(n,t){var r,e,u,o,i,c=-1,f=n.length;if(null==t){for(;++c<f;)if(null!=(e=n[c])&&e>=e){r=u=e;break}for(o=i=c;++c<f;)null!=(e=n[c])&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=t(n[c],c,n))&&e>=e){r=u=e;break}for(o=i=c;++c<f;)null!=(e=t(n[c],c,n))&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}return[o,i]},n.falsy=m,n.fastmap=function(n){var t,r,e={};function u(n){return _(e,n)&&e[n]!==L}return t={size:0,empty:0,object:e,has:u,get:function(n){return u(n)?e[n]:void 0},set:function(n,r){return u(n)||(++t.size,e[n]===L&&--t.empty),e[n]=r,this},delete:function(n){return u(n)&&(--t.size,++t.empty,e[n]=L),this},clear:function(){t.size=t.empty=0,t.object=e={}},test:function(n){return arguments.length?(r=n,t):r},clean:function(){var n,u,o={},i=0;for(n in e)(u=e[n])===L||r&&r(u)||(o[n]=u,++i);t.size=i,t.empty=0,t.object=e=o}},n&&Object.keys(n).forEach((function(r){t.set(r,n[r])})),t},n.field=l,n.flush=function(n,t,r,e,u,o){if(!r&&0!==r)return o;var i,c,f=n[0],l=x(n),a=+r;return l<f&&(i=f,f=l,l=i),(i=Math.abs(t-f))<(c=Math.abs(l-t))&&i<=a?e:c<=a?u:o},n.hasOwnProperty=_,n.id=s,n.identity=p,n.inherits=function(n,t){var r=n.prototype=Object.create(t.prototype);return r.constructor=n,r},n.inrange=function(n,t,r,e){var u,o=t[0],i=t[t.length-1];return o>i&&(u=o,o=i,i=u),e=void 0===e||e,((r=void 0===r||r)?o<=n:o<n)&&(e?n<=i:n<i)},n.isArray=o,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=q,n.isFunction=F,n.isNumber=B,n.isObject=i,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=c,n.key=function(n,r){return n&&(n=r?R(n).map((function(n){return n.replace(/\\(.)/g,"$1")})):R(n)),t(n&&n.length?Function("_","return ''+"+n.map((function(n){return"_["+(r?f(n):u(n).map(f).join("]["))+"]"})).join("+'|'+")+";"):function(){return""},n,"key")},n.lerp=function(n,t){const r=n[0],e=x(n),u=+t;return u?1===u?e:r+u*(e-r):r},n.logger=function(n,t){var r=n||b;return{level:function(n){return arguments.length?(r=+n,this):r},error:function(){return r>=d&&y(t||"error","ERROR",arguments),this},warn:function(){return r>=M&&y(t||"warn","WARN",arguments),this},info:function(){return r>=j&&y(t||"log","INFO",arguments),this},debug:function(){return r>=O&&y(t||"log","DEBUG",arguments),this}}},n.merge=function(n,t,r,e){var u=t.length,o=r.length;if(!o)return t;if(!u)return r;for(var i=e||new t.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(t[c],r[f])>0?r[f++]:t[c++];for(;c<u;++c,++l)i[l]=t[c];for(;f<o;++f,++l)i[l]=r[f];return i},n.one=g,n.pad=function(n,t,r,e){var u=r||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===e?I(u,i)+o:"center"===e?I(u,~~(i/2))+o+I(u,Math.ceil(i/2)):o+I(u,i)},n.panLinear=function(n,t){return S(n,t,w,p)},n.panLog=function(n,t){var r=Math.sign(n[0]);return S(n,t,D(r),z(r))},n.panPow=function(n,t,r){return S(n,t,E(r),E(1/r))},n.panSymlog=function(n,t,r){return S(n,t,k(r),A(r))},n.peek=x,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=I,n.span=function(n){return n&&x(n)-n[0]||0},n.splitAccessPath=u,n.stringValue=f,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||T,null==n||""===n?null:t(n)},n.toNumber=w,n.toSet=function(n){for(var t={},r=0,e=n.length;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,r,e){var u=null!=e?e:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===r?u+o.slice(i-c):"center"===r?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.truthy=v,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,r){if(n){var e,u=0,o=n.length;if(t)for(;u<o;++u)(e=t(n[u]))&&r(e,u,n);else n.forEach(r)}},n.zero=h,n.zoomLinear=function(n,t,r){return N(n,t,r,w,p)},n.zoomLog=function(n,t,r){var e=Math.sign(n[0]);return N(n,t,r,D(e),z(e))},n.zoomPow=function(n,t,r,e){return N(n,t,r,E(e),E(1/e))},n.zoomSymlog=function(n,t,r,e){return N(n,t,r,k(e),A(e))},Object.defineProperty(n,"__esModule",{value:!0})})); |
{ | ||
"name": "vega-util", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"description": "JavaScript utilities for Vega.", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "6661237f8ba417cabb3db1e5ce1532bdc1a52caf" | ||
"gitHead": "9badf6d2d1490057f4010e3796189ca366878101" | ||
} |
@@ -8,3 +8,3 @@ import peek from './peek'; | ||
export default function(array) { | ||
return (peek(array) - array[0]) || 0; | ||
return array && (peek(array) - array[0]) || 0; | ||
} |
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
85904