Comparing version 2.1.1 to 2.1.2
@@ -121,3 +121,2 @@ (function (global, factory) { | ||
}; | ||
if (count) { | ||
@@ -124,0 +123,0 @@ interval.count = (start, end) => { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.vega)}(this,(function(e,t){"use strict";const n="year",r="quarter",o="month",u="week",s="date",a="day",i="dayofyear",l="hours",c="minutes",g="seconds",f="milliseconds",T=[n,r,o,u,s,a,i,l,c,g,f],h=T.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function M(e){const n=t.array(e).slice(),l={};n.length||t.error("Missing time unit."),n.forEach((e=>{t.hasOwnProperty(h,e)?l[e]=1:t.error(`Invalid time unit: ${e}.`)}));return(l[u]||l[a]?1:0)+(l[r]||l[o]||l[s]?1:0)+(l[i]?1:0)>1&&t.error(`Incompatible time units: ${e}`),n.sort(((e,t)=>h[e]-h[t])),n}const U={[n]:"%Y ",[r]:"Q%q ",[o]:"%b ",[s]:"%d ",[u]:"W%U ",[a]:"%a ",[i]:"%j ",[l]:"%H:00",[c]:"00:%M",[g]:":%S",[f]:".%L",[`${n}-${o}`]:"%Y-%m ",[`${n}-${o}-${s}`]:"%Y-%m-%d ",[`${l}-${c}`]:"%H:%M"};const C=new Date,D=new Date;function d(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,u)=>{const s=[];if(n=o.ceil(n),u=null==u?1:Math.floor(u),!(n<r&&u>0))return s;let a;do{s.push(a=new Date(+n)),t(n,u),e(n)}while(a<n&&n<r);return s},o.filter=n=>d((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(o.count=(t,r)=>(C.setTime(+t),D.setTime(+r),e(C),e(D),Math.floor(n(C,D))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null)),o}const m=d((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));m.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?d((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):m:null),m.range;const F=1e3,Y=6e4,y=60*Y,w=24*y,v=7*w,H=d((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*F)}),((e,t)=>(t-e)/F),(e=>e.getUTCSeconds()));H.range;const S=d((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F)}),((e,t)=>{e.setTime(+e+t*Y)}),((e,t)=>(t-e)/Y),(e=>e.getMinutes()));S.range;const p=d((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Y)}),((e,t)=>(t-e)/Y),(e=>e.getUTCMinutes()));p.range;const N=d((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F-e.getMinutes()*Y)}),((e,t)=>{e.setTime(+e+t*y)}),((e,t)=>(t-e)/y),(e=>e.getHours()));N.range;const O=d((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*y)}),((e,t)=>(t-e)/y),(e=>e.getUTCHours()));O.range;const E=d((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Y)/w),(e=>e.getDate()-1));E.range;const z=d((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/w),(e=>e.getUTCDate()-1));z.range;function I(e){return d((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Y)/v))}d((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/w),(e=>Math.floor(e/w))).range;const $=I(0),b=I(1),q=I(2),x=I(3),A=I(4),k=I(5),R=I(6);function j(e){return d((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/v))}$.range,b.range,q.range,x.range,A.range,k.range,R.range;const L=j(0),Q=j(1),W=j(2),B=j(3),K=j(4),P=j(5),_=j(6);L.range,Q.range,W.range,B.range,K.range,P.range,_.range;const G=d((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()));G.range;const J=d((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()));J.range;const V=d((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));V.every=e=>isFinite(e=Math.floor(e))&&e>0?d((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,V.range;const X=d((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function Z(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ee(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function te(){return 0}X.every=e=>isFinite(e=Math.floor(e))&&e>0?d((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,X.range;const ne=Math.sqrt(50),re=Math.sqrt(10),oe=Math.sqrt(2);function ue(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),u=r/Math.pow(10,o),s=u>=ne?10:u>=re?5:u>=oe?2:1;let a,i,l;return o<0?(l=Math.pow(10,-o)/s,a=Math.round(e*l),i=Math.round(t*l),a/l<e&&++a,i/l>t&&--i,l=-l):(l=Math.pow(10,o)*s,a=Math.round(e/l),i=Math.round(t/l),a*l<e&&++a,i*l>t&&--i),i<a&&.5<=n&&n<2?ue(e,t,2*n):[a,i,l]}function se(e,t,n){return ue(e=+e,t=+t,n=+n)[2]}function ae(e,t,n){n=+n;const r=(t=+t)<(e=+e),o=r?se(t,e,n):se(e,t,n);return(r?-1:1)*(o<0?1/-o:o)}const ie=new Date;function le(e){return ie.setFullYear(e),ie.setMonth(0),ie.setDate(1),ie.setHours(0,0,0,0),ie}function ce(e){return E.count(le(e.getFullYear())-1,e)}function ge(e){return $.count(le(e.getFullYear())-1,e)}function fe(e){return le(e).getDay()}function Te(e,t,n,r,o,u,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,o,u,s);return a.setFullYear(e),a}return new Date(e,t,n,r,o,u,s)}function he(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return z.count(t-1,e)}function Me(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return L.count(t-1,e)}function Ue(e){return ie.setTime(Date.UTC(e,0,1)),ie.getUTCDay()}function Ce(e,t,n,r,o,u,s){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,o,u,s));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,o,u,s))}function De(e,T,h,M,U){const C=T||1,D=t.peek(e),d=(e,t,n)=>function(e,t,n,r){const o=n<=1?e:r?(t,o)=>r+n*Math.floor((e(t,o)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(o(e,n),n):o}(h[n=n||e],M[n],e===D&&C,t),m=new Date,F=t.toSet(e),Y=F[n]?d(n):t.constant(2012),y=F[o]?d(o):F[r]?d(r):t.zero,w=F[u]&&F[a]?d(a,1,u+a):F[u]?d(u,1):F[a]?d(a,1):F[s]?d(s,1):F[i]?d(i,1):t.one,v=F[l]?d(l):t.zero,H=F[c]?d(c):t.zero,S=F[g]?d(g):t.zero,p=F[f]?d(f):t.zero;return function(e){m.setTime(+e);const t=Y(m);return U(t,y(m),w(m,t),v(m),H(m),S(m),p(m))}}function de(e,t,n){return t+7*e-(n+6)%7}const me={[n]:e=>e.getFullYear(),[r]:e=>Math.floor(e.getMonth()/3),[o]:e=>e.getMonth(),[s]:e=>e.getDate(),[l]:e=>e.getHours(),[c]:e=>e.getMinutes(),[g]:e=>e.getSeconds(),[f]:e=>e.getMilliseconds(),[i]:e=>ce(e),[u]:e=>ge(e),[u+a]:(e,t)=>de(ge(e),e.getDay(),fe(t)),[a]:(e,t)=>de(1,e.getDay(),fe(t))},Fe={[r]:e=>3*e,[u]:(e,t)=>de(e,0,fe(t))};const Ye={[n]:e=>e.getUTCFullYear(),[r]:e=>Math.floor(e.getUTCMonth()/3),[o]:e=>e.getUTCMonth(),[s]:e=>e.getUTCDate(),[l]:e=>e.getUTCHours(),[c]:e=>e.getUTCMinutes(),[g]:e=>e.getUTCSeconds(),[f]:e=>e.getUTCMilliseconds(),[i]:e=>he(e),[u]:e=>Me(e),[a]:(e,t)=>de(1,e.getUTCDay(),Ue(t)),[u+a]:(e,t)=>de(Me(e),e.getUTCDay(),Ue(t))},ye={[r]:e=>3*e,[u]:(e,t)=>de(e,0,Ue(t))};const we={[n]:V,[r]:G.every(3),[o]:G,[u]:$,[s]:E,[a]:E,[i]:E,[l]:N,[c]:S,[g]:H,[f]:m},ve={[n]:X,[r]:J.every(3),[o]:J,[u]:L,[s]:z,[a]:z,[i]:z,[l]:O,[c]:p,[g]:H,[f]:m};function He(e){return we[e]}function Se(e){return ve[e]}function pe(e,t,n){return e?e.offset(t,n):void 0}function Ne(e,t,n,r){return e?e.range(t,n,r):void 0}const Oe=1e3,Ee=6e4,ze=36e5,Ie=864e5,$e=2592e6,be=31536e6,qe=[n,o,s,l,c,g,f],xe=qe.slice(0,-1),Ae=xe.slice(0,-1),ke=Ae.slice(0,-1),Re=ke.slice(0,-1),je=[n,o],Le=[n],Qe=[[xe,1,Oe],[xe,5,5e3],[xe,15,15e3],[xe,30,3e4],[Ae,1,Ee],[Ae,5,3e5],[Ae,15,9e5],[Ae,30,18e5],[ke,1,ze],[ke,3,108e5],[ke,6,216e5],[ke,12,432e5],[Re,1,Ie],[[n,u],1,6048e5],[je,1,$e],[je,3,7776e6],[Le,1,be]];e.DATE=s,e.DAY=a,e.DAYOFYEAR=i,e.HOURS=l,e.MILLISECONDS=f,e.MINUTES=c,e.MONTH=o,e.QUARTER=r,e.SECONDS=g,e.TIME_UNITS=T,e.WEEK=u,e.YEAR=n,e.dayofyear=function(e){return ce(new Date(e))},e.timeBin=function(e){const n=e.extent,r=e.maxbins||40,o=Math.abs(t.span(n))/r;let u,s,a=function(e){let t,n,r;function o(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<u){if(0!==t(r,r))return u;do{const t=o+u>>>1;n(e[t],r)<0?o=t+1:u=t}while(o<u)}return o}return 2!==e.length?(t=Z,n=(t,n)=>Z(e(t),n),r=(t,n)=>e(t)-n):(t=e===Z||e===ee?e:te,n=e,r=e),{left:o,center:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const u=o(e,t,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length)-1);return u>n&&r(e[u-1],t)>-r(e[u],t)?u-1:u},right:function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<u){if(0!==t(r,r))return u;do{const t=o+u>>>1;n(e[t],r)<=0?o=t+1:u=t}while(o<u)}return o}}}((e=>e[2])).right(Qe,o);return a===Qe.length?(u=Le,s=ae(n[0]/be,n[1]/be,r)):a?(a=Qe[o/Qe[a-1][2]<Qe[a][2]/o?a-1:a],u=a[0],s=a[1]):(u=qe,s=Math.max(ae(n[0],n[1],r),1)),{units:u,step:s}},e.timeFloor=function(e,t){return De(e,t||1,me,Fe,Te)},e.timeInterval=He,e.timeOffset=function(e,t,n){return pe(He(e),t,n)},e.timeSequence=function(e,t,n,r){return Ne(He(e),t,n,r)},e.timeUnitSpecifier=function(e,n){const r=t.extend({},U,n),o=M(e),u=o.length;let s,a,i="",l=0;for(l=0;l<u;)for(s=o.length;s>l;--s)if(a=o.slice(l,s).join("-"),null!=r[a]){i+=r[a],l=s;break}return i.trim()},e.timeUnits=M,e.utcFloor=function(e,t){return De(e,t||1,Ye,ye,Ce)},e.utcInterval=Se,e.utcOffset=function(e,t,n){return pe(Se(e),t,n)},e.utcSequence=function(e,t,n,r){return Ne(Se(e),t,n,r)},e.utcdayofyear=function(e){return he(new Date(e))},e.utcweek=function(e){return Me(new Date(e))},e.week=function(e){return ge(new Date(e))}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vega={},e.vega)}(this,(function(e,t){"use strict";const n="year",r="quarter",o="month",u="week",s="date",a="day",i="dayofyear",l="hours",c="minutes",g="seconds",f="milliseconds",T=[n,r,o,u,s,a,i,l,c,g,f],h=T.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function M(e){const n=t.array(e).slice(),l={};n.length||t.error("Missing time unit."),n.forEach((e=>{t.hasOwnProperty(h,e)?l[e]=1:t.error(`Invalid time unit: ${e}.`)}));return(l[u]||l[a]?1:0)+(l[r]||l[o]||l[s]?1:0)+(l[i]?1:0)>1&&t.error(`Incompatible time units: ${e}`),n.sort(((e,t)=>h[e]-h[t])),n}const U={[n]:"%Y ",[r]:"Q%q ",[o]:"%b ",[s]:"%d ",[u]:"W%U ",[a]:"%a ",[i]:"%j ",[l]:"%H:00",[c]:"00:%M",[g]:":%S",[f]:".%L",[`${n}-${o}`]:"%Y-%m ",[`${n}-${o}-${s}`]:"%Y-%m-%d ",[`${l}-${c}`]:"%H:%M"};const C=new Date,D=new Date;function d(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,u)=>{const s=[];if(n=o.ceil(n),u=null==u?1:Math.floor(u),!(n<r&&u>0))return s;let a;do{s.push(a=new Date(+n)),t(n,u),e(n)}while(a<n&&n<r);return s},o.filter=n=>d((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(o.count=(t,r)=>(C.setTime(+t),D.setTime(+r),e(C),e(D),Math.floor(n(C,D))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null)),o}const m=d((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));m.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?d((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):m:null),m.range;const F=1e3,Y=6e4,y=36e5,w=864e5,v=6048e5,H=d((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*F)}),((e,t)=>(t-e)/F),(e=>e.getUTCSeconds()));H.range;const S=d((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F)}),((e,t)=>{e.setTime(+e+t*Y)}),((e,t)=>(t-e)/Y),(e=>e.getMinutes()));S.range;const p=d((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Y)}),((e,t)=>(t-e)/Y),(e=>e.getUTCMinutes()));p.range;const N=d((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F-e.getMinutes()*Y)}),((e,t)=>{e.setTime(+e+t*y)}),((e,t)=>(t-e)/y),(e=>e.getHours()));N.range;const O=d((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*y)}),((e,t)=>(t-e)/y),(e=>e.getUTCHours()));O.range;const E=d((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Y)/w),(e=>e.getDate()-1));E.range;const z=d((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/w),(e=>e.getUTCDate()-1));z.range;function I(e){return d((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Y)/v))}d((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/w),(e=>Math.floor(e/w))).range;const $=I(0),b=I(1),q=I(2),x=I(3),A=I(4),k=I(5),R=I(6);function j(e){return d((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/v))}$.range,b.range,q.range,x.range,A.range,k.range,R.range;const L=j(0),Q=j(1),W=j(2),B=j(3),K=j(4),P=j(5),_=j(6);L.range,Q.range,W.range,B.range,K.range,P.range,_.range;const G=d((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()));G.range;const J=d((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()));J.range;const V=d((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));V.every=e=>isFinite(e=Math.floor(e))&&e>0?d((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,V.range;const X=d((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function Z(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ee(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function te(){return 0}X.every=e=>isFinite(e=Math.floor(e))&&e>0?d((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,X.range;const ne=Math.sqrt(50),re=Math.sqrt(10),oe=Math.sqrt(2);function ue(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),u=r/Math.pow(10,o),s=u>=ne?10:u>=re?5:u>=oe?2:1;let a,i,l;return o<0?(l=Math.pow(10,-o)/s,a=Math.round(e*l),i=Math.round(t*l),a/l<e&&++a,i/l>t&&--i,l=-l):(l=Math.pow(10,o)*s,a=Math.round(e/l),i=Math.round(t/l),a*l<e&&++a,i*l>t&&--i),i<a&&.5<=n&&n<2?ue(e,t,2*n):[a,i,l]}function se(e,t,n){return ue(e=+e,t=+t,n=+n)[2]}function ae(e,t,n){n=+n;const r=(t=+t)<(e=+e),o=r?se(t,e,n):se(e,t,n);return(r?-1:1)*(o<0?1/-o:o)}const ie=new Date;function le(e){return ie.setFullYear(e),ie.setMonth(0),ie.setDate(1),ie.setHours(0,0,0,0),ie}function ce(e){return E.count(le(e.getFullYear())-1,e)}function ge(e){return $.count(le(e.getFullYear())-1,e)}function fe(e){return le(e).getDay()}function Te(e,t,n,r,o,u,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,o,u,s);return a.setFullYear(e),a}return new Date(e,t,n,r,o,u,s)}function he(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return z.count(t-1,e)}function Me(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return L.count(t-1,e)}function Ue(e){return ie.setTime(Date.UTC(e,0,1)),ie.getUTCDay()}function Ce(e,t,n,r,o,u,s){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,o,u,s));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,o,u,s))}function De(e,T,h,M,U){const C=T||1,D=t.peek(e),d=(e,t,n)=>function(e,t,n,r){const o=n<=1?e:r?(t,o)=>r+n*Math.floor((e(t,o)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(o(e,n),n):o}(h[n=n||e],M[n],e===D&&C,t),m=new Date,F=t.toSet(e),Y=F[n]?d(n):t.constant(2012),y=F[o]?d(o):F[r]?d(r):t.zero,w=F[u]&&F[a]?d(a,1,u+a):F[u]?d(u,1):F[a]?d(a,1):F[s]?d(s,1):F[i]?d(i,1):t.one,v=F[l]?d(l):t.zero,H=F[c]?d(c):t.zero,S=F[g]?d(g):t.zero,p=F[f]?d(f):t.zero;return function(e){m.setTime(+e);const t=Y(m);return U(t,y(m),w(m,t),v(m),H(m),S(m),p(m))}}function de(e,t,n){return t+7*e-(n+6)%7}const me={[n]:e=>e.getFullYear(),[r]:e=>Math.floor(e.getMonth()/3),[o]:e=>e.getMonth(),[s]:e=>e.getDate(),[l]:e=>e.getHours(),[c]:e=>e.getMinutes(),[g]:e=>e.getSeconds(),[f]:e=>e.getMilliseconds(),[i]:e=>ce(e),[u]:e=>ge(e),[u+a]:(e,t)=>de(ge(e),e.getDay(),fe(t)),[a]:(e,t)=>de(1,e.getDay(),fe(t))},Fe={[r]:e=>3*e,[u]:(e,t)=>de(e,0,fe(t))};const Ye={[n]:e=>e.getUTCFullYear(),[r]:e=>Math.floor(e.getUTCMonth()/3),[o]:e=>e.getUTCMonth(),[s]:e=>e.getUTCDate(),[l]:e=>e.getUTCHours(),[c]:e=>e.getUTCMinutes(),[g]:e=>e.getUTCSeconds(),[f]:e=>e.getUTCMilliseconds(),[i]:e=>he(e),[u]:e=>Me(e),[a]:(e,t)=>de(1,e.getUTCDay(),Ue(t)),[u+a]:(e,t)=>de(Me(e),e.getUTCDay(),Ue(t))},ye={[r]:e=>3*e,[u]:(e,t)=>de(e,0,Ue(t))};const we={[n]:V,[r]:G.every(3),[o]:G,[u]:$,[s]:E,[a]:E,[i]:E,[l]:N,[c]:S,[g]:H,[f]:m},ve={[n]:X,[r]:J.every(3),[o]:J,[u]:L,[s]:z,[a]:z,[i]:z,[l]:O,[c]:p,[g]:H,[f]:m};function He(e){return we[e]}function Se(e){return ve[e]}function pe(e,t,n){return e?e.offset(t,n):void 0}function Ne(e,t,n,r){return e?e.range(t,n,r):void 0}const Oe=1e3,Ee=6e4,ze=36e5,Ie=864e5,$e=2592e6,be=31536e6,qe=[n,o,s,l,c,g,f],xe=qe.slice(0,-1),Ae=xe.slice(0,-1),ke=Ae.slice(0,-1),Re=ke.slice(0,-1),je=[n,o],Le=[n],Qe=[[xe,1,Oe],[xe,5,5e3],[xe,15,15e3],[xe,30,3e4],[Ae,1,Ee],[Ae,5,3e5],[Ae,15,9e5],[Ae,30,18e5],[ke,1,ze],[ke,3,108e5],[ke,6,216e5],[ke,12,432e5],[Re,1,Ie],[[n,u],1,6048e5],[je,1,$e],[je,3,7776e6],[Le,1,be]];e.DATE=s,e.DAY=a,e.DAYOFYEAR=i,e.HOURS=l,e.MILLISECONDS=f,e.MINUTES=c,e.MONTH=o,e.QUARTER=r,e.SECONDS=g,e.TIME_UNITS=T,e.WEEK=u,e.YEAR=n,e.dayofyear=function(e){return ce(new Date(e))},e.timeBin=function(e){const n=e.extent,r=e.maxbins||40,o=Math.abs(t.span(n))/r;let u,s,a=function(e){let t,n,r;function o(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<u){if(0!==t(r,r))return u;do{const t=o+u>>>1;n(e[t],r)<0?o=t+1:u=t}while(o<u)}return o}return 2!==e.length?(t=Z,n=(t,n)=>Z(e(t),n),r=(t,n)=>e(t)-n):(t=e===Z||e===ee?e:te,n=e,r=e),{left:o,center:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const u=o(e,t,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length)-1);return u>n&&r(e[u-1],t)>-r(e[u],t)?u-1:u},right:function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<u){if(0!==t(r,r))return u;do{const t=o+u>>>1;n(e[t],r)<=0?o=t+1:u=t}while(o<u)}return o}}}((e=>e[2])).right(Qe,o);return a===Qe.length?(u=Le,s=ae(n[0]/be,n[1]/be,r)):a?(a=Qe[o/Qe[a-1][2]<Qe[a][2]/o?a-1:a],u=a[0],s=a[1]):(u=qe,s=Math.max(ae(n[0],n[1],r),1)),{units:u,step:s}},e.timeFloor=function(e,t){return De(e,t||1,me,Fe,Te)},e.timeInterval=He,e.timeOffset=function(e,t,n){return pe(He(e),t,n)},e.timeSequence=function(e,t,n,r){return Ne(He(e),t,n,r)},e.timeUnitSpecifier=function(e,n){const r=t.extend({},U,n),o=M(e),u=o.length;let s,a,i="",l=0;for(l=0;l<u;)for(s=o.length;s>l;--s)if(a=o.slice(l,s).join("-"),null!=r[a]){i+=r[a],l=s;break}return i.trim()},e.timeUnits=M,e.utcFloor=function(e,t){return De(e,t||1,Ye,ye,Ce)},e.utcInterval=Se,e.utcOffset=function(e,t,n){return pe(Se(e),t,n)},e.utcSequence=function(e,t,n,r){return Ne(Se(e),t,n,r)},e.utcdayofyear=function(e){return he(new Date(e))},e.utcweek=function(e){return Me(new Date(e))},e.week=function(e){return ge(new Date(e))}})); | ||
//# sourceMappingURL=vega-time.min.js.map |
{ | ||
"name": "vega-time", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "JavaScript date/time utilities for Vega.", | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"d3-time": "^3.1.0", | ||
"vega-util": "^1.17.1" | ||
"vega-util": "^1.17.2" | ||
}, | ||
"gitHead": "fb1092f6b931d450f9c210b67ae4752bd3dd461b" | ||
"gitHead": "d2ef8b4f7d59c02ea80129f59551550a22e0ed97" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
112892
1
Updatedvega-util@^1.17.2