3910 lines
4.7 MiB
JavaScript
3910 lines
4.7 MiB
JavaScript
|
var rX=Object.create;var Hk=Object.defineProperty;var aX=Object.getOwnPropertyDescriptor;var nX=Object.getOwnPropertyNames;var iX=Object.getPrototypeOf,oX=Object.prototype.hasOwnProperty;var sX=(le,ge)=>()=>(ge||le((ge={exports:{}}).exports,ge),ge.exports);var lX=(le,ge,Ye,Pt)=>{if(ge&&typeof ge=="object"||typeof ge=="function")for(let vr of nX(ge))!oX.call(le,vr)&&vr!==Ye&&Hk(le,vr,{get:()=>ge[vr],enumerable:!(Pt=aX(ge,vr))||Pt.enumerable});return le};var uX=(le,ge,Ye)=>(Ye=le!=null?rX(iX(le)):{},lX(ge||!le||!le.__esModule?Hk(Ye,"default",{value:le,enumerable:!0}):Ye,le));var rF=sX((tF,u2)=>{(function(le,ge){typeof u2=="object"&&u2.exports?u2.exports=ge():le.moduleName=ge()})(typeof self<"u"?self:tF,()=>{"use strict";var le=(()=>{var ge=Object.create,Ye=Object.defineProperty,Pt=Object.defineProperties,vr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,ka=Object.getOwnPropertyNames,sn=Object.getOwnPropertySymbols,fn=Object.getPrototypeOf,Li=Object.prototype.hasOwnProperty,bi=Object.prototype.propertyIsEnumerable,Fi=(Z,q,v)=>q in Z?Ye(Z,q,{enumerable:!0,configurable:!0,writable:!0,value:v}):Z[q]=v,Uo=(Z,q)=>{for(var v in q||(q={}))Li.call(q,v)&&Fi(Z,v,q[v]);if(sn)for(var v of sn(q))bi.call(q,v)&&Fi(Z,v,q[v]);return Z},ws=(Z,q)=>Pt(Z,Zr(q)),mo=(Z,q)=>function(){return Z&&(q=(0,Z[ka(Z)[0]])(Z=0)),q},Ze=(Z,q)=>function(){return q||(0,Z[ka(Z)[0]])((q={exports:{}}).exports,q),q.exports},Ws=(Z,q)=>{for(var v in q)Ye(Z,v,{get:q[v],enumerable:!0})},Yl=(Z,q,v,x)=>{if(q&&typeof q=="object"||typeof q=="function")for(let A of ka(q))!Li.call(Z,A)&&A!==v&&Ye(Z,A,{get:()=>q[A],enumerable:!(x=vr(q,A))||x.enumerable});return Z},cu=(Z,q,v)=>(v=Z!=null?ge(fn(Z)):{},Yl(q||!Z||!Z.__esModule?Ye(v,"default",{value:Z,enumerable:!0}):v,Z)),ih=Z=>Yl(Ye({},"__esModule",{value:!0}),Z),Eh=Ze({"src/version.js"(Z){"use strict";Z.version="3.1.0"}}),Bp=Ze({"node_modules/native-promise-only/lib/npo.src.js"(Z,q){(function(x,A,M){A[x]=A[x]||M(),typeof q<"u"&&q.exports&&(q.exports=A[x])})("Promise",typeof window<"u"?window:Z,function(){"use strict";var x,A,M,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(_){return setImmediate(_)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(_,w,S,E){return Object.defineProperty(_,w,{value:S,writable:!0,configurable:E!==!1})}}catch{x=function(w,S,E){return w[S]=E,w}}M=function(){var _,w,S;function E(g,b){this.fn=g,this.self=b,this.next=void 0}return{add:function(b,p){S=new E(b,p),w?w.next=S:_=S,w=S,S=void 0},drain:function(){var b=_;for(_=w=A=void 0;b;)b.fn.call(b.self),b=b.next}}}();function r(l,_){M.add(l,_),A||(A=t(M.drain))}function i(l){var _,w=typeof l;return l!=null&&(w=="object"||w=="function")&&(_=l.then),typeof _=="function"?_:!1}function a(){for(var l=0;l<this.chain.length;l++)n(this,this.state===1?this.chain[l].success:this.chain[l].failure,this.chain[l]);this.chain.length=0}function n(l,_,w){var S,E;try{_===!1?w.reject(l.msg):(_===!0?S=l.msg:S=_.call(void 0,l.msg),S===w.promise?w.reject(TypeError("Promise-chain cycle")):(E=i(S))?E.call(S,w.resolve,w.reject):w.resolve(S))}catch(g){w.reject(g)}}function o(l){var _,w=this;if(!w.triggered){w.triggered=!0,w.def&&(w=w.def);try{(_=i(l))?r(function(){var S=new h(w);try{_.call(l,function(){o.apply(S,arguments)},function(){s.apply(S,arguments)})}catch(E){s.call(S,E)}}):(w.msg=l,w.state=1,w.chain.length>0&&r(a,w))}catch(S){s.call(new h(w),S)}}}function s(l){var _=this;_.triggered||(_.triggered=!0,_.def&&(_=_.def),_.msg=l,_.state=2,_.chain.length>0&&r(a,_))}function c(l,_,w,S){for(var E=0;E<_.length;E++)(function(b){l.resolve(_[b]).then(function(u){w(b,u)},S)})(E)}function h(l){this.def=l,this.triggered=!1}function m(l){this.promise=l,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function d(l){if(typeof l!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var _=new m(this);this.then=function(S,E){var g={success:typeof S=="function"?S:!0,failure:typeof E=="function"?E:!1};return g.promise=new this.constructor(function(p,u){if(typeof p!="function"||
|
|||
|
]`),vt=de.charCodeAt(0);function _t(qr,Wr,Ta){arguments.length<3&&(Ta=Wr,Wr=null);var ya=Fa(qr,De,Wr==null?St:ar(Wr),Ta);return ya.row=function(tn){return arguments.length?ya.response((Wr=tn)==null?St:ar(tn)):Wr},ya}function St(qr){return _t.parse(qr.responseText)}function ar(qr){return function(Wr){return _t.parse(Wr.responseText,qr)}}_t.parse=function(qr,Wr){var Ta;return _t.parseRows(qr,function(ya,tn){if(Ta)return Ta(ya,tn-1);var on=function(Ma){for(var Na={},Ka=ya.length,mn=0;mn<Ka;++mn)Na[ya[mn]]=Ma[mn];return Na};Ta=Wr?function(Ma,Na){return Wr(on(Ma),Na)}:on})},_t.parseRows=function(qr,Wr){var Ta={},ya={},tn=[],on=qr.length,Ma=0,Na=0,Ka,mn;function cn(){if(Ma>=on)return ya;if(mn)return mn=!1,Ta;var si=Ma;if(qr.charCodeAt(si)===34){for(var ni=si;ni++<on;)if(qr.charCodeAt(ni)===34){if(qr.charCodeAt(ni+1)!==34)break;++ni}Ma=ni+2;var vi=qr.charCodeAt(ni+1);return vi===13?(mn=!0,qr.charCodeAt(ni+2)===10&&++Ma):vi===10&&(mn=!0),qr.slice(si+1,ni).replace(/""/g,'"')}for(;Ma<on;){var vi=qr.charCodeAt(Ma++),Pi=1;if(vi===10)mn=!0;else if(vi===13)mn=!0,qr.charCodeAt(Ma)===10&&(++Ma,++Pi);else if(vi!==vt)continue;return qr.slice(si,Ma-Pi)}return qr.slice(si)}for(;(Ka=cn())!==ya;){for(var Pa=[];Ka!==Ta&&Ka!==ya;)Pa.push(Ka),Ka=cn();Wr&&(Pa=Wr(Pa,Na++))==null||tn.push(Pa)}return tn},_t.format=function(qr){if(Array.isArray(qr[0]))return _t.formatRows(qr);var Wr=new z,Ta=[];return qr.forEach(function(ya){for(var tn in ya)Wr.has(tn)||Ta.push(Wr.add(tn))}),[Ta.map(gr).join(de)].concat(qr.map(function(ya){return Ta.map(function(tn){return gr(ya[tn])}).join(de)})).join(`
|
|||
|
`)},_t.formatRows=function(qr){return qr.map(zt).join(`
|
|||
|
`)};function zt(qr){return qr.map(gr).join(de)}function gr(qr){return et.test(qr)?'"'+qr.replace(/\"/g,'""')+'"':qr}return _t},v.csv=v.dsv(",","text/csv"),v.tsv=v.dsv(" ","text/tab-separated-values");var Da,Zn,Pn,fi,Ai=this[O(this,"requestAnimationFrame")]||function(de){setTimeout(de,17)};v.timer=function(){ki.apply(this,arguments)};function ki(de,De,et){var vt=arguments.length;vt<2&&(De=0),vt<3&&(et=Date.now());var _t=et+De,St={c:de,t:_t,n:null};return Zn?Zn.n=St:Da=St,Zn=St,Pn||(fi=clearTimeout(fi),Pn=1,Ai(zi)),St}function zi(){var de=Xi(),De=to()-de;De>24?(isFinite(De)&&(clearTimeout(fi),fi=setTimeout(zi,De)),Pn=0):(Pn=1,Ai(zi))}v.timer.flush=function(){Xi(),to()};function Xi(){for(var de=Date.now(),De=Da;De;)de>=De.t&&De.c(de-De.t)&&(De.c=null),De=De.n;return de}function to(){for(var de,De=Da,et=1/0;De;)De.c?(De.t<et&&(et=De.t),De=(de=De).n):De=de?de.n=De.n:Da=De.n;return Zn=de,et}v.round=function(de,De){return De?Math.round(de*(De=Math.pow(10,De)))/De:Math.round(de)},v.geom={};function go(de){return de[0]}function pi(de){return de[1]}v.geom.hull=function(de){var De=go,et=pi;if(arguments.length)return vt(de);function vt(_t){if(_t.length<3)return[];var St=na(De),ar=na(et),zt,gr=_t.length,qr=[],Wr=[];for(zt=0;zt<gr;zt++)qr.push([+St.call(this,_t[zt],zt),+ar.call(this,_t[zt],zt),zt]);for(qr.sort(Xo),zt=0;zt<gr;zt++)Wr.push([qr[zt][0],-qr[zt][1]]);var Ta=Jo(qr),ya=Jo(Wr),tn=ya[0]===Ta[0],on=ya[ya.length-1]===Ta[Ta.length-1],Ma=[];for(zt=Ta.length-1;zt>=0;--zt)Ma.push(_t[qr[Ta[zt]][2]]);for(zt=+tn;zt<ya.length-on;++zt)Ma.push(_t[qr[ya[zt]][2]]);return Ma}return vt.x=function(_t){return arguments.length?(De=_t,vt):De},vt.y=function(_t){return arguments.length?(et=_t,vt):et},vt};function Jo(de){for(var De=de.length,et=[0,1],vt=2,_t=2;_t<De;_t++){for(;vt>1&&Tt(de[et[vt-2]],de[et[vt-1]],de[_t])<=0;)--vt;et[vt++]=_t}return et.slice(0,vt)}function Xo(de,De){return de[0]-De[0]||de[1]-De[1]}v.geom.polygon=function(de){return H(de,Ts),de};var Ts=v.geom.polygon.prototype=[];Ts.area=function(){for(var de=-1,De=this.length,et,vt=this[De-1],_t=0;++de<De;)et=vt,vt=this[de],_t+=et[1]*vt[0]-et[0]*vt[1];return _t*.5},Ts.centroid=function(de){var De=-1,et=this.length,vt=0,_t=0,St,ar=this[et-1],zt;for(arguments.length||(de=-1/(6*this.area()));++De<et;)St=ar,ar=this[De],zt=St[0]*ar[1]-ar[0]*St[1],vt+=(St[0]+ar[0])*zt,_t+=(St[1]+ar[1])*zt;return[vt*de,_t*de]},Ts.clip=function(de){for(var De,et=qi(de),vt=-1,_t=this.length-qi(this),St,ar,zt=this[_t-1],gr,qr,Wr;++vt<_t;){for(De=de.slice(),de.length=0,gr=this[vt],qr=De[(ar=De.length-et)-1],St=-1;++St<ar;)Wr=De[St],Po(Wr,zt,gr)?(Po(qr,zt,gr)||de.push(so(qr,Wr,zt,gr)),de.push(Wr)):Po(qr,zt,gr)&&de.push(so(qr,Wr,zt,gr)),qr=Wr;et&&de.push(de[0]),zt=gr}return de};function Po(de,De,et){return(et[0]-De[0])*(de[1]-De[1])<(et[1]-De[1])*(de[0]-De[0])}function so(de,De,et,vt){var _t=de[0],St=et[0],ar=De[0]-_t,zt=vt[0]-St,gr=de[1],qr=et[1],Wr=De[1]-gr,Ta=vt[1]-qr,ya=(zt*(gr-qr)-Ta*(_t-St))/(Ta*ar-zt*Wr);return[_t+ya*ar,gr+ya*Wr]}function qi(de){var De=de[0],et=de[de.length-1];return!(De[0]-et[0]||De[1]-et[1])}var To,Vo,Oo,lo=[],Co,os,Ys=[];function Os(){Ns(this),this.edge=this.site=this.circle=null}function Yo(de){var De=lo.pop()||new Os;return De.site=de,De}function jn(de){po(de),Oo.remove(de),lo.push(de),Ns(de)}function Ci(de){var De=de.circle,et=De.x,vt=De.cy,_t={x:et,y:vt},St=de.P,ar=de.N,zt=[de];jn(de);for(var gr=St;gr.circle&&l(et-gr.circle.x)<Ke&&l(vt-gr.circle.cy)<Ke;)St=gr.P,zt.unshift(gr),jn(gr),gr=St;zt.unshift(gr),po(gr);for(var qr=ar;qr.circle&&l(et-qr.circle.x)<Ke&&l(vt-qr.circle.cy)<Ke;)ar=qr.N,zt.push(qr),jn(qr),qr=ar;zt.push(qr),po(qr);var Wr=zt.length,Ta;for(Ta=1;Ta<Wr;++Ta)qr=zt[Ta],gr=zt[Ta-1],fl(qr.edge,gr.site,qr.site,_t);gr=zt[0],qr=zt[Wr-1],qr.edge=zs(gr.site,qr.site,null,_t),Si(gr),Si(qr)}function tl(de){for(var De=de.x,et=de.y,vt,_t,St,ar,zt=Oo._;zt;)if(St=Bs(zt,et)-De,St>Ke)zt=zt.L;else if(ar=De-uo(zt,et),ar>Ke){if(!zt.R){vt=zt;break}zt=zt.R}else{St>-Ke?(vt=zt.P,_t=zt):ar>-Ke?(vt=zt,_t=zt.N):vt=_t=zt;break}var gr=Yo(de);if(Oo.insert(vt,gr),!(!vt&&!_t)){if(vt===_t){po(vt),_t=Yo(vt.
|
|||
|
`+U.year;else return L(F,O)+`
|
|||
|
`+f(U.dayMonthYear,F,I,N);return f(B,F,I,N)};var z=3*t;Z.incrementMonth=function(F,B,O){O=d(O)&&O;var I=A(F,t);if(F=Math.round(F-I),O)try{var N=Math.round(F/t)+n,U=o.getComponentMethod("calendars","getCal")(O),W=U.fromJD(N);return B%12?U.add(W,B,"m"):U.add(W,B/12,"y"),(W.toJD()-n)*t+I}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+I-z},Z.findExactDates=function(F,B){for(var O=0,I=0,N=0,U=0,W,Q,ue=d(B)&&o.getComponentMethod("calendars","getCal")(B),se=0;se<F.length;se++){if(Q=F[se],!v(Q)){U++;continue}if(!(Q%t))if(ue)try{W=ue.fromJD(Q/t+n),W.day()===1?W.month()===1?O++:I++:N++}catch{}else W=new Date(Q),W.getUTCDate()===1?W.getUTCMonth()===0?O++:I++:N++}I+=O,N+=I;var he=F.length-U;return{exactYears:O/he,exactMonths:I/he,exactDays:N/he}}}}),S_=Ze({"src/lib/identity.js"(Z,q){"use strict";q.exports=function(x){return x}}}),m2=Ze({"src/lib/search.js"(Z){"use strict";var q=is(),v=Ym(),x=S_(),A=Vs().BADNUM,M=1e-9;Z.findBin=function(a,n,o){if(q(n.start))return o?Math.ceil((a-n.start)/n.size-M)-1:Math.floor((a-n.start)/n.size+M);var s=0,c=n.length,h=0,m=c>1?(n[c-1]-n[0])/(c-1):1,d,T;for(m>=0?T=o?e:t:T=o?i:r,a+=m*M*(o?-1:1)*(m>=0?1:-1);s<c&&h++<100;)d=Math.floor((s+c)/2),T(n[d],a)?s=d+1:c=d;return h>90&&v.log("Long binary search..."),s-1};function e(a,n){return a<n}function t(a,n){return a<=n}function r(a,n){return a>n}function i(a,n){return a>=n}Z.sorterAsc=function(a,n){return a-n},Z.sorterDes=function(a,n){return n-a},Z.distinctVals=function(a){var n=a.slice();n.sort(Z.sorterAsc);var o;for(o=n.length-1;o>-1&&n[o]===A;o--);for(var s=n[o]-n[0]||1,c=s/(o||1)/1e4,h=[],m,d=0;d<=o;d++){var T=n[d],l=T-m;m===void 0?(h.push(T),m=T):l>c&&(s=Math.min(s,l),h.push(T),m=T)}return{vals:h,minDiff:s}},Z.roundUp=function(a,n,o){for(var s=0,c=n.length-1,h,m=0,d=o?0:1,T=o?1:0,l=o?Math.ceil:Math.floor;s<c&&m++<100;)h=l((s+c)/2),n[h]<=a?s=h+d:c=h-T;return n[s]},Z.sort=function(a,n){for(var o=0,s=0,c=1;c<a.length;c++){var h=n(a[c],a[c-1]);if(h<0?o=1:h>0&&(s=1),o&&s)return a.sort(n)}return s?a:a.reverse()},Z.findIndexOfMin=function(a,n){n=n||x;for(var o=1/0,s,c=0;c<a.length;c++){var h=n(a[c]);h<o&&(o=h,s=c)}return s}}}),Km=Ze({"src/lib/sort_object_keys.js"(Z,q){"use strict";q.exports=function(x){return Object.keys(x).sort()}}}),GF=Ze({"src/lib/stats.js"(Z){"use strict";var q=is(),v=xp().isArrayOrTypedArray;Z.aggNums=function(x,A,M,e){var t,r;if((!e||e>M.length)&&(e=M.length),q(A)||(A=!1),v(M[0])){for(r=new Array(e),t=0;t<e;t++)r[t]=Z.aggNums(x,A,M[t]);M=r}for(t=0;t<e;t++)q(A)?q(M[t])&&(A=x(+A,+M[t])):A=M[t];return A},Z.len=function(x){return Z.aggNums(function(A){return A+1},0,x)},Z.mean=function(x,A){return A||(A=Z.len(x)),Z.aggNums(function(M,e){return M+e},0,x)/A},Z.geometricMean=function(x,A){return A||(A=Z.len(x)),Math.pow(Z.aggNums(function(M,e){return M*e},1,x),1/A)},Z.midRange=function(x){if(!(x===void 0||x.length===0))return(Z.aggNums(Math.max,null,x)+Z.aggNums(Math.min,null,x))/2},Z.variance=function(x,A,M){return A||(A=Z.len(x)),q(M)||(M=Z.mean(x,A)),Z.aggNums(function(e,t){return e+Math.pow(t-M,2)},0,x)/A},Z.stdev=function(x,A,M){return Math.sqrt(Z.variance(x,A,M))},Z.median=function(x){var A=x.slice().sort();return Z.interp(A,.5)},Z.interp=function(x,A){if(!q(A))throw"n should be a finite number";if(A=A*x.length-.5,A<0)return x[0];if(A>x.length-1)return x[x.length-1];var M=A%1;return M*x[Math.ceil(A)]+(1-M)*x[Math.floor(A)]}}}),HF=Ze({"src/lib/angles.js"(Z,q){"use strict";var v=Yy(),x=v.mod,A=v.modHalf,M=Math.PI,e=2*M;function t(T){return T/180*M}function r(T){return T/M*180}function i(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function n(T,l){return Math.abs(a(T,l))}function o(T,l){if(i(l))return!0;var _,w;l[0]<l[1]?(_=l[0],w=l[1]):(_=l[1],w=l[0]),_=x(_,e),w=x(w,e),_>w&&(w+=e);var S=x(T,e),E=S+e;return S>=_&&S<=w||E>=_&&E<=w}function s(T,l,_,w){if(!o(l,w))return!1;var S,E;return _[0]<_[1]?(S=_[0],E=_[1]):(S=_[1],E=_[0]),T>=S&&T<=E}function c(T,l,_,w,S,E,g){S=S||0,E=E||0;var b=i([_,w]),p,u,y,f,P;b?(p=0,u=M,y=e):_<w?(p=_,y=w):(p=w,y=_),T<l?(f=T,P=l):(f
|
|||
|
`);if(Ur!==-1&&(Kr=Gr.substr(Ur+1),Gr=Gr.substr(0,Ur)),Or&&(Kr!==void 0&&(Gr==="00:00:00"||Gr==="00:00")?(Gr=Kr,Kr=""):Gr.length===8&&(Gr=Gr.replace(/:00$/,""))),Kr)if(Nr)Rr==="d"?Gr+=", "+Kr:Gr=Kr+(Gr?", "+Gr:"");else if(!xt._inCalcTicks||xt._prevDateHead!==Kr)xt._prevDateHead=Kr,Gr+="<br>"+Kr;else{var aa=Ia(xt),da=xt._trueSide||xt.side;(!aa&&da==="top"||aa&&da==="bottom")&&(Gr+="<br> ")}ct.text=Gr}function Ir(xt,ct,Nr,Or,Rr){var Lr=xt.dtick,Gr=ct.x,Kr=xt.tickformat,Ur=typeof Lr=="string"&&Lr.charAt(0);if(Rr==="never"&&(Rr=""),Or&&Ur!=="L"&&(Lr="L3",Ur="L"),Kr||Ur==="L")ct.text=Pe(Math.pow(10,Gr),xt,Rr,Or);else if(x(Lr)||Ur==="D"&&(xt.minorloglabels==="complete"||e.mod(Gr+.01,1)<.1)){var aa;xt.minorloglabels==="complete"&&!(e.mod(Gr+.01,1)<.1)&&(aa=!0,ct.fontSize*=.75);var da=Math.pow(10,Gr).toExponential(0),fa=da.split("e"),It=+fa[1],dr=Math.abs(It),kr=xt.exponentformat;kr==="power"||Ce(kr)&&Te(It)?(ct.text=fa[0],dr>0&&(ct.text+="x10"),ct.text==="1x10"&&(ct.text="10"),It!==0&&It!==1&&(ct.text+="<sup>"+(It>0?"":z)+dr+"</sup>"),ct.fontSize*=1.25):(kr==="e"||kr==="E")&&dr>2?ct.text=fa[0]+kr+(It>0?"+":z)+dr:(ct.text=Pe(Math.pow(10,Gr),xt,"","fakehover"),Lr==="D1"&&xt._id.charAt(0)==="y"&&(ct.dy-=ct.fontSize/6))}else if(Ur==="D")ct.text=xt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Gr,1)))),ct.fontSize*=.75;else throw"unrecognized dtick "+String(Lr);if(xt.dtick==="D1"){var na=String(ct.text).charAt(0);(na==="0"||na==="1")&&(xt._id.charAt(0)==="y"?ct.dx-=ct.fontSize/4:(ct.dy+=ct.fontSize/2,ct.dx+=(xt.range[1]>xt.range[0]?1:-1)*ct.fontSize*(Gr<0?.5:.25)))}}function bt(xt,ct){var Nr=xt._categories[Math.round(ct.x)];Nr===void 0&&(Nr=""),ct.text=String(Nr)}function Be(xt,ct,Nr){var Or=Math.round(ct.x),Rr=xt._categories[Or]||[],Lr=Rr[1]===void 0?"":String(Rr[1]),Gr=Rr[0]===void 0?"":String(Rr[0]);Nr?ct.text=Gr+" - "+Lr:(ct.text=Lr,ct.text2=Gr)}function Ke(xt,ct,Nr,Or,Rr){Rr==="never"?Rr="":xt.showexponent==="all"&&Math.abs(ct.x/xt.dtick)<1e-6&&(Rr="hide"),ct.text=Pe(ct.x,xt,Rr,Or)}function Ue(xt,ct,Nr,Or,Rr){if(xt.thetaunit==="radians"&&!Nr){var Lr=ct.x/180;if(Lr===0)ct.text="0";else{var Gr=Ee(Lr);if(Gr[1]>=100)ct.text=Pe(e.deg2rad(ct.x),xt,Rr,Or);else{var Kr=ct.x<0;Gr[1]===1?Gr[0]===1?ct.text="\u03C0":ct.text=Gr[0]+"\u03C0":ct.text=["<sup>",Gr[0],"</sup>","\u2044","<sub>",Gr[1],"</sub>","\u03C0"].join(""),Kr&&(ct.text=z+ct.text)}}}else ct.text=Pe(ct.x,xt,Rr,Or)}function Ee(xt){function ct(Kr,Ur){return Math.abs(Kr-Ur)<=1e-6}function Nr(Kr,Ur){return ct(Ur,0)?Kr:Nr(Ur,Kr%Ur)}function Or(Kr){for(var Ur=1;!ct(Math.round(Kr*Ur)/Ur,Kr);)Ur*=10;return Ur}var Rr=Or(xt),Lr=xt*Rr,Gr=Math.abs(Nr(Lr,Rr));return[Math.round(Lr/Gr),Math.round(Rr/Gr)]}var Ve=["f","p","n","\u03BC","m","","k","M","G","T"];function Ce(xt){return xt==="SI"||xt==="B"}function Te(xt){return xt>14||xt<-15}function Pe(xt,ct,Nr,Or){var Rr=xt<0,Lr=ct._tickround,Gr=Nr||ct.exponentformat||"B",Kr=ct._tickexponent,Ur=J.getTickFormat(ct),aa=ct.separatethousands;if(Or){var da={exponentformat:Gr,minexponent:ct.minexponent,dtick:ct.showexponent==="none"?ct.dtick:x(xt)&&Math.abs(xt)||1,range:ct.showexponent==="none"?ct.range.map(ct.r2d):[0,xt||1]};xr(da),Lr=(Number(da._tickround)||0)+4,Kr=da._tickexponent,ct.hoverformat&&(Ur=ct.hoverformat)}if(Ur)return ct._numFormat(Ur)(xt).replace(/-/g,z);var fa=Math.pow(10,-Lr)/2;if(Gr==="none"&&(Kr=0),xt=Math.abs(xt),xt<fa)xt="0",Rr=!1;else{if(xt+=fa,Kr&&(xt*=Math.pow(10,-Kr),Lr+=Kr),Lr===0)xt=String(Math.floor(xt));else if(Lr<0){xt=String(Math.round(xt)),xt=xt.substr(0,xt.length+Lr);for(var It=Lr;It<0;It++)xt+="0"}else{xt=String(xt);var dr=xt.indexOf(".")+1;dr&&(xt=xt.substr(0,dr+Lr).replace(/\.?0+$/,""))}xt=e.numSeparate(xt,ct._separators,aa)}if(Kr&&Gr!=="hide"){Ce(Gr)&&Te(Kr)&&(Gr="power");var kr;Kr<0?kr=z+-Kr:Gr!=="power"?kr="+"+Kr:kr=String(Kr),Gr==="e"||Gr==="E"?xt+=Gr+kr:Gr==="power"?xt+="\xD710<sup>"+kr+"</sup>":Gr==="B"&&Kr===9?xt+="B":Ce(Gr)&&(xt+=Ve[Kr/3+5])}return Rr?z+xt:xt}J.getTickFormat=function(xt){var ct;function Nr(Ur){return typeof Ur!="string"?Ur:Number(Ur.replace("M",""))*S}function Or(Ur,aa){var da
|
|||
|
`));var tt;se.med!==e?tt=se.med:se.q1!==e?se.q3!==e?tt=(se.q1+se.q3)/2:tt=se.q1:se.q3!==e?tt=se.q3:tt=0,se.med=tt,se.q1=se.q3=tt,se.lf=se.uf=tt,se.mean=se.sd=tt,se.ln=se.un=tt,se.min=se.max=tt}ee=Math.min(ee,se.min),re=Math.max(re,se.max),se.pts2=he.filter(oe),u.push(se)}}E._extremes[L._id]=x.findExtremes(L,[ee,re],{padded:!0})}else{var ut=L.makeCalcdata(E,z),Me=i(Q,ue),_e=Q.length,fe=a(_e);for(f=0;f<E._length;f++)if(X=ut[f],!!v(X)){var Fe=M.findBin(N[f],Me);Fe>=0&&Fe<_e&&(J={v:X,i:f},o(J,E,f),fe[Fe].push(J))}var rt=1/0,st=-1/0,Qe=E.quartilemethod,Lt=Qe==="exclusive",kt=Qe==="inclusive";for(f=0;f<_e;f++)if(fe[f].length>0){if(se={},se.pos=se[B]=Q[f],he=se.pts=fe[f].sort(c),H=se[z]=he.map(h),$=H.length,se.min=H[0],se.max=H[$-1],se.mean=M.mean(H,$),se.sd=M.stdev(H,$,se.mean)*E.sdmultiple,se.med=M.interp(H,.5),$%2&&(Lt||kt)){var qt,Zt;Lt?(qt=H.slice(0,$/2),Zt=H.slice($/2+1)):kt&&(qt=H.slice(0,$/2+1),Zt=H.slice($/2)),se.q1=M.interp(qt,.5),se.q3=M.interp(Zt,.5)}else se.q1=M.interp(H,.25),se.q3=M.interp(H,.75);se.lf=m(se,H,$),se.uf=d(se,H,$),se.lo=T(se),se.uo=l(se);var Sr=_(se,$);se.ln=se.med-Sr,se.un=se.med+Sr,rt=Math.min(rt,se.ln),st=Math.max(st,se.un),se.pts2=he.filter(oe),u.push(se)}E.notched&&M.isTypedArray(ut)&&(ut=Array.from(ut)),E._extremes[L._id]=x.findExtremes(L,E.notched?ut.concat([rt,st]):ut,{padded:!0})}return s(u,E),u.length>0?(u[0].t={num:g[y],dPos:ue,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:E.boxmean==="sd"||E.sizemode==="sd"?t(S,"mean \xB1 \u03C3:").replace("\u03C3",E.sdmultiple===1?"\u03C3":E.sdmultiple+"\u03C3"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},g[y]++,u):[{t:{empty:!0}}]};function r(w,S,E,g){var b=S in w,p=S+"0"in w,u="d"+S in w;if(b||p&&u){var y=E.makeCalcdata(w,S),f=A(w,E,S,y).vals;return[f,y]}var P;p?P=w[S+"0"]:"name"in w&&(E.type==="category"||v(w.name)&&["linear","log"].indexOf(E.type)!==-1||M.isDateTime(w.name)&&E.type==="date")?P=w.name:P=g;for(var L=E.type==="multicategory"?E.r2c_just_indices(P):E.d2c(P,0,w[S+"calendar"]),z=w._length,F=new Array(z),B=0;B<z;B++)F[B]=L;return[F]}function i(w,S){for(var E=w.length,g=new Array(E+1),b=0;b<E;b++)g[b]=w[b]-S;return g[E]=w[E-1]+S,g}function a(w){for(var S=new Array(w),E=0;E<w;E++)S[E]=[];return S}var n={text:"tx",hovertext:"htx"};function o(w,S,E){for(var g in n)M.isArrayOrTypedArray(S[g])&&(Array.isArray(E)?M.isArrayOrTypedArray(S[g][E[0]])&&(w[n[g]]=S[g][E[0]][E[1]]):w[n[g]]=S[g][E])}function s(w,S){if(M.isArrayOrTypedArray(S.selectedpoints))for(var E=0;E<w.length;E++){for(var g=w[E].pts||[],b={},p=0;p<g.length;p++)b[g[p].i]=p;M.tagSelected(g,S,b)}}function c(w,S){return w.v-S.v}function h(w){return w.v}function m(w,S,E){return E===0?w.q1:Math.min(w.q1,S[Math.min(M.findBin(2.5*w.q1-1.5*w.q3,S,!0)+1,E-1)])}function d(w,S,E){return E===0?w.q3:Math.max(w.q3,S[Math.max(M.findBin(2.5*w.q3-1.5*w.q1,S),0)])}function T(w){return 4*w.q1-3*w.q3}function l(w){return 4*w.q3-3*w.q1}function _(w,S){return S===0?0:1.57*(w.q3-w.q1)/Math.sqrt(S)}}}),G2=Ze({"src/traces/box/cross_trace_calc.js"(Z,q){"use strict";var v=Wo(),x=ca(),A=Yg().getAxisGroup,M=["v","h"];function e(r,i){for(var a=r.calcdata,n=i.xaxis,o=i.yaxis,s=0;s<M.length;s++){for(var c=M[s],h=c==="h"?o:n,m=[],d=0;d<a.length;d++){var T=a[d],l=T[0].t,_=T[0].trace;_.visible===!0&&(_.type==="box"||_.type==="candlestick")&&!l.empty&&(_.orientation||"v")===c&&_.xaxis===n._id&&_.yaxis===o._id&&m.push(d)}t("box",r,m,h)}}function t(r,i,a,n){var o=i.calcdata,s=i._fullLayout,c=n._id,h=c.charAt(0),m,d,T,l=[],_=0;for(m=0;m<a.length;m++)for(T=o[a[m]],d=0;d<T.length;d++)l.push(n.c2l(T[d].pos,!0)),_+=(T[d].pts2||[]).length;if(l.length){var w=x.distinctVals(l);(n.type==="category"||n.type==="multicategory")&&(w.minDiff=1);var S=w.minDiff/2;v.minDtick(n,w.minDiff,w.vals[0],!0);var E=r==="violin"?"_numViolins":"_numBoxes",g=s[E],b=s[r+"mode"]==="group"&&g>1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(m=0;m<a.length;m++){T=o[a[m]];var y=T[0].trace,f=T[0].t,P=y.width,L=y.side,z,F,B,O;if(P)z=F=O=P/2,B=0;else if(z=S,b){var I=A(s,n._id)+y.or
|
|||
|
`)>-1&&(he?$=$.split(`
|
|||
|
`).map(function(X){return" "+X}).join(`
|
|||
|
`).slice(2):$=`
|
|||
|
`+$.split(`
|
|||
|
`).map(function(X){return" "+X}).join(`
|
|||
|
`))):$=U.stylize("[Circular]","special")),E(H)){if(he&&se.match(/^\d+$/))return $;H=JSON.stringify(""+se),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+$}function h(U,W,Q){var ue=0,se=U.reduce(function(he,H){return ue++,H.indexOf(`
|
|||
|
`)>=0&&ue++,he+H.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+`
|
|||
|
`)+" "+U.join(`,
|
|||
|
`)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=qM();function m(U){return Array.isArray(U)}Z.isArray=m;function d(U){return typeof U=="boolean"}Z.isBoolean=d;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function E(U){return U===void 0}Z.isUndefined=E;function g(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function p(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=p,Z.types.isDate=p;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function y(U){return typeof U=="function"}Z.isFunction=y;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=GM();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Yv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),ue=Q.length;ue--;)U[Q[ue]]=W[Q[ue]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,se,he=new Promise(function(J,X){ue=J,se=X}),H=[],$=0;$<arguments.length;$++)H.push(arguments[$]);H.push(function(J,X){J?se(J):ue(X)});try{W.apply(this,H)}catch(J){se(J)}return he}return Object.setPrototypeOf(Q,Object.getPrototypeOf(W)),O&&Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,q(W))},Z.promisify.custom=O;function I(U,W){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return W(U)}function N(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function W(){for(var Q=[],ue=0;ue<arguments.length;ue++)Q.push(arguments[ue]);var se=Q.pop();if(typeof se!="function")throw new TypeError("The last argument must be of type Function");var he=this,H=function(){return se.apply(he,arguments)};U.apply(this,Q).then(function($){process.nextTick(H.bind(null,null,$))},function($){process.nextTick(I.bind(null,$,H))})}return Object.setPrototypeOf(W,Object.getPrototypeOf(U)),Object.defineProperties(W,q(U)),W}Z.callbackify=N}}),U7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(Z,q){"use strict";function v(c,h){var m=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);h&&(d=d.filter(function(T){return Object.getOwnPropertyDescriptor(c,T).enumerable})),m.push.apply(m,d)}return m}function x(c){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?v(Object(m),!0).forEach(function(d){A(c,d,m[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(m)):v(Object(m)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(m,d))})}return c}function A(c,h,m){return h in c?Object.defineProperty(c,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):c[h]=m,c}function M(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function e(c,h){for(var m=0;m<h.length;m++){var d=h[m];d.enumerable=d.enumerable
|
|||
|
`)>-1&&(he?$=$.split(`
|
|||
|
`).map(function(X){return" "+X}).join(`
|
|||
|
`).slice(2):$=`
|
|||
|
`+$.split(`
|
|||
|
`).map(function(X){return" "+X}).join(`
|
|||
|
`))):$=U.stylize("[Circular]","special")),E(H)){if(he&&se.match(/^\d+$/))return $;H=JSON.stringify(""+se),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+$}function h(U,W,Q){var ue=0,se=U.reduce(function(he,H){return ue++,H.indexOf(`
|
|||
|
`)>=0&&ue++,he+H.replace(/\u001b\[\d\d?m/g,"").length+1},0);return se>60?Q[0]+(W===""?"":W+`
|
|||
|
`)+" "+U.join(`,
|
|||
|
`)+" "+Q[1]:Q[0]+W+" "+U.join(", ")+" "+Q[1]}Z.types=qM();function m(U){return Array.isArray(U)}Z.isArray=m;function d(U){return typeof U=="boolean"}Z.isBoolean=d;function T(U){return U===null}Z.isNull=T;function l(U){return U==null}Z.isNullOrUndefined=l;function _(U){return typeof U=="number"}Z.isNumber=_;function w(U){return typeof U=="string"}Z.isString=w;function S(U){return typeof U=="symbol"}Z.isSymbol=S;function E(U){return U===void 0}Z.isUndefined=E;function g(U){return b(U)&&P(U)==="[object RegExp]"}Z.isRegExp=g,Z.types.isRegExp=g;function b(U){return typeof U=="object"&&U!==null}Z.isObject=b;function p(U){return b(U)&&P(U)==="[object Date]"}Z.isDate=p,Z.types.isDate=p;function u(U){return b(U)&&(P(U)==="[object Error]"||U instanceof Error)}Z.isError=u,Z.types.isNativeError=u;function y(U){return typeof U=="function"}Z.isFunction=y;function f(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Z.isPrimitive=f,Z.isBuffer=GM();function P(U){return Object.prototype.toString.call(U)}function L(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,W=[L(U.getHours()),L(U.getMinutes()),L(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],W].join(" ")}Z.log=function(){console.log("%s - %s",F(),Z.format.apply(Z,arguments))},Z.inherits=Yv(),Z._extend=function(U,W){if(!W||!b(W))return U;for(var Q=Object.keys(W),ue=Q.length;ue--;)U[Q[ue]]=W[Q[ue]];return U};function B(U,W){return Object.prototype.hasOwnProperty.call(U,W)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(W){if(typeof W!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&W[O]){var Q=W[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,se,he=new Promise(function(J,X){ue=J,se=X}),H=[],$=0;$<arguments.length;$++)H.push(arguments[$]);H.push(function(J,X){J?se(J):ue(X)});try{W.apply(this,H)}catch(J){se(J)}return he}return Object.setPrototypeOf(Q,Object.getPrototypeOf(W)),O&&Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,q(W))},Z.promisify.custom=O;function I(U,W){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return W(U)}function N(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function W(){for(var Q=[],ue=0;ue<arguments.length;ue++)Q.push(arguments[ue]);var se=Q.pop();if(typeof se!="function")throw new TypeError("The last argument must be of type Function");var he=this,H=function(){return se.apply(he,arguments)};U.apply(this,Q).then(function($){process.nextTick(H.bind(null,null,$))},function($){process.nextTick(I.bind(null,$,H))})}return Object.setPrototypeOf(W,Object.getPrototypeOf(U)),Object.defineProperties(W,q(U)),W}Z.callbackify=N}}),$M=Ze({"node_modules/assert/build/internal/errors.js"(Z,q){"use strict";function v(E){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},v(E)}function x(E,g){for(var b=0;b<g.length;b++){var p=g[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,M(p.key),p)}}function A(E,g,b){return g&&x(E.prototype,g),b&&x(E,b),Object.defineProperty(E,"prototype",{writable:!1}),E}function M(E){var g=e(E,"string");return v(g)==="symbol"?g:String(g)}function e(E,g){if(v(E)!=="object"||E===null)return E;var b=E[Symbol.toPrimitive];if(b!==void 0){var p=b.call(E,g||"default");if(v(p)!=="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(E)}function t(E,g){if(!(E instanceof g))throw new TypeE
|
|||
|
`),X=B(U).split(`
|
|||
|
`),oe=0,ne="";if(W==="strictEqual"&&_(N)==="object"&&_(U)==="object"&&N!==null&&U!==null&&(W="strictEqualObject"),J.length===1&&X.length===1&&J[0]!==X[0]){var j=J[0].length+X[0].length;if(j<=z){if((_(N)!=="object"||N===null)&&(_(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(L[W],`
|
|||
|
|
|||
|
`)+"".concat(J[0]," !== ").concat(X[0],`
|
|||
|
`)}else if(W!=="strictEqualObject"){var ee=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(j<ee){for(;J[0][oe]===X[0][oe];)oe++;oe>2&&(ne=`
|
|||
|
`.concat(p(" ",oe),"^"),oe=0)}}}for(var re=J[J.length-1],ce=X[X.length-1];re===ce&&(oe++<2?he=`
|
|||
|
`.concat(re).concat(he):Q=re,J.pop(),X.pop(),!(J.length===0||X.length===0));)re=J[J.length-1],ce=X[X.length-1];var be=Math.max(J.length,X.length);if(be===0){var Ae=$.split(`
|
|||
|
`);if(Ae.length>30)for(Ae[26]="".concat(u,"...").concat(P);Ae.length>27;)Ae.pop();return"".concat(L.notIdentical,`
|
|||
|
|
|||
|
`).concat(Ae.join(`
|
|||
|
`),`
|
|||
|
`)}oe>3&&(he=`
|
|||
|
`.concat(u,"...").concat(P).concat(he),H=!0),Q!==""&&(he=`
|
|||
|
`.concat(Q).concat(he),Q="");var ze=0,Re=L[W]+`
|
|||
|
`.concat(y,"+ actual").concat(P," ").concat(f,"- expected").concat(P),We=" ".concat(u,"...").concat(P," Lines skipped");for(oe=0;oe<be;oe++){var it=oe-se;if(J.length<oe+1)it>1&&oe>2&&(it>4?(ue+=`
|
|||
|
`.concat(u,"...").concat(P),H=!0):it>3&&(ue+=`
|
|||
|
`.concat(X[oe-2]),ze++),ue+=`
|
|||
|
`.concat(X[oe-1]),ze++),se=oe,Q+=`
|
|||
|
`.concat(f,"-").concat(P," ").concat(X[oe]),ze++;else if(X.length<oe+1)it>1&&oe>2&&(it>4?(ue+=`
|
|||
|
`.concat(u,"...").concat(P),H=!0):it>3&&(ue+=`
|
|||
|
`.concat(J[oe-2]),ze++),ue+=`
|
|||
|
`.concat(J[oe-1]),ze++),se=oe,ue+=`
|
|||
|
`.concat(y,"+").concat(P," ").concat(J[oe]),ze++;else{var ot=X[oe],tt=J[oe],ut=tt!==ot&&(!b(tt,",")||tt.slice(0,-1)!==ot);ut&&b(ot,",")&&ot.slice(0,-1)===tt&&(ut=!1,tt+=","),ut?(it>1&&oe>2&&(it>4?(ue+=`
|
|||
|
`.concat(u,"...").concat(P),H=!0):it>3&&(ue+=`
|
|||
|
`.concat(J[oe-2]),ze++),ue+=`
|
|||
|
`.concat(J[oe-1]),ze++),se=oe,ue+=`
|
|||
|
`.concat(y,"+").concat(P," ").concat(tt),Q+=`
|
|||
|
`.concat(f,"-").concat(P," ").concat(ot),ze+=2):(ue+=Q,Q="",(it===1||oe===0)&&(ue+=`
|
|||
|
`.concat(tt),ze++))}if(ze>20&&oe<be-2)return"".concat(Re).concat(We,`
|
|||
|
`).concat(ue,`
|
|||
|
`).concat(u,"...").concat(P).concat(Q,`
|
|||
|
`)+"".concat(u,"...").concat(P)}return"".concat(Re).concat(H?We:"",`
|
|||
|
`).concat(ue).concat(Q).concat(he).concat(ne)}var I=function(N,U){a(Q,N);var W=n(Q);function Q(ue){var se;if(M(this,Q),_(ue)!=="object"||ue===null)throw new g("options","Object",ue);var he=ue.message,H=ue.operator,$=ue.stackStartFn,J=ue.actual,X=ue.expected,oe=Error.stackTraceLimit;if(Error.stackTraceLimit=0,he!=null)se=W.call(this,String(he));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(u="\x1B[34m",y="\x1B[32m",P="\x1B[39m",f="\x1B[31m"):(u="",y="",P="",f="")),_(J)==="object"&&J!==null&&_(X)==="object"&&X!==null&&"stack"in J&&J instanceof Error&&"stack"in X&&X instanceof Error&&(J=F(J),X=F(X)),H==="deepStrictEqual"||H==="strictEqual")se=W.call(this,O(J,X,H));else if(H==="notDeepStrictEqual"||H==="notStrictEqual"){var ne=L[H],j=B(J).split(`
|
|||
|
`);if(H==="notStrictEqual"&&_(J)==="object"&&J!==null&&(ne=L.notStrictEqualObject),j.length>30)for(j[26]="".concat(u,"...").concat(P);j.length>27;)j.pop();j.length===1?se=W.call(this,"".concat(ne," ").concat(j[0])):se=W.call(this,"".concat(ne,`
|
|||
|
|
|||
|
`).concat(j.join(`
|
|||
|
`),`
|
|||
|
`))}else{var ee=B(J),re="",ce=L[H];H==="notDeepEqual"||H==="notEqual"?(ee="".concat(L[H],`
|
|||
|
|
|||
|
`).concat(ee),ee.length>1024&&(ee="".concat(ee.slice(0,1021),"..."))):(re="".concat(B(X)),ee.length>512&&(ee="".concat(ee.slice(0,509),"...")),re.length>512&&(re="".concat(re.slice(0,509),"...")),H==="deepEqual"||H==="equal"?ee="".concat(ce,`
|
|||
|
|
|||
|
`).concat(ee,`
|
|||
|
|
|||
|
should equal
|
|||
|
|
|||
|
`):re=" ".concat(H," ").concat(re)),se=W.call(this,"".concat(ee).concat(re))}return Error.stackTraceLimit=oe,se.generatedMessage=!he,Object.defineProperty(s(se),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),se.code="ERR_ASSERTION",se.actual=J,se.expected=X,se.operator=H,Error.captureStackTrace&&Error.captureStackTrace(s(se),$),se.stack,se.name="AssertionError",o(se)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(se,he){return S(this,x(x({},he),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);q.exports=I}}),QM=Ze({"node_modules/object-keys/isArguments.js"(Z,q){"use strict";var v=Object.prototype.toString;q.exports=function(A){var M=v.call(A),e=M==="[object Arguments]";return e||(e=M!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&v.call(A.callee)==="[object Function]"),e}}}),Y7=Ze({"node_modules/object-keys/implementation.js"(Z,q){"use strict";var v;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,M=QM(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var h=c.constructor;return h&&h.prototype===c},n={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},o=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!n["$"+c]&&x.call(window,c)&&window[c]!==null&&typeof window[c]=="object")try{a(window[c])}catch{return!0}}catch{return!0}return!1}(),s=function(c){if(typeof window>"u"||!o)return a(c);try{return a(c)}catch{return!1}},v=function(h){var m=h!==null&&typeof h=="object",d=A.call(h)==="[object Function]",T=M(h),l=m&&A.call(h)==="[object String]",_=[];if(!m&&!d&&!T)throw new TypeError("Object.keys called on a non-object");var w=r&&d;if(l&&h.length>0&&!x.call(h,0))for(var S=0;S<h.length;++S)_.push(String(S));if(T&&h.length>0)for(var E=0;E<h.length;++E)_.push(String(E));else for(var g in h)!(w&&g==="prototype")&&x.call(h,g)&&_.push(String(g));if(t)for(var b=s(h),p=0;p<i.length;++p)!(b&&i[p]==="constructor")&&x.call(h,i[p])&&_.push(i[p]);return _});var x,A,M,e,t,r,i,a,n,o,s;q.exports=v}}),eE=Ze({"node_modules/object-keys/index.js"(Z,q){"use strict";var v=Array.prototype.slice,x=QM(),A=Object.keys,M=A?function(r){return A(r)}:Y7(),e=Object.keys;M.shim=function(){if(Object.keys){var r=function(){var i=Object.keys(arguments);return i&&i.length===arguments.length}(1,2);r||(Object.keys=function(a){return x(a)?e(v.call(a)):e(a)})}else Object.keys=M;return Object.keys||M},q.exports=M}}),K7=Ze({"node_modules/object.assign/implementation.js"(Z,q){"use strict";var v=eE(),x=p3()(),A=y1(),M=Object,e=A("Array.prototype.push"),t=A("Object.prototype.propertyIsEnumerable"),r=x?Object.getOwnPropertySymbols:null;q.exports=function(a,n){if(a==null)throw new TypeError("target must be an object");var o=M(a);if(arguments.length===1)return o;for(var s=1;s<arguments.length;++s){var c=M(arguments[s]),h=v(c),m=x&&(Object.getOwnPropertySymbols||r);if(m)for(var d=m(c),T=0;T<d.length;++T){var l=d[T];t(c,l)&&e(h,l)}for(var _=0;_<h.length;++_){var w=h[_];if(t(c,w)){var S=c[w];o[w]=S}}}return o}}}),J7=Ze({"node_modules/object.assign/polyfill.js"(Z,q){"use strict";var v=K7(),x=function(){if(!Object.assign)return!1;for(var M="abcdefghijklmnopqrst",e=M.split(""),t={},r=0;r<e.length;++r)t[e[r]]=e[r];var i=Object.assign({},t),a="";for(var n in i)a+=n;return M!==a},A=function(){if(!Object.assign||!Object.preventExtensions)return!1;var M=Object.preventExtensions({1:2});try{Object.assign(M,"xy")}catch{return M[1]==="y"}return!1};q.exports=function(){
|
|||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(Me,_e){if(Me){if(typeof Me=="string")return M(Me,_e);var fe=Object.prototype.toString.call(Me).slice(8,-1);if(fe==="Object"&&Me.constructor&&(fe=Me.constructor.name),fe==="Map"||fe==="Set")return Array.from(Me);if(fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe))return M(Me,_e)}}function M(Me,_e){(_e==null||_e>Me.length)&&(_e=Me.length);for(var fe=0,Fe=new Array(_e);fe<_e;fe++)Fe[fe]=Me[fe];return Fe}function e(Me,_e){var fe=Me==null?null:typeof Symbol<"u"&&Me[Symbol.iterator]||Me["@@iterator"];if(fe!=null){var Fe,rt,st,Qe,Lt=[],kt=!0,qt=!1;try{if(st=(fe=fe.call(Me)).next,_e===0){if(Object(fe)!==fe)return;kt=!1}else for(;!(kt=(Fe=st.call(fe)).done)&&(Lt.push(Fe.value),Lt.length!==_e);kt=!0);}catch(Zt){qt=!0,rt=Zt}finally{try{if(!kt&&fe.return!=null&&(Qe=fe.return(),Object(Qe)!==Qe))return}finally{if(qt)throw rt}}return Lt}}function t(Me){if(Array.isArray(Me))return Me}function r(Me){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_e){return typeof _e}:function(_e){return _e&&typeof Symbol=="function"&&_e.constructor===Symbol&&_e!==Symbol.prototype?"symbol":typeof _e},r(Me)}var i=/a/g.flags!==void 0,a=function(_e){var fe=[];return _e.forEach(function(Fe){return fe.push(Fe)}),fe},n=function(_e){var fe=[];return _e.forEach(function(Fe,rt){return fe.push([rt,Fe])}),fe},o=Object.is?Object.is:Q7(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:t9();function h(Me){return Me.call.bind(Me)}var m=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),T=h(Object.prototype.toString),l=_1().types,_=l.isAnyArrayBuffer,w=l.isArrayBufferView,S=l.isDate,E=l.isMap,g=l.isRegExp,b=l.isSet,p=l.isNativeError,u=l.isBoxedPrimitive,y=l.isNumberObject,f=l.isStringObject,P=l.isBooleanObject,L=l.isBigIntObject,z=l.isSymbolObject,F=l.isFloat32Array,B=l.isFloat64Array;function O(Me){if(Me.length===0||Me.length>10)return!0;for(var _e=0;_e<Me.length;_e++){var fe=Me.charCodeAt(_e);if(fe<48||fe>57)return!0}return Me.length===10&&Me>=Math.pow(2,32)}function I(Me){return Object.keys(Me).filter(O).concat(s(Me).filter(Object.prototype.propertyIsEnumerable.bind(Me)))}function N(Me,_e){if(Me===_e)return 0;for(var fe=Me.length,Fe=_e.length,rt=0,st=Math.min(fe,Fe);rt<st;++rt)if(Me[rt]!==_e[rt]){fe=Me[rt],Fe=_e[rt];break}return fe<Fe?-1:Fe<fe?1:0}var U=void 0,W=!0,Q=!1,ue=0,se=1,he=2,H=3;function $(Me,_e){return i?Me.source===_e.source&&Me.flags===_e.flags:RegExp.prototype.toString.call(Me)===RegExp.prototype.toString.call(_e)}function J(Me,_e){if(Me.byteLength!==_e.byteLength)return!1;for(var fe=0;fe<Me.byteLength;fe++)if(Me[fe]!==_e[fe])return!1;return!0}function X(Me,_e){return Me.byteLength!==_e.byteLength?!1:N(new Uint8Array(Me.buffer,Me.byteOffset,Me.byteLength),new Uint8Array(_e.buffer,_e.byteOffset,_e.byteLength))===0}function oe(Me,_e){return Me.byteLength===_e.byteLength&&N(new Uint8Array(Me),new Uint8Array(_e))===0}function ne(Me,_e){return y(Me)?y(_e)&&o(Number.prototype.valueOf.call(Me),Number.prototype.valueOf.call(_e)):f(Me)?f(_e)&&String.prototype.valueOf.call(Me)===String.prototype.valueOf.call(_e):P(Me)?P(_e)&&Boolean.prototype.valueOf.call(Me)===Boolean.prototype.valueOf.call(_e):L(Me)?L(_e)&&BigInt.prototype.valueOf.call(Me)===BigInt.prototype.valueOf.call(_e):z(_e)&&Symbol.prototype.valueOf.call(Me)===Symbol.prototype.valueOf.call(_e)}function j(Me,_e,fe,Fe){if(Me===_e)return Me!==0?!0:fe?o(Me,_e):!0;if(fe){if(r(Me)!=="object")return typeof Me=="number"&&c(Me)&&c(_e);if(r(_e)!=="object"||Me===null||_e===null||Object.getPrototypeOf(Me)!==Object.getPrototypeOf(_e))return!1}else{if(Me===null||r(Me)!=="object")return _e===null||r(_e)!=="object"?Me==_e:!1;if(_e===null||r(_e)!=="object")return!1}var rt=T(Me),st=T(_e);if(rt!==st)return!1;if(Array.isArray(Me)){if(Me.length!==_e.length)return!1;var Qe=I(Me,U),Lt=I(_e,U);return Qe.length!==Lt.length?!1:re(Me,_e,fe,Fe,se,Qe)}if(rt==="[object Object]
|
|||
|
`)+'Actual message: "'.concat(J&&J.message,'"'),stackStartFn:$})}throw J}}y.throws=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];ue.apply(void 0,[$,U(J)].concat(oe))},y.rejects=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];return Q(J).then(function(j){return ue.apply(void 0,[$,j].concat(oe))})},y.doesNotThrow=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];se.apply(void 0,[$,U(J)].concat(oe))},y.doesNotReject=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];return Q(J).then(function(j){return se.apply(void 0,[$,j].concat(oe))})},y.ifError=function $(J){if(J!=null){var X="ifError got unwanted exception: ";v(J)==="object"&&typeof J.message=="string"?J.message.length===0&&J.constructor?X+=J.constructor.name:X+=J.message:X+=d(J);var oe=new h({actual:J,expected:null,operator:"ifError",message:X,stackStartFn:$}),ne=J.stack;if(typeof ne=="string"){var j=ne.split(`
|
|||
|
`);j.shift();for(var ee=oe.stack.split(`
|
|||
|
`),re=0;re<j.length;re++){var ce=ee.indexOf(j[re]);if(ce!==-1){ee=ee.slice(0,ce);break}}oe.stack="".concat(ee.join(`
|
|||
|
`),`
|
|||
|
`).concat(j.join(`
|
|||
|
`))}throw oe}};function he($,J,X,oe,ne){if(!_(J))throw new n("regexp","RegExp",J);var j=ne==="match";if(typeof $!="string"||E(J,$)!==j){if(X instanceof Error)throw X;var ee=!X;X=X||(typeof $!="string"?'The "string" argument must be of type string. Received type '+"".concat(v($)," (").concat(d($),")"):(j?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(d(J),`. Input:
|
|||
|
|
|||
|
`).concat(d($),`
|
|||
|
`));var re=new h({actual:$,expected:J,message:X,operator:ne,stackStartFn:oe});throw re.generatedMessage=ee,re}}y.match=function $(J,X,oe){he(J,X,oe,$,"match")},y.doesNotMatch=function $(J,X,oe){he(J,X,oe,$,"doesNotMatch")};function H(){for(var $=arguments.length,J=new Array($),X=0;X<$;X++)J[X]=arguments[X];z.apply(void 0,[H,J.length].concat(J))}y.strict=w(H,y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict}}),a9=Ze({"node_modules/stream-parser/node_modules/ms/index.js"(Z,q){var v=1e3,x=v*60,A=x*60,M=A*24,e=M*365.25;q.exports=function(n,o){o=o||{};var s=typeof n;if(s==="string"&&n.length>0)return t(n);if(s==="number"&&isNaN(n)===!1)return o.long?i(n):r(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function t(n){if(n=String(n),!(n.length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n);if(o){var s=parseFloat(o[1]),c=(o[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*M;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(n){return n>=M?Math.round(n/M)+"d":n>=A?Math.round(n/A)+"h":n>=x?Math.round(n/x)+"m":n>=v?Math.round(n/v)+"s":n+"ms"}function i(n){return a(n,M,"day")||a(n,A,"hour")||a(n,x,"minute")||a(n,v,"second")||n+" ms"}function a(n,o,s){if(!(n<o))return n<o*1.5?Math.floor(n/o)+" "+s:Math.ceil(n/o)+" "+s+"s"}}}),n9=Ze({"node_modules/stream-parser/node_modules/debug/src/debug.js"(Z,q){Z=q.exports=A.debug=A.default=A,Z.coerce=r,Z.disable=e,Z.enable=M,Z.enabled=t,Z.humanize=a9(),Z.names=[],Z.skips=[],Z.formatters={};var v;function x(i){var a=0,n;for(n in i)a=(a<<5)-a+i.charCodeAt(n),a|=0;return Z.colors[Math.abs(a)%Z.colors.length]}function A(i){function a(){if(a.enabled){var n=a,o=+new Date,s=o-(v||o);n.diff=s,n.prev=v,n.curr=o,v=o;for(var c=new Array(arguments.length),h=0;h<c.length;h++)c[h]=arguments[h];c[0]=Z.coerce(c[0]),typeof c[0]!="string"&&c.unshift("%O");var m=0;c[0]=c[0].replace(/%([a-zA-Z%])/g,function(T,l){if(T==="%%")return T;m++;var _=Z.formatters[l];if(typeof _=="function"){var w=c[m];T=_.call(n,w),c.splice(m,1),m--}return T}),Z.formatArgs.call(n,c);var d=a.log||Z.log||console.log.bind(console);d.apply(n,c)}}return a.namespace=i,a.enabled=Z.enabled(i),a.useColors=Z.useColors(),a.color=x(i),typeof Z.init=="function"&&Z.init(a),a}function M(i){Z.save(i),Z.names=[],Z.skips=[];for(var a=(typeof i=="string"?i:"").split(/[\s,]+/),n=a.length,o=0;o<n;o++)a[o]&&(i=a[o].replace(/\*/g,".*?"),i[0]==="-"?Z.skips.push(new RegExp("^"+i.substr(1)+"$")):Z.names.push(new RegExp("^"+i+"$")))}function e(){Z.enable("")}function t(i){var a,n;for(a=0,n=Z.skips.length;a<n;a++)if(Z.skips[a].test(i))return!1;for(a=0,n=Z.names.length;a<n;a++)if(Z.names[a].test(i))return!0;return!1}function r(i){return i instanceof Error?i.stack||i.message:i}}}),i9=Ze({"node_modules/stream-parser/node_modules/debug/src/browser.js"(Z,q){Z=q.exports=n9(),Z.log=A,Z.formatArgs=x,Z.save=M,Z.load=e,Z.useColors=v,Z.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:t(),Z.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function v(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().
|
|||
|
|
|||
|
`),e=v("IHDR");q.exports=function(t){if(!(t.length<24)&&x(t,0,M)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),d9=Ze({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt32BE,M=v("8BPS\0");q.exports=function(e){if(!(e.length<22)&&x(e,0,M))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),v9=Ze({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Z,q){"use strict";function v(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var c=0,h=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(c=3);c<h&&v(s[c]);)c++;return c===h?!1:s[c]===60}var M=/<[-_.:a-zA-Z0-9][^>]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,i=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function n(s){var c=s.match(t),h=s.match(r),m=s.match(i);return{width:c&&(c[1]||c[2]),height:h&&(h[1]||h[2]),viewbox:m&&(m[1]||m[2])}}function o(s){return a.test(s)?s.match(a)[0]:"px"}q.exports=function(s){if(A(s)){for(var c="",h=0;h<s.length;h++)c+=String.fromCharCode(s[h]);var m=(c.match(M)||[""])[0];if(e.test(m)){var d=n(m),T=parseFloat(d.width),l=parseFloat(d.height);if(d.width&&d.height)return!x(T)||!x(l)?void 0:{width:T,height:l,type:"svg",mime:"image/svg+xml",wUnits:o(d.width),hUnits:o(d.height)};var _=(d.viewbox||"").split(" "),w={width:_[2],height:_[3]},S=parseFloat(w.width),E=parseFloat(w.height);if(!(!x(S)||!x(E))&&o(w.width)===o(w.height)){var g=S/E;return d.width?x(T)?{width:T,height:T/g,type:"svg",mime:"image/svg+xml",wUnits:o(d.width),hUnits:o(d.width)}:void 0:d.height?x(l)?{width:l*g,height:l,type:"svg",mime:"image/svg+xml",wUnits:o(d.height),hUnits:o(d.height)}:void 0:{width:S,height:E,type:"svg",mime:"image/svg+xml",wUnits:o(w.width),hUnits:o(w.height)}}}}}}}),m9=Ze({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=ac().readUInt16BE,e=ac().readUInt32LE,t=ac().readUInt32BE,r=v("II*\0"),i=v("MM\0*");function a(s,c,h){return h?M(s,c):A(s,c)}function n(s,c,h){return h?t(s,c):e(s,c)}function o(s,c,h){var m=a(s,c+2,h),d=n(s,c+4,h);return d!==1||m!==3&&m!==4?null:m===3?a(s,c+8,h):n(s,c+8,h)}q.exports=function(s){if(!(s.length<8)&&!(!x(s,0,r)&&!x(s,0,i))){var c=s[0]===77,h=n(s,4,c)-8;if(!(h<0)){var m=h+8;if(!(s.length-m<2)){var d=a(s,m+0,c)*12;if(!(d<=0)&&(m+=2,!(s.length-m<d))){var T,l,_,w;for(T=0;T<d;T+=12)w=a(s,m+T,c),w===256?l=o(s,m+T,c):w===257&&(_=o(s,m+T,c));if(l&&_)return{width:l,height:_,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}}),g9=Ze({"node_modules/probe-image-size/lib/parse_sync/webp.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=ac().readUInt32LE,e=y3(),t=v("RIFF"),r=v("WEBP");function i(o,s){if(!(o[s+3]!==157||o[s+4]!==1||o[s+5]!==42))return{width:A(o,s+6)&16383,height:A(o,s+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function a(o,s){if(o[s]===47){var c=M(o,s+1);return{width:(c&16383)+1,height:(c>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function n(o,s){return{width:(o[s+6]<<16|o[s+5]<<8|o[s+4])+1,height:(o[s+9]<<s|o[s+8]<<8|o[s+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}q.exports=function(o){if(!(o.length<16)&&!(!x(o,0,t)&&!x(o,8,r))){var s=12,c=null,h=0,m=M(o,4)+8;if(!(m>o.length)){for(;s+8<m;){if(o[s]===0){s++;continue}var d=String.fromCharCode.apply(null,o.slice(s,s+4)),T=M(o,s+4);d==="VP8 "&&T>=10?c=c||i(o,s+8):d==="VP8L"&&T>=9?c=c||a(o,s+8):d==="VP8X"&&T>=10?c=c||n(o,s+8):d==="EXIF"&&(h=e.get_orientation(o.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return h>0&&(c.orientation=h),c}}}}}),y9=Ze({"node_modules/probe-image-size/lib/parsers_sync.js"(Z,q){"use strict";q.exports={avif:l9(),bmp:u9(),gif:c9(),ico:f9(),jpeg:h9(),png:p9(),psd:d9(),svg:v9(),tiff:m9(),webp:g9()}}}),_9=Ze({"node_modules/probe-ima
|
|||
|
parent value =`,oe,`
|
|||
|
children sum =`,ne].join(" "))}J.value=oe});break}else o(Q,c,{branches:c.count.indexOf("branches")!==-1,leaves:c.count.indexOf("leaves")!==-1});if(!ue){c.sort&&Q.sort(function(J,X){return X.value-J.value});var se,he,H=c.marker.colors||[],$=!!H.length;return c._hasColorscale?($||(H=w?c.values:c._values),t(s,c,{vals:H,containerStr:"marker",cLetter:"c"}),he=A(c.marker)):se=M(h["_"+c.type+"colormap"]),Q.each(function(J){var X=J.data.data;X.color=c._hasColorscale?he(H[X.i]):se(H[X.i],X.id)}),S[0].hierarchy=Q,S}},Z._runCrossTraceCalc=function(s,c){var h=c._fullLayout,m=c.calcdata,d=h[s+"colorway"],T=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(d=e(d,s==="icicle"?n:s==="treemap"?a:i));var l=0,_;function w(b){var p=b.data.data,u=p.id;p.color===!1&&(T[u]?p.color=T[u]:b.parent?b.parent.parent?p.color=b.parent.data.data.color:(T[u]=p.color=d[l%d.length],l++):p.color=_)}for(var S=0;S<m.length;S++){var E=m[S],g=E[0];g.trace.type===s&&g.hierarchy&&(_=g.trace.root.color,g.hierarchy.each(w))}},Z.crossTraceCalc=function(s){return Z._runCrossTraceCalc("sunburst",s)};function o(s,c,h){var m=0,d=s.children;if(d){for(var T=d.length,l=0;l<T;l++)m+=o(d[l],c,h);h.branches&&m++}else h.leaves&&m++;return s.value=s.data.data.value=m,c._values||(c._values=[]),c._values[s.data.data.i]=m,m}}});function s0(Z,q,v){Z.prototype=q.prototype=v,v.constructor=Z}function b1(Z,q){var v=Object.create(Z.prototype);for(var x in q)v[x]=q[x];return v}var b3=mo({"node_modules/d3-color/src/define.js"(){}});function Kv(){}function oE(){return this.rgb().formatHex()}function O9(){return this.rgb().formatHex8()}function B9(){return hE(this).formatHsl()}function sE(){return this.rgb().formatRgb()}function w1(Z){var q,v;return Z=(Z+"").trim().toLowerCase(),(q=dE.exec(Z))?(v=q[1].length,q=parseInt(q[1],16),v===6?lE(q):v===3?new Xh(q>>8&15|q>>4&240,q>>4&15|q&240,(q&15)<<4|q&15,1):v===8?Q_(q>>24&255,q>>16&255,q>>8&255,(q&255)/255):v===4?Q_(q>>12&15|q>>8&240,q>>8&15|q>>4&240,q>>4&15|q&240,((q&15)<<4|q&15)/255):null):(q=vE.exec(Z))?new Xh(q[1],q[2],q[3],1):(q=mE.exec(Z))?new Xh(q[1]*255/100,q[2]*255/100,q[3]*255/100,1):(q=gE.exec(Z))?Q_(q[1],q[2],q[3],q[4]):(q=yE.exec(Z))?Q_(q[1]*255/100,q[2]*255/100,q[3]*255/100,q[4]):(q=_E.exec(Z))?fE(q[1],q[2]/100,q[3]/100,1):(q=xE.exec(Z))?fE(q[1],q[2]/100,q[3]/100,q[4]):S3.hasOwnProperty(Z)?lE(S3[Z]):Z==="transparent"?new Xh(NaN,NaN,NaN,0):null}function lE(Z){return new Xh(Z>>16&255,Z>>8&255,Z&255,1)}function Q_(Z,q,v,x){return x<=0&&(Z=q=v=NaN),new Xh(Z,q,v,x)}function w3(Z){return Z instanceof Kv||(Z=w1(Z)),Z?(Z=Z.rgb(),new Xh(Z.r,Z.g,Z.b,Z.opacity)):new Xh}function ex(Z,q,v,x){return arguments.length===1?w3(Z):new Xh(Z,q,v,x??1)}function Xh(Z,q,v,x){this.r=+Z,this.g=+q,this.b=+v,this.opacity=+x}function uE(){return`#${og(this.r)}${og(this.g)}${og(this.b)}`}function N9(){return`#${og(this.r)}${og(this.g)}${og(this.b)}${og((isNaN(this.opacity)?1:this.opacity)*255)}`}function cE(){let Z=tx(this.opacity);return`${Z===1?"rgb(":"rgba("}${ig(this.r)}, ${ig(this.g)}, ${ig(this.b)}${Z===1?")":`, ${Z})`}`}function tx(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function ig(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function og(Z){return Z=ig(Z),(Z<16?"0":"")+Z.toString(16)}function fE(Z,q,v,x){return x<=0?Z=q=v=NaN:v<=0||v>=1?Z=q=NaN:q<=0&&(Z=NaN),new Ud(Z,q,v,x)}function hE(Z){if(Z instanceof Ud)return new Ud(Z.h,Z.s,Z.l,Z.opacity);if(Z instanceof Kv||(Z=w1(Z)),!Z)return new Ud;if(Z instanceof Ud)return Z;Z=Z.rgb();var q=Z.r/255,v=Z.g/255,x=Z.b/255,A=Math.min(q,v,x),M=Math.max(q,v,x),e=NaN,t=M-A,r=(M+A)/2;return t?(q===M?e=(v-x)/t+(v<x)*6:v===M?e=(x-q)/t+2:e=(q-v)/t+4,t/=r<.5?M+A:2-M-A,e*=60):t=r>0&&r<1?0:e,new Ud(e,t,r,Z.opacity)}function T3(Z,q,v,x){return arguments.length===1?hE(Z):new Ud(Z,q,v,x??1)}function Ud(Z,q,v,x){this.h=+Z,this.s=+q,this.l=+v,this.opacity=+x}function pE(Z){return Z=(Z||0)%360,Z<0?Z+360:Z}function rx(Z){return Math.max(0,Math.min(1,Z||0))}function A3(Z,q,v){return(Z<60?q+(v-q)*Z/60:Z<180?v:Z<240?q+(v-q)*(240-Z)/60:q)*255}var Jv,sg,lg,l0,jd,dE,vE,mE,gE,yE,_E,xE,S3,M3=mo({"node_modules/d3-color/src/color.js
|
|||
|
`)}},3952:function(e,t,r){"use strict";e.exports=n;var i=r(3250);function a(o,s){for(var c=new Array(s+1),h=0;h<o.length;++h)c[h]=o[h];for(var h=0;h<=o.length;++h){for(var m=o.length;m<=s;++m){for(var d=new Array(s),T=0;T<s;++T)d[T]=Math.pow(m+1-h,T);c[m]=d}var l=i.apply(void 0,c);if(l)return!0}return!1}function n(o){var s=o.length;if(s===0)return[];if(s===1)return[0];for(var c=o[0].length,h=[o[0]],m=[0],d=1;d<s;++d){if(h.push(o[d]),!a(h,c)){h.pop();continue}if(m.push(d),m.length===c+1)return m}return m}},5995:function(e,t,r){"use strict";e.exports=n;var i=r(7642),a=r(6037);function n(o,s){return i(s).filter(function(c){for(var h=new Array(c.length),m=0;m<c.length;++m)h[m]=s[c[m]];return a(h)*o<1})}},3502:function(e,t,r){e.exports=n;var i=r(5995),a=r(9127);function n(o,s){return a(i(o,s))}},6468:function(e){e.exports=function(r){return atob(r)}},2642:function(e,t,r){"use strict";e.exports=n;var i=r(727);function a(o){for(var s=0,c=0;c<o.length;++c)s+=o[c];return s}function n(o,s){for(var c=s.length,h=new Array(c+1),m=0;m<c;++m){for(var d=new Array(c+1),T=0;T<=c;++T)d[T]=o[T][m];h[m]=d}h[c]=new Array(c+1);for(var m=0;m<=c;++m)h[c][m]=1;for(var l=new Array(c+1),m=0;m<c;++m)l[m]=s[m];l[c]=1;var _=i(h,l),w=a(_[c+1]);w===0&&(w=1);for(var S=new Array(c+1),m=0;m<=c;++m)S[m]=a(_[m])/w;return S}},7507:function(e,t){"use strict";t.byteLength=h,t.toByteArray=d,t.fromByteArray=_;for(var r=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=n.length;o<s;++o)r[o]=n[o],i[n.charCodeAt(o)]=o;i[45]=62,i[95]=63;function c(w){var S=w.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=w.indexOf("=");E===-1&&(E=S);var g=E===S?0:4-E%4;return[E,g]}function h(w){var S=c(w),E=S[0],g=S[1];return(E+g)*3/4-g}function m(w,S,E){return(S+E)*3/4-E}function d(w){var S,E=c(w),g=E[0],b=E[1],p=new a(m(w,g,b)),u=0,y=b>0?g-4:g,f;for(f=0;f<y;f+=4)S=i[w.charCodeAt(f)]<<18|i[w.charCodeAt(f+1)]<<12|i[w.charCodeAt(f+2)]<<6|i[w.charCodeAt(f+3)],p[u++]=S>>16&255,p[u++]=S>>8&255,p[u++]=S&255;return b===2&&(S=i[w.charCodeAt(f)]<<2|i[w.charCodeAt(f+1)]>>4,p[u++]=S&255),b===1&&(S=i[w.charCodeAt(f)]<<10|i[w.charCodeAt(f+1)]<<4|i[w.charCodeAt(f+2)]>>2,p[u++]=S>>8&255,p[u++]=S&255),p}function T(w){return r[w>>18&63]+r[w>>12&63]+r[w>>6&63]+r[w&63]}function l(w,S,E){for(var g,b=[],p=S;p<E;p+=3)g=(w[p]<<16&16711680)+(w[p+1]<<8&65280)+(w[p+2]&255),b.push(T(g));return b.join("")}function _(w){for(var S,E=w.length,g=E%3,b=[],p=16383,u=0,y=E-g;u<y;u+=p)b.push(l(w,u,u+p>y?y:u+p));return g===1?(S=w[E-1],b.push(r[S>>2]+r[S<<4&63]+"==")):g===2&&(S=(w[E-2]<<8)+w[E-1],b.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),b.join("")}},3865:function(e,t,r){"use strict";var i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[1]).add(o[0].mul(n[1])),n[1].mul(o[1]))}},1318:function(e){"use strict";e.exports=t;function t(r,i){return r[0].mul(i[1]).cmp(i[0].mul(r[1]))}},8697:function(e,t,r){"use strict";var i=r(869);e.exports=a;function a(n,o){return i(n[0].mul(o[1]),n[1].mul(o[0]))}},7842:function(e,t,r){"use strict";var i=r(6330),a=r(1533),n=r(2651),o=r(6768),s=r(869),c=r(8697);e.exports=h;function h(m,d){if(i(m))return d?c(m,h(d)):[m[0].clone(),m[1].clone()];var T=0,l,_;if(a(m))l=m.clone();else if(typeof m=="string")l=o(m);else{if(m===0)return[n(0),n(1)];if(m===Math.floor(m))l=n(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),T-=256;l=n(m)}}if(i(d))l.mul(d[1]),_=d[0].clone();else if(a(d))_=d.clone();else if(typeof d=="string")_=o(d);else if(!d)_=n(1);else if(d===Math.floor(d))_=n(d);else{for(;d!==Math.floor(d);)d=d*Math.pow(2,256),T+=256;_=n(d)}return T>0?l=l.ushln(T):T<0&&(_=_.ushln(-T)),s(l,_)}},6330:function(e,t,r){"use strict";var i=r(1533);e.exports=a;function a(n){return Array.isArray(n)&&n.length===2&&i(n[0])&&i(n[1])}},5716:function(e,t,r){"use strict";var i=r(6859);e.exports=a;function a(n){return n.cmp(new i(0))}},1369:function(e,t,r){"use strict";var i=r(5716);e.exports=a;function a(n){var o=n.length,s=n.words,c=0;if(o===1)c=s[0];else if(o===2)c=s[0]+s[1]*67108864;else fo
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 offset, majorAxis, minorAxis, screenAxis;
|
|||
|
uniform float lineWidth;
|
|||
|
uniform vec2 screenShape;
|
|||
|
|
|||
|
vec3 project(vec3 p) {
|
|||
|
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
|||
|
return pp.xyz / max(pp.w, 0.0001);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 major = position.x * majorAxis;
|
|||
|
vec3 minor = position.y * minorAxis;
|
|||
|
|
|||
|
vec3 vPosition = major + minor + offset;
|
|||
|
vec3 pPosition = project(vPosition);
|
|||
|
vec3 offset = project(vPosition + screenAxis * position.z);
|
|||
|
|
|||
|
vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;
|
|||
|
|
|||
|
gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);
|
|||
|
}
|
|||
|
`]),o=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform vec4 color;
|
|||
|
void main() {
|
|||
|
gl_FragColor = color;
|
|||
|
}`]);t.n=function(d){return a(d,n,o,null,[{name:"position",type:"vec3"}])};var s=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 offset, axis, alignDir, alignOpt;
|
|||
|
uniform float scale, angle, pixelScale;
|
|||
|
uniform vec2 resolution;
|
|||
|
|
|||
|
vec3 project(vec3 p) {
|
|||
|
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
|||
|
return pp.xyz / max(pp.w, 0.0001);
|
|||
|
}
|
|||
|
|
|||
|
float computeViewAngle(vec3 a, vec3 b) {
|
|||
|
vec3 A = project(a);
|
|||
|
vec3 B = project(b);
|
|||
|
|
|||
|
return atan(
|
|||
|
(B.y - A.y) * resolution.y,
|
|||
|
(B.x - A.x) * resolution.x
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
const float PI = 3.141592;
|
|||
|
const float TWO_PI = 2.0 * PI;
|
|||
|
const float HALF_PI = 0.5 * PI;
|
|||
|
const float ONE_AND_HALF_PI = 1.5 * PI;
|
|||
|
|
|||
|
int option = int(floor(alignOpt.x + 0.001));
|
|||
|
float hv_ratio = alignOpt.y;
|
|||
|
bool enableAlign = (alignOpt.z != 0.0);
|
|||
|
|
|||
|
float mod_angle(float a) {
|
|||
|
return mod(a, PI);
|
|||
|
}
|
|||
|
|
|||
|
float positive_angle(float a) {
|
|||
|
return mod_angle((a < 0.0) ?
|
|||
|
a + TWO_PI :
|
|||
|
a
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
float look_upwards(float a) {
|
|||
|
float b = positive_angle(a);
|
|||
|
return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?
|
|||
|
b - PI :
|
|||
|
b;
|
|||
|
}
|
|||
|
|
|||
|
float look_horizontal_or_vertical(float a, float ratio) {
|
|||
|
// ratio controls the ratio between being horizontal to (vertical + horizontal)
|
|||
|
// if ratio is set to 0.5 then it is 50%, 50%.
|
|||
|
// when using a higher ratio e.g. 0.75 the result would
|
|||
|
// likely be more horizontal than vertical.
|
|||
|
|
|||
|
float b = positive_angle(a);
|
|||
|
|
|||
|
return
|
|||
|
(b < ( ratio) * HALF_PI) ? 0.0 :
|
|||
|
(b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :
|
|||
|
(b < (2.0 + ratio) * HALF_PI) ? 0.0 :
|
|||
|
(b < (4.0 - ratio) * HALF_PI) ? HALF_PI :
|
|||
|
0.0;
|
|||
|
}
|
|||
|
|
|||
|
float roundTo(float a, float b) {
|
|||
|
return float(b * floor((a + 0.5 * b) / b));
|
|||
|
}
|
|||
|
|
|||
|
float look_round_n_directions(float a, int n) {
|
|||
|
float b = positive_angle(a);
|
|||
|
float div = TWO_PI / float(n);
|
|||
|
float c = roundTo(b, div);
|
|||
|
return look_upwards(c);
|
|||
|
}
|
|||
|
|
|||
|
float applyAlignOption(float rawAngle, float delta) {
|
|||
|
return
|
|||
|
(option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions
|
|||
|
(option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical
|
|||
|
(option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis
|
|||
|
(option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards
|
|||
|
(option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal
|
|||
|
rawAngle; // otherwise return back raw input angle
|
|||
|
}
|
|||
|
|
|||
|
bool isAxisTitle = (axis.x == 0.0) &&
|
|||
|
(axis.y == 0.0) &&
|
|||
|
(axis.z == 0.0);
|
|||
|
|
|||
|
void main() {
|
|||
|
//Compute world offset
|
|||
|
float axisDistance = position.z;
|
|||
|
vec3 dataPosition = axisDistance * axis + offset;
|
|||
|
|
|||
|
float beta = angle; // i.e. user defined attributes for each tick
|
|||
|
|
|||
|
float axisAngle;
|
|||
|
float clipAngle;
|
|||
|
float flip;
|
|||
|
|
|||
|
if (enableAlign) {
|
|||
|
axisAngle = (isAxisTitle) ? HALF_PI :
|
|||
|
computeViewAngle(dataPosition, dataPosition + axis);
|
|||
|
clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);
|
|||
|
|
|||
|
axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;
|
|||
|
clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;
|
|||
|
|
|||
|
flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),
|
|||
|
vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;
|
|||
|
|
|||
|
beta += applyAlignOption(clipAngle, flip * PI);
|
|||
|
}
|
|||
|
|
|||
|
//Compute plane offset
|
|||
|
vec2 planeCoord = position.xy * pixelScale;
|
|||
|
|
|||
|
mat2 planeXform = scale * mat2(
|
|||
|
cos(beta), sin(beta),
|
|||
|
-sin(beta), cos(beta)
|
|||
|
);
|
|||
|
|
|||
|
vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;
|
|||
|
|
|||
|
//Compute clip position
|
|||
|
vec3 clipPosition = project(dataPosition);
|
|||
|
|
|||
|
//Apply text offset in clip coordinates
|
|||
|
clipPosition += vec3(viewOffset, 0.0);
|
|||
|
|
|||
|
//Done
|
|||
|
gl_Position = vec4(clipPosition, 1.0);
|
|||
|
}
|
|||
|
`]),c=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform vec4 color;
|
|||
|
void main() {
|
|||
|
gl_FragColor = color;
|
|||
|
}`]);t.Q=function(d){return a(d,s,c,null,[{name:"position",type:"vec3"}])};var h=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec3 normal;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 enable;
|
|||
|
uniform vec3 bounds[2];
|
|||
|
|
|||
|
varying vec3 colorChannel;
|
|||
|
|
|||
|
void main() {
|
|||
|
|
|||
|
vec3 signAxis = sign(bounds[1] - bounds[0]);
|
|||
|
|
|||
|
vec3 realNormal = signAxis * normal;
|
|||
|
|
|||
|
if(dot(realNormal, enable) > 0.0) {
|
|||
|
vec3 minRange = min(bounds[0], bounds[1]);
|
|||
|
vec3 maxRange = max(bounds[0], bounds[1]);
|
|||
|
vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));
|
|||
|
gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));
|
|||
|
} else {
|
|||
|
gl_Position = vec4(0,0,0,0);
|
|||
|
}
|
|||
|
|
|||
|
colorChannel = abs(realNormal);
|
|||
|
}
|
|||
|
`]),m=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform vec4 colors[3];
|
|||
|
|
|||
|
varying vec3 colorChannel;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_FragColor = colorChannel.x * colors[0] +
|
|||
|
colorChannel.y * colors[1] +
|
|||
|
colorChannel.z * colors[2];
|
|||
|
}`]);t.bg=function(d){return a(d,h,m,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){"use strict";e.exports=_;var i=r(2762),a=r(8116),n=r(4359),o=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var h=3;function m(w,S,E,g){this.gl=w,this.shader=S,this.buffer=E,this.vao=g,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var d=m.prototype,T=[0,0];d.bind=function(w,S,E,g){this.vao.bind(),this.shader.bind();var b=this.shader.uniforms;b.model=w,b.view=S,b.projection=E,b.pixelScale=g,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},d.unbind=function(){this.vao.unbind()},d.update=function(w,S,E,g,b){var p=[];function u(N,U,W,Q,ue,se){var he=[W.style,W.weight,W.variant,W.family].join("_"),H=c[he];H||(H=c[he]={});var $=H[U];$||($=H[U]=l(U,{triangles:!0,font:W.family,fontStyle:W.style,fontWeight:W.weight,fontVariant:W.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:se}));for(var J=(Q||12)/12,X=$.positions,oe=$.cells,ne=0,j=oe.length;ne<j;++ne)for(var ee=oe[ne],re=2;re>=0;--re){var ce=X[ee[re]];p.push(J*ce[0],-J*ce[1],N)}}for(var y=[0,0,0],f=[0,0,0],P=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){P[B]=p.length/h|0,u(.5*(w[0][B]+w[1][B]),S[B],E[B],12,z,F),L[B]=(p.length/h|0)-P[B],y[B]=p.length/h|0;for(var O=0;O<g[B].length;++O)if(g[B][O].text){var I={family:g[B][O].font||b[B].family,style:b[B].fontStyle||b[B].style,weight:b[B].fontWeight||b[B].weight,variant:b[B].fontVariant||b[B].variant};u(g[B][O].x,g[B][O].text,I,g[B][O].fontSize||12,z,F)}f[B]=(p.length/h|0)-y[B]}this.buffer.update(p),this.tickOffset=y,this.tickCount=f,this.labelOffset=P,this.labelCount=L},d.drawTicks=function(w,S,E,g,b,p,u,y){this.tickCount[w]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=b,this.shader.uniforms.angle=E,this.shader.uniforms.scale=S,this.shader.uniforms.offset=g,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=y,this.vao.draw(this.gl.TRIANGLES,this.tickCount[w],this.tickOffset[w]))},d.drawLabel=function(w,S,E,g,b,p,u,y){this.labelCount[w]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=b,this.shader.uniforms.angle=E,this.shader.uniforms.scale=S,this.shader.uniforms.offset=g,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=y,this.vao.draw(this.gl.TRIANGLES,this.labelCount[w],this.labelOffset[w]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(w,S){try{return n(w,S)}catch(E){return console.warn('error vectorizing text:"'+w+'" error:',E),{cells:[],positions:[]}}}function _(w,S,E,g,b,p){var u=i(w),y=a(w,[{buffer:u,size:3}]),f=o(w);f.attributes.position.location=0;var P=new m(w,f,u,y);return P.update(S,E,g,b,p),P}},6444:function(e,t){"use strict";t.create=i,t.equal=a;function r(n,o){var s=n+"",c=s.indexOf("."),h=0;c>=0&&(h=s.length-c-1);var m=Math.pow(10,h),d=Math.round(n*o*m),T=d+"";if(T.indexOf("e")>=0)return T;var l=d/m,_=d%m;d<0?(l=-Math.ceil(l)|0,_=-_|0):(l=Math.floor(l)|0,_=_|0);var w=""+l;if(d<0&&(w="-"+w),h){for(var S=""+_;S.length<h;)S="0"+S;return w+"."+S}else return w}function i(n,o){for(var s=[],c=0;c<3;++c){for(var h=[],m=.5*(n[0][c]+n[1][c]),d=0;d*o[c]<=n[1][c];++d)h.push({x:d*o[c],text:r(o[c],d)});for(var d=-1;d*o[c]>=n[0][c];--d)h.push({x:d*o[c],text:r(o[c],d)});s.push(h)}return s}function a(n,o){for(var s=0;s<3;++s){if(n[s].length!==o[s].length)return!1;for(var c=0;c<n[s].length;++c){var h=n[s][c],m=o[s][c];if(h.x!==m.x||h.text!==m.text||h.font!==m.font||h.fontColor!==m.fontColor||h.fontSize!==m.fontSize||h.dx!==m.dx||h.dy!==m.dy)return!1}}return!0}},5445:function(e,t,r){"use strict";e.exports=E;var i=r(5033),a=r(5202),n=r(6429),o=r(6760),s=r(5665),c=r(5352),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=new Float32Array(16);function d(g,b,p){this.lo=g,this.hi=b,this.pixelsPerDataUnit=p}var T=[0,0,0,1],l=[0,0,0,1];function _(g,b,p,u,y){for(var f=0;f<3;++f){for(var P=T,L=l,z=0;z<3;++z)L[z]=P[z]=p[z];L[3]=P[3]=
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
vec3 getOrthogonalVector(vec3 v) {
|
|||
|
// Return up-vector for only-z vector.
|
|||
|
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
|||
|
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
|||
|
// Assign z = 0, x = -b, y = a:
|
|||
|
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
|||
|
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
|||
|
return normalize(vec3(-v.y, v.x, 0.0));
|
|||
|
} else {
|
|||
|
return normalize(vec3(0.0, v.z, -v.y));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Calculate the cone vertex and normal at the given index.
|
|||
|
//
|
|||
|
// The returned vertex is for a cone with its top at origin and height of 1.0,
|
|||
|
// pointing in the direction of the vector attribute.
|
|||
|
//
|
|||
|
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
|
|||
|
// These vertices are used to make up the triangles of the cone by the following:
|
|||
|
// segment + 0 top vertex
|
|||
|
// segment + 1 perimeter vertex a+1
|
|||
|
// segment + 2 perimeter vertex a
|
|||
|
// segment + 3 center base vertex
|
|||
|
// segment + 4 perimeter vertex a
|
|||
|
// segment + 5 perimeter vertex a+1
|
|||
|
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
|
|||
|
// To go from index to segment, floor(index / 6)
|
|||
|
// To go from segment to angle, 2*pi * (segment/segmentCount)
|
|||
|
// To go from index to segment index, index - (segment*6)
|
|||
|
//
|
|||
|
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
|
|||
|
|
|||
|
const float segmentCount = 8.0;
|
|||
|
|
|||
|
float index = rawIndex - floor(rawIndex /
|
|||
|
(segmentCount * 6.0)) *
|
|||
|
(segmentCount * 6.0);
|
|||
|
|
|||
|
float segment = floor(0.001 + index/6.0);
|
|||
|
float segmentIndex = index - (segment*6.0);
|
|||
|
|
|||
|
normal = -normalize(d);
|
|||
|
|
|||
|
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
|
|||
|
return mix(vec3(0.0), -d, coneOffset);
|
|||
|
}
|
|||
|
|
|||
|
float nextAngle = (
|
|||
|
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
|
|||
|
(segmentIndex > 4.99 && segmentIndex < 5.01)
|
|||
|
) ? 1.0 : 0.0;
|
|||
|
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
|
|||
|
|
|||
|
vec3 v1 = mix(d, vec3(0.0), coneOffset);
|
|||
|
vec3 v2 = v1 - d;
|
|||
|
|
|||
|
vec3 u = getOrthogonalVector(d);
|
|||
|
vec3 v = normalize(cross(u, d));
|
|||
|
|
|||
|
vec3 x = u * cos(angle) * length(d)*0.25;
|
|||
|
vec3 y = v * sin(angle) * length(d)*0.25;
|
|||
|
vec3 v3 = v2 + x + y;
|
|||
|
if (segmentIndex < 3.0) {
|
|||
|
vec3 tx = u * sin(angle);
|
|||
|
vec3 ty = v * -cos(angle);
|
|||
|
vec3 tangent = tx + ty;
|
|||
|
normal = normalize(cross(v3 - v1, tangent));
|
|||
|
}
|
|||
|
|
|||
|
if (segmentIndex == 0.0) {
|
|||
|
return mix(d, vec3(0.0), coneOffset);
|
|||
|
}
|
|||
|
return v3;
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 vector;
|
|||
|
attribute vec4 color, position;
|
|||
|
attribute vec2 uv;
|
|||
|
|
|||
|
uniform float vectorScale, coneScale, coneOffset;
|
|||
|
uniform mat4 model, view, projection, inverseModel;
|
|||
|
uniform vec3 eyePosition, lightPosition;
|
|||
|
|
|||
|
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
// Scale the vector magnitude to stay constant with
|
|||
|
// model & view changes.
|
|||
|
vec3 normal;
|
|||
|
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);
|
|||
|
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
|||
|
|
|||
|
//Lighting geometry parameters
|
|||
|
vec4 cameraCoordinate = view * conePosition;
|
|||
|
cameraCoordinate.xyz /= cameraCoordinate.w;
|
|||
|
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
|||
|
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
|||
|
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
|||
|
|
|||
|
// vec4 m_position = model * vec4(conePosition, 1.0);
|
|||
|
vec4 t_position = view * conePosition;
|
|||
|
gl_Position = projection * t_position;
|
|||
|
|
|||
|
f_color = color;
|
|||
|
f_data = conePosition.xyz;
|
|||
|
f_position = position.xyz;
|
|||
|
f_uv = uv;
|
|||
|
}
|
|||
|
`]),n=i([`#extension GL_OES_standard_derivatives : enable
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
float beckmannDistribution(float x, float roughness) {
|
|||
|
float NdotH = max(x, 0.0001);
|
|||
|
float cos2Alpha = NdotH * NdotH;
|
|||
|
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
|||
|
float roughness2 = roughness * roughness;
|
|||
|
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
|||
|
return exp(tan2Alpha / roughness2) / denom;
|
|||
|
}
|
|||
|
|
|||
|
float cookTorranceSpecular(
|
|||
|
vec3 lightDirection,
|
|||
|
vec3 viewDirection,
|
|||
|
vec3 surfaceNormal,
|
|||
|
float roughness,
|
|||
|
float fresnel) {
|
|||
|
|
|||
|
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
|||
|
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
|||
|
|
|||
|
//Half angle vector
|
|||
|
vec3 H = normalize(lightDirection + viewDirection);
|
|||
|
|
|||
|
//Geometric term
|
|||
|
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
|||
|
float VdotH = max(dot(viewDirection, H), 0.000001);
|
|||
|
float LdotH = max(dot(lightDirection, H), 0.000001);
|
|||
|
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
|||
|
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
|||
|
float G = min(1.0, min(G1, G2));
|
|||
|
|
|||
|
//Distribution term
|
|||
|
float D = beckmannDistribution(NdotH, roughness);
|
|||
|
|
|||
|
//Fresnel term
|
|||
|
float F = pow(1.0 - VdotN, fresnel);
|
|||
|
|
|||
|
//Multiply terms and done
|
|||
|
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
|||
|
uniform sampler2D texture;
|
|||
|
|
|||
|
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
|||
|
vec3 N = normalize(f_normal);
|
|||
|
vec3 L = normalize(f_lightDirection);
|
|||
|
vec3 V = normalize(f_eyeDirection);
|
|||
|
|
|||
|
if(gl_FrontFacing) {
|
|||
|
N = -N;
|
|||
|
}
|
|||
|
|
|||
|
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
|||
|
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
|||
|
|
|||
|
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
|
|||
|
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
|||
|
|
|||
|
gl_FragColor = litColor * opacity;
|
|||
|
}
|
|||
|
`]),o=i([`precision highp float;
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
vec3 getOrthogonalVector(vec3 v) {
|
|||
|
// Return up-vector for only-z vector.
|
|||
|
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
|||
|
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
|||
|
// Assign z = 0, x = -b, y = a:
|
|||
|
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
|||
|
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
|||
|
return normalize(vec3(-v.y, v.x, 0.0));
|
|||
|
} else {
|
|||
|
return normalize(vec3(0.0, v.z, -v.y));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Calculate the cone vertex and normal at the given index.
|
|||
|
//
|
|||
|
// The returned vertex is for a cone with its top at origin and height of 1.0,
|
|||
|
// pointing in the direction of the vector attribute.
|
|||
|
//
|
|||
|
// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
|
|||
|
// These vertices are used to make up the triangles of the cone by the following:
|
|||
|
// segment + 0 top vertex
|
|||
|
// segment + 1 perimeter vertex a+1
|
|||
|
// segment + 2 perimeter vertex a
|
|||
|
// segment + 3 center base vertex
|
|||
|
// segment + 4 perimeter vertex a
|
|||
|
// segment + 5 perimeter vertex a+1
|
|||
|
// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
|
|||
|
// To go from index to segment, floor(index / 6)
|
|||
|
// To go from segment to angle, 2*pi * (segment/segmentCount)
|
|||
|
// To go from index to segment index, index - (segment*6)
|
|||
|
//
|
|||
|
vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
|
|||
|
|
|||
|
const float segmentCount = 8.0;
|
|||
|
|
|||
|
float index = rawIndex - floor(rawIndex /
|
|||
|
(segmentCount * 6.0)) *
|
|||
|
(segmentCount * 6.0);
|
|||
|
|
|||
|
float segment = floor(0.001 + index/6.0);
|
|||
|
float segmentIndex = index - (segment*6.0);
|
|||
|
|
|||
|
normal = -normalize(d);
|
|||
|
|
|||
|
if (segmentIndex > 2.99 && segmentIndex < 3.01) {
|
|||
|
return mix(vec3(0.0), -d, coneOffset);
|
|||
|
}
|
|||
|
|
|||
|
float nextAngle = (
|
|||
|
(segmentIndex > 0.99 && segmentIndex < 1.01) ||
|
|||
|
(segmentIndex > 4.99 && segmentIndex < 5.01)
|
|||
|
) ? 1.0 : 0.0;
|
|||
|
float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
|
|||
|
|
|||
|
vec3 v1 = mix(d, vec3(0.0), coneOffset);
|
|||
|
vec3 v2 = v1 - d;
|
|||
|
|
|||
|
vec3 u = getOrthogonalVector(d);
|
|||
|
vec3 v = normalize(cross(u, d));
|
|||
|
|
|||
|
vec3 x = u * cos(angle) * length(d)*0.25;
|
|||
|
vec3 y = v * sin(angle) * length(d)*0.25;
|
|||
|
vec3 v3 = v2 + x + y;
|
|||
|
if (segmentIndex < 3.0) {
|
|||
|
vec3 tx = u * sin(angle);
|
|||
|
vec3 ty = v * -cos(angle);
|
|||
|
vec3 tangent = tx + ty;
|
|||
|
normal = normalize(cross(v3 - v1, tangent));
|
|||
|
}
|
|||
|
|
|||
|
if (segmentIndex == 0.0) {
|
|||
|
return mix(d, vec3(0.0), coneOffset);
|
|||
|
}
|
|||
|
return v3;
|
|||
|
}
|
|||
|
|
|||
|
attribute vec4 vector;
|
|||
|
attribute vec4 position;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform float vectorScale, coneScale, coneOffset;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 normal;
|
|||
|
vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);
|
|||
|
vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
|||
|
gl_Position = projection * (view * conePosition);
|
|||
|
f_id = id;
|
|||
|
f_position = position.xyz;
|
|||
|
}
|
|||
|
`]),s=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float pickId;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
|||
|
|
|||
|
gl_FragColor = vec4(pickId, f_id.xyz);
|
|||
|
}`]);t.meshShader={vertex:a,fragment:n,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",3407
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position, offset;
|
|||
|
attribute vec4 color;
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform float capSize;
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec3 fragPosition;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec4 worldPosition = model * vec4(position, 1.0);
|
|||
|
worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);
|
|||
|
gl_Position = projection * (view * worldPosition);
|
|||
|
fragColor = color;
|
|||
|
fragPosition = position;
|
|||
|
}`]),o=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float opacity;
|
|||
|
varying vec3 fragPosition;
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (
|
|||
|
outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||
|
|||
|
fragColor.a * opacity == 0.
|
|||
|
) discard;
|
|||
|
|
|||
|
gl_FragColor = opacity * fragColor;
|
|||
|
}`]);e.exports=function(s){return a(s,n,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){"use strict";var i=r(7766);e.exports=b;var a=null,n,o,s,c;function h(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),y=p.getParameter(p.RENDERBUFFER_BINDING),f=p.getParameter(p.TEXTURE_BINDING_2D);return[u,y,f]}function m(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function d(p,u){var y=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(y+1);for(var f=0;f<=y;++f){for(var P=new Array(y),L=0;L<f;++L)P[L]=p.COLOR_ATTACHMENT0+L;for(var L=f;L<y;++L)P[L]=p.NONE;a[f]=P}}function T(p){switch(p){case n:throw new Error("gl-fbo: Framebuffer unsupported");case o:throw new Error("gl-fbo: Framebuffer incomplete attachment");case s:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case c:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function l(p,u,y,f,P,L){if(!f)return null;var z=i(p,u,y,P,f);return z.magFilter=p.NEAREST,z.minFilter=p.NEAREST,z.mipSamples=1,z.bind(),p.framebufferTexture2D(p.FRAMEBUFFER,L,p.TEXTURE_2D,z.handle,0),z}function _(p,u,y,f,P){var L=p.createRenderbuffer();return p.bindRenderbuffer(p.RENDERBUFFER,L),p.renderbufferStorage(p.RENDERBUFFER,f,u,y),p.framebufferRenderbuffer(p.FRAMEBUFFER,P,p.RENDERBUFFER,L),L}function w(p){var u=h(p.gl),y=p.gl,f=p.handle=y.createFramebuffer(),P=p._shape[0],L=p._shape[1],z=p.color.length,F=p._ext,B=p._useStencil,O=p._useDepth,I=p._colorType;y.bindFramebuffer(y.FRAMEBUFFER,f);for(var N=0;N<z;++N)p.color[N]=l(y,P,L,I,y.RGBA,y.COLOR_ATTACHMENT0+N);z===0?(p._color_rb=_(y,P,L,y.RGBA4,y.COLOR_ATTACHMENT0),F&&F.drawBuffersWEBGL(a[0])):z>1&&F.drawBuffersWEBGL(a[z]);var U=y.getExtension("WEBGL_depth_texture");U?B?p.depth=l(y,P,L,U.UNSIGNED_INT_24_8_WEBGL,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(y,P,L,y.UNSIGNED_SHORT,y.DEPTH_COMPONENT,y.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=_(y,P,L,y.DEPTH_STENCIL,y.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=_(y,P,L,y.DEPTH_COMPONENT16,y.DEPTH_ATTACHMENT):B&&(p._depth_rb=_(y,P,L,y.STENCIL_INDEX,y.STENCIL_ATTACHMENT));var W=y.checkFramebufferStatus(y.FRAMEBUFFER);if(W!==y.FRAMEBUFFER_COMPLETE){p._destroyed=!0,y.bindFramebuffer(y.FRAMEBUFFER,null),y.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(y.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;N<p.color.length;++N)p.color[N].dispose(),p.color[N]=null;p._color_rb&&(y.deleteRenderbuffer(p._color_rb),p._color_rb=null),m(y,u),T(W)}m(y,u)}function S(p,u,y,f,P,L,z,F){this.gl=p,this._shape=[u|0,y|0],this._destroyed=!1,this._ext=F,this.color=new Array(P);for(var B=0;B<P;++B)this.color[B]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=f,this._useDepth=L,this._useStencil=z;var O=this,I=[u|0,y|0];Object.defineProperties(I,{0:{get:function(){return O._shape[0]},set:function(N){return O.width=N}},1:{get:function(){return O._shape[1]},set:function(N){return O.height=N}}}),this._shapeVector=I,w(this)}var E=S.prototype;function g(p,u,y){if(p._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(p._shape[0]===u&&p._shape[1]===y)){var f=p.gl,P=f.getParameter(f.MAX_RENDERBUFFER_SIZE);if(u<0||u>P||y<0||y>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=y;for(var L=h(f),z=0;z<p.color.length;++z)p.color[z].shape=p._shape;p._color_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,p._color_rb),f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,p._shape[0],p._shape[1])),p.depth&&(p.depth.shape=p._shape),p._depth_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,p._depth_rb),p._useDepth&&p._useStencil?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,p._shape[0],p._shape[1]):p._useDepth?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,p._shape[0],p._shape[1]):p._useStencil&&f.renderbufferStorage(f.RENDERBUFFER,f.STENCIL_INDEX,p._shape[0],p._shape[1
|
|||
|
`,T,d),_=i("%s%s",l,c),w=c.split(`
|
|||
|
`),S={},E=0;E<w.length;E++){var g=w[E];if(!(g===""||g==="\0")){var b=parseInt(g.split(":")[2]);if(isNaN(b))throw new Error(i("Could not parse error: %s",g));S[b]=g}}for(var p=o(h).split(`
|
|||
|
`),E=0;E<p.length;E++)if(!(!S[E+3]&&!S[E+2]&&!S[E+1])){var u=p[E];if(l+=u+`
|
|||
|
`,S[E+1]){var y=S[E+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),l+=i(`^^^ %s
|
|||
|
|
|||
|
`,y)}}return{long:l.trim(),short:_.trim()}}},7319:function(e,t,r){var i=r(3236),a=r(9405),n=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position, nextPosition;
|
|||
|
attribute float arcLength, lineWidth;
|
|||
|
attribute vec4 color;
|
|||
|
|
|||
|
uniform vec2 screenShape;
|
|||
|
uniform float pixelRatio;
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec3 worldPosition;
|
|||
|
varying float pixelArcLength;
|
|||
|
|
|||
|
vec4 project(vec3 p) {
|
|||
|
return projection * (view * (model * vec4(p, 1.0)));
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
vec4 startPoint = project(position);
|
|||
|
vec4 endPoint = project(nextPosition);
|
|||
|
|
|||
|
vec2 A = startPoint.xy / startPoint.w;
|
|||
|
vec2 B = endPoint.xy / endPoint.w;
|
|||
|
|
|||
|
float clipAngle = atan(
|
|||
|
(B.y - A.y) * screenShape.y,
|
|||
|
(B.x - A.x) * screenShape.x
|
|||
|
);
|
|||
|
|
|||
|
vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(
|
|||
|
sin(clipAngle),
|
|||
|
-cos(clipAngle)
|
|||
|
) / screenShape;
|
|||
|
|
|||
|
gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);
|
|||
|
|
|||
|
worldPosition = position;
|
|||
|
pixelArcLength = arcLength;
|
|||
|
fragColor = color;
|
|||
|
}
|
|||
|
`]),o=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform sampler2D dashTexture;
|
|||
|
uniform float dashScale;
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
varying vec3 worldPosition;
|
|||
|
varying float pixelArcLength;
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (
|
|||
|
outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||
|
|||
|
fragColor.a * opacity == 0.
|
|||
|
) discard;
|
|||
|
|
|||
|
float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;
|
|||
|
if(dashWeight < 0.5) {
|
|||
|
discard;
|
|||
|
}
|
|||
|
gl_FragColor = fragColor * opacity;
|
|||
|
}
|
|||
|
`]),s=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
#define FLOAT_MAX 1.70141184e38
|
|||
|
#define FLOAT_MIN 1.17549435e-38
|
|||
|
|
|||
|
// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl
|
|||
|
vec4 packFloat(float v) {
|
|||
|
float av = abs(v);
|
|||
|
|
|||
|
//Handle special cases
|
|||
|
if(av < FLOAT_MIN) {
|
|||
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|||
|
} else if(v > FLOAT_MAX) {
|
|||
|
return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;
|
|||
|
} else if(v < -FLOAT_MAX) {
|
|||
|
return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;
|
|||
|
}
|
|||
|
|
|||
|
vec4 c = vec4(0,0,0,0);
|
|||
|
|
|||
|
//Compute exponent and mantissa
|
|||
|
float e = floor(log2(av));
|
|||
|
float m = av * pow(2.0, -e) - 1.0;
|
|||
|
|
|||
|
//Unpack mantissa
|
|||
|
c[1] = floor(128.0 * m);
|
|||
|
m -= c[1] / 128.0;
|
|||
|
c[2] = floor(32768.0 * m);
|
|||
|
m -= c[2] / 32768.0;
|
|||
|
c[3] = floor(8388608.0 * m);
|
|||
|
|
|||
|
//Unpack exponent
|
|||
|
float ebias = e + 127.0;
|
|||
|
c[0] = floor(ebias / 2.0);
|
|||
|
ebias -= c[0] * 2.0;
|
|||
|
c[1] += floor(ebias) * 128.0;
|
|||
|
|
|||
|
//Unpack sign bit
|
|||
|
c[0] += 128.0 * step(0.0, -v);
|
|||
|
|
|||
|
//Scale back to range
|
|||
|
return c / 255.0;
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform float pickId;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
|
|||
|
varying vec3 worldPosition;
|
|||
|
varying float pixelArcLength;
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;
|
|||
|
|
|||
|
gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);
|
|||
|
}`]),c=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(h){return a(h,n,o,null,c)},t.createPickShader=function(h){return a(h,n,s,null,c)}},5714:function(e,t,r){"use strict";e.exports=p;var i=r(2762),a=r(8116),n=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer);function c(u,y,f,P){return o[0]=P,o[1]=f,o[2]=y,o[3]=u,s[0]}var h=r(2478),m=r(9618),d=r(7319),T=d.createShader,l=d.createPickShader,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(u,y){for(var f=0,P=0;P<3;++P){var L=u[P]-y[P];f+=L*L}return Math.sqrt(f)}function S(u){for(var y=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],f=0;f<3;++f)y[0][f]=Math.max(u[0][f],y[0][f]),y[1][f]=Math.min(u[1][f],y[1][f]);return y}function E(u,y,f,P){this.arcLength=u,this.position=y,this.index=f,this.dataCoordinate=P}function g(u,y,f,P,L,z){this.gl=u,this.shader=y,this.pickShader=f,this.buffer=P,this.vao=L,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var b=g.prototype;b.isTransparent=function(){return this.hasAlpha},b.isOpaque=function(){return!this.hasAlpha},b.pickSlots=1,b.setPickBase=function(u){this.pickId=u},b.drawTransparent=b.draw=function(u){if(this.vertexCount){var y=this.gl,f=this.shader,P=this.vao;f.bind(),f.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(y.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.drawPick=function(u){if(this.vertexCount){var y=this.gl,f=this.pickShader,P=this.vao;f.bind(),f.uniforms={model:u.model||_,view:u.view||_,projection:u.projection||_,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[y.drawingBufferWidth,y.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(y.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},b.update=function(u){var y,f;this.dirty=!0;var P=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var L=[],z=[],F=[],B=0,O=0,I=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=u.position||u.positions;if(N){var U=u.color||u.colors||[0,0,0,1],W=u.lineWidth||1,Q=!1;e:for(y=1;y<N.length;++y){var ue=N[y-1],se=N[y];for(z.push(B),F.push(ue.slice()),f=0;f<3;++f){if(isNaN(ue[f])||isNaN(se[f])||!isFinite(ue[f])||!isFinite(se[f])){if(!P&&L.length>0){for(var he=0;he<24;++he)L.push(L[L.length-12]);O+=2,Q=!0}continue e}I[0][f]=Math.min(I[0][f],ue[f],se[f]),I[1][f]=Math.max(I[1][f],ue[f],se[f])}var H,$;Array.isArray(U[0])?(H=U.length>y-1?U[y-1]:U.length>0?U[U.length-1]:[0,0,0,1],$=U.length>y?U[y]:U.length>0?U[U.length-1]:[0,0,0,1]):H=$=U,H.length===3&&(H=[H[0],H[1],H[2],1]),$.length===3&&($=[$[0],$[1],$[2],1]),!this.hasAlpha&&H[3]<1&&(this.hasAlpha=!0);var J;Array.isArray(W)?J=W.length>y-1?W[y-1]:W.length>0?W[W.length-1]:[0,0,0,1]:J=W;var X=B;if(B+=w(ue,se),Q){for(f=0;f<2;++f)L.push(ue[0],ue[1],ue[2],se[0],se[1],se[2],X,J,H[0],H[1],H[2],H[3]);O+=2,Q=!1}L.push(ue[0],ue[1],ue[2],se[0],se[1],se[2],X,J,H[0],H[1],H[2],H[3],ue[0],ue[1],ue[2],se[0],se[1],se[2],X,-J,H[0],H[1],H[2],H[3],se[0],se[1],se[2],ue[0],ue[1],ue[2],B,-J,$[0],$[1],$[2],$[3],se[0],se[1],se[2],ue[0],ue[1],ue[2],B,J,$[0],$[1],$[2],$[3]),O+=4}}if(this.buffer.update(L),z.push(B),F.push(N[N.length-1].slice()),this.bounds=I,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var oe=u.dashes,ne=oe.slice();for(ne.unshift(0),y=1;y<ne.length;++y)ne[y]=ne[y-1]+ne[y];var j=m(new Array(256*4),[256,1,4]);for(y=0;y<256;++y){for(f=0;f<4;++f)j.set(y,0,f,0);h.le(ne,ne[ne.length-1]*y/255)&1?j.set(y,0,0,0):j.set(y,0,0,255)}this.texture.setPixels(j)}},b.dispose=function(){this.shader.dispose(),
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position, normal;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 uv;
|
|||
|
|
|||
|
uniform mat4 model
|
|||
|
, view
|
|||
|
, projection
|
|||
|
, inverseModel;
|
|||
|
uniform vec3 eyePosition
|
|||
|
, lightPosition;
|
|||
|
|
|||
|
varying vec3 f_normal
|
|||
|
, f_lightDirection
|
|||
|
, f_eyeDirection
|
|||
|
, f_data;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
vec4 project(vec3 p) {
|
|||
|
return projection * (view * (model * vec4(p, 1.0)));
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_Position = project(position);
|
|||
|
|
|||
|
//Lighting geometry parameters
|
|||
|
vec4 cameraCoordinate = view * vec4(position , 1.0);
|
|||
|
cameraCoordinate.xyz /= cameraCoordinate.w;
|
|||
|
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
|||
|
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
|||
|
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
|||
|
|
|||
|
f_color = color;
|
|||
|
f_data = position;
|
|||
|
f_uv = uv;
|
|||
|
}
|
|||
|
`]),n=i([`#extension GL_OES_standard_derivatives : enable
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
float beckmannDistribution(float x, float roughness) {
|
|||
|
float NdotH = max(x, 0.0001);
|
|||
|
float cos2Alpha = NdotH * NdotH;
|
|||
|
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
|||
|
float roughness2 = roughness * roughness;
|
|||
|
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
|||
|
return exp(tan2Alpha / roughness2) / denom;
|
|||
|
}
|
|||
|
|
|||
|
float cookTorranceSpecular(
|
|||
|
vec3 lightDirection,
|
|||
|
vec3 viewDirection,
|
|||
|
vec3 surfaceNormal,
|
|||
|
float roughness,
|
|||
|
float fresnel) {
|
|||
|
|
|||
|
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
|||
|
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
|||
|
|
|||
|
//Half angle vector
|
|||
|
vec3 H = normalize(lightDirection + viewDirection);
|
|||
|
|
|||
|
//Geometric term
|
|||
|
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
|||
|
float VdotH = max(dot(viewDirection, H), 0.000001);
|
|||
|
float LdotH = max(dot(lightDirection, H), 0.000001);
|
|||
|
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
|||
|
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
|||
|
float G = min(1.0, min(G1, G2));
|
|||
|
|
|||
|
//Distribution term
|
|||
|
float D = beckmannDistribution(NdotH, roughness);
|
|||
|
|
|||
|
//Fresnel term
|
|||
|
float F = pow(1.0 - VdotN, fresnel);
|
|||
|
|
|||
|
//Multiply terms and done
|
|||
|
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
|||
|
}
|
|||
|
|
|||
|
//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float roughness
|
|||
|
, fresnel
|
|||
|
, kambient
|
|||
|
, kdiffuse
|
|||
|
, kspecular;
|
|||
|
uniform sampler2D texture;
|
|||
|
|
|||
|
varying vec3 f_normal
|
|||
|
, f_lightDirection
|
|||
|
, f_eyeDirection
|
|||
|
, f_data;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (f_color.a == 0.0 ||
|
|||
|
outOfRange(clipBounds[0], clipBounds[1], f_data)
|
|||
|
) discard;
|
|||
|
|
|||
|
vec3 N = normalize(f_normal);
|
|||
|
vec3 L = normalize(f_lightDirection);
|
|||
|
vec3 V = normalize(f_eyeDirection);
|
|||
|
|
|||
|
if(gl_FrontFacing) {
|
|||
|
N = -N;
|
|||
|
}
|
|||
|
|
|||
|
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
|||
|
//float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d
|
|||
|
|
|||
|
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
|||
|
|
|||
|
vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);
|
|||
|
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
|||
|
|
|||
|
gl_FragColor = litColor * f_color.a;
|
|||
|
}
|
|||
|
`]),o=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 uv;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec3 f_data;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
|||
|
f_color = color;
|
|||
|
f_data = position;
|
|||
|
f_uv = uv;
|
|||
|
}`]),s=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform sampler2D texture;
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec3 f_data;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;
|
|||
|
|
|||
|
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
|
|||
|
}`]),c=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 uv;
|
|||
|
attribute float pointSize;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
|||
|
|
|||
|
gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);
|
|||
|
} else {
|
|||
|
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
|||
|
}
|
|||
|
gl_PointSize = pointSize;
|
|||
|
f_color = color;
|
|||
|
f_uv = uv;
|
|||
|
}`]),h=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform sampler2D texture;
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);
|
|||
|
if(dot(pointR, pointR) > 0.25) {
|
|||
|
discard;
|
|||
|
}
|
|||
|
gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
|
|||
|
}`]),m=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
|||
|
f_id = id;
|
|||
|
f_position = position;
|
|||
|
}`]),d=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float pickId;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
|||
|
|
|||
|
gl_FragColor = vec4(pickId, f_id.xyz);
|
|||
|
}`]),T=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute float pointSize;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
|||
|
|
|||
|
gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
|
|||
|
} else {
|
|||
|
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
|||
|
gl_PointSize = pointSize;
|
|||
|
}
|
|||
|
f_id = id;
|
|||
|
f_position = position;
|
|||
|
}`]),l=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_Position = projection * (view * (model * vec4(position, 1.0)));
|
|||
|
}`]),_=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform vec3 contourColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_FragColor = vec4(contourColor, 1.0);
|
|||
|
}
|
|||
|
`]);t.meshShader={vertex:a,fragment:n,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:m,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:_,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){"use strict";var i=1e-6,a=1e-6,n=r(9405),o=r(2762),s=r(8116),c=r(7766),h=r(8406),m=r(6760),d=r(7608),T=r(9618),l=r(6729),_=r(7765),w=r(1888),S=r(840),E=r(7626),g=S.meshShader,b=S.wireShader,p=S.pointShader,u=S.pickShader,y=S.pointPickShader,f=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(he,H,$,J,X,oe,ne,j,ee,re,ce,be,Ae,ze,Re,We,it,ot,tt,ut,Me,_e,fe,Fe,rt,st,Qe){this.gl=he,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=H,this.dirty=!0,this.triShader=$,this.lineShader=J,this.pointShader=X,this.pickShader=oe,this.pointPickShader=ne,this.contourShader=j,this.trianglePositions=ee,this.triangleColors=ce,this.triangleNormals=Ae,this.triangleUVs=be,this.triangleIds=re,this.triangleVAO=ze,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Re,this.edgeColors=it,this.edgeUVs=ot,this.edgeIds=We,this.edgeVAO=tt,this.edgeCount=0,this.pointPositions=ut,this.pointColors=_e,this.pointUVs=fe,this.pointSizes=Fe,this.pointIds=Me,this.pointVAO=rt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=st,this.contourVAO=Qe,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=P,this._view=P,this._projection=P,this._resolution=[1,1]}var z=L.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(he){this.pickId=he};function F(he,H){if(!H||!H.length)return 1;for(var $=0;$<H.length;++$){if(H.length<2)return 1;if(H[$][0]===he)return H[$][1];if(H[$][0]>he&&$>0){var J=(H[$][0]-he)/(H[$][0]-H[$-1][0]);return H[$][1]*(1-J)+J*H[$-1][1]}}return 1}function B(he,H){for(var $=l({colormap:he,nshades:256,format:"rgba"}),J=new Uint8Array(256*4),X=0;X<256;++X){for(var oe=$[X],ne=0;ne<3;++ne)J[4*X+ne]=oe[ne];H?J[4*X+3]=255*F(X/255,H):J[4*X+3]=255*oe[3]}return T(J,[256,256,4],[4,0,1])}function O(he){for(var H=he.length,$=new Array(H),J=0;J<H;++J)$[J]=he[J][2];return $}z.highlight=function(he){if(!he||!this.contourEnable){this.contourCount=0;return}for(var H=_(this.cells,this.intensity,he.intensity),$=H.cells,J=H.vertexIds,X=H.vertexWeights,oe=$.length,ne=w.mallocFloat32(2*3*oe),j=0,ee=0;ee<oe;++ee)for(var re=$[ee],ce=0;ce<2;++ce){var be=re[0];re.length===2&&(be=re[ce]);for(var Ae=J[be][0],ze=J[be][1],Re=X[be],We=1-Re,it=this.positions[Ae],ot=this.positions[ze],tt=0;tt<3;++tt)ne[j++]=Re*it[tt]+We*ot[tt]}this.contourCount=j/3|0,this.contourPositions.update(ne.subarray(0,j)),w.free(ne)},z.update=function(he){he=he||{};var H=this.gl;this.dirty=!0,"contourEnable"in he&&(this.contourEnable=he.contourEnable),"contourColor"in he&&(this.contourColor=he.contourColor),"lineWidth"in he&&(this.lineWidth=he.lineWidth),"lightPosition"in he&&(this.lightPosition=he.lightPosition),this.hasAlpha=!1,"opacity"in he&&(this.opacity=he.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in he&&(this.opacityscale=he.opacityscale,this.hasAlpha=!0),"ambient"in he&&(this.ambientLight=he.ambient),"diffuse"in he&&(this.diffus
|
|||
|
#define GLSLIFY 1
|
|||
|
attribute vec2 position;
|
|||
|
varying vec2 uv;
|
|||
|
void main() {
|
|||
|
uv = position;
|
|||
|
gl_Position = vec4(position, 0, 1);
|
|||
|
}`]),o=i([`precision mediump float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform sampler2D accumBuffer;
|
|||
|
varying vec2 uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));
|
|||
|
gl_FragColor = min(vec4(1,1,1,1), accum);
|
|||
|
}`]);e.exports=function(s){return a(s,n,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){"use strict";var i=r(4437),a=r(3837),n=r(5445),o=r(4449),s=r(3589),c=r(2260),h=r(7169),m=r(351),d=r(4772),T=r(4040),l=r(799),_=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:b,createCamera:i};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function S(u,y){var f=null;try{f=u.getContext("webgl",y),f||(f=u.getContext("experimental-webgl",y))}catch{return null}return f}function E(u){var y=Math.round(Math.log(Math.abs(u))/Math.log(10));if(y<0){var f=Math.round(Math.pow(10,-y));return Math.ceil(u*f)/f}else if(y>0){var f=Math.round(Math.pow(10,y));return Math.ceil(u/f)*f}return Math.ceil(u)}function g(u){return typeof u=="boolean"?u:!0}function b(u){u=u||{},u.camera=u.camera||{};var y=u.canvas;if(!y)if(y=document.createElement("canvas"),u.container){var f=u.container;f.appendChild(y)}else document.body.appendChild(y);var P=u.gl;if(P||(u.glOptions&&(_=!!u.glOptions.preserveDrawingBuffer),P=S(y,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:_})),!P)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new w,F=c(P,P.drawingBufferWidth,P.drawingBufferHeight,{preferFloat:!_}),B=l(P),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,I={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(P,N);U.enable=!N.disable;var W=u.spikes||{},Q=o(P,W),ue=[],se=[],he=[],H=[],$=!0,ne=!0,J=new Array(16),X=new Array(16),oe={view:null,projection:J,model:X,_ortho:!1},ne=!0,j=[P.drawingBufferWidth,P.drawingBufferHeight],ee=u.cameraObject||i(y,I),re={gl:P,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:y,selection:z,camera:ee,axes:U,axesPixels:null,spikes:Q,bounds:L,objects:ue,shape:j,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:g(u.autoResize),autoBounds:g(u.autoBounds),autoScale:!!u.autoScale,autoCenter:g(u.autoCenter),clipToBounds:g(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:oe,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ut){this.aspect[0]=ut.x,this.aspect[1]=ut.y,this.aspect[2]=ut.z,ne=!0},setBounds:function(ut,Me){this.bounds[0][ut]=Me.min,this.bounds[1][ut]=Me.max},setClearColor:function(ut){this.clearColor=ut},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},ce=[P.drawingBufferWidth/re.pixelRatio|0,P.drawingBufferHeight/re.pixelRatio|0];function be(){if(!re._stopped&&re.autoResize){var ut=y.parentNode,Me=1,_e=1;ut&&ut!==document.body?(Me=ut.clientWidth,_e=ut.clientHeight):(Me=window.innerWidth,_e=window.innerHeight);var fe=Math.ceil(Me*re.pixelRatio)|0,Fe=Math.ceil(_e*re.pixelRatio)|0;if(fe!==y.width||Fe!==y.height){y.width=fe,y.height=Fe;var rt=y.style;rt.position=rt.position||"absolute",rt.left="0px",rt.top="0px",rt.width=Me+"px",rt.height=_e+"px",$=!0}}}re.autoResize&&be(),window.addEventListener("resize",be);function Ae(){for(var ut=ue.length,Me=H.length,_e=0;_e<Me;++_e)he[_e]=0;e:for(var _e=0;_e<ut;++_e){var fe=ue[_e],Fe=fe.pickSlots;if(!Fe){se[_e]=-1;continue}for(var rt=0;rt<Me;++rt)if(he[rt]+Fe<255){se[_e]=rt,fe.setPickBase(he[rt]+1),he[rt]+=Fe;continue e}var st=s(P,j);se[_e]=Me,H.push(st),he.push(Fe),fe.setPickBase(1),Me+=1}for(;Me>0&&he[Me-1]===0;)he.pop(),H.pop().dispose()}re.update=function(ut){re._stopped||(ut=ut||{},$=!0,ne=!0)},re.add=function(ut){re._stopped||(ut.axes=U,ue.push(ut),se.push(-1),$
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 glyph;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform vec4 highlightId;
|
|||
|
uniform float highlightScale;
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
|
|||
|
varying vec4 interpColor;
|
|||
|
varying vec4 pickId;
|
|||
|
varying vec3 dataCoordinate;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
|||
|
|
|||
|
gl_Position = vec4(0,0,0,0);
|
|||
|
} else {
|
|||
|
float scale = 1.0;
|
|||
|
if(distance(highlightId, id) < 0.0001) {
|
|||
|
scale = highlightScale;
|
|||
|
}
|
|||
|
|
|||
|
vec4 worldPosition = model * vec4(position, 1);
|
|||
|
vec4 viewPosition = view * worldPosition;
|
|||
|
viewPosition = viewPosition / viewPosition.w;
|
|||
|
vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));
|
|||
|
|
|||
|
gl_Position = clipPosition;
|
|||
|
interpColor = color;
|
|||
|
pickId = id;
|
|||
|
dataCoordinate = position;
|
|||
|
}
|
|||
|
}`]),o=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 glyph;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec2 screenSize;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float highlightScale, pixelRatio;
|
|||
|
uniform vec4 highlightId;
|
|||
|
|
|||
|
varying vec4 interpColor;
|
|||
|
varying vec4 pickId;
|
|||
|
varying vec3 dataCoordinate;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
|||
|
|
|||
|
gl_Position = vec4(0,0,0,0);
|
|||
|
} else {
|
|||
|
float scale = pixelRatio;
|
|||
|
if(distance(highlightId.bgr, id.bgr) < 0.001) {
|
|||
|
scale *= highlightScale;
|
|||
|
}
|
|||
|
|
|||
|
vec4 worldPosition = model * vec4(position, 1.0);
|
|||
|
vec4 viewPosition = view * worldPosition;
|
|||
|
vec4 clipPosition = projection * viewPosition;
|
|||
|
clipPosition /= clipPosition.w;
|
|||
|
|
|||
|
gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);
|
|||
|
interpColor = color;
|
|||
|
pickId = id;
|
|||
|
dataCoordinate = position;
|
|||
|
}
|
|||
|
}`]),s=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
attribute vec3 position;
|
|||
|
attribute vec4 color;
|
|||
|
attribute vec2 glyph;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform float highlightScale;
|
|||
|
uniform vec4 highlightId;
|
|||
|
uniform vec3 axes[2];
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec2 screenSize;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float scale, pixelRatio;
|
|||
|
|
|||
|
varying vec4 interpColor;
|
|||
|
varying vec4 pickId;
|
|||
|
varying vec3 dataCoordinate;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], position)) {
|
|||
|
|
|||
|
gl_Position = vec4(0,0,0,0);
|
|||
|
} else {
|
|||
|
float lscale = pixelRatio * scale;
|
|||
|
if(distance(highlightId, id) < 0.0001) {
|
|||
|
lscale *= highlightScale;
|
|||
|
}
|
|||
|
|
|||
|
vec4 clipCenter = projection * (view * (model * vec4(position, 1)));
|
|||
|
vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;
|
|||
|
vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));
|
|||
|
|
|||
|
gl_Position = clipPosition;
|
|||
|
interpColor = color;
|
|||
|
pickId = id;
|
|||
|
dataCoordinate = dataPosition;
|
|||
|
}
|
|||
|
}
|
|||
|
`]),c=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 fragClipBounds[2];
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
varying vec4 interpColor;
|
|||
|
varying vec3 dataCoordinate;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (
|
|||
|
outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||
|
|||
|
interpColor.a * opacity == 0.
|
|||
|
) discard;
|
|||
|
gl_FragColor = interpColor * opacity;
|
|||
|
}
|
|||
|
`]),h=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 fragClipBounds[2];
|
|||
|
uniform float pickGroup;
|
|||
|
|
|||
|
varying vec4 pickId;
|
|||
|
varying vec3 dataCoordinate;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;
|
|||
|
|
|||
|
gl_FragColor = vec4(pickGroup, pickId.bgr);
|
|||
|
}`]),m=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],d={vertex:n,fragment:c,attributes:m},T={vertex:o,fragment:c,attributes:m},l={vertex:s,fragment:c,attributes:m},_={vertex:n,fragment:h,attributes:m},w={vertex:o,fragment:h,attributes:m},S={vertex:s,fragment:h,attributes:m};function E(g,b){var p=i(g,b),u=p.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,p}t.createPerspective=function(g){return E(g,d)},t.createOrtho=function(g){return E(g,T)},t.createProject=function(g){return E(g,l)},t.createPickPerspective=function(g){return E(g,_)},t.createPickOrtho=function(g){return E(g,w)},t.createPickProject=function(g){return E(g,S)}},8418:function(e,t,r){"use strict";var i=r(5219),a=r(2762),n=r(8116),o=r(1888),s=r(6760),c=r(1283),h=r(9366),m=r(5964),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function _(X){return T.isView(X)&&!(X instanceof l)}function w(X){return Array.isArray(X)||_(X)}e.exports=J;function S(X,oe){var ne=X[0],j=X[1],ee=X[2],re=X[3];return X[0]=oe[0]*ne+oe[4]*j+oe[8]*ee+oe[12]*re,X[1]=oe[1]*ne+oe[5]*j+oe[9]*ee+oe[13]*re,X[2]=oe[2]*ne+oe[6]*j+oe[10]*ee+oe[14]*re,X[3]=oe[3]*ne+oe[7]*j+oe[11]*ee+oe[15]*re,X}function E(X,oe,ne,j){return S(j,j,ne),S(j,j,oe),S(j,j,X)}function g(X,oe){this.index=X,this.dataCoordinate=this.position=oe}function b(X){return X===!0||X>1?1:X}function p(X,oe,ne,j,ee,re,ce,be,Ae,ze,Re,We){this.gl=X,this.pixelRatio=1,this.shader=oe,this.orthoShader=ne,this.projectShader=j,this.pointBuffer=ee,this.colorBuffer=re,this.glyphBuffer=ce,this.idBuffer=be,this.vao=Ae,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=ze,this.pickOrthoShader=Re,this.pickProjectShader=We,this.points=[],this._selectResult=new g(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=p.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],f=[0,0,0],P=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=d.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function I(X){return X[0]=X[1]=X[2]=0,X}function N(X,oe){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[3]=1,X}function U(X,oe,ne,j){return X[0]=oe[0],X[1]=oe[1],X[2]=oe[2],X[ne]=j,X}function W(X){for(var oe=O,ne=0;ne<2;++ne)for(var j=0;j<3;++j)oe[ne][j]=Math.max(Math.min(X[ne][j],1e8),-1e8);return oe}function Q(X,oe,ne,j){var ee=oe.axesProject,re=oe.gl,ce=X.uniforms,be=ne.model||d,Ae=ne.view||d,ze=ne.projection||d,Re=oe.axesBounds,We=W(oe.clipBounds),it;oe.axes&&oe.axes.lastCubeProps?it=oe.axes.lastCubeProps.axis:it=[1,1,1],y[0]=2/re.drawingBufferWidth,y[1]=2/re.drawingBufferHeight,X.bind(),ce.view=Ae,ce.projection=ze,ce.screenSize=y,ce.highlightId=oe.highlightId,ce.highlightScale=oe.highlightScale,ce.clipBounds=We,ce.pickGroup=oe.pickId/255,ce.pixelRatio=j;for(var ot=0;ot<3;++ot)if(ee[ot]){ce.scale=oe.projectScale[ot],ce.opacity=oe.projectOpacity[ot];for(var tt=F,ut=0;ut<16;++ut)tt[ut]=0;for(var ut=0;ut<4;++ut)tt[5*ut]=1;tt[5*ot]=0,it[ot]<0?tt[12+ot]=Re[0][ot]:tt[12+ot]=Re[1][ot],s(tt,be,tt),ce.model=tt;var Me=(ot+1)%3,_e=(ot+2)%3,fe=I(f),Fe=I(P);fe[Me]=1,Fe[_e]=1;var rt=E(ze,Ae,be,N(L,fe)),st=E(ze,Ae,be,N(z,Fe));if(Math.abs(rt[1])>Math.abs(st[1])){var Qe=rt;rt=st,st=Qe,Qe=fe,fe=Fe,Fe=Qe;var Lt=Me;Me=_e,_e=Lt}rt[0]<0&&(fe[Me]=-1),st[1]>0&&(Fe[_e]=-1);for(var kt=0,qt=0,ut=0;ut<4;++ut)kt+=Math.pow(be[4*Me+ut],2),qt+=Math.pow(be[4*_e+ut],2);fe[Me]/=Math.sqrt(kt),Fe[_e]/=Math.sqrt(qt),c
|
|||
|
`+a:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t},8731:function(e,t,r){"use strict";e.exports=h;var i=r(8866);function a(m,d,T,l,_,w){this._gl=m,this._wrapper=d,this._index=T,this._locations=l,this._dimension=_,this._constFunc=w}var n=a.prototype;n.pointer=function(d,T,l,_){var w=this,S=w._gl,E=w._locations[w._index];S.vertexAttribPointer(E,w._dimension,d||S.FLOAT,!!T,l||0,_||0),S.enableVertexAttribArray(E)},n.set=function(m,d,T,l){return this._constFunc(this._locations[this._index],m,d,T,l)},Object.defineProperty(n,"location",{get:function(){return this._locations[this._index]},set:function(m){return m!==this._locations[this._index]&&(this._locations[this._index]=m|0,this._wrapper.program=null),m|0}});var o=[function(m,d,T){return T.length===void 0?m.vertexAttrib1f(d,T):m.vertexAttrib1fv(d,T)},function(m,d,T,l){return T.length===void 0?m.vertexAttrib2f(d,T,l):m.vertexAttrib2fv(d,T)},function(m,d,T,l,_){return T.length===void 0?m.vertexAttrib3f(d,T,l,_):m.vertexAttrib3fv(d,T)},function(m,d,T,l,_,w){return T.length===void 0?m.vertexAttrib4f(d,T,l,_,w):m.vertexAttrib4fv(d,T)}];function s(m,d,T,l,_,w,S){var E=o[_],g=new a(m,d,T,l,_,E);Object.defineProperty(w,S,{set:function(b){return m.disableVertexAttribArray(l[T]),E(m,l[T],b),b},get:function(){return g},enumerable:!0})}function c(m,d,T,l,_,w,S){for(var E=new Array(_),g=new Array(_),b=0;b<_;++b)s(m,d,T[b],l,_,E,b),g[b]=E[b];Object.defineProperty(E,"location",{set:function(y){if(Array.isArray(y))for(var f=0;f<_;++f)g[f].location=y[f];else for(var f=0;f<_;++f)g[f].location=y+f;return y},get:function(){for(var y=new Array(_),f=0;f<_;++f)y[f]=l[T[f]];return y},enumerable:!0}),E.pointer=function(y,f,P,L){y=y||m.FLOAT,f=!!f,P=P||_*_,L=L||0;for(var z=0;z<_;++z){var F=l[T[z]];m.vertexAttribPointer(F,_,y,f,P,L+z*_),m.enableVertexAttribArray(F)}};var p=new Array(_),u=m["vertexAttrib"+_+"fv"];Object.defineProperty(w,S,{set:function(y){for(var f=0;f<_;++f){var P=l[T[f]];if(m.disableVertexAttribArray(P),Array.isArray(y[0]))u.call(m,P,y[f]);else{for(var L=0;L<_;++L)p[L]=y[_*f+L];u.call(m,P,p)}}return y},get:function(){return E},enumerable:!0})}function h(m,d,T,l){for(var _={},w=0,S=T.length;w<S;++w){var E=T[w],g=E.name,b=E.type,p=E.locations;switch(b){case"bool":case"int":case"float":s(m,d,p[0],l,1,_,g);break;default:if(b.indexOf("vec")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new i("","Invalid data type for attribute "+g+": "+b);s(m,d,p[0],l,u,_,g)}else if(b.indexOf("mat")>=0){var u=b.charCodeAt(b.length-1)-48;if(u<2||u>4)throw new i("","Invalid data type for attribute "+g+": "+b);c(m,d,p,l,u,_,g)}else throw new i("","Unknown data type for attribute "+g+": "+b);break}}return _}},3327:function(e,t,r){"use strict";var i=r(216),a=r(8866);e.exports=s;function n(c){return function(){return c}}function o(c,h){for(var m=new Array(c),d=0;d<c;++d)m[d]=h;return m}function s(c,h,m,d){function T(b){return function(p,u,y){return p.getUniform(u.program,y[b])}}function l(b){return function(u){for(var y=_("",b),f=0;f<y.length;++f){var P=y[f],L=P[0],z=P[1];if(d[z]){var F=u;if(typeof L=="string"&&(L.indexOf(".")===0||L.indexOf("[")===0)){var B=L;if(L.indexOf(".")===0&&(B=L.slice(1)),B.indexOf("]")===B.length-1){var O=B.indexOf("["),I=B.slice(0,O),N=B.slice(O+1,B.length-1);F=I?u[I][N]:u[N]}else F=u[B]}var U=m[z].type,W;switch(U){case"bool":case"int":case"sampler2D":case"samplerCube":c.uniform1i(d[z],F);break;case"float":c.uniform1f(d[z],F);break;default:var Q=U.indexOf("vec");if(0<=Q&&Q<=1&&U.length===4+Q){if(W=U.charCodeAt(U.length-1)-48,W<2||W>4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+W+"iv"](d[z],F);break;case"v":c["uniform"+W+"fv"](d[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(W=U.charCodeAt(U.length-1)-48,W<2||W>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);c["uniformMatrix"+W+"fv"](d[z],!1,F);break}else throw new a("","Unknown uniform data type for "
|
|||
|
`+p)}throw new i(p,u.short,u.long)}return b}m.getShaderReference=function(S,E){var g=this.gl,b=this.shaders[S===g.FRAGMENT_SHADER|0],p=b[E];if(!p||!g.isShader(p.shader)){var u=d(g,S,E);p=b[E]=new c(s++,E,S,u,[],1,this)}else p.count+=1;return p};function T(S,E,g,b,p){var u=S.createProgram();S.attachShader(u,E),S.attachShader(u,g);for(var y=0;y<b.length;++y)S.bindAttribLocation(u,p[y],b[y]);if(S.linkProgram(u),!S.getProgramParameter(u,S.LINK_STATUS)){var f=S.getProgramInfoLog(u);throw new i(f,"Error linking program: "+f)}return u}m.getProgram=function(S,E,g,b){var p=[S.id,E.id,g.join(":"),b.join(":")].join("@"),u=this.programs[p];return(!u||!this.gl.isProgram(u))&&(this.programs[p]=u=T(this.gl,S.shader,E.shader,g,b),S.programs.push(p),E.programs.push(p)),u};function l(S){var E=o.get(S);return E||(E=new h(S),o.set(S,E)),E}function _(S,E,g){return l(S).getShaderReference(E,g)}function w(S,E,g,b,p){return l(S).getProgram(E,g,b,p)}},1493:function(e,t,r){"use strict";var i=r(3236),a=r(9405),n=i([`precision mediump float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec3 position, color;
|
|||
|
attribute float weight;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform vec3 coordinates[3];
|
|||
|
uniform vec4 colors[3];
|
|||
|
uniform vec2 screenShape;
|
|||
|
uniform float lineWidth;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 vertexPosition = mix(coordinates[0],
|
|||
|
mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));
|
|||
|
|
|||
|
vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));
|
|||
|
vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;
|
|||
|
vec2 delta = weight * clipOffset * screenShape;
|
|||
|
vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;
|
|||
|
|
|||
|
gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);
|
|||
|
fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];
|
|||
|
}
|
|||
|
`]),o=i([`precision mediump float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_FragColor = fragColor;
|
|||
|
}`]);e.exports=function(s){return a(s,n,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(e,t,r){"use strict";var i=r(2762),a=r(8116),n=r(1493);e.exports=T;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,_,w,S){this.gl=l,this.buffer=_,this.vao=w,this.shader=S,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var c=s.prototype,h=[0,0,0],m=[0,0,0],d=[0,0];c.isTransparent=function(){return!1},c.drawTransparent=function(l){},c.draw=function(l){var _=this.gl,w=this.vao,S=this.shader;w.bind(),S.bind();var E=l.model||o,g=l.view||o,b=l.projection||o,p;this.axes&&(p=this.axes.lastCubeProps.axis);for(var u=h,y=m,f=0;f<3;++f)p&&p[f]<0?(u[f]=this.bounds[0][f],y[f]=this.bounds[1][f]):(u[f]=this.bounds[1][f],y[f]=this.bounds[0][f]);d[0]=_.drawingBufferWidth,d[1]=_.drawingBufferHeight,S.uniforms.model=E,S.uniforms.view=g,S.uniforms.projection=b,S.uniforms.coordinates=[this.position,u,y],S.uniforms.colors=this.colors,S.uniforms.screenShape=d;for(var f=0;f<3;++f)S.uniforms.lineWidth=this.lineWidth[f]*this.pixelRatio,this.enabled[f]&&(w.draw(_.TRIANGLES,6,6*f),this.drawSides[f]&&w.draw(_.TRIANGLES,12,18+12*f));w.unbind()},c.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},c.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,_){var w=[];function S(u,y,f,P,L,z){var F=[u,y,f,0,0,0,1];F[P+3]=1,F[P]=L,w.push.apply(w,F),F[6]=-1,w.push.apply(w,F),F[P]=z,w.push.apply(w,F),w.push.apply(w,F),F[6]=1,w.push.apply(w,F),F[P]=L,w.push.apply(w,F)}S(0,0,0,0,0,1),S(0,0,0,1,0,1),S(0,0,0,2,0,1),S(1,0,0,1,-1,1),S(1,0,0,2,-1,1),S(0,1,0,0,-1,1),S(0,1,0,2,-1,1),S(0,0,1,0,-1,1),S(0,0,1,1,-1,1);var E=i(l,w),g=a(l,[{type:l.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:E,size:1,offset:24,stride:28}]),b=n(l);b.attributes.position.location=0,b.attributes.color.location=1,b.attributes.weight.location=2;var p=new s(l,E,g,b);return p.update(_),p}},6740:function(e,t,r){var i=r(3236),a=i([`precision highp float;
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
vec3 getOrthogonalVector(vec3 v) {
|
|||
|
// Return up-vector for only-z vector.
|
|||
|
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
|||
|
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
|||
|
// Assign z = 0, x = -b, y = a:
|
|||
|
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
|||
|
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
|||
|
return normalize(vec3(-v.y, v.x, 0.0));
|
|||
|
} else {
|
|||
|
return normalize(vec3(0.0, v.z, -v.y));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Calculate the tube vertex and normal at the given index.
|
|||
|
//
|
|||
|
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
|
|||
|
//
|
|||
|
// Each tube segment is made up of a ring of vertices.
|
|||
|
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
|
|||
|
// The indexes of tube segments run from 0 to 8.
|
|||
|
//
|
|||
|
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
|
|||
|
float segmentCount = 8.0;
|
|||
|
|
|||
|
float angle = 2.0 * 3.14159 * (index / segmentCount);
|
|||
|
|
|||
|
vec3 u = getOrthogonalVector(d);
|
|||
|
vec3 v = normalize(cross(u, d));
|
|||
|
|
|||
|
vec3 x = u * cos(angle) * length(d);
|
|||
|
vec3 y = v * sin(angle) * length(d);
|
|||
|
vec3 v3 = x + y;
|
|||
|
|
|||
|
normal = normalize(v3);
|
|||
|
|
|||
|
return v3;
|
|||
|
}
|
|||
|
|
|||
|
attribute vec4 vector;
|
|||
|
attribute vec4 color, position;
|
|||
|
attribute vec2 uv;
|
|||
|
|
|||
|
uniform float vectorScale, tubeScale;
|
|||
|
uniform mat4 model, view, projection, inverseModel;
|
|||
|
uniform vec3 eyePosition, lightPosition;
|
|||
|
|
|||
|
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
// Scale the vector magnitude to stay constant with
|
|||
|
// model & view changes.
|
|||
|
vec3 normal;
|
|||
|
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
|
|||
|
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
|||
|
|
|||
|
//Lighting geometry parameters
|
|||
|
vec4 cameraCoordinate = view * tubePosition;
|
|||
|
cameraCoordinate.xyz /= cameraCoordinate.w;
|
|||
|
f_lightDirection = lightPosition - cameraCoordinate.xyz;
|
|||
|
f_eyeDirection = eyePosition - cameraCoordinate.xyz;
|
|||
|
f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
|
|||
|
|
|||
|
// vec4 m_position = model * vec4(tubePosition, 1.0);
|
|||
|
vec4 t_position = view * tubePosition;
|
|||
|
gl_Position = projection * t_position;
|
|||
|
|
|||
|
f_color = color;
|
|||
|
f_data = tubePosition.xyz;
|
|||
|
f_position = position.xyz;
|
|||
|
f_uv = uv;
|
|||
|
}
|
|||
|
`]),n=i([`#extension GL_OES_standard_derivatives : enable
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
float beckmannDistribution(float x, float roughness) {
|
|||
|
float NdotH = max(x, 0.0001);
|
|||
|
float cos2Alpha = NdotH * NdotH;
|
|||
|
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
|||
|
float roughness2 = roughness * roughness;
|
|||
|
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
|||
|
return exp(tan2Alpha / roughness2) / denom;
|
|||
|
}
|
|||
|
|
|||
|
float cookTorranceSpecular(
|
|||
|
vec3 lightDirection,
|
|||
|
vec3 viewDirection,
|
|||
|
vec3 surfaceNormal,
|
|||
|
float roughness,
|
|||
|
float fresnel) {
|
|||
|
|
|||
|
float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
|
|||
|
float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
|
|||
|
|
|||
|
//Half angle vector
|
|||
|
vec3 H = normalize(lightDirection + viewDirection);
|
|||
|
|
|||
|
//Geometric term
|
|||
|
float NdotH = max(dot(surfaceNormal, H), 0.0);
|
|||
|
float VdotH = max(dot(viewDirection, H), 0.000001);
|
|||
|
float LdotH = max(dot(lightDirection, H), 0.000001);
|
|||
|
float G1 = (2.0 * NdotH * VdotN) / VdotH;
|
|||
|
float G2 = (2.0 * NdotH * LdotN) / LdotH;
|
|||
|
float G = min(1.0, min(G1, G2));
|
|||
|
|
|||
|
//Distribution term
|
|||
|
float D = beckmannDistribution(NdotH, roughness);
|
|||
|
|
|||
|
//Fresnel term
|
|||
|
float F = pow(1.0 - VdotN, fresnel);
|
|||
|
|
|||
|
//Multiply terms and done
|
|||
|
return G * F * D / max(3.14159265 * VdotN, 0.000001);
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
|||
|
uniform sampler2D texture;
|
|||
|
|
|||
|
varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
|
|||
|
varying vec4 f_color;
|
|||
|
varying vec2 f_uv;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
|||
|
vec3 N = normalize(f_normal);
|
|||
|
vec3 L = normalize(f_lightDirection);
|
|||
|
vec3 V = normalize(f_eyeDirection);
|
|||
|
|
|||
|
if(gl_FrontFacing) {
|
|||
|
N = -N;
|
|||
|
}
|
|||
|
|
|||
|
float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
|
|||
|
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
|||
|
|
|||
|
vec4 surfaceColor = f_color * texture2D(texture, f_uv);
|
|||
|
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
|||
|
|
|||
|
gl_FragColor = litColor * opacity;
|
|||
|
}
|
|||
|
`]),o=i([`precision highp float;
|
|||
|
|
|||
|
precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
vec3 getOrthogonalVector(vec3 v) {
|
|||
|
// Return up-vector for only-z vector.
|
|||
|
// Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
|
|||
|
// From the above if-statement we have ||a|| > 0 U ||b|| > 0.
|
|||
|
// Assign z = 0, x = -b, y = a:
|
|||
|
// a*-b + b*a + c*0 = -ba + ba + 0 = 0
|
|||
|
if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
|
|||
|
return normalize(vec3(-v.y, v.x, 0.0));
|
|||
|
} else {
|
|||
|
return normalize(vec3(0.0, v.z, -v.y));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// Calculate the tube vertex and normal at the given index.
|
|||
|
//
|
|||
|
// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.
|
|||
|
//
|
|||
|
// Each tube segment is made up of a ring of vertices.
|
|||
|
// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.
|
|||
|
// The indexes of tube segments run from 0 to 8.
|
|||
|
//
|
|||
|
vec3 getTubePosition(vec3 d, float index, out vec3 normal) {
|
|||
|
float segmentCount = 8.0;
|
|||
|
|
|||
|
float angle = 2.0 * 3.14159 * (index / segmentCount);
|
|||
|
|
|||
|
vec3 u = getOrthogonalVector(d);
|
|||
|
vec3 v = normalize(cross(u, d));
|
|||
|
|
|||
|
vec3 x = u * cos(angle) * length(d);
|
|||
|
vec3 y = v * sin(angle) * length(d);
|
|||
|
vec3 v3 = x + y;
|
|||
|
|
|||
|
normal = normalize(v3);
|
|||
|
|
|||
|
return v3;
|
|||
|
}
|
|||
|
|
|||
|
attribute vec4 vector;
|
|||
|
attribute vec4 position;
|
|||
|
attribute vec4 id;
|
|||
|
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform float tubeScale;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 normal;
|
|||
|
vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);
|
|||
|
vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
|
|||
|
|
|||
|
gl_Position = projection * (view * tubePosition);
|
|||
|
f_id = id;
|
|||
|
f_position = position.xyz;
|
|||
|
}
|
|||
|
`]),s=i([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float pickId;
|
|||
|
|
|||
|
varying vec3 f_position;
|
|||
|
varying vec4 f_id;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
|
|||
|
|
|||
|
gl_FragColor = vec4(pickId, f_id.xyz);
|
|||
|
}`]);t.meshShader={vertex:a,fragment:n,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){"use strict";var i=r(2931),a=r(9970),n=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(S,E,g,b){for(var p=S.points,u=S.velocities,y=S.divergences,f=[],P=[],L=[],z=[],F=[],B=[],O=0,I=0,N=a.create(),U=a.create(),W=8,Q=0;Q<p.length;Q++){var ue=p[Q],se=u[Q],he=y[Q];E===0&&(he=g*.05),I=i.length(se)/b,N=a.create(),i.copy(N,se),N[3]=he;for(var H=0;H<W;H++)F[H]=[ue[0],ue[1],ue[2],H];if(z.length>0)for(var H=0;H<W;H++){var $=(H+1)%W;f.push(z[H],F[H],F[$],F[$],z[$],z[H]),L.push(U,N,N,N,U,U),B.push(O,I,I,I,O,O);var J=f.length;P.push([J-6,J-5,J-4],[J-3,J-2,J-1])}var X=z;z=F,F=X;var oe=U;U=N,N=oe;var ne=O;O=I,I=ne}return{positions:f,cells:P,vectors:L,vertexIntensity:B}},s=function(S,E,g,b){for(var p=0,u=0;u<S.length;u++)for(var y=S[u].velocities,f=0;f<y.length;f++)p=Math.max(p,i.length(y[f]));for(var P=S.map(function(Q){return o(Q,g,b,p)}),L=[],z=[],F=[],B=[],u=0;u<P.length;u++){var O=P[u],I=L.length;L=L.concat(O.positions),F=F.concat(O.vectors),B=B.concat(O.vertexIntensity);for(var f=0;f<O.cells.length;f++){var N=O.cells[f],U=[];z.push(U);for(var W=0;W<N.length;W++)U.push(N[W]+I)}}return{positions:L,cells:z,vectors:F,vertexIntensity:B,colormap:E}},c=function(S,E){var g=S.length,b;for(b=0;b<g;b++){var p=S[b];if(p===E)return b;if(p>E)return b-1}return b},h=function(S,E,g){return S<E?E:S>g?g:S},m=function(S,E,g){var b=E.vectors,p=E.meshgrid,u=S[0],y=S[1],f=S[2],P=p[0].length,L=p[1].length,z=p[2].length,F=c(p[0],u),B=c(p[1],y),O=c(p[2],f),I=F+1,N=B+1,U=O+1;if(F=h(F,0,P-1),I=h(I,0,P-1),B=h(B,0,L-1),N=h(N,0,L-1),O=h(O,0,z-1),U=h(U,0,z-1),F<0||B<0||O<0||I>P-1||N>L-1||U>z-1)return i.create();var W=p[0][F],Q=p[0][I],ue=p[1][B],se=p[1][N],he=p[2][O],H=p[2][U],$=(u-W)/(Q-W),J=(y-ue)/(se-ue),X=(f-he)/(H-he);isFinite($)||($=.5),isFinite(J)||(J=.5),isFinite(X)||(X=.5);var oe,ne,j,ee,re,ce;switch(g.reversedX&&(F=P-1-F,I=P-1-I),g.reversedY&&(B=L-1-B,N=L-1-N),g.reversedZ&&(O=z-1-O,U=z-1-U),g.filled){case 5:re=O,ce=U,j=B*z,ee=N*z,oe=F*z*L,ne=I*z*L;break;case 4:re=O,ce=U,oe=F*z,ne=I*z,j=B*z*P,ee=N*z*P;break;case 3:j=B,ee=N,re=O*L,ce=U*L,oe=F*L*z,ne=I*L*z;break;case 2:j=B,ee=N,oe=F*L,ne=I*L,re=O*L*P,ce=U*L*P;break;case 1:oe=F,ne=I,re=O*P,ce=U*P,j=B*P*z,ee=N*P*z;break;default:oe=F,ne=I,j=B*P,ee=N*P,re=O*P*L,ce=U*P*L;break}var be=b[oe+j+re],Ae=b[oe+j+ce],ze=b[oe+ee+re],Re=b[oe+ee+ce],We=b[ne+j+re],it=b[ne+j+ce],ot=b[ne+ee+re],tt=b[ne+ee+ce],ut=i.create(),Me=i.create(),_e=i.create(),fe=i.create();i.lerp(ut,be,We,$),i.lerp(Me,Ae,it,$),i.lerp(_e,ze,ot,$),i.lerp(fe,Re,tt,$);var Fe=i.create(),rt=i.create();i.lerp(Fe,ut,_e,J),i.lerp(rt,Me,fe,J);var st=i.create();return i.lerp(st,Fe,rt,X),st},d=function(S,E){var g=E[0],b=E[1],p=E[2];return S[0]=g<0?-g:g,S[1]=b<0?-b:b,S[2]=p<0?-p:p,S},T=function(S){var E=1/0;S.sort(function(u,y){return u-y});for(var g=S.length,b=1;b<g;b++){var p=Math.abs(S[b]-S[b-1]);p<E&&(E=p)}return E},l=function(S){for(var E=[],g=[],b=[],p={},u={},y={},f=S.length,P=0;P<f;P++){var L=S[P],z=L[0],F=L[1],B=L[2];p[z]||(E.push(z),p[z]=!0),u[F]||(g.push(F),u[F]=!0),y[B]||(b.push(B),y[B]=!0)}var O=T(E),I=T(g),N=T(b),U=Math.min(O,I,N);return isFinite(U)?U:1};e.exports=function(S,E){var g=S.startingPositions,b=S.maxLength||1e3,p=S.tubeSize||1,u=S.absoluteTubeSize,y=S.gridFill||"+x+y+z",f={};y.indexOf("-x")!==-1&&(f.reversedX=!0),y.indexOf("-y")!==-1&&(f.reversedY=!0),y.indexOf("-z")!==-1&&(f.reversedZ=!0),f.filled=n.indexOf(y.replace(/-/g,"").replace(/\+/g,""));var P=S.getVelocity||function(it){return m(it,S,f)},L=S.getDivergence||function(it,ot){var tt=i.create(),ut=1e-4;i.add(tt,it,[ut,0,0]);var Me=P(tt);i.subtract(Me,Me,ot),i.scale(Me,Me,1/ut),i.add(tt,it,[0,ut,0]);var _e=P(tt);i.subtract(_e,_e,ot),i.scale(_e,_e,1/ut),i.add(tt,it,[0,0,ut]);var fe=P(tt);return i.subtract(fe,fe,ot),i.scale(fe,fe,1/ut),i.add(tt,Me,_e),i.add(tt,tt,fe),tt},z=[],
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec4 uv;
|
|||
|
attribute vec3 f;
|
|||
|
attribute vec3 normal;
|
|||
|
|
|||
|
uniform vec3 objectOffset;
|
|||
|
uniform mat4 model, view, projection, inverseModel;
|
|||
|
uniform vec3 lightPosition, eyePosition;
|
|||
|
uniform sampler2D colormap;
|
|||
|
|
|||
|
varying float value, kill;
|
|||
|
varying vec3 worldCoordinate;
|
|||
|
varying vec2 planeCoordinate;
|
|||
|
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
|||
|
varying vec4 vColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 localCoordinate = vec3(uv.zw, f.x);
|
|||
|
worldCoordinate = objectOffset + localCoordinate;
|
|||
|
mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));
|
|||
|
vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);
|
|||
|
vec4 clipPosition = projection * (view * worldPosition);
|
|||
|
gl_Position = clipPosition;
|
|||
|
kill = f.y;
|
|||
|
value = f.z;
|
|||
|
planeCoordinate = uv.xy;
|
|||
|
|
|||
|
vColor = texture2D(colormap, vec2(value, value));
|
|||
|
|
|||
|
//Lighting geometry parameters
|
|||
|
vec4 cameraCoordinate = view * worldPosition;
|
|||
|
cameraCoordinate.xyz /= cameraCoordinate.w;
|
|||
|
lightDirection = lightPosition - cameraCoordinate.xyz;
|
|||
|
eyeDirection = eyePosition - cameraCoordinate.xyz;
|
|||
|
surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);
|
|||
|
}
|
|||
|
`]),o=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
float beckmannDistribution(float x, float roughness) {
|
|||
|
float NdotH = max(x, 0.0001);
|
|||
|
float cos2Alpha = NdotH * NdotH;
|
|||
|
float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
|
|||
|
float roughness2 = roughness * roughness;
|
|||
|
float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
|
|||
|
return exp(tan2Alpha / roughness2) / denom;
|
|||
|
}
|
|||
|
|
|||
|
float beckmannSpecular(
|
|||
|
vec3 lightDirection,
|
|||
|
vec3 viewDirection,
|
|||
|
vec3 surfaceNormal,
|
|||
|
float roughness) {
|
|||
|
return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec3 lowerBound, upperBound;
|
|||
|
uniform float contourTint;
|
|||
|
uniform vec4 contourColor;
|
|||
|
uniform sampler2D colormap;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
|
|||
|
uniform float vertexColor;
|
|||
|
|
|||
|
varying float value, kill;
|
|||
|
varying vec3 worldCoordinate;
|
|||
|
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
|||
|
varying vec4 vColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
if (
|
|||
|
kill > 0.0 ||
|
|||
|
vColor.a == 0.0 ||
|
|||
|
outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)
|
|||
|
) discard;
|
|||
|
|
|||
|
vec3 N = normalize(surfaceNormal);
|
|||
|
vec3 V = normalize(eyeDirection);
|
|||
|
vec3 L = normalize(lightDirection);
|
|||
|
|
|||
|
if(gl_FrontFacing) {
|
|||
|
N = -N;
|
|||
|
}
|
|||
|
|
|||
|
float specular = max(beckmannSpecular(L, V, N, roughness), 0.);
|
|||
|
float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
|
|||
|
|
|||
|
//decide how to interpolate color \u2014 in vertex or in fragment
|
|||
|
vec4 surfaceColor =
|
|||
|
step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +
|
|||
|
step(.5, vertexColor) * vColor;
|
|||
|
|
|||
|
vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
|
|||
|
|
|||
|
gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;
|
|||
|
}
|
|||
|
`]),s=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute vec4 uv;
|
|||
|
attribute float f;
|
|||
|
|
|||
|
uniform vec3 objectOffset;
|
|||
|
uniform mat3 permutation;
|
|||
|
uniform mat4 model, view, projection;
|
|||
|
uniform float height, zOffset;
|
|||
|
uniform sampler2D colormap;
|
|||
|
|
|||
|
varying float value, kill;
|
|||
|
varying vec3 worldCoordinate;
|
|||
|
varying vec2 planeCoordinate;
|
|||
|
varying vec3 lightDirection, eyeDirection, surfaceNormal;
|
|||
|
varying vec4 vColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
vec3 dataCoordinate = permutation * vec3(uv.xy, height);
|
|||
|
worldCoordinate = objectOffset + dataCoordinate;
|
|||
|
mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));
|
|||
|
vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);
|
|||
|
|
|||
|
vec4 clipPosition = projection * (view * worldPosition);
|
|||
|
clipPosition.z += zOffset;
|
|||
|
|
|||
|
gl_Position = clipPosition;
|
|||
|
value = f + objectOffset.z;
|
|||
|
kill = -1.0;
|
|||
|
planeCoordinate = uv.zw;
|
|||
|
|
|||
|
vColor = texture2D(colormap, vec2(value, value));
|
|||
|
|
|||
|
//Don't do lighting for contours
|
|||
|
surfaceNormal = vec3(1,0,0);
|
|||
|
eyeDirection = vec3(0,1,0);
|
|||
|
lightDirection = vec3(0,0,1);
|
|||
|
}
|
|||
|
`]),c=a([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
bool outOfRange(float a, float b, float p) {
|
|||
|
return ((p > max(a, b)) ||
|
|||
|
(p < min(a, b)));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
|||
|
return (outOfRange(a.x, b.x, p.x) ||
|
|||
|
outOfRange(a.y, b.y, p.y) ||
|
|||
|
outOfRange(a.z, b.z, p.z));
|
|||
|
}
|
|||
|
|
|||
|
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
|||
|
return outOfRange(a.xyz, b.xyz, p.xyz);
|
|||
|
}
|
|||
|
|
|||
|
uniform vec2 shape;
|
|||
|
uniform vec3 clipBounds[2];
|
|||
|
uniform float pickId;
|
|||
|
|
|||
|
varying float value, kill;
|
|||
|
varying vec3 worldCoordinate;
|
|||
|
varying vec2 planeCoordinate;
|
|||
|
varying vec3 surfaceNormal;
|
|||
|
|
|||
|
vec2 splitFloat(float v) {
|
|||
|
float vh = 255.0 * v;
|
|||
|
float upper = floor(vh);
|
|||
|
float lower = fract(vh);
|
|||
|
return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
if ((kill > 0.0) ||
|
|||
|
(outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;
|
|||
|
|
|||
|
vec2 ux = splitFloat(planeCoordinate.x / shape.x);
|
|||
|
vec2 uy = splitFloat(planeCoordinate.y / shape.y);
|
|||
|
gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));
|
|||
|
}
|
|||
|
`]);t.createShader=function(h){var m=i(h,n,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createPickShader=function(h){var m=i(h,n,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m.attributes.normal.location=2,m},t.createContourShader=function(h){var m=i(h,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m},t.createPickContourShader=function(h){var m=i(h,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return m.attributes.uv.location=0,m.attributes.f.location=1,m}},9499:function(e,t,r){"use strict";e.exports=oe;var i=r(8828),a=r(2762),n=r(8116),o=r(7766),s=r(1888),c=r(6729),h=r(5298),m=r(9994),d=r(9618),T=r(3711),l=r(6760),_=r(7608),w=r(2478),S=r(6199),E=r(990),g=E.createShader,b=E.createContourShader,p=E.createPickShader,u=E.createPickContourShader,y=4*10,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],L=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var ne=0;ne<3;++ne){var j=L[ne],ee=(ne+1)%3,re=(ne+2)%3;j[ee+0]=1,j[re+3]=1,j[ne+6]=1}})();function z(ne,j,ee,re,ce){this.position=ne,this.index=j,this.uv=ee,this.level=re,this.dataCoordinate=ce}var F=256;function B(ne,j,ee,re,ce,be,Ae,ze,Re,We,it,ot,tt,ut,Me){this.gl=ne,this.shape=j,this.bounds=ee,this.objectOffset=Me,this.intensityBounds=[],this._shader=re,this._pickShader=ce,this._coordinateBuffer=be,this._vao=Ae,this._colorMap=ze,this._contourShader=Re,this._contourPickShader=We,this._contourBuffer=it,this._contourVAO=ot,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new z([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=tt,this._dynamicVAO=ut,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[d(s.mallocFloat(1024),[0,0]),d(s.mallocFloat(1024),[0,0]),d(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=B.prototype;O.genColormap=function(ne,j){var ee=!1,re=m([c({colormap:ne,nshades:F,format:"rgba"}).map(function(ce,be){var Ae=j?I(be/255,j):ce[3];return Ae<1&&(ee=!0),[ce[0],ce[1],ce[2],255*Ae]})]);return h.divseq(re,255),this.hasAlphaScale=ee,re},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(ne){this.pickId=ne};function I(ne,j){if(!j||!j.length)return 1;for(var ee=0;ee<j.length;++ee){if(j.length<2)return 1;if(j[ee][0]===ne)return j[ee][1];if(j[ee][0]>ne&&ee>0){var re=(j[ee][0]-ne)/(j[ee][0]-j[ee-1][0]);return j[ee][1]*(1-re)+re*j[ee-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[f.slice(),f.slice(),f.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function W(ne,j){var ee,re,ce,be=j.axes&&j.axes.lastCubeProps.axis||N,Ae=j.showSurface,ze=j.showContour;for(ee=0;ee<3;++ee)for(Ae=Ae||j.surfaceProject[ee],re=0;re<3;++re)ze=ze||j.contourProject[ee][re];for(ee=0;ee<3;++ee){var Re
|
|||
|
`),J=$.length;for(var Fe;B=$[L],L<J;){switch(Fe=L,F){case m:L=We();break;case d:L=Re();break;case T:L=ze();break;case l:L=it();break;case _:L=ut();break;case u:L=tt();break;case w:L=Me();break;case h:L=_e();break;case b:L=Ae();break;case c:L=be();break}if(Fe!==L)switch($[Fe]){case`
|
|||
|
`:ue=0,++Q;break;default:++ue;break}}return z+=L,$=$.slice(L),N}function ce(fe){return I.length&&ee(I.join("")),F=p,ee("(eof)"),N}function be(){return I=I.length?[]:I,O==="/"&&B==="*"?(se=z+L-1,F=m,O=B,L+1):O==="/"&&B==="/"?(se=z+L-1,F=d,O=B,L+1):B==="#"?(F=T,se=z+L,L):/\s/.test(B)?(F=b,se=z+L,L):(he=/\d/.test(B),H=/[^\w_]/.test(B),se=z+L,F=he?_:H?l:h,L)}function Ae(){return/[^\s]/g.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function ze(){return(B==="\r"||B===`
|
|||
|
`)&&O!=="\\"?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function Re(){return ze()}function We(){return B==="/"&&O==="*"?(I.push(B),ee(I.join("")),F=c,L+1):(I.push(B),O=B,L+1)}function it(){if(O==="."&&/\d/.test(B))return F=w,L;if(O==="/"&&B==="*")return F=m,L;if(O==="/"&&B==="/")return F=d,L;if(B==="."&&I.length){for(;ot(I););return F=w,L}if(B===";"||B===")"||B==="("){if(I.length)for(;ot(I););return ee(B),F=c,L+1}var fe=I.length===2&&B!=="=";if(/[\w_\d\s]/.test(B)||fe){for(;ot(I););return F=c,L}return I.push(B),O=B,L+1}function ot(fe){var Fe=0,rt,st;do{if(rt=a.indexOf(fe.slice(0,fe.length+Fe).join("")),st=a[rt],rt===-1){if(Fe--+fe.length>0)continue;st=fe.slice(0,1).join("")}return ee(st),se+=st.length,I=I.slice(st.length),I.length}while(!0)}function tt(){return/[^a-fA-F0-9]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function ut(){return B==="."||/[eE]/.test(B)?(I.push(B),F=w,O=B,L+1):B==="x"&&I.length===1&&I[0]==="0"?(F=u,I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function Me(){return B==="f"&&(I.push(B),O=B,L+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(I.push(B),O=B,L+1):/[^\d]/.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function _e(){if(/[^\d\w_]/.test(B)){var fe=I.join("");return j[fe]?F=g:ne[fe]?F=E:F=S,ee(I.join("")),F=c,L}return I.push(B),O=B,L+1}}},3508:function(e,t,r){var i=r(6852);i=i.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=i.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_Objec
|
|||
|
`):B=B.replace(/\<br\>/g," ");var U="",W=[];for(j=0;j<B.length;++j)W[j]=U;N.bolds===!0&&(W=b(h,m,B,W)),N.italics===!0&&(W=b(d,T,B,W)),N.superscripts===!0&&(W=b(l,w,B,W)),N.subscripts===!0&&(W=b(S,g,B,W));var Q=[],ue="";for(j=0;j<B.length;++j)W[j]!==null&&(ue+=B[j],Q.push(W[j]));var se=ue.split(`
|
|||
|
`),he=se.length,H=Math.round(I*O),$=O,J=O*2,X=0,oe=he*H+J;z.height<oe&&(z.height=oe),F.fillStyle="#000",F.fillRect(0,0,z.width,z.height),F.fillStyle="#fff";var ne,j,ee,re,ce,be=0,Ae="";function ze(){if(Ae!==""){var fe=F.measureText(Ae).width;F.fillText(Ae,$+ee,J+re),ee+=fe}}function Re(){return""+Math.round(ce)+"px "}function We(fe,Fe){var rt=""+F.font;if(N.subscripts===!0){var st=fe.indexOf(E),Qe=Fe.indexOf(E),Lt=st>-1?parseInt(fe[1+st]):0,kt=Qe>-1?parseInt(Fe[1+Qe]):0;Lt!==kt&&(rt=rt.replace(Re(),"?px "),ce*=Math.pow(.75,kt-Lt),rt=rt.replace("?px ",Re())),re+=.25*H*(kt-Lt)}if(N.superscripts===!0){var qt=fe.indexOf(_),Zt=Fe.indexOf(_),Sr=qt>-1?parseInt(fe[1+qt]):0,xr=Zt>-1?parseInt(Fe[1+Zt]):0;Sr!==xr&&(rt=rt.replace(Re(),"?px "),ce*=Math.pow(.75,xr-Sr),rt=rt.replace("?px ",Re())),re-=.25*H*(xr-Sr)}if(N.bolds===!0){var jr=fe.indexOf(m)>-1,wr=Fe.indexOf(m)>-1;!jr&&wr&&(Ir?rt=rt.replace("italic ","italic bold "):rt="bold "+rt),jr&&!wr&&(rt=rt.replace("bold ",""))}if(N.italics===!0){var Ir=fe.indexOf(T)>-1,bt=Fe.indexOf(T)>-1;!Ir&&bt&&(rt="italic "+rt),Ir&&!bt&&(rt=rt.replace("italic ",""))}F.font=rt}for(ne=0;ne<he;++ne){var it=se[ne]+`
|
|||
|
`;for(ee=0,re=ne*H,ce=O,Ae="",j=0;j<it.length;++j){var ot=j+be<Q.length?Q[j+be]:Q[Q.length-1];U===ot?Ae+=it[j]:(ze(),Ae=it[j],ot!==void 0&&(We(U,ot),U=ot))}ze(),be+=it.length;var tt=Math.round(ee+2*$)|0;X<tt&&(X=tt)}var ut=X,Me=J+H*he,_e=a(F.getImageData(0,0,ut,Me).data,[Me,ut,4]);return _e.pick(-1,-1,0).transpose(1,0)}function y(z,F){var B=i(z,128);return F?n(B.cells,B.positions,.25):{edges:B.cells,positions:B.positions}}function f(z,F,B,O){var I=y(z,O),N=p(I.positions,F,B),U=I.edges,W=F.orientation==="ccw";if(o(N,U),F.polygons||F.polygon||F.polyline){for(var Q=c(U,N),ue=new Array(Q.length),se=0;se<Q.length;++se){for(var he=Q[se],H=new Array(he.length),$=0;$<he.length;++$){for(var J=he[$],X=new Array(J.length),oe=0;oe<J.length;++oe)X[oe]=N[J[oe]].slice();W&&X.reverse(),H[$]=X}ue[se]=H}return ue}else return F.triangles||F.triangulate||F.triangle?{cells:s(N,U,{delaunay:!1,exterior:!1,interior:!0}),positions:N}:{edges:U,positions:N}}function P(z,F,B){try{return f(z,F,B,!0)}catch{}try{return f(z,F,B,!1)}catch{}return F.polygons||F.polyline||F.polygon?[]:F.triangles||F.triangulate||F.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function L(z,F,B,O){var I=64,N=1.25,U={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};O&&(O.size&&O.size>0&&(I=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,I+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var W=u(F,B,z,I,N,U);return P(W,O,I)}},1538:function(e){(function(){"use strict";if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(f){f.permitHostObjects___&&f.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var i=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var n=new a,o=Object.freeze({});if(n.set(o,1),n.get(o)!==1)i=!0;else{e.exports=WeakMap;return}}}var s=Object.prototype.hasOwnProperty,c=Object.getOwnPropertyNames,h=Object.defineProperty,m=Object.isExtensible,d="weakmap:",T=d+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var l=new ArrayBuffer(25),_=new Uint8Array(l);crypto.getRandomValues(_),T=d+"rand:"+Array.prototype.map.call(_,function(f){return(f%36).toString(36)}).join("")+"___"}function w(f){return!(f.substr(0,d.length)==d&&f.substr(f.length-3)==="___")}if(h(Object,"getOwnPropertyNames",{value:function(P){return c(P).filter(w)}}),"getPropertyNames"in Object){var S=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(P){return S(P).filter(w)}})}function E(f){if(f!==Object(f))throw new TypeError("Not an object: "+f);var P=f[T];if(P&&P.key===f)return P;if(m(f)){P={key:f};try{return h(f,T,{value:P,writable:!1,enumerable:!1,configurable:!1}),P}catch{return}}}(function(){var f=Object.freeze;h(Object,"freeze",{value:function(F){return E(F),f(F)}});var P=Object.seal;h(Object,"seal",{value:function(F){return E(F),P(F)}});var L=Object.preventExtensions;h(Object,"preventExtensions",{value:function(F){return E(F),L(F)}})})();function g(f){return f.prototype=null,Object.freeze(f)}var b=!1;function p(){!b&&typeof console<"u"&&(b=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var u=0,y=function(){this instanceof y||p();var f=[],P=[],L=u++;function z(I,N){var U,W=E(I);return W?L in W?W[L]:N:(U=f.indexOf(I),U>=0?P[U]:N)}function F(I){var N=E(I);return N?L in N:f.indexOf(I)>=0}function B(I,N){var U,W=E(I);return W?W[L]=N:(U=f.indexOf(I),U>=0?P[U]=N:(U=f.length,P[U]=N,f[U]=I)),this}function O(I){var N
|
|||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=hg(),s=v0(),c=fj(),h=vT(),m=sh(),d=hj(),T=Ev(),l=q5(),_=m0(),w=pj(),S=mT(),E=k1(),g=b;function b(y,f){var P=this;if(!(this instanceof b))return new b(y,f);typeof y=="function"?(f||(f={}),f.regl=y):(f=y,y=null),f&&f.length&&(f.positions=f),y=f.regl;var L=y._gl,z,F=[],B={},O=[],I=[null],N=[null],U=255,W=100;this.tooManyColors=w,z=y.texture({data:new Uint8Array(U*4),width:U,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),m(this,{regl:y,gl:L,groups:O,markerCache:N,markerTextures:I,palette:F,paletteIds:B,paletteTexture:z,maxColors:U,maxSize:W,canvas:L.canvas}),this.update(f);var Q={uniforms:{constPointSize:!!f.constPointSize,opacity:y.prop("opacity"),paletteSize:function(H,$){return[P.tooManyColors?0:U,z.height]},pixelRatio:y.context("pixelRatio"),scale:y.prop("scale"),scaleFract:y.prop("scaleFract"),translate:y.prop("translate"),translateFract:y.prop("translateFract"),markerTexture:y.prop("markerTexture"),paletteTexture:z},attributes:{x:function(H,$){return $.xAttr||{buffer:$.positionBuffer,stride:8,offset:0}},y:function(H,$){return $.yAttr||{buffer:$.positionBuffer,stride:8,offset:4}},xFract:function(H,$){return $.xAttr?{constant:[0,0]}:{buffer:$.positionFractBuffer,stride:8,offset:0}},yFract:function(H,$){return $.yAttr?{constant:[0,0]}:{buffer:$.positionFractBuffer,stride:8,offset:4}},size:function(H,$){return $.size.length?{buffer:$.sizeBuffer,stride:2,offset:0}:{constant:[Math.round($.size*255/P.maxSize)]}},borderSize:function(H,$){return $.borderSize.length?{buffer:$.sizeBuffer,stride:2,offset:1}:{constant:[Math.round($.borderSize*255/P.maxSize)]}},colorId:function(H,$){return $.color.length?{buffer:$.colorBuffer,stride:P.tooManyColors?8:4,offset:0}:{constant:P.tooManyColors?F.slice($.color*4,$.color*4+4):[$.color]}},borderColorId:function(H,$){return $.borderColor.length?{buffer:$.colorBuffer,stride:P.tooManyColors?8:4,offset:P.tooManyColors?4:2}:{constant:P.tooManyColors?F.slice($.borderColor*4,$.borderColor*4+4):[$.borderColor]}},isActive:function(H,$){return $.activation===!0?{constant:[1]}:$.activation?$.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:y.prop("viewport")},viewport:y.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:y.prop("elements"),count:y.prop("count"),offset:y.prop("offset"),primitive:"points"},ue=m({},Q);ue.frag=d([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
uniform float opacity;
|
|||
|
uniform sampler2D markerTexture;
|
|||
|
|
|||
|
varying vec4 fragColor, fragBorderColor;
|
|||
|
varying float fragWidth, fragBorderColorLevel, fragColorLevel;
|
|||
|
|
|||
|
float smoothStep(float x, float y) {
|
|||
|
return 1.0 / (1.0 + exp(50.0*(x - y)));
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;
|
|||
|
|
|||
|
// max-distance alpha
|
|||
|
if (dist < 0.003) discard;
|
|||
|
|
|||
|
// null-border case
|
|||
|
if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {
|
|||
|
float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);
|
|||
|
gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);
|
|||
|
}
|
|||
|
else {
|
|||
|
float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);
|
|||
|
float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);
|
|||
|
|
|||
|
vec4 color = fragBorderColor;
|
|||
|
color.a *= borderColorAmt;
|
|||
|
color = mix(color, fragColor, colorAmt);
|
|||
|
color.a *= opacity;
|
|||
|
|
|||
|
gl_FragColor = color;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
`]),ue.vert=d([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute float x, y, xFract, yFract;
|
|||
|
attribute float size, borderSize;
|
|||
|
attribute vec4 colorId, borderColorId;
|
|||
|
attribute float isActive;
|
|||
|
|
|||
|
// \`invariant\` effectively turns off optimizations for the position.
|
|||
|
// We need this because -fast-math on M1 Macs is re-ordering
|
|||
|
// floating point operations in a way that causes floating point
|
|||
|
// precision limits to put points in the wrong locations.
|
|||
|
invariant gl_Position;
|
|||
|
|
|||
|
uniform bool constPointSize;
|
|||
|
uniform float pixelRatio;
|
|||
|
uniform vec2 scale, scaleFract, translate, translateFract, paletteSize;
|
|||
|
uniform sampler2D paletteTexture;
|
|||
|
|
|||
|
const float maxSize = 100.;
|
|||
|
const float borderLevel = .5;
|
|||
|
|
|||
|
varying vec4 fragColor, fragBorderColor;
|
|||
|
varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;
|
|||
|
|
|||
|
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
|
|||
|
|
|||
|
bool isDirect = (paletteSize.x < 1.);
|
|||
|
|
|||
|
vec4 getColor(vec4 id) {
|
|||
|
return isDirect ? id / 255. : texture2D(paletteTexture,
|
|||
|
vec2(
|
|||
|
(id.x + .5) / paletteSize.x,
|
|||
|
(id.y + .5) / paletteSize.y
|
|||
|
)
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
// ignore inactive points
|
|||
|
if (isActive == 0.) return;
|
|||
|
|
|||
|
vec2 position = vec2(x, y);
|
|||
|
vec2 positionFract = vec2(xFract, yFract);
|
|||
|
|
|||
|
vec4 color = getColor(colorId);
|
|||
|
vec4 borderColor = getColor(borderColorId);
|
|||
|
|
|||
|
float size = size * maxSize / 255.;
|
|||
|
float borderSize = borderSize * maxSize / 255.;
|
|||
|
|
|||
|
gl_PointSize = 2. * size * pointSizeScale;
|
|||
|
fragPointSize = size * pixelRatio;
|
|||
|
|
|||
|
vec2 pos = (position + translate) * scale
|
|||
|
+ (positionFract + translateFract) * scale
|
|||
|
+ (position + translate) * scaleFract
|
|||
|
+ (positionFract + translateFract) * scaleFract;
|
|||
|
|
|||
|
gl_Position = vec4(pos * 2. - 1., 0., 1.);
|
|||
|
|
|||
|
fragColor = color;
|
|||
|
fragBorderColor = borderColor;
|
|||
|
fragWidth = 1. / gl_PointSize;
|
|||
|
|
|||
|
fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);
|
|||
|
fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);
|
|||
|
}
|
|||
|
`]),this.drawMarker=y(ue);var se=m({},Q);se.frag=d([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
varying vec4 fragColor, fragBorderColor;
|
|||
|
varying float fragBorderRadius, fragWidth;
|
|||
|
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
float smoothStep(float edge0, float edge1, float x) {
|
|||
|
float t;
|
|||
|
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
|
|||
|
return t * t * (3.0 - 2.0 * t);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
float radius, alpha = 1.0, delta = fragWidth;
|
|||
|
|
|||
|
radius = length(2.0 * gl_PointCoord.xy - 1.0);
|
|||
|
|
|||
|
if (radius > 1.0 + delta) {
|
|||
|
discard;
|
|||
|
}
|
|||
|
|
|||
|
alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);
|
|||
|
|
|||
|
float borderRadius = fragBorderRadius;
|
|||
|
float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);
|
|||
|
vec4 color = mix(fragColor, fragBorderColor, ratio);
|
|||
|
color.a *= alpha * opacity;
|
|||
|
gl_FragColor = color;
|
|||
|
}
|
|||
|
`]),se.vert=d([`precision highp float;
|
|||
|
#define GLSLIFY 1
|
|||
|
|
|||
|
attribute float x, y, xFract, yFract;
|
|||
|
attribute float size, borderSize;
|
|||
|
attribute vec4 colorId, borderColorId;
|
|||
|
attribute float isActive;
|
|||
|
|
|||
|
// \`invariant\` effectively turns off optimizations for the position.
|
|||
|
// We need this because -fast-math on M1 Macs is re-ordering
|
|||
|
// floating point operations in a way that causes floating point
|
|||
|
// precision limits to put points in the wrong locations.
|
|||
|
invariant gl_Position;
|
|||
|
|
|||
|
uniform bool constPointSize;
|
|||
|
uniform float pixelRatio;
|
|||
|
uniform vec2 paletteSize, scale, scaleFract, translate, translateFract;
|
|||
|
uniform sampler2D paletteTexture;
|
|||
|
|
|||
|
const float maxSize = 100.;
|
|||
|
|
|||
|
varying vec4 fragColor, fragBorderColor;
|
|||
|
varying float fragBorderRadius, fragWidth;
|
|||
|
|
|||
|
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
|
|||
|
|
|||
|
bool isDirect = (paletteSize.x < 1.);
|
|||
|
|
|||
|
vec4 getColor(vec4 id) {
|
|||
|
return isDirect ? id / 255. : texture2D(paletteTexture,
|
|||
|
vec2(
|
|||
|
(id.x + .5) / paletteSize.x,
|
|||
|
(id.y + .5) / paletteSize.y
|
|||
|
)
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
// ignore inactive points
|
|||
|
if (isActive == 0.) return;
|
|||
|
|
|||
|
vec2 position = vec2(x, y);
|
|||
|
vec2 positionFract = vec2(xFract, yFract);
|
|||
|
|
|||
|
vec4 color = getColor(colorId);
|
|||
|
vec4 borderColor = getColor(borderColorId);
|
|||
|
|
|||
|
float size = size * maxSize / 255.;
|
|||
|
float borderSize = borderSize * maxSize / 255.;
|
|||
|
|
|||
|
gl_PointSize = (size + borderSize) * pointSizeScale;
|
|||
|
|
|||
|
vec2 pos = (position + translate) * scale
|
|||
|
+ (positionFract + translateFract) * scale
|
|||
|
+ (position + translate) * scaleFract
|
|||
|
+ (positionFract + translateFract) * scaleFract;
|
|||
|
|
|||
|
gl_Position = vec4(pos * 2. - 1., 0., 1.);
|
|||
|
|
|||
|
fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);
|
|||
|
fragColor = color;
|
|||
|
fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;
|
|||
|
fragWidth = 1. / gl_PointSize;
|
|||
|
}
|
|||
|
`]),w&&(se.frag=se.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=y(se)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var y=this,f=arguments.length,P=new Array(f),L=0;L<f;L++)P[L]=arguments[L];var z=this.groups;if(P.length===1&&Array.isArray(P[0])&&(P[0][0]===null||Array.isArray(P[0][0]))&&(P=P[0]),this.regl._refresh(),P.length)for(var F=0;F<P.length;F++)this.drawItem(F,P[F]);else z.forEach(function(B,O){y.drawItem(O)});return this},b.prototype.drawItem=function(y,f){var P=this.groups,L=P[y];if(typeof f=="number"&&(y=f,L=P[f],f=null),!!(L&&L.count&&L.opacity)){L.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,L,f));for(var z=[],F=1;F<L.activation.length;F++)!L.activation[F]||L.activation[F]!==!0&&!L.activation[F].data.length||z.push.apply(z,A(this.getMarkerDrawOptions(F,L,f)));z.length&&this.drawMarker(z)}},b.prototype.getMarkerDrawOptions=function(y,f,P){var L=f.range,z=f.tree,F=f.viewport,B=f.activation,O=f.selectionBuffer,I=f.count,N=this.regl;if(!z)return P?[m({},f,{markerTexture:this.markerTextures[y],activation:B[y],count:P.length,elements:P,offset:0})]:[m({},f,{markerTexture:this.markerTextures[y],activation:B[y],offset:0})];var U=[],W=z.range(L,{lod:!0,px:[(L[2]-L[0])/F.width,(L[3]-L[1])/F.height]});if(P){for(var Q=B[y],ue=Q.data,se=new Uint8Array(I),he=0;he<P.length;he++){var H=P[he];se[H]=ue?ue[H]:1}O.subdata(se)}for(var $=W.length;$--;){var J=x(W[$],2),X=J[0],oe=J[1];U.push(m({},f,{markerTexture:this.markerTextures[y],activation:P?O:B[y],offset:X,count:oe-X}))}return U},b.prototype.update=function(){for(var y=this,f=arguments.length,P=new Array(f),L=0;L<f;L++)P[L]=arguments[L];if(P.length){P.length===1&&Array.isArray(P[0])&&(P=P[0]);var z=this.groups,F=this.gl,B=this.regl,O=this.maxSize,I=this.maxColors,N=this.palette;this.groups=z=P.map(function(U,W){var Q=z[W];if(U===void 0)return Q;U===null?U={positions:null}:typeof U=="function"?U={ondraw:U}:typeof U[0]=="number"&&(U={positions:U}),U=T(U,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),U.positions===null&&(U.positions=[]),U.tooManyColors!=null&&(y.tooManyColors=U.tooManyColors),Q||(z[W]=Q={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:B.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},U=m({},b.defaults,U)),U.positions&&!("marker"in U)&&(U.marker=Q.marker,delete Q.marker),U.marker&&!("positions"in U)&&(U.positions=Q.positions,delete Q.positions);var ue=0,se=0;if(l(Q,U,[{snap:!0,size:function(tt,ut){return tt==null&&(tt=b.defaults.size),ue+=tt&&tt.length?1:0,tt},borderSize:function(tt,ut){return tt==null&&(tt=b.defaults.borderSize),ue+=tt&&tt.length?1:0,tt},opacity:parseFloat,color:function(tt,ut){return tt==null&&(tt=b.defaults.color),tt=y.updateColor(tt),se++,tt},borderColor:function(tt,ut){return tt==null&&(tt=b.defaults.borderColor),tt=y.updateColor(tt),se++,tt},bounds:f
|
|||
|
`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),M)}}}),$5=Ze({"node_modules/type/lib/resolve-exception.js"(Z,q){"use strict";var v=y0(),x=yT(),A=Nj(),M=jj(),e=function(t,r){return t.replace("%v",M(r))};q.exports=function(t,r,i){if(!x(i))throw new TypeError(e(r,t));if(!v(t)){if("default"in i)return i.default;if(i.isOptional)return null}var a=A(i.errorMessage);throw v(a)||(a=r),new TypeError(e(a,t))}}}),Vj=Ze({"node_modules/type/value/ensure.js"(Z,q){"use strict";var v=$5(),x=y0();q.exports=function(A){return x(A)?A:v(A,"Cannot use %v",arguments[1])}}}),qj=Ze({"node_modules/type/plain-function/ensure.js"(Z,q){"use strict";var v=$5(),x=Z5();q.exports=function(A){return x(A)?A:v(A,"%v is not a plain function",arguments[1])}}}),Gj=Ze({"node_modules/es5-ext/array/from/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v=Array.from,x,A;return typeof v!="function"?!1:(x=["raz","dwa"],A=v(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),Hj=Ze({"node_modules/es5-ext/function/is-function.js"(Z,q){"use strict";var v=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);q.exports=function(A){return typeof A=="function"&&x(v.call(A))}}}),Wj=Ze({"node_modules/es5-ext/math/sign/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v=Math.sign;return typeof v!="function"?!1:v(10)===1&&v(-20)===-1}}}),Xj=Ze({"node_modules/es5-ext/math/sign/shim.js"(Z,q){"use strict";q.exports=function(v){return v=Number(v),isNaN(v)||v===0?v:v>0?1:-1}}}),Zj=Ze({"node_modules/es5-ext/math/sign/index.js"(Z,q){"use strict";q.exports=Wj()()?Math.sign:Xj()}}),Yj=Ze({"node_modules/es5-ext/number/to-integer.js"(Z,q){"use strict";var v=Zj(),x=Math.abs,A=Math.floor;q.exports=function(M){return isNaN(M)?0:(M=Number(M),M===0||!isFinite(M)?M:v(M)*A(x(M)))}}}),Kj=Ze({"node_modules/es5-ext/number/to-pos-integer.js"(Z,q){"use strict";var v=Yj(),x=Math.max;q.exports=function(A){return x(0,v(A))}}}),Jj=Ze({"node_modules/es5-ext/array/from/shim.js"(Z,q){"use strict";var v=yg().iterator,x=xx(),A=Hj(),M=Kj(),e=L1(),t=tm(),r=gg(),i=bx(),a=Array.isArray,n=Function.prototype.call,o={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;q.exports=function(c){var h=arguments[1],m=arguments[2],d,T,l,_,w,S,E,g,b,p;if(c=Object(t(c)),r(h)&&e(h),!this||this===Array||!A(this)){if(!h){if(x(c))return w=c.length,w!==1?Array.apply(null,c):(_=new Array(1),_[0]=c[0],_);if(a(c)){for(_=new Array(w=c.length),T=0;T<w;++T)_[T]=c[T];return _}}_=[]}else d=this;if(!a(c)){if((b=c[v])!==void 0){for(E=e(b).call(c),d&&(_=new d),g=E.next(),T=0;!g.done;)p=h?n.call(h,m,g.value,T):g.value,d?(o.value=p,s(_,T,o)):_[T]=p,g=E.next(),++T;w=T}else if(i(c)){for(w=c.length,d&&(_=new d),T=0,l=0;T<w;++T)p=c[T],T+1<w&&(S=p.charCodeAt(0),S>=55296&&S<=56319&&(p+=c[++T])),p=h?n.call(h,m,p,l):p,d?(o.value=p,s(_,l,o)):_[l]=p,++l;w=l}}if(w===void 0)for(w=M(c.length),d&&(_=new d(w)),T=0;T<w;++T)p=h?n.call(h,m,c[T],T):c[T],d?(o.value=p,s(_,T,o)):_[T]=p;return d&&(o.value=null,_.length=w),_}}}),$j=Ze({"node_modules/es5-ext/array/from/index.js"(Z,q){"use strict";q.exports=Gj()()?Array.from:Jj()}}),Qj=Ze({"node_modules/es5-ext/object/copy.js"(Z,q){"use strict";var v=$j(),x=_T(),A=tm();q.exports=function(M){var e=Object(A(M)),t=arguments[1],r=Object(arguments[2]);if(e!==M&&!t)return e;var i={};return t?v(t,function(a){(r.ensure||a in M)&&(i[a]=M[a])}):x(i,M),i}}}),eV=Ze({"node_modules/es5-ext/object/_iterate.js"(Z,q){"use strict";var v=L1(),x=tm(),A=Function.prototype.bind,M=Function.prototype.call,e=Object.keys,t=Object.prototype.propertyIsEnumerable;q.exports=function(r,i){return function(a,n){var o,s=arguments[2],c=arguments[3];return a=Object(x(a)),v(n),o=e(a),c&&o.sort(typeof c=="function"?A.call(c,a):void 0),typeof r!="function"&&(r=o[r]),M.call(r,o,function(h,m){return t.call(a,h)?M.call(n,s,a[h],h,a,m):i})}}}}),tV=Ze({"node_modules/es5-ext/object/for-each.js"(Z,q){"use strict";q.exports=eV()("forEach")}}),rV=Ze({"node_modules/es5-ext/object/map.js"(Z,q){"use stric
|
|||
|
precision highp float;
|
|||
|
|
|||
|
attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;
|
|||
|
attribute vec4 color;
|
|||
|
attribute float lineEnd, lineTop;
|
|||
|
|
|||
|
uniform vec2 scale, scaleFract, translate, translateFract;
|
|||
|
uniform float thickness, pixelRatio, id, depth;
|
|||
|
uniform vec4 viewport;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec2 tangent;
|
|||
|
|
|||
|
vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {
|
|||
|
// the order is important
|
|||
|
return position * scale + translate
|
|||
|
+ positionFract * scale + translateFract
|
|||
|
+ position * scaleFract
|
|||
|
+ positionFract * scaleFract;
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
float lineStart = 1. - lineEnd;
|
|||
|
float lineOffset = lineTop * 2. - 1.;
|
|||
|
|
|||
|
vec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);
|
|||
|
tangent = normalize(diff * scale * viewport.zw);
|
|||
|
vec2 normal = vec2(-tangent.y, tangent.x);
|
|||
|
|
|||
|
vec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart
|
|||
|
+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd
|
|||
|
|
|||
|
+ thickness * normal * .5 * lineOffset / viewport.zw;
|
|||
|
|
|||
|
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
|||
|
|
|||
|
fragColor = color / 255.;
|
|||
|
}
|
|||
|
`,h=`
|
|||
|
precision highp float;
|
|||
|
|
|||
|
uniform float dashLength, pixelRatio, thickness, opacity, id;
|
|||
|
uniform sampler2D dashTexture;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec2 tangent;
|
|||
|
|
|||
|
void main() {
|
|||
|
float alpha = 1.;
|
|||
|
|
|||
|
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
|
|||
|
float dash = texture2D(dashTexture, vec2(t, .5)).r;
|
|||
|
|
|||
|
gl_FragColor = fragColor;
|
|||
|
gl_FragColor.a *= alpha * opacity * dash;
|
|||
|
}
|
|||
|
`,m=`
|
|||
|
precision highp float;
|
|||
|
|
|||
|
attribute vec2 position, positionFract;
|
|||
|
|
|||
|
uniform vec4 color;
|
|||
|
uniform vec2 scale, scaleFract, translate, translateFract;
|
|||
|
uniform float pixelRatio, id;
|
|||
|
uniform vec4 viewport;
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
const float MAX_LINES = 256.;
|
|||
|
|
|||
|
void main() {
|
|||
|
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
|
|||
|
|
|||
|
vec2 position = position * scale + translate
|
|||
|
+ positionFract * scale + translateFract
|
|||
|
+ position * scaleFract
|
|||
|
+ positionFract * scaleFract;
|
|||
|
|
|||
|
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
|||
|
|
|||
|
fragColor = color / 255.;
|
|||
|
fragColor.a *= opacity;
|
|||
|
}
|
|||
|
`,d=`
|
|||
|
precision highp float;
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_FragColor = fragColor;
|
|||
|
}
|
|||
|
`,T=`
|
|||
|
precision highp float;
|
|||
|
|
|||
|
attribute vec2 aCoord, bCoord, nextCoord, prevCoord;
|
|||
|
attribute vec4 aColor, bColor;
|
|||
|
attribute float lineEnd, lineTop;
|
|||
|
|
|||
|
uniform vec2 scale, translate;
|
|||
|
uniform float thickness, pixelRatio, id, depth;
|
|||
|
uniform vec4 viewport;
|
|||
|
uniform float miterLimit, miterMode;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec4 startCutoff, endCutoff;
|
|||
|
varying vec2 tangent;
|
|||
|
varying vec2 startCoord, endCoord;
|
|||
|
varying float enableStartMiter, enableEndMiter;
|
|||
|
|
|||
|
const float REVERSE_THRESHOLD = -.875;
|
|||
|
const float MIN_DIFF = 1e-6;
|
|||
|
|
|||
|
// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead
|
|||
|
// TODO: precalculate dot products, normalize things beforehead etc.
|
|||
|
// TODO: refactor to rectangular algorithm
|
|||
|
|
|||
|
float distToLine(vec2 p, vec2 a, vec2 b) {
|
|||
|
vec2 diff = b - a;
|
|||
|
vec2 perp = normalize(vec2(-diff.y, diff.x));
|
|||
|
return dot(p - a, perp);
|
|||
|
}
|
|||
|
|
|||
|
bool isNaN( float val ){
|
|||
|
return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
vec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;
|
|||
|
|
|||
|
vec2 adjustedScale;
|
|||
|
adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;
|
|||
|
adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;
|
|||
|
|
|||
|
vec2 scaleRatio = adjustedScale * viewport.zw;
|
|||
|
vec2 normalWidth = thickness / scaleRatio;
|
|||
|
|
|||
|
float lineStart = 1. - lineEnd;
|
|||
|
float lineBot = 1. - lineTop;
|
|||
|
|
|||
|
fragColor = (lineStart * aColor + lineEnd * bColor) / 255.;
|
|||
|
|
|||
|
if (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;
|
|||
|
|
|||
|
if (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);
|
|||
|
if (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);
|
|||
|
|
|||
|
|
|||
|
vec2 prevDiff = aCoord - prevCoord;
|
|||
|
vec2 currDiff = bCoord - aCoord;
|
|||
|
vec2 nextDiff = nextCoord - bCoord;
|
|||
|
|
|||
|
vec2 prevTangent = normalize(prevDiff * scaleRatio);
|
|||
|
vec2 currTangent = normalize(currDiff * scaleRatio);
|
|||
|
vec2 nextTangent = normalize(nextDiff * scaleRatio);
|
|||
|
|
|||
|
vec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);
|
|||
|
vec2 currNormal = vec2(-currTangent.y, currTangent.x);
|
|||
|
vec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);
|
|||
|
|
|||
|
vec2 startJoinDirection = normalize(prevTangent - currTangent);
|
|||
|
vec2 endJoinDirection = normalize(currTangent - nextTangent);
|
|||
|
|
|||
|
// collapsed/unidirectional segment cases
|
|||
|
// FIXME: there should be more elegant solution
|
|||
|
vec2 prevTanDiff = abs(prevTangent - currTangent);
|
|||
|
vec2 nextTanDiff = abs(nextTangent - currTangent);
|
|||
|
if (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {
|
|||
|
startJoinDirection = currNormal;
|
|||
|
}
|
|||
|
if (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {
|
|||
|
endJoinDirection = currNormal;
|
|||
|
}
|
|||
|
if (aCoord == bCoord) {
|
|||
|
endJoinDirection = startJoinDirection;
|
|||
|
currNormal = prevNormal;
|
|||
|
currTangent = prevTangent;
|
|||
|
}
|
|||
|
|
|||
|
tangent = currTangent;
|
|||
|
|
|||
|
//calculate join shifts relative to normals
|
|||
|
float startJoinShift = dot(currNormal, startJoinDirection);
|
|||
|
float endJoinShift = dot(currNormal, endJoinDirection);
|
|||
|
|
|||
|
float startMiterRatio = abs(1. / startJoinShift);
|
|||
|
float endMiterRatio = abs(1. / endJoinShift);
|
|||
|
|
|||
|
vec2 startJoin = startJoinDirection * startMiterRatio;
|
|||
|
vec2 endJoin = endJoinDirection * endMiterRatio;
|
|||
|
|
|||
|
vec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;
|
|||
|
startTopJoin = sign(startJoinShift) * startJoin * .5;
|
|||
|
startBotJoin = -startTopJoin;
|
|||
|
|
|||
|
endTopJoin = sign(endJoinShift) * endJoin * .5;
|
|||
|
endBotJoin = -endTopJoin;
|
|||
|
|
|||
|
vec2 aTopCoord = aCoord + normalWidth * startTopJoin;
|
|||
|
vec2 bTopCoord = bCoord + normalWidth * endTopJoin;
|
|||
|
vec2 aBotCoord = aCoord + normalWidth * startBotJoin;
|
|||
|
vec2 bBotCoord = bCoord + normalWidth * endBotJoin;
|
|||
|
|
|||
|
//miter anti-clipping
|
|||
|
float baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));
|
|||
|
float abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));
|
|||
|
|
|||
|
//prevent close to reverse direction switch
|
|||
|
bool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);
|
|||
|
bool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);
|
|||
|
|
|||
|
if (prevReverse) {
|
|||
|
//make join rectangular
|
|||
|
vec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;
|
|||
|
float normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);
|
|||
|
aBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
|
|||
|
aTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
|
|||
|
}
|
|||
|
else if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {
|
|||
|
//handle miter clipping
|
|||
|
bTopCoord -= normalWidth * endTopJoin;
|
|||
|
bTopCoord += normalize(endTopJoin * normalWidth) * baClipping;
|
|||
|
}
|
|||
|
|
|||
|
if (nextReverse) {
|
|||
|
//make join rectangular
|
|||
|
vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;
|
|||
|
float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);
|
|||
|
bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
|
|||
|
bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
|
|||
|
}
|
|||
|
else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {
|
|||
|
//handle miter clipping
|
|||
|
aBotCoord -= normalWidth * startBotJoin;
|
|||
|
aBotCoord += normalize(startBotJoin * normalWidth) * abClipping;
|
|||
|
}
|
|||
|
|
|||
|
vec2 aTopPosition = (aTopCoord) * adjustedScale + translate;
|
|||
|
vec2 aBotPosition = (aBotCoord) * adjustedScale + translate;
|
|||
|
|
|||
|
vec2 bTopPosition = (bTopCoord) * adjustedScale + translate;
|
|||
|
vec2 bBotPosition = (bBotCoord) * adjustedScale + translate;
|
|||
|
|
|||
|
//position is normalized 0..1 coord on the screen
|
|||
|
vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;
|
|||
|
|
|||
|
startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;
|
|||
|
endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;
|
|||
|
|
|||
|
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
|||
|
|
|||
|
enableStartMiter = step(dot(currTangent, prevTangent), .5);
|
|||
|
enableEndMiter = step(dot(currTangent, nextTangent), .5);
|
|||
|
|
|||
|
//bevel miter cutoffs
|
|||
|
if (miterMode == 1.) {
|
|||
|
if (enableStartMiter == 1.) {
|
|||
|
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;
|
|||
|
startCutoff = vec4(aCoord, aCoord);
|
|||
|
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
|
|||
|
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
|||
|
startCutoff += viewport.xyxy;
|
|||
|
startCutoff += startMiterWidth.xyxy;
|
|||
|
}
|
|||
|
|
|||
|
if (enableEndMiter == 1.) {
|
|||
|
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;
|
|||
|
endCutoff = vec4(bCoord, bCoord);
|
|||
|
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
|
|||
|
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
|||
|
endCutoff += viewport.xyxy;
|
|||
|
endCutoff += endMiterWidth.xyxy;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//round miter cutoffs
|
|||
|
else if (miterMode == 2.) {
|
|||
|
if (enableStartMiter == 1.) {
|
|||
|
vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;
|
|||
|
startCutoff = vec4(aCoord, aCoord);
|
|||
|
startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;
|
|||
|
startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
|||
|
startCutoff += viewport.xyxy;
|
|||
|
startCutoff += startMiterWidth.xyxy;
|
|||
|
}
|
|||
|
|
|||
|
if (enableEndMiter == 1.) {
|
|||
|
vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;
|
|||
|
endCutoff = vec4(bCoord, bCoord);
|
|||
|
endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;
|
|||
|
endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;
|
|||
|
endCutoff += viewport.xyxy;
|
|||
|
endCutoff += endMiterWidth.xyxy;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
`,l=`
|
|||
|
precision highp float;
|
|||
|
|
|||
|
uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;
|
|||
|
uniform sampler2D dashTexture;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
varying vec2 tangent;
|
|||
|
varying vec4 startCutoff, endCutoff;
|
|||
|
varying vec2 startCoord, endCoord;
|
|||
|
varying float enableStartMiter, enableEndMiter;
|
|||
|
|
|||
|
float distToLine(vec2 p, vec2 a, vec2 b) {
|
|||
|
vec2 diff = b - a;
|
|||
|
vec2 perp = normalize(vec2(-diff.y, diff.x));
|
|||
|
return dot(p - a, perp);
|
|||
|
}
|
|||
|
|
|||
|
void main() {
|
|||
|
float alpha = 1., distToStart, distToEnd;
|
|||
|
float cutoff = thickness * .5;
|
|||
|
|
|||
|
//bevel miter
|
|||
|
if (miterMode == 1.) {
|
|||
|
if (enableStartMiter == 1.) {
|
|||
|
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
|
|||
|
if (distToStart < -1.) {
|
|||
|
discard;
|
|||
|
return;
|
|||
|
}
|
|||
|
alpha *= min(max(distToStart + 1., 0.), 1.);
|
|||
|
}
|
|||
|
|
|||
|
if (enableEndMiter == 1.) {
|
|||
|
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
|
|||
|
if (distToEnd < -1.) {
|
|||
|
discard;
|
|||
|
return;
|
|||
|
}
|
|||
|
alpha *= min(max(distToEnd + 1., 0.), 1.);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// round miter
|
|||
|
else if (miterMode == 2.) {
|
|||
|
if (enableStartMiter == 1.) {
|
|||
|
distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);
|
|||
|
if (distToStart < 0.) {
|
|||
|
float radius = length(gl_FragCoord.xy - startCoord);
|
|||
|
|
|||
|
if(radius > cutoff + .5) {
|
|||
|
discard;
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (enableEndMiter == 1.) {
|
|||
|
distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);
|
|||
|
if (distToEnd < 0.) {
|
|||
|
float radius = length(gl_FragCoord.xy - endCoord);
|
|||
|
|
|||
|
if(radius > cutoff + .5) {
|
|||
|
discard;
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
alpha -= smoothstep(cutoff - .5, cutoff + .5, radius);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;
|
|||
|
float dash = texture2D(dashTexture, vec2(t, .5)).r;
|
|||
|
|
|||
|
gl_FragColor = fragColor;
|
|||
|
gl_FragColor.a *= alpha * opacity * dash;
|
|||
|
}
|
|||
|
`;q.exports=_;function _(w,S){if(!(this instanceof _))return new _(w,S);if(typeof w=="function"?(S||(S={}),S.regl=w):S=w,S.length&&(S.positions=S),w=S.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=_.shaders.has(w)?_.shaders.get(w):_.shaders.set(w,_.createShaders(w)).get(w),this.update(S)}_.dashMult=2,_.maxPatternLength=256,_.precisionThreshold=3e6,_.maxPoints=1e4,_.maxLines=2048,_.shaders=new n,_.createShaders=function(w){let S=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,y)=>y.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(u,y)=>[y.viewport.x,y.viewport.y,u.viewportWidth,u.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,y)=>!y.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},g=w(A({vert:c,frag:h,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),b;try{b=w(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{b=g}return{fill:w({primitive:"triangle",elements:(u,y)=>y.triangles,offset:0,vert:m,frag:d,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(u,y)=>[y.viewport.x,y.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:g,miter:b}},_.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},_.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},_.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((S,E)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>_.precisionThreshold||S.scale[1]*S.viewport.height>_.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=_.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},_.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w
|
|||
|
precision highp float;
|
|||
|
|
|||
|
attribute vec2 position, positionFract;
|
|||
|
attribute vec4 error;
|
|||
|
attribute vec4 color;
|
|||
|
|
|||
|
attribute vec2 direction, lineOffset, capOffset;
|
|||
|
|
|||
|
uniform vec4 viewport;
|
|||
|
uniform float lineWidth, capSize;
|
|||
|
uniform vec2 scale, scaleFract, translate, translateFract;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
void main() {
|
|||
|
fragColor = color / 255.;
|
|||
|
|
|||
|
vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;
|
|||
|
|
|||
|
vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;
|
|||
|
|
|||
|
vec2 position = position + dxy;
|
|||
|
|
|||
|
vec2 pos = (position + translate) * scale
|
|||
|
+ (positionFract + translateFract) * scale
|
|||
|
+ (position + translate) * scaleFract
|
|||
|
+ (positionFract + translateFract) * scaleFract;
|
|||
|
|
|||
|
pos += pixelOffset / viewport.zw;
|
|||
|
|
|||
|
gl_Position = vec4(pos * 2. - 1., 0, 1);
|
|||
|
}
|
|||
|
`,frag:`
|
|||
|
precision highp float;
|
|||
|
|
|||
|
varying vec4 fragColor;
|
|||
|
|
|||
|
uniform float opacity;
|
|||
|
|
|||
|
void main() {
|
|||
|
gl_FragColor = fragColor;
|
|||
|
gl_FragColor.a *= opacity;
|
|||
|
}
|
|||
|
`,uniforms:{range:o.prop("range"),lineWidth:o.prop("lineWidth"),capSize:o.prop("capSize"),opacity:o.prop("opacity"),scale:o.prop("scale"),translate:o.prop("translate"),scaleFract:o.prop("scaleFract"),translateFract:o.prop("translateFract"),viewport:(y,f)=>[f.viewport.x,f.viewport.y,y.viewportWidth,y.viewportHeight]},attributes:{color:{buffer:T,offset:(y,f)=>f.offset*4,divisor:1},position:{buffer:m,offset:(y,f)=>f.offset*8,divisor:1},positionFract:{buffer:d,offset:(y,f)=>f.offset*8,divisor:1},error:{buffer:l,offset:(y,f)=>f.offset*16,divisor:1},direction:{buffer:_,stride:24,offset:0},lineOffset:{buffer:_,stride:24,offset:8},capOffset:{buffer:_,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:o.prop("viewport")},viewport:o.prop("viewport"),stencil:!1,instances:o.prop("count"),count:a.length}),e(E,{update:p,draw:g,destroy:u,regl:o,gl:c,canvas:c.canvas,groups:S}),E;function E(y){y?p(y):y===null&&u(),g()}function g(y){if(typeof y=="number")return b(y);y&&!Array.isArray(y)&&(y=[y]),o._refresh(),S.forEach((f,P)=>{if(f){if(y&&(y[P]?f.draw=!0:f.draw=!1),!f.draw){f.draw=!0;return}b(P)}})}function b(y){typeof y=="number"&&(y=S[y]),y!=null&&y&&y.count&&y.color&&y.opacity&&y.positions&&y.positions.length>1&&(y.scaleRatio=[y.scale[0]*y.viewport.width,y.scale[1]*y.viewport.height],h(y),y.after&&y.after(y))}function p(y){if(!y)return;y.length!=null?typeof y[0]=="number"&&(y=[{positions:y}]):Array.isArray(y)||(y=[y]);let f=0,P=0;if(E.groups=S=y.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=M(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},w,F)),A(O,F,[{lineWidth:I=>+I*.5,capSize:I=>+I*.5,opacity:parseFloat,errors:I=>(I=t(I),P+=I.length,I),positions:(I,N)=>(I=t(I,"float64"),N.count=Math.floor(I.length/2),N.bounds=v(I,2),N.offset=f,f+=N.count,I)},{color:(I,N)=>{let U=N.count;if(I||(I="transparent"),!Array.isArray(I)||typeof I[0]=="number"){let Q=I;I=Array(U);for(let ue=0;ue<U;ue++)I[ue]=Q}if(I.length<U)throw Error("Not enough colors");let W=new Uint8Array(U*4);for(let Q=0;Q<U;Q++){let ue=x(I[Q],"uint8");W.set(ue,Q*4)}return W},range:(I,N,U)=>{let W=N.bounds;return I||(I=W),N.scale=[1/(I[2]-I[0]),1/(I[3]-I[1])],N.translate=[-I[0],-I[1]],N.scaleFract=i(N.scale),N.translateFract=i(N.translate),I},viewport:I=>{let N;return Array.isArray(I)?N={x:I[0],y:I[1],width:I[2]-I[0],height:I[3]-I[1]}:I?(N={x:I.x||I.left||0,y:I.y||I.top||0},I.right?N.width=I.right-N.x:N.width=I.w||I.width||0,I.bottom?N.height=I.bottom-N.y:N.height=I.h||I.height||0):N={x:0,y:0,width:c.drawingBufferWidth,height:c.drawingBufferHeight},N}}]),O}),f||P){let F=S.reduce((N,U,W)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),I=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:W,count:Q,offset:ue,color:se,errors:he}=N;Q&&(O.set(se,ue*4),I.set(he,ue*4),B.set(W,ue*2))});var L=r(B);m(L);var z=i(B,L);d(z),T(O),l(I)}}function u(){m.destroy(),d.destroy(),T.destroy(),l.destroy(),_.destroy()}}}}),pV=Ze({"node_modules/unquote/index.js"(Z,q){var v=/[\'\"]/;q.exports=function(A){return A?(v.test(A.charAt(0))&&(A=A.substr(1)),v.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),aC=Ze({"node_modules/css-global-keywords/index.json"(){}}),nC=Ze({"node_modules/css-system-font-keywords/index.json"(){}}),iC=Ze({"node_modules/css-font-weight-keywords/index.json"(){}}),oC=Ze({"node_modules/css-font-style-keywords/index.json"(){}}),sC=Ze({"node_modules/css-font-stretch-keywords/index.json"(){}}),dV=Ze({"node_modules/parenthesis/index.js"(Z,q){"use strict";function v(M,
|
|||
|
`).replace(/}/g,`}
|
|||
|
`).replace(/{/g,`{
|
|||
|
`),Ea;if(Yt&&(Ea=Ec(ea),Yt[Ea]))return Yt[Ea].apply(null,Aa);var an=Function.apply(null,ua.concat(ea));return Yt&&(Yt[Ea]=an),an.apply(null,Aa)}return{global:hn,link:wa,block:Ja,proc:Bn,scope:Sn,cond:wn,compile:Ln}}var Ki="xyzw".split(""),ao=5121,Ji=1,co=2,wi=0,ui=1,xo=2,Qo=3,xs=4,Qs=5,Rs=6,Ks="dither",ys="blend.enable",Fl="blend.color",yl="blend.equation",sl="blend.func",Ui="depth.enable",Io="depth.func",Xs="depth.range",Ls="depth.mask",ou="colorMask",Iu="cull.enable",Zu="cull.face",Lc="frontFace",yu="lineWidth",Pc="polygonOffset.enable",wu="polygonOffset.offset",gc="sample.alpha",fo="sample.enable",zo="sample.coverage",Ic="stencil.enable",lc="stencil.mask",Yu="stencil.func",Ne="stencil.opFront",R="stencil.opBack",ae="scissor.enable",we="scissor.box",Se="viewport",Oe="profile",pt="framebuffer",At="vert",Bt="frag",$t="elements",br="primitive",Ar="count",Yr="offset",sa="instances",He="vao",Je="Width",lt="Height",dt=pt+Je,Ct=pt+lt,wt=Se+Je,Dt=Se+lt,ur="drawingBuffer",mr=ur+Je,Er=ur+lt,Br=[sl,yl,Yu,Ne,R,zo,Se,we,wu],Qr=34962,ga=34963,Sa=2884,Oa=3042,vn=3024,Xn=2960,Hn=2929,oi=3089,Ti=32823,Wi=32926,Bi=32928,Ao=5126,ss=35664,So=35665,Ko=35666,hs=5124,ll=35667,Js=35668,es=35669,ts=35670,Pl=35671,$l=35672,Ru=35673,hu=35674,wl=35675,su=35676,uc=35678,Vl=35680,ql=4,de=1028,De=1029,et=2304,vt=2305,_t=32775,St=32776,ar=519,zt=7680,gr=0,qr=1,Wr=32774,Ta=513,ya=36160,tn=36064,on={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ma={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Na={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ka={cw:et,ccw:vt};function mn(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function cn(nt){return nt.sort(function(Yt,cr){return Yt===Se?-1:cr===Se?1:Yt<cr?-1:1})}function Pa(nt,Yt,cr,ua){this.thisDep=nt,this.contextDep=Yt,this.propDep=cr,this.append=ua}function si(nt){return nt&&!(nt.thisDep||nt.contextDep||nt.propDep)}function ni(nt){return new Pa(!1,!1,!1,nt)}function vi(nt,Yt){var cr=nt.type;if(cr===wi){var ua=nt.data.length;return new Pa(!0,ua>=1,ua>=2,Yt)}else if(cr===xs){var Aa=nt.data;return new Pa(Aa.thisDep,Aa.contextDep,Aa.propDep,Yt)}else{if(cr===Qs)return new Pa(!1,!1,!1,Yt);if(cr===Rs){for(var xa=!1,wa=!1,Ja=!1,Sn=0;Sn<nt.data.length;++Sn){var wn=nt.data[Sn];if(wn.type===ui)Ja=!0;else if(wn.type===xo)wa=!0;else if(wn.type===Qo)xa=!0;else if(wn.type===wi){xa=!0;var hn=wn.data;hn>=1&&(wa=!0),hn>=2&&(Ja=!0)}else wn.type===xs&&(xa=xa||wn.data.thisDep,wa=wa||wn.data.contextDep,Ja=Ja||wn.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===xo,cr===ui,Yt)}}var Pi=new Pa(!1,!1,!1,function(){});function Zi(nt,Yt,cr,ua,Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea){var Ea=wn.Record,an={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(an.min=_t,an.max=St);var gn=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,Vn=cr.oes_vertex_array_object,Rn={dirty:!0,profile:ea.profile},hi={},Za=[],qa={},Qn={};function Fn(gt){return gt.replace(".","_")}function Mn(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),hi[nr]=Rn[nr]=!!Ft,qa[nr]=Et}function An(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),Array.isArray(Ft)?(Rn[nr]=Ft.slice(),hi[nr]=Ft.slice()):Rn[nr]=hi[nr]=Ft,Qn[nr]=Et}function Jn(gt){return!!isNaN(gt)}Mn(Ks,vn),Mn(ys,Oa),An(Fl,"blendColor",[0,0,0,0]),An(yl,"blendEquationSeparate",[Wr,Wr]),An(sl,"blendFuncSeparate",[qr,gr,qr,gr]),Mn(Ui,Hn,!0),An(Io,"depthFunc",Ta),An(Xs,"depthRange",[0,1]),An(Ls,"depthMask",!0),An(ou,ou,[!0,!0,!0,!0]),Mn(Iu,Sa),An(Zu,"cullFace",De),An(Lc,Lc,vt),An(yu,yu,1),Mn(Pc,Ti),An(wu,"polygonOffset",[0,0]),Mn(gc,Wi),Mn(fo,Bi),An(zo,"sampleCoverage",[1,!1]),Mn(Ic,Xn),An(lc,"stencilMask",-1),An(Yu,"stencilFunc",
|
|||
|
precision highp float;
|
|||
|
attribute float width, charOffset, char;
|
|||
|
attribute vec2 position;
|
|||
|
uniform float fontSize, charStep, em, align, baseline;
|
|||
|
uniform vec4 viewport;
|
|||
|
uniform vec4 color;
|
|||
|
uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;
|
|||
|
varying vec2 charCoord, charId;
|
|||
|
varying float charWidth;
|
|||
|
varying vec4 fontColor;
|
|||
|
void main () {
|
|||
|
vec2 offset = floor(em * (vec2(align + charOffset, baseline)
|
|||
|
+ vec2(positionOffset.x, -positionOffset.y)))
|
|||
|
/ (viewport.zw * scale.xy);
|
|||
|
|
|||
|
vec2 position = (position + translate) * scale;
|
|||
|
position += offset * scale;
|
|||
|
|
|||
|
charCoord = position * viewport.zw + viewport.xy;
|
|||
|
|
|||
|
gl_Position = vec4(position * 2. - 1., 0, 1);
|
|||
|
|
|||
|
gl_PointSize = charStep;
|
|||
|
|
|||
|
charId.x = mod(char, atlasDim.x);
|
|||
|
charId.y = floor(char / atlasDim.x);
|
|||
|
|
|||
|
charWidth = width * em;
|
|||
|
|
|||
|
fontColor = color / 255.;
|
|||
|
}`,frag:`
|
|||
|
precision highp float;
|
|||
|
uniform float fontSize, charStep, opacity;
|
|||
|
uniform vec2 atlasSize;
|
|||
|
uniform vec4 viewport;
|
|||
|
uniform sampler2D atlas;
|
|||
|
varying vec4 fontColor;
|
|||
|
varying vec2 charCoord, charId;
|
|||
|
varying float charWidth;
|
|||
|
|
|||
|
float lightness(vec4 color) {
|
|||
|
return color.r * 0.299 + color.g * 0.587 + color.b * 0.114;
|
|||
|
}
|
|||
|
|
|||
|
void main () {
|
|||
|
vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;
|
|||
|
float halfCharStep = floor(charStep * .5 + .5);
|
|||
|
|
|||
|
// invert y and shift by 1px (FF expecially needs that)
|
|||
|
uv.y = charStep - uv.y;
|
|||
|
|
|||
|
// ignore points outside of character bounding box
|
|||
|
float halfCharWidth = ceil(charWidth * .5);
|
|||
|
if (floor(uv.x) > halfCharStep + halfCharWidth ||
|
|||
|
floor(uv.x) < halfCharStep - halfCharWidth) return;
|
|||
|
|
|||
|
uv += charId * charStep;
|
|||
|
uv = uv / atlasSize;
|
|||
|
|
|||
|
vec4 color = fontColor;
|
|||
|
vec4 mask = texture2D(atlas, uv);
|
|||
|
|
|||
|
float maskY = lightness(mask);
|
|||
|
// float colorY = lightness(color);
|
|||
|
color.a *= maskY;
|
|||
|
color.a *= opacity;
|
|||
|
|
|||
|
// color.a += .1;
|
|||
|
|
|||
|
// antialiasing, see yiq color space y-channel formula
|
|||
|
// color.rgb += (1. - color.rgb) * (1. - mask.rgb);
|
|||
|
|
|||
|
gl_FragColor = color;
|
|||
|
}`}),y={};return{regl:p,draw:u,atlas:y}},E.prototype.update=function(p){var u=this;if(typeof p=="string")p={text:p};else if(!p)return;p=x(p,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),p.opacity!=null&&(Array.isArray(p.opacity)?this.opacity=p.opacity.map(function(fe){return parseFloat(fe)}):this.opacity=parseFloat(p.opacity)),p.viewport!=null&&(this.viewport=a(p.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),p.kerning!=null&&(this.kerning=p.kerning),p.offset!=null&&(typeof p.offset=="number"&&(p.offset=[p.offset,0]),this.positionOffset=d(p.offset)),p.direction&&(this.direction=p.direction),p.range&&(this.range=p.range,this.scale=[1/(p.range[2]-p.range[0]),1/(p.range[3]-p.range[1])],this.translate=[-p.range[0],-p.range[1]]),p.scale&&(this.scale=p.scale),p.translate&&(this.translate=p.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!p.font&&(p.font=E.baseFontSize+"px sans-serif");var y=!1,f=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(fe,Fe){if(typeof fe=="string")try{fe=v.parse(fe)}catch{fe=v.parse(E.baseFontSize+"px "+fe)}else{var rt=fe.style,st=fe.weight,Qe=fe.stretch,Lt=fe.variant;fe=v.parse(v.stringify(fe)),rt&&(fe.style=rt),st&&(fe.weight=st),Qe&&(fe.stretch=Qe),Lt&&(fe.variant=Lt)}var kt=v.stringify({size:E.baseFontSize,family:fe.family,stretch:w?fe.stretch:void 0,variant:fe.variant,weight:fe.weight,style:fe.style}),qt=o(fe.size),Zt=Math.round(qt[0]*s(qt[1]));if(Zt!==u.fontSize[Fe]&&(f=!0,u.fontSize[Fe]=Zt),(!u.font[Fe]||kt!=u.font[Fe].baseString)&&(y=!0,u.font[Fe]=E.fonts[kt],!u.font[Fe])){var Sr=fe.family.join(", "),xr=[fe.style];fe.style!=fe.variant&&xr.push(fe.variant),fe.variant!=fe.weight&&xr.push(fe.weight),w&&fe.weight!=fe.stretch&&xr.push(fe.stretch),u.font[Fe]={baseString:kt,family:Sr,weight:fe.weight,stretch:fe.stretch,style:fe.style,variant:fe.variant,width:{},kerning:{},metrics:m(Sr,{origin:"top",fontSize:E.baseFontSize,fontStyle:xr.join(" ")})},E.fonts[kt]=u.font[Fe]}}),(y||f)&&this.font.forEach(function(fe,Fe){var rt=v.stringify({size:u.fontSize[Fe],family:fe.family,stretch:w?fe.stretch:void 0,variant:fe.variant,weight:fe.weight,style:fe.style});if(u.fontAtlas[Fe]=u.shader.atlas[rt],!u.fontAtlas[Fe]){var st=fe.metrics;u.shader.atlas[rt]=u.fontAtlas[Fe]={fontString:rt,step:Math.ceil(u.fontSize[Fe]*st.bottom*.5)*2,em:u.fontSize[Fe],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}p.text==null&&(p.text=u.text)}),typeof p.text=="string"&&p.position&&p.position.length>2){for(var P=Array(p.position.length*.5),L=0;L<P.length;L++)P[L]=p.text;p.text=P}var z;if(p.text!=null||y){if(this.textOffsets=[0],Array.isArray(p.text)){this.count=p.text[0].length,this.counts=[this.count];for(var F=1;F<p.text.length;F++)this.textOffsets[F]=this.textOffsets[F-1]+p.text[F-1].length,this.count+=p.text[F].length,this.counts.push(p.text[F].length);this.text=p.text.join("")}else this.text=p.text,this.count=this.text.length,this.counts=[this.count];z=[],this.font.forEach(function(fe,Fe){E.atlasContext.font=fe.baseString;for(var rt=u.fontAtlas[Fe],st=0;st<u.text.length;st++){var Qe=u.text.charAt(st);if(rt.ids[Qe]==null&&(rt.ids
|
|||
|
`).replace(/}/g,`}
|
|||
|
`).replace(/{/g,`{
|
|||
|
`),Ea;if(Yt&&(Ea=Ec(ea),Yt[Ea]))return Yt[Ea].apply(null,Aa);var an=Function.apply(null,ua.concat(ea));return Yt&&(Yt[Ea]=an),an.apply(null,Aa)}return{global:hn,link:wa,block:Ja,proc:Bn,scope:Sn,cond:wn,compile:Ln}}var Ki="xyzw".split(""),ao=5121,Ji=1,co=2,wi=0,ui=1,xo=2,Qo=3,xs=4,Qs=5,Rs=6,Ks="dither",ys="blend.enable",Fl="blend.color",yl="blend.equation",sl="blend.func",Ui="depth.enable",Io="depth.func",Xs="depth.range",Ls="depth.mask",ou="colorMask",Iu="cull.enable",Zu="cull.face",Lc="frontFace",yu="lineWidth",Pc="polygonOffset.enable",wu="polygonOffset.offset",gc="sample.alpha",fo="sample.enable",zo="sample.coverage",Ic="stencil.enable",lc="stencil.mask",Yu="stencil.func",Ne="stencil.opFront",R="stencil.opBack",ae="scissor.enable",we="scissor.box",Se="viewport",Oe="profile",pt="framebuffer",At="vert",Bt="frag",$t="elements",br="primitive",Ar="count",Yr="offset",sa="instances",He="vao",Je="Width",lt="Height",dt=pt+Je,Ct=pt+lt,wt=Se+Je,Dt=Se+lt,ur="drawingBuffer",mr=ur+Je,Er=ur+lt,Br=[sl,yl,Yu,Ne,R,zo,Se,we,wu],Qr=34962,ga=34963,Sa=2884,Oa=3042,vn=3024,Xn=2960,Hn=2929,oi=3089,Ti=32823,Wi=32926,Bi=32928,Ao=5126,ss=35664,So=35665,Ko=35666,hs=5124,ll=35667,Js=35668,es=35669,ts=35670,Pl=35671,$l=35672,Ru=35673,hu=35674,wl=35675,su=35676,uc=35678,Vl=35680,ql=4,de=1028,De=1029,et=2304,vt=2305,_t=32775,St=32776,ar=519,zt=7680,gr=0,qr=1,Wr=32774,Ta=513,ya=36160,tn=36064,on={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ma={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Na={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ka={cw:et,ccw:vt};function mn(nt){return Array.isArray(nt)||wr(nt)||Ir(nt)}function cn(nt){return nt.sort(function(Yt,cr){return Yt===Se?-1:cr===Se?1:Yt<cr?-1:1})}function Pa(nt,Yt,cr,ua){this.thisDep=nt,this.contextDep=Yt,this.propDep=cr,this.append=ua}function si(nt){return nt&&!(nt.thisDep||nt.contextDep||nt.propDep)}function ni(nt){return new Pa(!1,!1,!1,nt)}function vi(nt,Yt){var cr=nt.type;if(cr===wi){var ua=nt.data.length;return new Pa(!0,ua>=1,ua>=2,Yt)}else if(cr===xs){var Aa=nt.data;return new Pa(Aa.thisDep,Aa.contextDep,Aa.propDep,Yt)}else{if(cr===Qs)return new Pa(!1,!1,!1,Yt);if(cr===Rs){for(var xa=!1,wa=!1,Ja=!1,Sn=0;Sn<nt.data.length;++Sn){var wn=nt.data[Sn];if(wn.type===ui)Ja=!0;else if(wn.type===xo)wa=!0;else if(wn.type===Qo)xa=!0;else if(wn.type===wi){xa=!0;var hn=wn.data;hn>=1&&(wa=!0),hn>=2&&(Ja=!0)}else wn.type===xs&&(xa=xa||wn.data.thisDep,wa=wa||wn.data.contextDep,Ja=Ja||wn.data.propDep)}return new Pa(xa,wa,Ja,Yt)}else return new Pa(cr===Qo,cr===xo,cr===ui,Yt)}}var Pi=new Pa(!1,!1,!1,function(){});function Zi(nt,Yt,cr,ua,Aa,xa,wa,Ja,Sn,wn,hn,yi,Bn,Ln,Va,ea){var Ea=wn.Record,an={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(an.min=_t,an.max=St);var gn=cr.angle_instanced_arrays,Wa=cr.webgl_draw_buffers,Vn=cr.oes_vertex_array_object,Rn={dirty:!0,profile:ea.profile},hi={},Za=[],qa={},Qn={};function Fn(gt){return gt.replace(".","_")}function Mn(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),hi[nr]=Rn[nr]=!!Ft,qa[nr]=Et}function An(gt,Et,Ft){var nr=Fn(gt);Za.push(gt),Array.isArray(Ft)?(Rn[nr]=Ft.slice(),hi[nr]=Ft.slice()):Rn[nr]=hi[nr]=Ft,Qn[nr]=Et}function Jn(gt){return!!isNaN(gt)}Mn(Ks,vn),Mn(ys,Oa),An(Fl,"blendColor",[0,0,0,0]),An(yl,"blendEquationSeparate",[Wr,Wr]),An(sl,"blendFuncSeparate",[qr,gr,qr,gr]),Mn(Ui,Hn,!0),An(Io,"depthFunc",Ta),An(Xs,"depthRange",[0,1]),An(Ls,"depthMask",!0),An(ou,ou,[!0,!0,!0,!0]),Mn(Iu,Sa),An(Zu,"cullFace",De),An(Lc,Lc,vt),An(yu,yu,1),Mn(Pc,Ti),An(wu,"polygonOffset",[0,0]),Mn(gc,Wi),Mn(fo,Bi),An(zo,"sampleCoverage",[1,!1]),Mn(Ic,Xn),An(lc,"stencilMask",-1),An(Yu,"stencilFunc",
|
|||
|
`),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(`
|
|||
|
`),A=Tx().maxDimensionCount,M=ca(),e=1e-6,t=2048,r=new Uint8Array(4),i=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function n(b){b.read({x:0,y:0,width:1,height:1,data:r})}function o(b,p,u,y,f){var P=b._gl;P.enable(P.SCISSOR_TEST),P.scissor(p,u,y,f),b.clear({color:[0,0,0,0],depth:1})}function s(b,p,u,y,f,P){var L=P.key;function z(F){var B=Math.min(y,f-F*y);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],o(b,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!u.clearOnly&&(P.count=2*B,P.offset=2*F*y,p(P),F*y+B<f&&(u.currentRafs[L]=window.requestAnimationFrame(function(){z(F+1)})),u.drawCompleted=!1)}u.drawCompleted||(n(b),u.drawCompleted=!0),z(0)}function c(b){return Math.max(e,Math.min(1-e,b))}function h(b,p){for(var u=new Array(256),y=0;y<256;y++)u[y]=b(y/255).concat(p);return u}function m(b,p){return(b>>>8*p)%256/255}function d(b,p,u){for(var y=new Array(b*(A+4)),f=0,P=0;P<b;P++){for(var L=0;L<A;L++)y[f++]=L<p.length?p[L].paddedUnitValues[P]:.5;y[f++]=m(P,2),y[f++]=m(P,1),y[f++]=m(P,0),y[f++]=c(u[P])}return y}function T(b,p,u){for(var y=new Array(p*8),f=0,P=0;P<p;P++)for(var L=0;L<2;L++)for(var z=0;z<4;z++){var F=b*4+z,B=u[P*64+F];F===63&&L===0&&(B*=-1),y[f++]=B}return y}function l(b){var p="0"+b;return p.substr(p.length-2)}function _(b){return b<A?"p"+l(b+1)+"_"+l(b+4):"colors"}function w(b,p,u){for(var y=0;y<=A;y+=4)b[_(y)](T(y/4,p,u))}function S(b){for(var p={},u=0;u<=A;u+=4)p[_(u)]=b.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return p}function E(b,p,u,y,f,P,L,z,F,B,O,I,N,U){for(var W=[[],[]],Q=0;Q<64;Q++)W[0][Q]=Q===f?1:0,W[1][Q]=Q===P?1:0;L*=U,z*=U,F*=U,B*=U;var ue=b.lines.canvasOverdrag*U,se=b.domain,he=b.canvasWidth*U,H=b.canvasHeight*U,$=b.pad.l*U,J=b.pad.b*U,X=b.layoutHeight*U,oe=b.layoutWidth*U,ne=b.deselectedLines.color,j=b.deselectedLines.opacity,ee=M.extendFlat({key:O,resolution:[he,H],viewBoxPos:[L+ue,z],viewBoxSize:[F,B],i0:f,i1:P,dim0A:W[0].slice(0,16),dim0B:W[0].slice(16,32),dim0C:W[0].slice(32,48),dim0D:W[0].slice(48,64),dim1A:W[1].slice(0,16),dim1B:W[1].slice(16,32),dim1C:W[1].slice(32,48),dim1D:W[1].slice(48,64),drwLayer:I,contextColor:[ne[0]/255,ne[1]/255,ne[2]/255,j!=="auto"?ne[3]*j:Math.max(1/255,Math.pow(1/b.lines.color.length,1/3))],scissorX:(y===p?0:L+ue)+($-ue)+oe*se.x[0],scissorWidth:(y===u?he-L+ue:F+.5)+(y===p?L+ue:0),scissorY:z+J+X*se.y[0],scissorHeight:B,viewportX:$-ue+oe*se.x[0],viewportY:J+X*se.y[0],viewportWidth:he,viewportHeight:H},N);return ee}function g(b){var p=t-1,u=Math.max(0,Math.floor(b[0]*p),0),y=Math.min(p,Math.ceil(b[1]*p),p);return[Math.min(u,y),Math.max(u,y)]}q.exports=function(b,p){var u=p.context,y=p.pick,f=p.regl,P=f._gl,L=P.getParameter(P.ALIASED_LINE_WIDTH_RANGE),z=Math.max(L[0],Math.min(L[1],p.viewModel.plotGlPixelRatio)),F={currentRafs:{},drawCompleted:!0,clearOnly:!1},B,O,I,N,U=S(f),W,Q=f.texture(a),ue=[];he(p);var se=f({profile:!1,blend:{enable:u,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!u,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:f.prop("scissorX"),y:f.prop("scissorY"),width:f.prop("scissorWidth"),height:f.prop("scissorHeight")}},viewport:{x:f.prop("viewportX"),y:f.prop("viewportY"),width:f.prop("viewportWidth"),height:f.prop("viewportHeight")},dither:!1,vert:v,frag:x,primitive:"lines",lineWidth:z,attributes:U,uniforms:{resolution:f.prop("resolution"),viewBoxPos:f.prop("viewBoxPos"),viewBoxSize:f.prop("viewBoxSize"),dim0A:f.prop("dim0A"),dim1A:f.prop("dim1A"),dim0B:f.prop("dim0B"),dim1B:f.prop("dim1B"),dim0C:f.prop("dim0C"),dim1C:f.prop("dim1C"),dim0D:f.prop("dim0D"),dim1D:f.prop("dim1D"),loA:f.prop("loA"),hiA:f.prop("hiA"),loB:f.prop("loB"),hiB:f.prop("hiB"),loC:f.prop("loC"),hiC:f.prop("hiC"),loD:f.prop("loD"),hiD:f.prop("hiD"),palette:Q,contextColor:f.prop("contextColor"),maskTexture:f.prop("maskTexture"),drwLayer:f.prop("drwLayer"),maskHeight:f.prop("maskHeight")},offset:f.prop("offset"),count:f.prop("count")});funct
|
|||
|
`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(`
|
|||
|
`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(`
|
|||
|
`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(`
|
|||
|
`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new"
|
|||
|
`)),F.push({type:"Feature",geometry:{type:"Point",coordinates:O.lonlat},properties:{symbol:P(B),angle:L(B),text:N}})}}return{type:"FeatureCollection",features:F}}function T(E,g){return x.isArrayOrTypedArray(E)?g?function(b){return v(E[b])?+E[b]:0}:function(b){return E[b]}:E?function(){return E}:l}function l(){return""}function _(E){return E[0]===A}function w(E,g){var b;if(x.isArrayOrTypedArray(E)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],E[0]];for(var p=1;p<E.length;p++)b.push(g[p-1],E[p])}else b=E;return b}function S(E){var g=E.textfont,b=g.family,p=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||p==="italic";var P=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?P+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(P="Metropolis",u>850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",y[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),dq=Ze({"src/traces/scattermapbox/plot.js"(Z,q){"use strict";var v=ca(),x=pq(),A=am().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,i,a,n){this.type="scattermapbox",this.subplot=r,this.uid=i,this.clusterEnabled=a,this.isHidden=n,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:A+i+"-fill",line:A+i+"-line",circle:A+i+"-circle",symbol:A+i+"-symbol",cluster:A+i+"-cluster",clusterCount:A+i+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,i,a){var n={type:"geojson",data:i.geojson};a&&a.enabled&&v.extendFlat(n,{cluster:!0,clusterMaxZoom:a.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[r]);o?o.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},t.addLayer=function(r,i,a){var n={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(n.filter=i.filter);for(var o=this.layerIds[r],s,c=this.subplot.getMapLayers(),h=0;h<c.length;h++)if(c[h].id===o){s=!0;break}s?(this.subplot.setOptions(o,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(o,"setPaintProperty",n.paint)):this.subplot.addLayer(n,a)},t.update=function(i){var a=i[0].trace,n=this.subplot,o=n.map,s=x(n.gd,i),c=n.belowLookup["trace-"+this.uid],h=!!(a.cluster&&a.cluster.enabled),m=!!this.clusterEnabled,d=this;function T(u){u||d.addSource("circle",s.circle,a.cluster);for(var y=M.cluster,f=0;f<y.length;f++){var P=y[f],L=s[P];d.addLayer(P,L,c)}}function l(u){for(var y=M.cluster,f=y.length-1;f>=0;f--){var P=y[f];o.removeLayer(d.layerIds[P])}u||o.removeSource(d.sourceIds.circle)}function _(u){for(var y=M.nonCluster,f=0;f<y.length;f++){var P=y[f],L=s[P];u||d.addSource(P,L),d.addLayer(P,L,c)}}function w(u){for(var y=M.nonCluster,f=y.length-1;f>=0;f--){var P=y[f];o.removeLayer(d.layerIds[P]),u||o.removeSource(d.sourceIds[P])}}function S(u){m?l(u):w(u)}function E(u){h?T(u):_(u)}function g(){for(var u=h?M.cluster:M.nonCluster,y=0;y<u.length;y++){var f=u[y],P=s[f];P&&(n.setOptions(d.layerIds[f],"setLayoutProperty",P.layout),P.layout.visibility==="visible"&&(f!=="cluster"&&d.setSourceData(f,P),n.setOptions(d.layerIds[f],"setPaintProperty",P.paint)))}}var b=this.isHidden,p=a.visible!==!0;p?b||S():b?p||E():m!==h?(S(),E()):(this.below!==c&
|
|||
|
precision mediump float;
|
|||
|
#else
|
|||
|
#if !defined(lowp)
|
|||
|
#define lowp
|
|||
|
#endif
|
|||
|
#if !defined(mediump)
|
|||
|
#define mediump
|
|||
|
#endif
|
|||
|
#if !defined(highp)
|
|||
|
#define highp
|
|||
|
#endif
|
|||
|
#endif`,Cu=`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#else
|
|||
|
#if !defined(lowp)
|
|||
|
#define lowp
|
|||
|
#endif
|
|||
|
#if !defined(mediump)
|
|||
|
#define mediump
|
|||
|
#endif
|
|||
|
#if !defined(highp)
|
|||
|
#define highp
|
|||
|
#endif
|
|||
|
#endif
|
|||
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|||
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`,Af=`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,pf="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Us=`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,qc="uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}",Sf=`varying vec3 v_data;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define highp vec4 stroke_color
|
|||
|
#pragma mapbox: define mediump float stroke_width
|
|||
|
#pragma mapbox: define lowp float stroke_opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|||
|
#pragma mapbox: initialize mediump float stroke_width
|
|||
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|||
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,iu=`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define highp vec4 stroke_color
|
|||
|
#pragma mapbox: define mediump float stroke_width
|
|||
|
#pragma mapbox: define lowp float stroke_opacity
|
|||
|
void main(void) {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|||
|
#pragma mapbox: initialize mediump float stroke_width
|
|||
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|||
|
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,Ll="void main() {gl_FragColor=vec4(1.0);}",nc="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Ou=`uniform highp float u_intensity;varying vec2 v_extrude;
|
|||
|
#pragma mapbox: define highp float weight
|
|||
|
#define GAUSS_COEF 0.3989422804014327
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp float weight
|
|||
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,nl=`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|||
|
#pragma mapbox: define highp float weight
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
const highp float ZERO=1.0/255.0/16.0;
|
|||
|
#define GAUSS_COEF 0.3989422804014327
|
|||
|
void main(void) {
|
|||
|
#pragma mapbox: initialize highp float weight
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`,vl=`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(0.0);
|
|||
|
#endif
|
|||
|
}`,gs="uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}",qs="varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}",ic="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Nl="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",Vu="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}",cl="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",yh="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}",ls=`#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_FragColor=color*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,_h=`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_Position=u_matrix*vec4(a_pos,0,1);}`,Ss=`varying vec2 v_pos;
|
|||
|
#pragma mapbox: define highp vec4 outline_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 outline_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Qi=`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define highp vec4 outline_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 outline_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,Gc=`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,qu=`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`,Ul=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Mf=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`,wc=`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,rf=`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
|
|||
|
#pragma mapbox: define highp float base
|
|||
|
#pragma mapbox: define highp float height
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp float base
|
|||
|
#pragma mapbox: initialize highp float height
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Kl=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|||
|
#pragma mapbox: define lowp float base
|
|||
|
#pragma mapbox: define lowp float height
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float base
|
|||
|
#pragma mapbox: initialize lowp float height
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Yf=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|||
|
#pragma mapbox: define lowp float base
|
|||
|
#pragma mapbox: define lowp float height
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float base
|
|||
|
#pragma mapbox: initialize lowp float height
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|||
|
? a_pos
|
|||
|
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,zf=`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#endif
|
|||
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,af="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Nc=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|||
|
#define PI 3.141592653589793
|
|||
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Ff="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Of=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Gu=`
|
|||
|
#define scale 0.015873016
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Ef=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,oc=`
|
|||
|
#define scale 0.015873016
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Hc=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Jl=`
|
|||
|
#define scale 0.015873016
|
|||
|
#define LINE_DISTANCE_SCALE 2.0
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,Uc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Tc=`
|
|||
|
#define scale 0.015873016
|
|||
|
#define LINE_DISTANCE_SCALE 2.0
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Gs=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Cf="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",lh=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Bf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,Wc=`#define SDF_PX 8.0
|
|||
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Kf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,ku=`#define SDF_PX 8.0
|
|||
|
#define SDF 1.0
|
|||
|
#define ICON 0.0
|
|||
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,Nf=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,ml=hl(Bc,Cu),Lu=hl(Af,pf),Ac=hl(Us,qc),il=hl(Sf,iu),dc=hl(Ll,nc),vu=hl(Ou,nl),bu=hl(vl,gs),Ml=hl(qs,ic),Uf=hl(Nl,Vu),Jf=hl(cl,yh),Bu=hl(ls,_h),Sc=hl(Ss,Qi),vc=hl(Gc,qu),Lh=hl(Ul,Mf),nf=hl(wc,rf),df=hl(Kl,Yf),Nu=hl(zf,af),of=hl(Nc,Ff),tu=hl(Of,Gu),Xc=hl(Ef,oc),uh=hl(Hc,Jl),vf=hl(Uc,Tc),ol=hl(Gs,Cf),mu=hl(lh,Bf),Pu=hl(Wc,Kf),kf=hl(ku,Nf);function hl(ve,Y){var ye=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=Y.match(/attribute ([\w]+) ([\w]+)/g),me=ve.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ge=Y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Le=Ge?Ge.concat(me):me,$e={};return ve=ve.replace(ye,function(mt,jt,_r,Fr,hr){return $e[hr]=!0,jt==="define"?`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
varying `+_r+" "+Fr+" "+hr+`;
|
|||
|
#else
|
|||
|
uniform `+_r+" "+Fr+" u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifdef HAS_UNIFORM_u_`+hr+`
|
|||
|
`+_r+" "+Fr+" "+hr+" = u_"+hr+`;
|
|||
|
#endif
|
|||
|
`}),Y=Y.replace(ye,function(mt,jt,_r,Fr,hr){var gt=Fr==="float"?"vec2":"vec4",Et=hr.match(/color/)?"color":gt;return $e[hr]?jt==="define"?`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
uniform lowp float u_`+hr+`_t;
|
|||
|
attribute `+_r+" "+gt+" a_"+hr+`;
|
|||
|
varying `+_r+" "+Fr+" "+hr+`;
|
|||
|
#else
|
|||
|
uniform `+_r+" "+Fr+" u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:Et==="vec4"?`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
`+hr+" = a_"+hr+`;
|
|||
|
#else
|
|||
|
`+_r+" "+Fr+" "+hr+" = u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
`+hr+" = unpack_mix_"+Et+"(a_"+hr+", u_"+hr+`_t);
|
|||
|
#else
|
|||
|
`+_r+" "+Fr+" "+hr+" = u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:jt==="define"?`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
uniform lowp float u_`+hr+`_t;
|
|||
|
attribute `+_r+" "+gt+" a_"+hr+`;
|
|||
|
#else
|
|||
|
uniform `+_r+" "+Fr+" u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:Et==="vec4"?`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
`+_r+" "+Fr+" "+hr+" = a_"+hr+`;
|
|||
|
#else
|
|||
|
`+_r+" "+Fr+" "+hr+" = u_"+hr+`;
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifndef HAS_UNIFORM_u_`+hr+`
|
|||
|
`+_r+" "+Fr+" "+hr+" = unpack_mix_"+Et+"(a_"+hr+", u_"+hr+`_t);
|
|||
|
#else
|
|||
|
`+_r+" "+Fr+" "+hr+" = u_"+hr+`;
|
|||
|
#endif
|
|||
|
`}),{fragmentSource:ve,vertexSource:Y,staticAttributes:te,staticUniforms:Le}}var sf=Object.freeze({__proto__:null,prelude:ml,background:Lu,backgroundPattern:Ac,circle:il,clippingMask:dc,heatmap:vu,heatmapTexture:bu,collisionBox:Ml,collisionCircle:Uf,debug:Jf,fill:Bu,fillOutline:Sc,fillOutlinePattern:vc,fillPattern:Lh,fillExtrusion:nf,fillExtrusionPattern:df,hillshadePrepare:Nu,hillshade:of,line:tu,lineGradient:Xc,linePattern:uh,lineSDF:vf,raster:ol,symbolIcon:mu,symbolSDF:Pu,symbolTextAndIcon:kf}),Mc=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Mc.prototype.bind=function(Y,ye,te,me,Ge,Le,$e,mt){this.context=Y;for(var jt=this.boundPaintVertexBuffers.length!==me.length,_r=0;!jt&&_r<me.length;_r++)this.boundPaintVertexBuffers[_r]!==me[_r]&&(jt=!0);var Fr=!this.vao||this.boundProgram!==ye||this.boundLayoutVertexBuffer!==te||jt||this.boundIndexBuffer!==Ge||this.boundVertexOffset!==Le||this.boundDynamicVertexBuffer!==$e||this.boundDynamicVertexBuffer2!==mt;!Y.extVertexArrayObject||Fr?this.freshBind(ye,te,me,Ge,Le,$e,mt):(Y.bindVertexArrayOES.set(this.vao),$e&&$e.bind(),Ge&&Ge.dynamicDraw&&Ge.bind(),mt&&mt.bind())},Mc.prototype.freshBind=function(Y,ye,te,me,Ge,Le,$e){var mt,jt=Y.numAttributes,_r=this.context,Fr=_r.gl;if(_r.extVertexArrayObject)this.vao&&this.destroy(),this.vao=_r.extVertexArrayObject.createVertexArrayOES(),_r.bindVertexArrayOES.set(this.vao),mt=0,this.boundProgram=Y,this.boundLayoutVertexBuffer=ye,this.boundPaintVertexBuffers=te,this.boundIndexBuffer=me,this.boundVertexOffset=Ge,this.boundDynamicVertexBuffer=Le,this.boundDynamicVertexBuffer2=$e;else{mt=_r.currentNumAttributes||0;for(var hr=jt;hr<mt;hr++)Fr.disableVertexAttribArray(hr)}ye.enableAttributes(Fr,Y);for(var gt=0,Et=te;gt<Et.length;gt+=1){var Ft=Et[gt];Ft.enableAttributes(Fr,Y)}Le&&Le.enableAttributes(Fr,Y),$e&&$e.enableAttributes(Fr,Y),ye.bind(),ye.setVertexAttribPointers(Fr,Y,Ge);for(var nr=0,fr=te;nr<fr.length;nr+=1){var sr=fr[nr];sr.bind(),sr.setVertexAttribPointers(Fr,Y,Ge)}Le&&(Le.bind(),Le.setVertexAttribPointers(Fr,Y,Ge)),me&&me.bind(),$e&&($e.bind(),$e.setVertexAttribPointers(Fr,Y,Ge)),_r.currentNumAttributes=jt},Mc.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function Hu(ve){for(var Y=[],ye=0;ye<ve.length;ye++)if(ve[ye]!==null){var te=ve[ye].split(" ");Y.push(te.pop())}return Y}var mf=function(Y,ye,te,me,Ge,Le){var $e=Y.gl;this.program=$e.createProgram();for(var mt=Hu(te.staticAttributes),jt=me?me.getBinderAttributes():[],_r=mt.concat(jt),Fr=te.staticUniforms?Hu(te.staticUniforms):[],hr=me?me.getBinderUniforms():[],gt=Fr.concat(hr),Et=[],Ft=0,nr=gt;Ft<nr.length;Ft+=1){var fr=nr[Ft];Et.indexOf(fr)<0&&Et.push(fr)}var sr=me?me.defines():[];Le&&sr.push("#define OVERDRAW_INSPECTOR;");var pr=sr.concat(ml.fragmentSource,te.fragmentSource).join(`
|
|||
|
`),lr=sr.concat(ml.vertexSource,te.vertexSource).join(`
|
|||
|
`),Xt=$e.createShader($e.FRAGMENT_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(Xt,pr),$e.compileShader(Xt),$e.attachShader(this.program,Xt);var or=$e.createShader($e.VERTEX_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(or,lr),$e.compileShader(or),$e.attachShader(this.program,or),this.attributes={};var Vt={};this.numAttributes=_r.length;for(var Dr=0;Dr<this.numAttributes;Dr++)_r[Dr]&&($e.bindAttribLocation(this.program,Dr,_r[Dr]),this.attributes[_r[Dr]]=Dr);$e.linkProgram(this.program),$e.deleteShader(or),$e.deleteShader(Xt);for(var Jr=0;Jr<Et.length;Jr++){var ba=Et[Jr];if(ba&&!Vt[ba]){var _n=$e.getUniformLocation(this.program,ba);_n&&(Vt[ba]=_n)}}this.fixedUniforms=Ge(Y,Vt),this.binderUniforms=me?me.getUniforms(Y,Vt):[]};mf.prototype.draw=function(Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr,hr,gt,Et,Ft,nr){var fr,sr=Y.gl;if(!this.failedToCreate){Y.program.set(this.program),Y.setDepthMode(te),Y.setStencilMode(me),Y.setColorMode(Ge),Y.setCullFace(Le);for(var pr in this.fixedUniforms)this.fixedUniforms[pr].set($e[pr]);Et&&Et.setUniforms(Y,this.binderUniforms,hr,{zoom:gt});for(var lr=(fr={},fr[sr.LINES]=2,fr[sr.TRIANGLES]=3,fr[sr.LINE_STRIP]=1,fr)[ye],Xt=0,or=Fr.get();Xt<or.length;Xt+=1){var Vt=or[Xt],Dr=Vt.vaos||(Vt.vaos={}),Jr=Dr[mt]||(Dr[mt]=new Mc);Jr.bind(Y,this,jt,Et?Et.getPaintVertexBuffers():[],_r,Vt.vertexOffset,Ft,nr),sr.drawElements(ye,Vt.primitiveLength*lr,sr.UNSIGNED_SHORT,Vt.primitiveOffset*lr*2)}}};function Wu(ve,Y,ye){var te=1/qi(ye,1,Y.transform.tileZoom),me=Math.pow(2,ye.tileID.overscaledZ),Ge=ye.tileSize*Math.pow(2,Y.transform.tileZoom)/me,Le=Ge*(ye.tileID.canonical.x+ye.tileID.wrap*me),$e=Ge*ye.tileID.canonical.y;return{u_image:0,u_texsize:ye.imageAtlasTexture.size,u_scale:[te,ve.fromScale,ve.toScale],u_fade:ve.t,u_pixel_coord_upper:[Le>>16,$e>>16],u_pixel_coord_lower:[Le&65535,$e&65535]}}function Zc(ve,Y,ye,te){var me=ye.imageManager.getPattern(ve.from.toString()),Ge=ye.imageManager.getPattern(ve.to.toString()),Le=ye.imageManager.getPixelSize(),$e=Le.width,mt=Le.height,jt=Math.pow(2,te.tileID.overscaledZ),_r=te.tileSize*Math.pow(2,ye.transform.tileZoom)/jt,Fr=_r*(te.tileID.canonical.x+te.tileID.wrap*jt),hr=_r*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ge.tl,u_pattern_br_b:Ge.br,u_texsize:[$e,mt],u_mix:Y.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ge.displaySize,u_scale_a:Y.fromScale,u_scale_b:Y.toScale,u_tile_units_to_pixels:1/qi(te,1,ye.transform.tileZoom),u_pixel_coord_upper:[Fr>>16,hr>>16],u_pixel_coord_lower:[Fr&65535,hr&65535]}}var Lf=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_lightpos:new e.Uniform3f(ve,Y.u_lightpos),u_lightintensity:new e.Uniform1f(ve,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,Y.u_vertical_gradient),u_opacity:new e.Uniform1f(ve,Y.u_opacity)}},ru=function(ve,Y){return{u_matrix:new e.UniformMatrix4f(ve,Y.u_matrix),u_lightpos:new e.Uniform3f(ve,Y.u_lightpos),u_lightintensity:new e.Uniform1f(ve,Y.u_lightintensity),u_lightcolor:new e.Uniform3f(ve,Y.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ve,Y.u_vertical_gradient),u_height_factor:new e.Uniform1f(ve,Y.u_height_factor),u_image:new e.Uniform1i(ve,Y.u_image),u_texsize:new e.Uniform2f(ve,Y.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ve,Y.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ve,Y.u_pixel_coord_lower),u_scale:new e.Uniform3f(ve,Y.u_scale),u_fade:new e.Uniform1f(ve,Y.u_fade),u_opacity:new e.Uniform1f(ve,Y.u_opacity)}},jf=function(ve,Y,ye,te){var me=Y.style.light,Ge=me.properties.get("position"),Le=[Ge.x,Ge.y,Ge.z],$e=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation($e,-Y.transform.angle),e.transformMat3(Le,Le,$e);var mt=me.properties.get("color");return{u_matrix:ve,u_lightpos:Le,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[mt.r,mt.g,mt.b],u_vertical_gradient:+ye,u_opacity:te}},Xu=function(ve,Y,ye,te,me,Ge,Le){return e.extend(jf(ve,Y,ye,te),Wu(Ge,Y,Le),{u_height_factor:-Math.p
|
|||
|
{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-
|
|||
|
{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin}
|
|||
|
{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),zq=Ze({"src/plots/map/styles/arcgis-sat.js"(Z,q){q.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),_g=Ze({"src/plots/map/constants.js"(Z,q){"use strict";var v=Km(),x=Dq(),A=zq(),M='\xA9 <a targe
|
|||
|
`),mapOnErrorMsg:"Map error."}}}),Ex=Ze({"src/plots/map/layout_attributes.js"(Z,q){"use strict";var v=ca(),x=Yi().defaultLine,A=bc().attributes,M=tc(),e=tf().textposition,t=pc().overrideAll,r=Dl().templatedArray,i=_g(),a=M({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var n=q.exports=t({_arrayAttrRegexps:[v.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:i.styleValuesMap,dflt:i.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:v.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");n.uirevision={valType:"any",editType:"none"}}}),ET=Ze({"src/traces/scattermap/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=$d(),M=d0(),e=tf(),t=Ex(),r=eu(),i=Mu(),a=rs().extendFlat,n=pc().overrideAll,o=Ex(),s=M.line,c=M.marker;q.exports=n({lon:M.lon,lat:M.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},o.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},i("marker")),fill:M.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:v()},"calc","nested")}}),PC=Ze({"src/traces/scattermap/constants.js"(Z,q){"use strict";var v=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];q.exports={isSupportedFont:function(x){return v.indexOf(x)!==-1}}}}),Fq=Ze({"src/traces/scattermap/defaul
|
|||
|
`)),F.push({type:"Feature",geometry:{type:"Point",coordinates:O.lonlat},properties:{symbol:P(B),angle:L(B),text:N}})}}return{type:"FeatureCollection",features:F}}function T(E,g){return x.isArrayOrTypedArray(E)?g?function(b){return v(E[b])?+E[b]:0}:function(b){return E[b]}:E?function(){return E}:l}function l(){return""}function _(E){return E[0]===A}function w(E,g){var b;if(x.isArrayOrTypedArray(E)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],E[0]];for(var p=1;p<E.length;p++)b.push(g[p-1],E[p])}else b=E;return b}function S(E){var g=E.textfont,b=g.family,p=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||p==="italic";var P=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?P+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(P="Metropolis",u>850?P+=" Black":u>750?P+=" Extra Bold":u>650?P+=" Bold":u>550?P+=" Semi Bold":u>450?P+=" Medium":u>350?P+=" Regular":u>250?P+=" Light":u>150?P+=" Extra Light":P+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",u>750?P+=" Extrabold":u>650?P+=" Bold":u>550?P+=" Semibold":u>350?P+=" Regular":P+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",y[3]==="CJK"&&(P+=" CJK"),P+=u>500?" Bold":" Regular")),f&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),a(P)||(P=b);var L=P.split(", ");return L}}}),Bq=Ze({"src/traces/scattermap/plot.js"(Z,q){"use strict";var v=ca(),x=Oq(),A=_g().traceLayerPrefix,M={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,i,a,n){this.type="scattermap",this.subplot=r,this.uid=i,this.clusterEnabled=a,this.isHidden=n,this.sourceIds={fill:"source-"+i+"-fill",line:"source-"+i+"-line",circle:"source-"+i+"-circle",symbol:"source-"+i+"-symbol",cluster:"source-"+i+"-circle",clusterCount:"source-"+i+"-circle"},this.layerIds={fill:A+i+"-fill",line:A+i+"-line",circle:A+i+"-circle",symbol:A+i+"-symbol",cluster:A+i+"-cluster",clusterCount:A+i+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,i,a){var n={type:"geojson",data:i.geojson};a&&a.enabled&&v.extendFlat(n,{cluster:!0,clusterMaxZoom:a.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[r]);o?o.setData(i.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,i){this.subplot.map.getSource(this.sourceIds[r]).setData(i.geojson)},t.addLayer=function(r,i,a){var n={type:i.type,id:this.layerIds[r],source:this.sourceIds[r],layout:i.layout,paint:i.paint};i.filter&&(n.filter=i.filter);for(var o=this.layerIds[r],s,c=this.subplot.getMapLayers(),h=0;h<c.length;h++)if(c[h].id===o){s=!0;break}s?(this.subplot.setOptions(o,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(o,"setPaintProperty",n.paint)):this.subplot.addLayer(n,a)},t.update=function(i){var a=i[0].trace,n=this.subplot,o=n.map,s=x(n.gd,i),c=n.belowLookup["trace-"+this.uid],h=!!(a.cluster&&a.cluster.enabled),m=!!this.clusterEnabled,d=this;function T(u){u||d.addSource("circle",s.circle,a.cluster);for(var y=M.cluster,f=0;f<y.length;f++){var P=y[f],L=s[P];d.addLayer(P,L,c)}}function l(u){for(var y=M.cluster,f=y.length-1;f>=0;f--){var P=y[f];o.removeLayer(d.layerIds[P])}u||o.removeSource(d.sourceIds.circle)}function _(u){for(var y=M.nonCluster,f=0;f<y.length;f++){var P=y[f],L=s[P];u||d.addSource(P,L),d.addLayer(P,L,c)}}function w(u){for(var y=M.nonCluster,f=y.length-1;f>=0;f--){var P=y[f];o.removeLayer(d.layerIds[P]),u||o.removeSource(d.sourceIds[P])}}function S(u){m?l(u):w(u)}function E(u){h?T(u):_(u)}function g(){for(var u=h?M.cluster:M.nonCluster,y=0;y<u.length;y++){var f=u[y],P=s[f];P&&(n.setOptions(d.layerIds[f],"setLayoutProperty",P.layout),P.layout.visibility==="visible"&&(f!=="cluster"&&d.setSourceData(f,P),n.setOptions(d.layerIds[f],"setPaintProperty",P.paint)))}}var b=this.isHidden,p=a.visible!==!0;p?b||S():b?p||E():m!==h?(S(),E()):(this.below!==c&&(S(!0
|
|||
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Mr[1])} }\`.`)];let zr=[];return G.layerType==="symbol"&&(ft==="text-field"&&ke&&!ke.glyphs&&zr.push(new _e(K,Xe,'use of "text-field" requires a style "glyphs" property')),ft==="text-font"&&Cf(mu(Xe))&&ol(Xe.type)==="identity"&&zr.push(new _e(K,Xe,'"text-font" does not support identity functions'))),zr.concat(pe({key:G.key,value:Xe,valueSpec:ir,style:ke,styleSpec:je,expressionContext:"property",propertyType:D,propertyKey:ft}))}function Lf(G){return Zc(G,"paint")}function ru(G){return Zc(G,"layout")}function jf(G){let D=[],K=G.value,pe=G.key,ke=G.style,je=G.styleSpec;K.type||K.ref||D.push(new _e(pe,K,'either "type" or "ref" is required'));let Xe=ol(K.type),ft=ol(K.ref);if(K.id){let Mt=ol(K.id);for(let Ut=0;Ut<G.arrayIndex;Ut++){let ir=ke.layers[Ut];ol(ir.id)===Mt&&D.push(new _e(pe,K.id,`duplicate layer id "${K.id}", previously used at line ${ir.id.__line__}`))}}if("ref"in K){let Mt;["type","source","source-layer","filter","layout"].forEach(Ut=>{Ut in K&&D.push(new _e(pe,K[Ut],`"${Ut}" is prohibited for ref layers`))}),ke.layers.forEach(Ut=>{ol(Ut.id)===ft&&(Mt=Ut)}),Mt?Mt.ref?D.push(new _e(pe,K.ref,"ref cannot reference another ref layer")):Xe=ol(Mt.type):D.push(new _e(pe,K.ref,`ref layer "${ft}" not found`))}else if(Xe!=="background")if(K.source){let Mt=ke.sources&&ke.sources[K.source],Ut=Mt&&ol(Mt.type);Mt?Ut==="vector"&&Xe==="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster source`)):Ut!=="raster-dem"&&Xe==="hillshade"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a raster-dem source`)):Ut==="raster"&&Xe!=="raster"?D.push(new _e(pe,K.source,`layer "${K.id}" requires a vector source`)):Ut!=="vector"||K["source-layer"]?Ut==="raster-dem"&&Xe!=="hillshade"?D.push(new _e(pe,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Xe!=="line"||!K.paint||!K.paint["line-gradient"]||Ut==="geojson"&&Mt.lineMetrics||D.push(new _e(pe,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new _e(pe,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new _e(pe,K.source,`source "${K.source}" not found`))}else D.push(new _e(pe,K,'missing required property "source"'));return D=D.concat(Pu({key:pe,value:K,valueSpec:je.layer,style:G.style,styleSpec:G.styleSpec,validateSpec:G.validateSpec,objectElementValidators:{"*":()=>[],type:()=>G.validateSpec({key:`${pe}.type`,value:K.type,valueSpec:je.layer.type,style:G.style,styleSpec:G.styleSpec,validateSpec:G.validateSpec,object:K,objectKey:"type"}),filter:mf,layout:Mt=>Pu({layer:K,key:Mt.key,value:Mt.value,style:Mt.style,styleSpec:Mt.styleSpec,validateSpec:Mt.validateSpec,objectElementValidators:{"*":Ut=>ru(fe({layerType:Xe},Ut))}}),paint:Mt=>Pu({layer:K,key:Mt.key,value:Mt.value,style:Mt.style,styleSpec:Mt.styleSpec,validateSpec:Mt.validateSpec,objectElementValidators:{"*":Ut=>Lf(fe({layerType:Xe},Ut))}})}})),D}function Xu(G){let D=G.value,K=G.key,pe=Gs(D);return pe!=="string"?[new _e(K,D,`string expected, ${pe} found`)]:[]}let Ec={promoteId:function({key:G,value:D}){if(Gs(D)==="string")return Xu({key:G,value:D});{let K=[];for(let pe in D)K.push(...Xu({key:`${G}.${pe}`,value:D[pe]}));return K}}};function mc(G){let D=G.value,K=G.key,pe=G.styleSpec,ke=G.style,je=G.validateSpec;if(!D.type)return[new _e(K,D,'"type" is required')];let Xe=ol(D.type),ft;switch(Xe){case"vector":case"raster":return ft=Pu({key:K,value:D,valueSpec:pe[`source_${Xe.replace("-","_")}`],style:G.style,styleSpec:pe,objectElementValidators:Ec,validateSpec:je}),ft;case"raster-dem":return ft=function(Mt){var Ut;let ir=(Ut=Mt.sourceName)!==null&&Ut!==void 0?Ut:"",Mr=Mt.value,zr=Mt.styleSpec,Hr=zr.source_raster_dem,oa=Mt.style,va=[],Ga=Gs(Mr);if(Mr===void 0)return va;if(Ga!=="object")return va.push(new _e("source_raster_dem",Mr,`object expected, ${Ga} found`)),va;let $a=ol(Mr.encoding)==="custom",Kn=["redFactor","greenFactor","blueFactor","baseShift"],bn=Mt.value.encoding?`"${Mt.value.encoding}"`:"Default";for(let Wn in Mr)
|
|||
|
precision mediump float;
|
|||
|
#else
|
|||
|
#if !defined(lowp)
|
|||
|
#define lowp
|
|||
|
#endif
|
|||
|
#if !defined(mediump)
|
|||
|
#define mediump
|
|||
|
#endif
|
|||
|
#if !defined(highp)
|
|||
|
#define highp
|
|||
|
#endif
|
|||
|
#endif
|
|||
|
`,`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#else
|
|||
|
#if !defined(lowp)
|
|||
|
#define lowp
|
|||
|
#endif
|
|||
|
#if !defined(mediump)
|
|||
|
#define mediump
|
|||
|
#endif
|
|||
|
#if !defined(highp)
|
|||
|
#define highp
|
|||
|
#endif
|
|||
|
#endif
|
|||
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|||
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
|
|||
|
#ifdef TERRAIN3D
|
|||
|
uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
|
|||
|
#endif
|
|||
|
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
|
|||
|
#ifdef TERRAIN3D
|
|||
|
highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
|
|||
|
#else
|
|||
|
return 1.0;
|
|||
|
#endif
|
|||
|
}float calculate_visibility(vec4 pos) {
|
|||
|
#ifdef TERRAIN3D
|
|||
|
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
|
|||
|
#else
|
|||
|
return 1.0;
|
|||
|
#endif
|
|||
|
}float ele(vec2 pos) {
|
|||
|
#ifdef TERRAIN3D
|
|||
|
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
|||
|
#else
|
|||
|
return 0.0;
|
|||
|
#endif
|
|||
|
}float get_elevation(vec2 pos) {
|
|||
|
#ifdef TERRAIN3D
|
|||
|
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
|
|||
|
#else
|
|||
|
return 0.0;
|
|||
|
#endif
|
|||
|
}`),background:It(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:It(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:It(`varying vec3 v_data;varying float v_visibility;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define highp vec4 stroke_color
|
|||
|
#pragma mapbox: define mediump float stroke_width
|
|||
|
#pragma mapbox: define lowp float stroke_opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|||
|
#pragma mapbox: initialize mediump float stroke_width
|
|||
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|||
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define highp vec4 stroke_color
|
|||
|
#pragma mapbox: define mediump float stroke_width
|
|||
|
#pragma mapbox: define lowp float stroke_opacity
|
|||
|
void main(void) {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|||
|
#pragma mapbox: initialize mediump float stroke_width
|
|||
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|||
|
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:It("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:It(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|||
|
#pragma mapbox: define highp float weight
|
|||
|
#define GAUSS_COEF 0.3989422804014327
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp float weight
|
|||
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|||
|
#pragma mapbox: define highp float weight
|
|||
|
#pragma mapbox: define mediump float radius
|
|||
|
const highp float ZERO=1.0/255.0/16.0;
|
|||
|
#define GAUSS_COEF 0.3989422804014327
|
|||
|
void main(void) {
|
|||
|
#pragma mapbox: initialize highp float weight
|
|||
|
#pragma mapbox: initialize mediump float radius
|
|||
|
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:It(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(0.0);
|
|||
|
#endif
|
|||
|
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:It("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:It("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:It("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:It(`#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_FragColor=color*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:It(`varying vec2 v_pos;
|
|||
|
#pragma mapbox: define highp vec4 outline_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 outline_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define highp vec4 outline_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 outline_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:It(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:It(`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#endif
|
|||
|
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:It(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
attribute vec2 a_centroid;
|
|||
|
#endif
|
|||
|
varying vec4 v_color;
|
|||
|
#pragma mapbox: define highp float base
|
|||
|
#pragma mapbox: define highp float height
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp float base
|
|||
|
#pragma mapbox: initialize highp float height
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
vec3 normal=a_normal_ed.xyz;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
|||
|
#else
|
|||
|
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
|||
|
#endif
|
|||
|
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:It(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|||
|
#pragma mapbox: define lowp float base
|
|||
|
#pragma mapbox: define lowp float height
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float base
|
|||
|
#pragma mapbox: initialize lowp float height
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
attribute vec2 a_centroid;
|
|||
|
#endif
|
|||
|
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|||
|
#pragma mapbox: define lowp float base
|
|||
|
#pragma mapbox: define lowp float height
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float base
|
|||
|
#pragma mapbox: initialize lowp float height
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
|||
|
#else
|
|||
|
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
|||
|
#endif
|
|||
|
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|||
|
? a_pos
|
|||
|
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:It(`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#endif
|
|||
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:It(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|||
|
#define PI 3.141592653589793
|
|||
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:It(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`
|
|||
|
#define scale 0.015873016
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
v_gamma_scale=1.0;
|
|||
|
#else
|
|||
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|||
|
#endif
|
|||
|
v_width2=vec2(outset,inset);}`),lineGradient:It(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`
|
|||
|
#define scale 0.015873016
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
v_gamma_scale=1.0;
|
|||
|
#else
|
|||
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|||
|
#endif
|
|||
|
v_width2=vec2(outset,inset);}`),linePattern:It(`#ifdef GL_ES
|
|||
|
precision highp float;
|
|||
|
#endif
|
|||
|
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`
|
|||
|
#define scale 0.015873016
|
|||
|
#define LINE_DISTANCE_SCALE 2.0
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
#pragma mapbox: define lowp vec4 pattern_from
|
|||
|
#pragma mapbox: define lowp vec4 pattern_to
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|||
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|||
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
v_gamma_scale=1.0;
|
|||
|
#else
|
|||
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|||
|
#endif
|
|||
|
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:It(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`
|
|||
|
#define scale 0.015873016
|
|||
|
#define LINE_DISTANCE_SCALE 2.0
|
|||
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|||
|
#pragma mapbox: define highp vec4 color
|
|||
|
#pragma mapbox: define lowp float blur
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define mediump float gapwidth
|
|||
|
#pragma mapbox: define lowp float offset
|
|||
|
#pragma mapbox: define mediump float width
|
|||
|
#pragma mapbox: define lowp float floorwidth
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 color
|
|||
|
#pragma mapbox: initialize lowp float blur
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize mediump float gapwidth
|
|||
|
#pragma mapbox: initialize lowp float offset
|
|||
|
#pragma mapbox: initialize mediump float width
|
|||
|
#pragma mapbox: initialize lowp float floorwidth
|
|||
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
|
|||
|
#ifdef TERRAIN3D
|
|||
|
v_gamma_scale=1.0;
|
|||
|
#else
|
|||
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|||
|
#endif
|
|||
|
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:It(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:It(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:It(`#define SDF_PX 8.0
|
|||
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:It(`#define SDF_PX 8.0
|
|||
|
#define SDF 1.0
|
|||
|
#define ICON 0.0
|
|||
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|||
|
#ifdef OVERDRAW_INSPECTOR
|
|||
|
gl_FragColor=vec4(1.0);
|
|||
|
#endif
|
|||
|
}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}
|
|||
|
#pragma mapbox: define highp vec4 fill_color
|
|||
|
#pragma mapbox: define highp vec4 halo_color
|
|||
|
#pragma mapbox: define lowp float opacity
|
|||
|
#pragma mapbox: define lowp float halo_width
|
|||
|
#pragma mapbox: define lowp float halo_blur
|
|||
|
void main() {
|
|||
|
#pragma mapbox: initialize highp vec4 fill_color
|
|||
|
#pragma mapbox: initialize highp vec4 halo_color
|
|||
|
#pragma mapbox: initialize lowp float opacity
|
|||
|
#pragma mapbox: initialize lowp float halo_width
|
|||
|
#pragma mapbox: initialize lowp float halo_blur
|
|||
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|||
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|||
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:It("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:It("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:It("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
varying ${br} ${Ar} ${Yr};
|
|||
|
#else
|
|||
|
uniform ${br} ${Ar} u_${Yr};
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifdef HAS_UNIFORM_u_${Yr}
|
|||
|
${br} ${Ar} ${Yr} = u_${Yr};
|
|||
|
#endif
|
|||
|
`)),vertexSource:R=R.replace(ae,(Bt,$t,br,Ar,Yr)=>{let sa=Ar==="float"?"vec2":"vec4",He=Yr.match(/color/)?"color":sa;return At[Yr]?$t==="define"?`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
uniform lowp float u_${Yr}_t;
|
|||
|
attribute ${br} ${sa} a_${Yr};
|
|||
|
varying ${br} ${Ar} ${Yr};
|
|||
|
#else
|
|||
|
uniform ${br} ${Ar} u_${Yr};
|
|||
|
#endif
|
|||
|
`:He==="vec4"?`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
${Yr} = a_${Yr};
|
|||
|
#else
|
|||
|
${br} ${Ar} ${Yr} = u_${Yr};
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
${Yr} = unpack_mix_${He}(a_${Yr}, u_${Yr}_t);
|
|||
|
#else
|
|||
|
${br} ${Ar} ${Yr} = u_${Yr};
|
|||
|
#endif
|
|||
|
`:$t==="define"?`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
uniform lowp float u_${Yr}_t;
|
|||
|
attribute ${br} ${sa} a_${Yr};
|
|||
|
#else
|
|||
|
uniform ${br} ${Ar} u_${Yr};
|
|||
|
#endif
|
|||
|
`:He==="vec4"?`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
${br} ${Ar} ${Yr} = a_${Yr};
|
|||
|
#else
|
|||
|
${br} ${Ar} ${Yr} = u_${Yr};
|
|||
|
#endif
|
|||
|
`:`
|
|||
|
#ifndef HAS_UNIFORM_u_${Yr}
|
|||
|
${br} ${Ar} ${Yr} = unpack_mix_${He}(a_${Yr}, u_${Yr}_t);
|
|||
|
#else
|
|||
|
${br} ${Ar} ${Yr} = u_${Yr};
|
|||
|
#endif
|
|||
|
`}),staticAttributes:we,staticUniforms:pt}}class dr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(R,ae,we,Se,Oe,pt,At,Bt,$t){this.context=R;let br=this.boundPaintVertexBuffers.length!==Se.length;for(let Ar=0;!br&&Ar<Se.length;Ar++)this.boundPaintVertexBuffers[Ar]!==Se[Ar]&&(br=!0);!this.vao||this.boundProgram!==ae||this.boundLayoutVertexBuffer!==we||br||this.boundIndexBuffer!==Oe||this.boundVertexOffset!==pt||this.boundDynamicVertexBuffer!==At||this.boundDynamicVertexBuffer2!==Bt||this.boundDynamicVertexBuffer3!==$t?this.freshBind(ae,we,Se,Oe,pt,At,Bt,$t):(R.bindVertexArray.set(this.vao),At&&At.bind(),Oe&&Oe.dynamicDraw&&Oe.bind(),Bt&&Bt.bind(),$t&&$t.bind())}freshBind(R,ae,we,Se,Oe,pt,At,Bt){let $t=R.numAttributes,br=this.context,Ar=br.gl;this.vao&&this.destroy(),this.vao=br.createVertexArray(),br.bindVertexArray.set(this.vao),this.boundProgram=R,this.boundLayoutVertexBuffer=ae,this.boundPaintVertexBuffers=we,this.boundIndexBuffer=Se,this.boundVertexOffset=Oe,this.boundDynamicVertexBuffer=pt,this.boundDynamicVertexBuffer2=At,this.boundDynamicVertexBuffer3=Bt,ae.enableAttributes(Ar,R);for(let Yr of we)Yr.enableAttributes(Ar,R);pt&&pt.enableAttributes(Ar,R),At&&At.enableAttributes(Ar,R),Bt&&Bt.enableAttributes(Ar,R),ae.bind(),ae.setVertexAttribPointers(Ar,R,Oe);for(let Yr of we)Yr.bind(),Yr.setVertexAttribPointers(Ar,R,Oe);pt&&(pt.bind(),pt.setVertexAttribPointers(Ar,R,Oe)),Se&&Se.bind(),At&&(At.bind(),At.setVertexAttribPointers(Ar,R,Oe)),Bt&&(Bt.bind(),Bt.setVertexAttribPointers(Ar,R,Oe)),br.currentNumAttributes=$t}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let kr=(Ne,R,ae,we,Se)=>({u_matrix:Ne,u_texture:0,u_ele_delta:R,u_fog_matrix:ae,u_fog_color:we?we.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:we?we.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:we?we.calculateFogBlendOpacity(Se):0,u_horizon_color:we?we.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:we?we.properties.get("horizon-fog-blend"):1});function na(Ne){let R=[];for(let ae=0;ae<Ne.length;ae++){if(Ne[ae]===null)continue;let we=Ne[ae].split(" ");R.push(we.pop())}return R}class Ca{constructor(R,ae,we,Se,Oe,pt){let At=R.gl;this.program=At.createProgram();let Bt=na(ae.staticAttributes),$t=we?we.getBinderAttributes():[],br=Bt.concat($t),Ar=fa.prelude.staticUniforms?na(fa.prelude.staticUniforms):[],Yr=ae.staticUniforms?na(ae.staticUniforms):[],sa=we?we.getBinderUniforms():[],He=Ar.concat(Yr).concat(sa),Je=[];for(let mr of He)Je.indexOf(mr)<0&&Je.push(mr);let lt=we?we.defines():[];Oe&<.push("#define OVERDRAW_INSPECTOR;"),pt&<.push("#define TERRAIN3D;");let dt=lt.concat(fa.prelude.fragmentSource,ae.fragmentSource).join(`
|
|||
|
`),Ct=lt.concat(fa.prelude.vertexSource,ae.vertexSource).join(`
|
|||
|
`),wt=At.createShader(At.FRAGMENT_SHADER);if(At.isContextLost())return void(this.failedToCreate=!0);if(At.shaderSource(wt,dt),At.compileShader(wt),!At.getShaderParameter(wt,At.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${At.getShaderInfoLog(wt)}`);At.attachShader(this.program,wt);let Dt=At.createShader(At.VERTEX_SHADER);if(At.isContextLost())return void(this.failedToCreate=!0);if(At.shaderSource(Dt,Ct),At.compileShader(Dt),!At.getShaderParameter(Dt,At.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${At.getShaderInfoLog(Dt)}`);At.attachShader(this.program,Dt),this.attributes={};let ur={};this.numAttributes=br.length;for(let mr=0;mr<this.numAttributes;mr++)br[mr]&&(At.bindAttribLocation(this.program,mr,br[mr]),this.attributes[br[mr]]=mr);if(At.linkProgram(this.program),!At.getProgramParameter(this.program,At.LINK_STATUS))throw new Error(`Program failed to link: ${At.getProgramInfoLog(this.program)}`);At.deleteShader(Dt),At.deleteShader(wt);for(let mr=0;mr<Je.length;mr++){let Er=Je[mr];if(Er&&!ur[Er]){let Br=At.getUniformLocation(this.program,Er);Br&&(ur[Er]=Br)}}this.fixedUniforms=Se(R,ur),this.terrainUniforms=((mr,Er)=>({u_depth:new t.aH(mr,Er.u_depth),u_terrain:new t.aH(mr,Er.u_terrain),u_terrain_dim:new t.aI(mr,Er.u_terrain_dim),u_terrain_matrix:new t.aJ(mr,Er.u_terrain_matrix),u_terrain_unpack:new t.aK(mr,Er.u_terrain_unpack),u_terrain_exaggeration:new t.aI(mr,Er.u_terrain_exaggeration)}))(R,ur),this.binderUniforms=we?we.getUniforms(R,ur):[]}draw(R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He,Je,lt,dt,Ct){let wt=R.gl;if(this.failedToCreate)return;if(R.program.set(this.program),R.setDepthMode(we),R.setStencilMode(Se),R.setColorMode(Oe),R.setCullFace(pt),Bt){R.activeTexture.set(wt.TEXTURE2),wt.bindTexture(wt.TEXTURE_2D,Bt.depthTexture),R.activeTexture.set(wt.TEXTURE3),wt.bindTexture(wt.TEXTURE_2D,Bt.texture);for(let ur in this.terrainUniforms)this.terrainUniforms[ur].set(Bt[ur])}for(let ur in this.fixedUniforms)this.fixedUniforms[ur].set(At[ur]);Je&&Je.setUniforms(R,this.binderUniforms,sa,{zoom:He});let Dt=0;switch(ae){case wt.LINES:Dt=2;break;case wt.TRIANGLES:Dt=3;break;case wt.LINE_STRIP:Dt=1}for(let ur of Yr.get()){let mr=ur.vaos||(ur.vaos={});(mr[$t]||(mr[$t]=new dr)).bind(R,this,br,Je?Je.getPaintVertexBuffers():[],Ar,ur.vertexOffset,lt,dt,Ct),wt.drawElements(ae,ur.primitiveLength*Dt,wt.UNSIGNED_SHORT,ur.primitiveOffset*Dt*2)}}}function Fa(Ne,R,ae){let we=1/Ua(ae,1,R.transform.tileZoom),Se=Math.pow(2,ae.tileID.overscaledZ),Oe=ae.tileSize*Math.pow(2,R.transform.tileZoom)/Se,pt=Oe*(ae.tileID.canonical.x+ae.tileID.wrap*Se),At=Oe*ae.tileID.canonical.y;return{u_image:0,u_texsize:ae.imageAtlasTexture.size,u_scale:[we,Ne.fromScale,Ne.toScale],u_fade:Ne.t,u_pixel_coord_upper:[pt>>16,At>>16],u_pixel_coord_lower:[65535&pt,65535&At]}}let Ya=(Ne,R,ae,we)=>{let Se=R.style.light,Oe=Se.properties.get("position"),pt=[Oe.x,Oe.y,Oe.z],At=function(){var $t=new t.A(9);return t.A!=Float32Array&&($t[1]=0,$t[2]=0,$t[3]=0,$t[5]=0,$t[6]=0,$t[7]=0),$t[0]=1,$t[4]=1,$t[8]=1,$t}();Se.properties.get("anchor")==="viewport"&&function($t,br){var Ar=Math.sin(br),Yr=Math.cos(br);$t[0]=Yr,$t[1]=Ar,$t[2]=0,$t[3]=-Ar,$t[4]=Yr,$t[5]=0,$t[6]=0,$t[7]=0,$t[8]=1}(At,-R.transform.angle),function($t,br,Ar){var Yr=br[0],sa=br[1],He=br[2];$t[0]=Yr*Ar[0]+sa*Ar[3]+He*Ar[6],$t[1]=Yr*Ar[1]+sa*Ar[4]+He*Ar[7],$t[2]=Yr*Ar[2]+sa*Ar[5]+He*Ar[8]}(pt,pt,At);let Bt=Se.properties.get("color");return{u_matrix:Ne,u_lightpos:pt,u_lightintensity:Se.properties.get("intensity"),u_lightcolor:[Bt.r,Bt.g,Bt.b],u_vertical_gradient:+ae,u_opacity:we}},ha=(Ne,R,ae,we,Se,Oe,pt)=>t.e(Ya(Ne,R,ae,we),Fa(Oe,R,pt),{u_height_factor:-Math.pow(2,Se.overscaledZ)/pt.tileSize/8}),Da=Ne=>({u_matrix:Ne}),Zn=(Ne,R,ae,we)=>t.e(Da(Ne),Fa(ae,R,we)),Pn=(Ne,R)=>({u_matrix:Ne,u_world:R}),fi=(Ne,R,ae,we,Se)=>t.e(Zn(Ne,R,ae,we),{u_world:Se}),Ai=(Ne,R,ae,we)=>{let Se=Ne.transform,Oe,pt;if(we.paint.get("circle-pitch-alignment")==="map"){let At=Ua(ae,1,Se.zoom);Oe=!0,pt=[At,At]}else Oe=!1,pt=Se.pixelsToGLUnits;return{u_camera_to_center_distance:Se.cameraToCenterDistance,u_sc
|
|||
|
/* [wrapped with `+ge+`] */
|
|||
|
`)}var cL=KZ;function JZ(le){return function(){return le}}var $0=JZ;var $Z=function(){try{var le=ld(Object,"defineProperty");return le({},"",{}),le}catch{}}(),Q0=$Z;var QZ=Q0?function(le,ge){return Q0(le,"toString",{configurable:!0,enumerable:!1,value:$0(ge),writable:!0})}:Fc,fL=QZ;var eY=Lb(fL),ey=eY;function tY(le,ge){for(var Ye=-1,Pt=le==null?0:le.length;++Ye<Pt&&ge(le[Ye],Ye,le)!==!1;);return le}var Nh=tY;function rY(le,ge,Ye,Pt){for(var vr=le.length,Zr=Ye+(Pt?1:-1);Pt?Zr--:++Zr<vr;)if(ge(le[Zr],Zr,le))return Zr;return-1}var Am=rY;function aY(le){return le!==le}var Ib=aY;function nY(le,ge,Ye){for(var Pt=Ye-1,vr=le.length;++Pt<vr;)if(le[Pt]===ge)return Pt;return-1}var hL=nY;function iY(le,ge,Ye){return ge===ge?hL(le,ge,Ye):Am(le,Ib,Ye)}var Ad=iY;function oY(le,ge){var Ye=le==null?0:le.length;return!!Ye&&Ad(le,ge,0)>-1}var Sm=oY;var sY=1,lY=2,uY=8,cY=16,fY=32,hY=64,pY=128,dY=256,vY=512,mY=[["ary",pY],["bind",sY],["bindKey",lY],["curry",uY],["curryRight",cY],["flip",vY],["partial",fY],["partialRight",hY],["rearg",dY]];function gY(le,ge){return Nh(mY,function(Ye){var Pt="_."+Ye[0];ge&Ye[1]&&!Sm(le,Pt)&&le.push(Pt)}),le.sort()}var pL=gY;function yY(le,ge,Ye){var Pt=ge+"";return ey(le,cL(Pt,pL(uL(Pt),Ye)))}var Rb=yY;var _Y=1,xY=2,bY=4,wY=8,dL=32,vL=64;function TY(le,ge,Ye,Pt,vr,Zr,ka,sn,fn,Li){var bi=ge&wY,Fi=bi?ka:void 0,Uo=bi?void 0:ka,ws=bi?Zr:void 0,mo=bi?void 0:Zr;ge|=bi?dL:vL,ge&=~(bi?vL:dL),ge&bY||(ge&=~(_Y|xY));var Ze=[le,ge,vr,ws,Fi,mo,Uo,sn,fn,Li],Ws=Ye.apply(void 0,Ze);return n_(le)&&Pb(Ws,Ze),Ws.placeholder=Pt,Rb(Ws,le,ge)}var Db=TY;function AY(le){var ge=le;return ge.placeholder}var Sd=AY;var SY=9007199254740991,MY=/^(?:0|[1-9]\d*)$/;function EY(le,ge){var Ye=typeof le;return ge=ge??SY,!!ge&&(Ye=="number"||Ye!="symbol"&&MY.test(le))&&le>-1&&le%1==0&&le<ge}var np=EY;var CY=Math.min;function kY(le,ge){for(var Ye=le.length,Pt=CY(ge.length,Ye),vr=ff(le);Pt--;){var Zr=ge[Pt];le[Pt]=np(Zr,Ye)?vr[Zr]:void 0}return le}var mL=kY;var gL="__lodash_placeholder__";function LY(le,ge){for(var Ye=-1,Pt=le.length,vr=0,Zr=[];++Ye<Pt;){var ka=le[Ye];(ka===ge||ka===gL)&&(le[Ye]=gL,Zr[vr++]=Ye)}return Zr}var Yp=LY;var PY=1,IY=2,RY=8,DY=16,zY=128,FY=512;function yL(le,ge,Ye,Pt,vr,Zr,ka,sn,fn,Li){var bi=ge&zY,Fi=ge&PY,Uo=ge&IY,ws=ge&(RY|DY),mo=ge&FY,Ze=Uo?void 0:Vv(le);function Ws(){for(var Yl=arguments.length,cu=Array(Yl),ih=Yl;ih--;)cu[ih]=arguments[ih];if(ws)var Eh=Sd(Ws),Bp=lL(cu,Eh);if(Pt&&(cu=Ab(cu,Pt,vr,ws)),Zr&&(cu=Sb(cu,Zr,ka,ws)),Yl-=Bp,ws&&Yl<Li){var Oi=Yp(cu,Eh);return Db(le,ge,yL,Ws.placeholder,Ye,cu,Oi,sn,fn,Li-Yl)}var $p=Fi?Ye:this,Np=Uo?$p[le]:le;return Yl=cu.length,sn?cu=mL(cu,sn):mo&&Yl>1&&cu.reverse(),bi&&fn<Yl&&(cu.length=fn),this&&this!==_u&&this instanceof Ws&&(Np=Ze||Vv(Np)),Np.apply($p,cu)}return Ws}var ty=yL;function OY(le,ge,Ye){var Pt=Vv(le);function vr(){for(var Zr=arguments.length,ka=Array(Zr),sn=Zr,fn=Sd(vr);sn--;)ka[sn]=arguments[sn];var Li=Zr<3&&ka[0]!==fn&&ka[Zr-1]!==fn?[]:Yp(ka,fn);if(Zr-=Li.length,Zr<Ye)return Db(le,ge,ty,vr.placeholder,void 0,ka,Li,void 0,void 0,Ye-Zr);var bi=this&&this!==_u&&this instanceof vr?Pt:le;return _f(bi,this,ka)}return vr}var _L=OY;var BY=1;function NY(le,ge,Ye,Pt){var vr=ge&BY,Zr=Vv(le);function ka(){for(var sn=-1,fn=arguments.length,Li=-1,bi=Pt.length,Fi=Array(bi+fn),Uo=this&&this!==_u&&this instanceof ka?Zr:le;++Li<bi;)Fi[Li]=Pt[Li];for(;fn--;)Fi[Li++]=arguments[++sn];return _f(Uo,vr?Ye:this,Fi)}return ka}var xL=NY;var bL="__lodash_placeholder__",TA=1,UY=2,jY=4,wL=8,i_=128,TL=256,VY=Math.min;function qY(le,ge){var Ye=le[1],Pt=ge[1],vr=Ye|Pt,Zr=vr<(TA|UY|i_),ka=Pt==i_&&Ye==wL||Pt==i_&&Ye==TL&&le[7].length<=ge[8]||Pt==(i_|TL)&&ge[7].length<=ge[8]&&Ye==wL;if(!(Zr||ka))return le;Pt&TA&&(le[2]=ge[2],vr|=Ye&TA?0:jY);var sn=ge[3];if(sn){var fn=le[3];le[3]=fn?Ab(fn,sn,ge[4]):sn,le[4]=fn?Yp(le[3],bL):ge[4]}return sn=ge[5],sn&&(fn=le[5],le[5]=fn?Sb(fn,sn,ge[6]):sn,le[6]=fn?Yp(le[5],bL):ge[6]),sn=ge[7],sn&&(le[7]=sn),Pt&i_&&(le[8]=le[8]==null?ge[8]:VY(le[8],ge[8])),le[9]==null&&(le[9]=ge[9]),le[0]=ge[0],le[1]=vr,le}var AL=qY;var GY="Expected a function",SL=1,HY=2,AA=8,SA=16,MA=
|
|||
|
`:"";le.replace(Uo,function(Ws,Yl,cu,ih,Eh,Bp){return cu||(cu=ih),Fi+=le.slice(Li,Bp).replace(Bce,Qz),Yl&&(sn=!0,Fi+=`' +
|
|||
|
__e(`+Yl+`) +
|
|||
|
'`),Eh&&(fn=!0,Fi+=`';
|
|||
|
`+Eh+`;
|
|||
|
__p += '`),cu&&(Fi+=`' +
|
|||
|
((__t = (`+cu+`)) == null ? '' : __t) +
|
|||
|
'`),Li=Bp+Ws.length,Ws}),Fi+=`';
|
|||
|
`;var mo=r8.call(ge,"variable")&&ge.variable;if(!mo)Fi=`with (obj) {
|
|||
|
`+Fi+`
|
|||
|
}
|
|||
|
`;else if(Fce.test(mo))throw new Error(Ice);Fi=(fn?Fi.replace(Rce,""):Fi).replace(Dce,"$1").replace(zce,"$1;"),Fi="function("+(mo||"obj")+`) {
|
|||
|
`+(mo?"":`obj || (obj = {});
|
|||
|
`)+"var __t, __p = ''"+(sn?", __e = _.escape":"")+(fn?`, __j = Array.prototype.join;
|
|||
|
function print() { __p += __j.call(arguments, '') }
|
|||
|
`:`;
|
|||
|
`)+Fi+`return __p
|
|||
|
}`;var Ze=Vb(function(){return Function(Zr,ws+"return "+Fi).apply(void 0,ka)});if(Ze.source=Fi,fy(Ze))throw Ze;return Ze}var a8=Uce;var jce="Expected a function";function Vce(le,ge,Ye){var Pt=!0,vr=!0;if(typeof le!="function")throw new TypeError(jce);return kl(Ye)&&(Pt="leading"in Ye?!!Ye.leading:Pt,vr="trailing"in Ye?!!Ye.trailing:vr),_w(le,ge,{leading:Pt,maxWait:ge,trailing:vr})}var n8=Vce;function qce(le,ge){return ge(le)}var Wv=qce;var Gce=9007199254740991,GA=4294967295,Hce=Math.min;function Wce(le,ge){if(le=Go(le),le<1||le>Gce)return[];var Ye=GA,Pt=Hce(le,GA);ge=Mh(ge),le-=GA;for(var vr=ry(Pt,ge);++Ye<le;)ge(Ye);return vr}var i8=Wce;function Xce(){return this}var o8=Xce;function Zce(le,ge){var Ye=le;return Ye instanceof Bl&&(Ye=Ye.value()),py(ge,function(Pt,vr){return vr.func.apply(vr.thisArg,Dp([Pt],vr.args))},Ye)}var a2=Zce;function Yce(){return a2(this.__wrapped__,this.__actions__)}var Wm=Yce;function Kce(le){return Ds(le).toLowerCase()}var s8=Kce;function Jce(le){return Do(le)?Sl(le,Sh):Rf(le)?[le]:ff(Ub(Ds(le)))}var l8=Jce;var u8=9007199254740991;function $ce(le){return le?cd(Go(le),-u8,u8):le===0?le:0}var c8=$ce;function Qce(le){return Ds(le).toUpperCase()}var f8=Qce;function efe(le,ge,Ye){var Pt=Do(le),vr=Pt||Kp(le)||Ed(le);if(ge=wo(ge,4),Ye==null){var Zr=le&&le.constructor;vr?Ye=Pt?new Zr:[]:kl(le)?Ye=ap(Zr)?Td(Im(le)):{}:Ye={}}return(vr?Nh:cp)(le,function(ka,sn,fn){return ge(Ye,ka,sn,fn)}),Ye}var h8=efe;function tfe(le,ge){for(var Ye=le.length;Ye--&&Ad(ge,le[Ye],0)>-1;);return Ye}var n2=tfe;function rfe(le,ge){for(var Ye=-1,Pt=le.length;++Ye<Pt&&Ad(ge,le[Ye],0)>-1;);return Ye}var i2=rfe;function afe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return bb(le);if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=Uh(ge),Zr=i2(Pt,vr),ka=n2(Pt,vr)+1;return zp(Pt,Zr,ka).join("")}var p8=afe;function nfe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return le.slice(0,xb(le)+1);if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=n2(Pt,Uh(ge))+1;return zp(Pt,0,vr).join("")}var d8=nfe;var ife=/^\s+/;function ofe(le,ge,Ye){if(le=Ds(le),le&&(Ye||ge===void 0))return le.replace(ife,"");if(!le||!(ge=ah(ge)))return le;var Pt=Uh(le),vr=i2(Pt,Uh(ge));return zp(Pt,vr).join("")}var v8=ofe;var sfe=30,lfe="...",ufe=/\w*$/;function cfe(le,ge){var Ye=sfe,Pt=lfe;if(kl(ge)){var vr="separator"in ge?ge.separator:vr;Ye="length"in ge?Go(ge.length):Ye,Pt="omission"in ge?ah(ge.omission):Pt}le=Ds(le);var Zr=le.length;if(Cd(le)){var ka=Uh(le);Zr=ka.length}if(Ye>=Zr)return le;var sn=Ye-Pd(Pt);if(sn<1)return Pt;var fn=ka?zp(ka,0,sn).join(""):le.slice(0,sn);if(vr===void 0)return fn+Pt;if(ka&&(sn+=fn.length-sn),By(vr)){if(le.slice(sn).search(vr)){var Li,bi=fn;for(vr.global||(vr=RegExp(vr.source,Ds(ufe.exec(vr))+"g")),vr.lastIndex=0;Li=vr.exec(bi);)var Fi=Li.index;fn=fn.slice(0,Fi===void 0?sn:Fi)}}else if(le.indexOf(ah(vr),sn)!=sn){var Uo=fn.lastIndexOf(vr);Uo>-1&&(fn=fn.slice(0,Uo))}return fn+Pt}var m8=cfe;function ffe(le){return zb(le,1)}var g8=ffe;var hfe={"&":"&","<":"<",">":">",""":'"',"'":"'"},pfe=dy(hfe),y8=pfe;var _8=/&(?:amp|lt|gt|quot|#39);/g,dfe=RegExp(_8.source);function vfe(le){return le=Ds(le),le&&dfe.test(le)?le.replace(_8,y8):le}var x8=vfe;var mfe=1/0,gfe=Rm&&1/zm(new Rm([,-0]))[1]==mfe?function(le){return new Rm(le)}:Y0,b8=gfe;var yfe=200;function _fe(le,ge,Ye){var Pt=-1,vr=Sm,Zr=le.length,ka=!0,sn=[],fn=sn;if(Ye)ka=!1,vr=Iy;else if(Zr>=yfe){var Li=ge?null:b8(le);if(Li)return zm(Li);ka=!1,vr=Gv,fn=new Dm}else fn=ge?[]:sn;e:for(;++Pt<Zr;){var bi=le[Pt],Fi=ge?ge(bi):bi;if(bi=Ye||bi!==0?bi:0,ka&&Fi===Fi){for(var Uo=fn.length;Uo--;)if(fn[Uo]===Fi)continue e;ge&&fn.push(Fi),sn.push(bi)}else vr(fn,Fi,Ye)||(fn!==sn&&fn.push(Fi),sn.push(bi))}return sn}var Jp=_fe;var xfe=Ho(function(le){return Jp(Qu(le,1,Su,!0))}),w8=xfe;var bfe=Ho(function(le){var ge=wf(le);return Su(ge)&&(ge=void 0),Jp(Qu(le,1,Su,!0),wo(ge,2))}),T8=bfe;var wfe=Ho(function(le){var ge=wf(le);return ge=typeof ge=="function"?ge:void 0,Jp(Qu(le,1,Su,!0),void 0,ge)}),A8=wfe;function Tfe(le){return le&&le.length?Jp(le):[]}var S8=Tfe;function Afe(le,ge){return le&&le.l
|
|||
|
/*! Bundled license information:
|
|||
|
|
|||
|
plotly.js/dist/plotly.js:
|
|||
|
(*!
|
|||
|
* The buffer module from node.js, for the browser.
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|||
|
* @license MIT
|
|||
|
*)
|
|||
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
(*!
|
|||
|
* Determine if an object is a Buffer
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|||
|
* @license MIT
|
|||
|
*)
|
|||
|
(*!
|
|||
|
* pad-left <https://github.com/jonschlinkert/pad-left>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|||
|
* Licensed under the MIT license.
|
|||
|
*)
|
|||
|
(*!
|
|||
|
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
|||
|
*
|
|||
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|||
|
* Licensed under the MIT License.
|
|||
|
*)
|
|||
|
(*! Bundled license information:
|
|||
|
|
|||
|
native-promise-only/lib/npo.src.js:
|
|||
|
(*! Native Promise Only
|
|||
|
v0.8.1 (c) Kyle Simpson
|
|||
|
MIT License: http://getify.mit-license.org
|
|||
|
*)
|
|||
|
|
|||
|
polybooljs/index.js:
|
|||
|
(*
|
|||
|
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
|
|||
|
* @license MIT
|
|||
|
* @preserve Project Home: https://github.com/voidqk/polybooljs
|
|||
|
*)
|
|||
|
|
|||
|
ieee754/index.js:
|
|||
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|||
|
buffer/index.js:
|
|||
|
(*!
|
|||
|
* The buffer module from node.js, for the browser.
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|||
|
* @license MIT
|
|||
|
*)
|
|||
|
|
|||
|
safe-buffer/index.js:
|
|||
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|||
|
assert/build/internal/util/comparisons.js:
|
|||
|
(*!
|
|||
|
* The buffer module from node.js, for the browser.
|
|||
|
*
|
|||
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|||
|
* @license MIT
|
|||
|
*)
|
|||
|
|
|||
|
object-assign/index.js:
|
|||
|
(*
|
|||
|
object-assign
|
|||
|
(c) Sindre Sorhus
|
|||
|
@license MIT
|
|||
|
*)
|
|||
|
|
|||
|
maplibre-gl/dist/maplibre-gl.js:
|
|||
|
(**
|
|||
|
* MapLibre GL JS
|
|||
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
|
|||
|
*)
|
|||
|
*)
|
|||
|
|
|||
|
lodash-es/lodash.default.js:
|
|||
|
(**
|
|||
|
* @license
|
|||
|
* Lodash (Custom Build) <https://lodash.com/>
|
|||
|
* Build: `lodash modularize exports="es" -o ./`
|
|||
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|||
|
* Released under MIT license <https://lodash.com/license>
|
|||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|||
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|||
|
*)
|
|||
|
|
|||
|
lodash-es/lodash.js:
|
|||
|
(**
|
|||
|
* @license
|
|||
|
* Lodash (Custom Build) <https://lodash.com/>
|
|||
|
* Build: `lodash modularize exports="es" -o ./`
|
|||
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|||
|
* Released under MIT license <https://lodash.com/license>
|
|||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|||
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|||
|
*)
|
|||
|
*/
|