Socket
Socket
Sign inDemoInstall

d3-marching-squares

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-marching-squares - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

build/d3-marching-squares.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.rastertools=e.rastertools||{})}(this,function(e){"use strict";function t(e,t,o){return(e-t)/(o-t)}function o(e){for(var t=[],o=e.rows,r=e.cols,h=[],l=0;l<o;l++)for(var a=0;a<r;a++)if("undefined"!=typeof e.cells[l][a]&&e.cells[l][a].edges.length>0){var f=e.cells[l][a],n=(f.cval,p(f)),i=null,c=a,b=l;null!==n&&h.push([n.p[0]+c,n.p[1]+b]);do{if(i=u(e.cells[b][c],n.x,n.y,n.o),null===i)break;if(h.push([i.p[0]+c,i.p[1]+b]),c+=i.x,b+=i.y,n=i,b<0||b>=o||c<0||c>=r||"undefined"==typeof e.cells[b][c]){c-=i.x,b-=i.y;var g=s(e,c,b,i.x,i.y,i.o);if(null===g)break;g.path.forEach(function(e){h.push(e)}),c=g.i,b=g.j,n=g}}while("undefined"!=typeof e.cells[b][c]&&e.cells[b][c].edges.length>0);t.push(h),h=[],e.cells[l][a].edges.length>0&&a--}return t}function s(e,t,o,s,r,p){for(var u=e.cells[o][t],h=u.cval_real,l=t+s,a=o+r,f=[],n=(e.rows,e.cols,!1);!n;){if("undefined"==typeof e.cells[a]||"undefined"==typeof e.cells[a][l])if(a-=r,l-=s,u=e.cells[a][l],h=u.cval_real,r===-1)if(0===p)if(h&w)f.push([l,a]),s=-1,r=0,p=0;else{if(!(h&x)){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l+1,a]),s=1,r=0,p=0}else{if(!(h&w)){if(h&x){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l+u.bottomleft,a]),s=0,r=1,p=0,n=!0;break}f.push([l,a]),s=-1,r=0,p=0}else if(1===r)if(0===p){if(!(h&k)){if(h&v){f.push([l+u.topleft,a+1]),s=0,r=-1,p=0,n=!0;break}f.push([l+u.topright,a+1]),s=0,r=-1,p=1,n=!0;break}f.push([l+1,a+1]),s=1,r=0,p=1}else h&k?(f.push([l+1,a+1]),s=1,r=0,p=1):(f.push([l+1,a+1]),s=1,r=0,p=1);else if(s===-1)if(0===p){if(!(h&v)){if(h&w){f.push([l,a+u.leftbottom]),s=1,r=0,p=0,n=!0;break}f.push([l,a+u.lefttop]),s=1,r=0,p=1,n=!0;break}f.push([l,a+1]),s=0,r=1,p=0}else{if(!(h&v)){console.log("wtf");break}f.push([l,a+1]),s=0,r=1,p=0}else{if(1!==s){console.log("we came from nowhere!");break}if(0===p){if(!(h&x)){f.push([l+1,a+u.rightbottom]),s=-1,r=0,p=0,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}else{if(!(h&x)){if(h&k){f.push([l+1,a+u.righttop]),s=-1,r=0,p=1;break}f.push([l+1,a+u.rightbottom]),s=-1,r=0,p=0,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}}else if(u=e.cells[a][l],h=u.cval_real,s===-1)if(0===p)if("undefined"!=typeof e.cells[a-1]&&"undefined"!=typeof e.cells[a-1][l])s=0,r=-1,p=1;else{if(!(h&w)){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l,a])}else{if(!(h&v)){console.log("found entry from top at "+l+","+a);break}console.log("proceeding in x-direction!")}else if(1===s){if(0===p){console.log("wtf");break}if("undefined"!=typeof e.cells[a+1]&&"undefined"!=typeof e.cells[a+1][l])s=0,r=1,p=0;else{if(!(h&k)){f.push([l+u.topleft,a+1]),s=0,r=-1,p=0,n=!0;break}f.push([l+1,a+1]),s=1,r=0,p=1}}else if(r===-1){if(1!==p){console.log("wtf");break}if("undefined"!=typeof e.cells[a][l+1])s=1,r=0,p=1;else{if(!(h&x)){f.push([l+1,a+u.righttop]),s=-1,r=0,p=1,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}}else{if(1!==r){console.log("where did we came from???");break}if(0!==p){console.log("wtf");break}if("undefined"!=typeof e.cells[a][l-1])s=-1,r=0,p=0;else{if(!(h&v)){f.push([l,a+u.leftbottom]),s=1,r=0,p=0,n=!0;break}f.push([l,a+1]),s=0,r=1,p=0}}if(l+=s,a+=r,l===t&&a===o)break}return{path:f,i:l,j:a,x:s,y:r,o:p}}function r(e,t){delete e.edges[t];for(var o=t+1;o<e.edges.length;o++)e.edges[o-1]=e.edges[o];e.edges.pop()}function p(e){if(e.edges.length>0){var t=e.edges[e.edges.length-1],o=e.cval_real;switch(t){case 0:return o&k?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 1:return o&x?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 2:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 3:return o&w?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 4:return o&k?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 5:return o&x?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 6:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 7:return o&w?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 8:return o&x?{p:[e.bottomright],x:0,y:1,o:1}:{p:[1,e.righttop],x:-1,y:0,o:1};case 9:return o&w?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 10:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.righttop],x:-1,y:0,o:1};case 11:return o&v?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 12:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 13:return o&w?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 14:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 15:return o&v?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 16:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 17:return o&v?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 18:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 19:return o&v?{p:[e.bottomleft,0],x:0,y:1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 20:return o&v?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 21:return o&k?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.topright,1],x:0,y:-1,o:1};case 22:return o&v?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 23:return o&k?{p:[0,e.lefttop],x:1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};default:console.log("edge index out of range!"),console.log(e)}}return null}function u(e,t,o,s){var p,u,t,o,h,l,a,f=e.cval;switch(t){case-1:switch(s){case 0:p=U[f],h=A[f],l=G[f],a=P[f];break;default:p=R[f],h=F[f],l=O[f],a=I[f]}break;case 1:switch(s){case 0:p=Y[f],h=J[f],l=K[f],a=Q[f];break;default:p=Z[f],h=B[f],l=D[f],a=H[f]}break;default:switch(o){case-1:switch(s){case 0:p=$[f],h=N[f],l=j[f],a=C[f];break;default:p=ee[f],h=_[f],l=E[f],a=M[f]}break;case 1:switch(s){case 0:p=X[f],h=T[f],l=V[f],a=L[f];break;default:p=W[f],h=S[f],l=q[f],a=z[f]}}}if(u=e.edges.indexOf(p),"undefined"==typeof e.edges[u])return null;switch(r(e,u),f=e.cval_real,p){case 0:f&k?(t=e.topleft,o=1):(t=1,o=e.righttop);break;case 1:f&x?(t=1,o=e.rightbottom):(t=e.topleft,o=1);break;case 2:f&x?(t=e.topleft,o=1):(t=e.bottomright,o=0);break;case 3:f&w?(t=e.bottomleft,o=0):(t=e.topleft,o=1);break;case 4:f&k?(t=e.topright,o=1):(t=1,o=e.righttop);break;case 5:f&x?(t=1,o=e.rightbottom):(t=e.topright,o=1);break;case 6:f&x?(t=e.topright,o=1):(t=e.bottomright,o=0);break;case 7:f&w?(t=e.bottomleft,o=0):(t=e.topright,o=1);break;case 8:f&x?(t=1,o=e.righttop):(t=e.bottomright,o=0);break;case 9:f&w?(t=e.bottomleft,o=0):(t=1,o=e.righttop);break;case 10:f&w?(t=1,o=e.righttop):(t=0,o=e.leftbottom);break;case 11:f&v?(t=0,o=e.lefttop):(t=1,o=e.righttop);break;case 12:f&x?(t=1,o=e.rightbottom):(t=e.bottomright,o=0);break;case 13:f&w?(t=e.bottomleft,o=0):(t=1,o=e.rightbottom);break;case 14:f&w?(t=1,o=e.rightbottom):(t=0,o=e.leftbottom);break;case 15:f&v?(t=0,o=e.lefttop):(t=1,o=e.rightbottom);break;case 16:f&x?(t=0,o=e.leftbottom):(t=e.bottomright,o=0);break;case 17:f&v?(t=0,o=e.lefttop):(t=e.bottomright,o=0);break;case 18:f&w?(t=e.bottomleft,o=0):(t=0,o=e.leftbottom);break;case 19:f&v?(t=0,o=e.lefttop):(t=e.bottomleft,o=0);break;case 20:f&v?(t=0,o=e.leftbottom):(t=e.topleft,o=1);break;case 21:f&k?(t=e.topright,o=1):(t=0,o=e.leftbottom);break;case 22:f&v?(t=0,o=e.lefttop):(t=e.topleft,o=1);break;case 23:f&k?(t=e.topright,o=1):(t=0,o=e.lefttop);break;default:return console.log("edge index out of range!"),console.log(e),null}return"undefined"!=typeof t&&"undefined"!=typeof o&&"undefined"!=typeof h&&"undefined"!=typeof l&&"undefined"!=typeof a||(console.log("undefined value!"),console.log(e),console.log(t+" "+o+" "+h+" "+l+" "+a)),{p:[t,o],x:h,y:l,o:a}}function h(e,t,o){return(e-t)/(o-t)}function l(e,t){for(var o=e.length-1,s=e[0].length-1,r={rows:o,cols:s,cells:[]},p=0;p<o;++p){r.cells[p]=[];for(var u=0;u<s;++u){var l=0,a=e[p+1][u],f=e[p+1][u+1],n=e[p][u+1],i=e[p][u];if(!(isNaN(a)||isNaN(f)||isNaN(n)||isNaN(i))){l|=a>=t?8:0,l|=f>=t?4:0,l|=n>=t?2:0,l|=i>=t?1:0;var c=!1;if(5==l||10==l){var b=(a+f+n+i)/4;5==l&&b<t?(l=10,c=!0):10==l&&b<t&&(l=5,c=!0)}if(0!==l&&15!==l){var g,d,y,m;g=d=y=m=.5,1==l?(y=1-h(t,a,i),d=1-h(t,n,i)):2==l?(d=h(t,i,n),m=1-h(t,f,n)):3==l?(y=1-h(t,a,i),m=1-h(t,f,n)):4==l?(g=h(t,a,f),m=h(t,n,f)):5==l?(g=h(t,a,f),m=h(t,n,f),d=1-h(t,n,i),y=1-h(t,a,i)):6==l?(d=h(t,i,n),g=h(t,a,f)):7==l?(y=1-h(t,a,i),g=h(t,a,f)):8==l?(y=h(t,i,a),g=1-h(t,f,a)):9==l?(d=1-h(t,n,i),g=1-h(t,f,a)):10==l?(g=1-h(t,f,a),m=1-h(t,f,n),d=h(t,i,n),y=h(t,i,a)):11==l?(g=1-h(t,f,a),m=1-h(t,f,n)):12==l?(y=h(t,i,a),m=h(t,n,f)):13==l?(d=1-h(t,n,i),m=h(t,n,f)):14==l?(y=h(t,i,a),d=h(t,i,n)):console.log("Illegal cval detected: "+l),r.cells[p][u]={cval:l,flipped:c,top:g,right:m,bottom:d,left:y}}}}}return r}function a(e){return 5==e.cval||10==e.cval}function f(e){return 0===e.cval||15==e.cval}function n(e){f(e)||5==e.cval||10==e.cval||(e.cval=15)}function i(e,t){return"top"===t?[e.top,1]:"bottom"===t?[e.bottom,0]:"right"===t?[1,e.right]:"left"===t?[0,e.left]:void 0}function c(e){var t=[],o=0,s=(e.rows,e.cols,1e-7);return e.cells.forEach(function(r,p){r.forEach(function(r,u){if("undefined"!=typeof r&&!a(r)&&!f(r)){var h=b(e.cells,p,u),l=!1;if("mergeable"==h.info)for(var n=h.path[h.path.length-1][0],i=h.path[h.path.length-1][1],c=o-1;c>=0;c--)if(Math.abs(t[c][0][0]-n)<=s&&Math.abs(t[c][0][1]-i)<=s){for(var g=h.path.length-2;g>=0;--g)t[c].unshift(h.path[g]);l=!0;break}l||(t[o++]=h.path)}})}),t}function b(e,t,o){var s,r,p=e.length,u=[],h=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],l=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],a=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],f=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],c=(e[t][o],e[t][o]),b=c.cval,g=a[b],d=i(c,g);u.push([o+d[0],t+d[1]]),g=f[b],d=i(c,g),u.push([o+d[0],t+d[1]]),n(c);for(var y=o+h[b],m=t+l[b],v=b;y>=0&&m>=0&&m<p&&(y!=o||m!=t)&&(c=e[m][y],"undefined"!=typeof c);){if(b=c.cval,0===b||15===b)return{path:u,info:"mergeable"};g=f[b],s=h[b],r=l[b],5!=b&&10!=b||(5==b?c.flipped?l[v]==-1?(g="left",s=-1,r=0):(g="right",s=1,r=0):h[v]==-1&&(g="bottom",s=0,r=-1):10==b&&(c.flipped?h[v]==-1?(g="top",s=0,r=1):(g="bottom",s=0,r=-1):1==l[v]&&(g="left",s=-1,r=0))),d=i(c,g),u.push([y+d[0],m+d[1]]),n(c),y+=s,m+=r,v=b}return{path:u,info:"closed"}}var g=function(e,t,o){for(var s={type:"FeatureCollection",features:[]},r=1;r<o.length;r++){for(var p=o[r-1],u=o[r],h=d(e,t,p,u-p),l=0;l<h.length;l++)h[l].reverse();s.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:h},properties:[{lowerValue:p,upperValue:u}]})}return s},d=function(e,t,o,s){if(typeof t!=typeof new Array||6!=t.length)throw new Error("GeoTransform must be a 6 elements array");for(var r=m(e,o,s),p=0;p<r.length;p++)for(var u=0;u<r[p].length;u++){var h=y(r[p][u][0],r[p][u][1],t);r[p][u][0]=h[0],r[p][u][1]=h[1]}return r},y=function(e,t,o){var s=o[0]+e*o[1]+t*o[2],r=o[3]+e*o[4]+t*o[5];return[s,r]},m=function(e,t,s,r){var p={},u={successCallback:null,progressCallback:null,verbose:!1};r=r?r:{};for(var h=Object.keys(u),l=0;l<h.length;l++){var a=h[l],f=r[a];f="undefined"!=typeof f&&null!==f?f:u[a],p[a]=f}p.verbose&&console.log("computing isobands for ["+t+":"+(t+s)+"]");var n=te(e,t,s),i=o(n);return i},v=64,k=16,x=4,w=1,N=[],j=[],C=[],_=[],E=[],M=[],F=[],O=[],I=[],A=[],G=[],P=[],T=[],V=[],L=[],S=[],q=[],z=[],B=[],D=[],H=[],J=[],K=[],Q=[];F[85]=A[85]=-1,O[85]=G[85]=0,I[85]=P[85]=1,B[85]=J[85]=1,D[85]=K[85]=0,H[85]=Q[85]=1,N[85]=_[85]=0,j[85]=E[85]=-1,C[85]=L[85]=0,S[85]=T[85]=0,q[85]=V[85]=1,M[85]=z[85]=1,J[1]=J[169]=0,K[1]=K[169]=-1,Q[1]=Q[169]=0,T[1]=T[169]=-1,V[1]=V[169]=0,L[1]=L[169]=0,A[4]=A[166]=0,G[4]=G[166]=-1,P[4]=P[166]=1,S[4]=S[166]=1,q[4]=q[166]=0,z[4]=z[166]=0,F[16]=F[154]=0,O[16]=O[154]=1,I[16]=I[154]=1,_[16]=_[154]=1,E[16]=E[154]=0,M[16]=M[154]=1,B[64]=B[106]=0,D[64]=D[106]=1,H[64]=H[106]=0,N[64]=N[106]=-1,j[64]=j[106]=0,C[64]=C[106]=1,B[2]=B[168]=0,D[2]=D[168]=-1,H[2]=H[168]=1,J[2]=J[168]=0,K[2]=K[168]=-1,Q[2]=Q[168]=0,T[2]=T[168]=-1,V[2]=V[168]=0,L[2]=L[168]=0,S[2]=S[168]=-1,q[2]=q[168]=0,z[2]=z[168]=1,F[8]=F[162]=0,O[8]=O[162]=-1,I[8]=I[162]=0,A[8]=A[162]=0,G[8]=G[162]=-1,P[8]=P[162]=1,T[8]=T[162]=1,V[8]=V[162]=0,L[8]=L[162]=1,S[8]=S[162]=1,q[8]=q[162]=0,z[8]=z[162]=0,F[32]=F[138]=0,O[32]=O[138]=1,I[32]=I[138]=1,A[32]=A[138]=0,G[32]=G[138]=1,P[32]=P[138]=0,N[32]=N[138]=1,j[32]=j[138]=0,C[32]=C[138]=0,_[32]=_[138]=1,E[32]=E[138]=0,M[32]=M[138]=1,J[128]=J[42]=0,K[128]=K[42]=1,Q[128]=Q[42]=1,B[128]=B[42]=0,D[128]=D[42]=1,H[128]=H[42]=0,N[128]=N[42]=-1,j[128]=j[42]=0,C[128]=C[42]=1,_[128]=_[42]=-1,E[128]=E[42]=0,M[128]=M[42]=0,A[5]=A[165]=-1,G[5]=G[165]=0,P[5]=P[165]=0,J[5]=J[165]=1,K[5]=K[165]=0,Q[5]=Q[165]=0,S[20]=S[150]=0,q[20]=q[150]=1,z[20]=z[150]=1,_[20]=_[150]=0,E[20]=E[150]=-1,M[20]=M[150]=1,F[80]=F[90]=-1,O[80]=O[90]=0,I[80]=I[90]=1,B[80]=B[90]=1,D[80]=D[90]=0,H[80]=H[90]=1,T[65]=T[105]=0,V[65]=V[105]=1,L[65]=L[105]=0,N[65]=N[105]=0,j[65]=j[105]=-1,C[65]=C[105]=0,F[160]=F[10]=-1,O[160]=O[10]=0,I[160]=I[10]=1,A[160]=A[10]=-1,G[160]=G[10]=0,P[160]=P[10]=0,J[160]=J[10]=1,K[160]=K[10]=0,Q[160]=Q[10]=0,B[160]=B[10]=1,D[160]=D[10]=0,H[160]=H[10]=1,S[130]=S[40]=0,q[130]=q[40]=1,z[130]=z[40]=1,T[130]=T[40]=0,V[130]=V[40]=1,L[130]=L[40]=0,N[130]=N[40]=0,j[130]=j[40]=-1,C[130]=C[40]=0,_[130]=_[40]=0,E[130]=E[40]=-1,M[130]=M[40]=1,A[37]=A[133]=0,G[37]=G[133]=1,P[37]=P[133]=1,J[37]=J[133]=0,K[37]=K[133]=1,Q[37]=Q[133]=0,N[37]=N[133]=-1,j[37]=j[133]=0,C[37]=C[133]=0,_[37]=_[133]=1,E[37]=E[133]=0,M[37]=M[133]=0,S[148]=S[22]=-1,q[148]=q[22]=0,z[148]=z[22]=0,J[148]=J[22]=0,K[148]=K[22]=-1,Q[148]=Q[22]=1,B[148]=B[22]=0,D[148]=D[22]=1,H[148]=H[22]=1,_[148]=_[22]=-1,E[148]=E[22]=0,M[148]=M[22]=1,F[82]=F[88]=0,O[82]=O[88]=-1,I[82]=I[88]=1,S[82]=S[88]=1,q[82]=q[88]=0,z[82]=z[88]=1,T[82]=T[88]=-1,V[82]=V[88]=0,L[82]=L[88]=1,B[82]=B[88]=0,D[82]=D[88]=-1,H[82]=H[88]=0,F[73]=F[97]=0,O[73]=O[97]=1,I[73]=I[97]=0,A[73]=A[97]=0,G[73]=G[97]=-1,P[73]=P[97]=0,T[73]=T[97]=1,V[73]=V[97]=0,L[73]=L[97]=0,N[73]=N[97]=1,j[73]=j[97]=0,C[73]=C[97]=1,F[145]=F[25]=0,O[145]=O[25]=-1,I[145]=I[25]=0,T[145]=T[25]=1,V[145]=V[25]=0,L[145]=L[25]=1,J[145]=J[25]=0,K[145]=K[25]=1,Q[145]=Q[25]=1,_[145]=_[25]=-1,E[145]=E[25]=0,M[145]=M[25]=0,A[70]=A[100]=0,G[70]=G[100]=1,P[70]=P[100]=0,S[70]=S[100]=-1,q[70]=q[100]=0,z[70]=z[100]=1,B[70]=B[100]=0,D[70]=D[100]=-1;H[70]=H[100]=1;N[70]=N[100]=1,j[70]=j[100]=0,C[70]=C[100]=0,A[101]=A[69]=0,G[101]=G[69]=1,P[101]=P[69]=0,N[101]=N[69]=1,j[101]=j[69]=0,C[101]=C[69]=0,J[149]=J[21]=0,K[149]=K[21]=1,Q[149]=Q[21]=1,_[149]=_[21]=-1,E[149]=E[21]=0,M[149]=M[21]=0,S[86]=S[84]=-1,q[86]=q[84]=0,z[86]=z[84]=1,B[86]=B[84]=0,D[86]=D[84]=-1,H[86]=H[84]=1,F[89]=F[81]=0,O[89]=O[81]=-1,I[89]=I[81]=0,T[89]=T[81]=1,V[89]=V[81]=0,L[89]=L[81]=1,F[96]=F[74]=0,O[96]=O[74]=1,I[96]=I[74]=0,A[96]=A[74]=-1,G[96]=G[74]=0,P[96]=P[74]=1,B[96]=B[74]=1,D[96]=D[74]=0,H[96]=H[74]=0,N[96]=N[74]=1,j[96]=j[74]=0,C[96]=C[74]=1,F[24]=F[146]=0,O[24]=O[146]=-1,I[24]=I[146]=1,S[24]=S[146]=1,q[24]=q[146]=0,z[24]=z[146]=1,T[24]=T[146]=0,V[24]=V[146]=1,L[24]=L[146]=1,_[24]=_[146]=0,E[24]=E[146]=-1,M[24]=M[146]=0,A[6]=A[164]=-1,G[6]=G[164]=0,P[6]=P[164]=1,S[6]=S[164]=-1,q[6]=q[164]=0,z[6]=z[164]=0,J[6]=J[164]=0,K[6]=K[164]=-1,Q[6]=Q[164]=1,B[6]=B[164]=1,D[6]=D[164]=0,H[6]=H[164]=0,T[129]=T[41]=0,V[129]=V[41]=1,L[129]=L[41]=1,J[129]=J[41]=0,K[129]=K[41]=1,Q[129]=Q[41]=0,N[129]=N[41]=-1,j[129]=j[41]=0,C[129]=C[41]=0,_[129]=_[41]=0,E[129]=E[41]=-1,M[129]=M[41]=0,S[66]=S[104]=0,q[66]=q[104]=1,z[66]=z[104]=0,T[66]=T[104]=-1,V[66]=V[104]=0,L[66]=L[104]=1,B[66]=B[104]=0,D[66]=D[104]=-1,H[66]=H[104]=0,N[66]=N[104]=0,j[66]=j[104]=-1,C[66]=C[104]=1,F[144]=F[26]=-1,O[144]=O[26]=0,I[144]=I[26]=0,J[144]=J[26]=1,K[144]=K[26]=0,Q[144]=Q[26]=1,B[144]=B[26]=0,D[144]=D[26]=1,H[144]=H[26]=1,_[144]=_[26]=-1,E[144]=E[26]=0,M[144]=M[26]=1,A[36]=A[134]=0,G[36]=G[134]=1,P[36]=P[134]=1,S[36]=S[134]=0,q[36]=q[134]=1,z[36]=z[134]=0,N[36]=N[134]=0,j[36]=j[134]=-1,C[36]=C[134]=1,_[36]=_[134]=1,E[36]=E[134]=0,M[36]=M[134]=0,F[9]=F[161]=-1,O[9]=O[161]=0,I[9]=I[161]=0,A[9]=A[161]=0,G[9]=G[161]=-1,P[9]=P[161]=0,T[9]=T[161]=1,V[9]=V[161]=0,L[9]=L[161]=0,J[9]=J[161]=1,K[9]=K[161]=0,Q[9]=Q[161]=1,F[136]=0,O[136]=1,I[136]=1,A[136]=0,G[136]=1,P[136]=0,S[136]=-1,q[136]=0,z[136]=1,T[136]=-1,V[136]=0,L[136]=0,J[136]=0,K[136]=-1,Q[136]=0,B[136]=0,D[136]=-1,H[136]=1,N[136]=1,j[136]=0,C[136]=0,_[136]=1,E[136]=0,M[136]=1,F[34]=0,O[34]=-1,I[34]=0,A[34]=0,G[34]=-1,P[34]=1,S[34]=1,q[34]=0,z[34]=0,T[34]=1,V[34]=0,L[34]=1,J[34]=0,K[34]=1,Q[34]=1,B[34]=0,D[34]=1,H[34]=0,N[34]=-1,j[34]=0,C[34]=1,_[34]=-1,E[34]=0,M[34]=0,F[35]=0,O[35]=1,I[35]=1,A[35]=0,G[35]=-1,P[35]=1,S[35]=1,q[35]=0,z[35]=0,T[35]=-1,V[35]=0,L[35]=0,J[35]=0,K[35]=-1,Q[35]=0,B[35]=0,D[35]=1,H[35]=0,N[35]=-1,j[35]=0,C[35]=1,_[35]=1,E[35]=0,M[35]=1,F[153]=0,O[153]=1,I[153]=1,T[153]=-1,V[153]=0;L[153]=0;J[153]=0,K[153]=-1,Q[153]=0,_[153]=1,E[153]=0,M[153]=1,A[102]=0,G[102]=-1,P[102]=1,S[102]=1,q[102]=0,z[102]=0,B[102]=0,D[102]=1,H[102]=0,N[102]=-1,j[102]=0,C[102]=1,F[155]=0,O[155]=-1,I[155]=0,T[155]=1,V[155]=0,L[155]=1,J[155]=0,K[155]=1,Q[155]=1,_[155]=-1,E[155]=0,M[155]=0,A[103]=0,G[103]=1,P[103]=0,S[103]=-1,q[103]=0,z[103]=1,B[103]=0,D[103]=-1,H[103]=1,N[103]=1,j[103]=0,C[103]=0,F[152]=0,O[152]=1,I[152]=1,S[152]=-1,q[152]=0,z[152]=1,T[152]=-1,V[152]=0,L[152]=0,J[152]=0,K[152]=-1,Q[152]=0,B[152]=0,D[152]=-1,H[152]=1,_[152]=1,E[152]=0,M[152]=1,F[156]=0,O[156]=-1,I[156]=1,S[156]=1,q[156]=0,z[156]=1,T[156]=-1,V[156]=0,L[156]=0,J[156]=0,K[156]=-1,Q[156]=0,B[156]=0,D[156]=1,H[156]=1,_[156]=-1,E[156]=0,M[156]=1,F[137]=0,O[137]=1,I[137]=1,A[137]=0,G[137]=1,P[137]=0,T[137]=-1,V[137]=0,L[137]=0,J[137]=0,K[137]=-1,Q[137]=0,N[137]=1,j[137]=0,C[137]=0,_[137]=1,E[137]=0,M[137]=1,F[139]=0,O[139]=1,I[139]=1,A[139]=0,G[139]=-1,P[139]=0,T[139]=1,V[139]=0,L[139]=0,J[139]=0,K[139]=1,Q[139]=0,N[139]=-1,j[139]=0,C[139]=0,_[139]=1,E[139]=0,M[139]=1,F[98]=0,O[98]=-1,I[98]=0,A[98]=0,G[98]=-1,P[98]=1,S[98]=1,q[98]=0,z[98]=0,T[98]=1,V[98]=0,L[98]=1,B[98]=0,D[98]=1,H[98]=0,N[98]=-1,j[98]=0,C[98]=1,F[99]=0,O[99]=1,I[99]=0,A[99]=0,G[99]=-1,P[99]=1,S[99]=1,q[99]=0,z[99]=0,T[99]=-1,V[99]=0,L[99]=1,B[99]=0,D[99]=-1,H[99]=0,N[99]=1,j[99]=0,C[99]=1,A[38]=0,G[38]=-1,P[38]=1,S[38]=1,q[38]=0,z[38]=0,J[38]=0,K[38]=1,Q[38]=1,B[38]=0,D[38]=1,H[38]=0,N[38]=-1,j[38]=0,C[38]=1,_[38]=-1,E[38]=0,M[38]=0,A[39]=0,G[39]=1,P[39]=1,S[39]=-1,q[39]=0,z[39]=0,J[39]=0,K[39]=-1,Q[39]=1,B[39]=0,D[39]=1,H[39]=0,N[39]=-1,j[39]=0,C[39]=1,_[39]=1,E[39]=0,M[39]=0;var R=[],U=[],W=[],X=[],Y=[],Z=[],$=[],ee=[];X[1]=Y[1]=18,X[169]=Y[169]=18,W[4]=U[4]=12,W[166]=U[166]=12,R[16]=ee[16]=4,R[154]=ee[154]=4,Z[64]=$[64]=22,Z[106]=$[106]=22,W[2]=Z[2]=17,X[2]=Y[2]=18,W[168]=Z[168]=17,X[168]=Y[168]=18,R[8]=X[8]=9,U[8]=W[8]=12,R[162]=X[162]=9,U[162]=W[162]=12,R[32]=ee[32]=4,U[32]=$[32]=1,R[138]=ee[138]=4,U[138]=$[138]=1,Y[128]=ee[128]=21,Z[128]=$[128]=22,Y[42]=ee[42]=21,Z[42]=$[42]=22,U[5]=Y[5]=14,U[165]=Y[165]=14,W[20]=ee[20]=6,W[150]=ee[150]=6,R[80]=Z[80]=11,R[90]=Z[90]=11,X[65]=$[65]=3,X[105]=$[105]=3,R[160]=Z[160]=11,U[160]=Y[160]=14,R[10]=Z[10]=11,U[10]=Y[10]=14,W[130]=ee[130]=6,X[130]=$[130]=3,W[40]=ee[40]=6,X[40]=$[40]=3,U[101]=$[101]=1,U[69]=$[69]=1,Y[149]=ee[149]=21,Y[21]=ee[21]=21,W[86]=Z[86]=17,W[84]=Z[84]=17,R[89]=X[89]=9,R[81]=X[81]=9,R[96]=$[96]=0,U[96]=Z[96]=15,R[74]=$[74]=0,U[74]=Z[74]=15,R[24]=W[24]=8,X[24]=ee[24]=7,R[146]=W[146]=8,X[146]=ee[146]=7,U[6]=Z[6]=15,W[6]=Y[6]=16,U[164]=Z[164]=15,W[164]=Y[164]=16,X[129]=ee[129]=7,Y[129]=$[129]=20,X[41]=ee[41]=7,Y[41]=$[41]=20,W[66]=$[66]=2,X[66]=Z[66]=19,W[104]=$[104]=2,X[104]=Z[104]=19,R[144]=Y[144]=10,Z[144]=ee[144]=23,R[26]=Y[26]=10,Z[26]=ee[26]=23,U[36]=ee[36]=5,W[36]=$[36]=2,U[134]=ee[134]=5,W[134]=$[134]=2,R[9]=Y[9]=10,U[9]=X[9]=13,R[161]=Y[161]=10,U[161]=X[161]=13,U[37]=ee[37]=5,Y[37]=$[37]=20,U[133]=ee[133]=5,Y[133]=$[133]=20,W[148]=Y[148]=16,Z[148]=ee[148]=23,W[22]=Y[22]=16,Z[22]=ee[22]=23,R[82]=W[82]=8,X[82]=Z[82]=19,R[88]=W[88]=8,X[88]=Z[88]=19,R[73]=$[73]=0,U[73]=X[73]=13,R[97]=$[97]=0,U[97]=X[97]=13,R[145]=X[145]=9,Y[145]=ee[145]=21,R[25]=X[25]=9,Y[25]=ee[25]=21,U[70]=$[70]=1,W[70]=Z[70]=17,U[100]=$[100]=1,W[100]=Z[100]=17,R[34]=X[34]=9,U[34]=W[34]=12,Y[34]=ee[34]=21,Z[34]=$[34]=22,R[136]=ee[136]=4,U[136]=$[136]=1,W[136]=Z[136]=17,X[136]=Y[136]=18,R[35]=ee[35]=4,U[35]=W[35]=12,X[35]=Y[35]=18,Z[35]=$[35]=22,R[153]=ee[153]=4,X[153]=Y[153]=18,U[102]=W[102]=12,Z[102]=$[102]=22,R[155]=X[155]=9,Y[155]=ee[155]=23,U[103]=$[103]=1,W[103]=Z[103]=17,R[152]=ee[152]=4,W[152]=Z[152]=17,X[152]=Y[152]=18,R[156]=W[156]=8,X[156]=Y[156]=18,Z[156]=ee[156]=23,R[137]=ee[137]=4,U[137]=$[137]=1,X[137]=Y[137]=18,R[139]=ee[139]=4,U[139]=X[139]=13,Y[139]=$[139]=20,R[98]=X[98]=9,U[98]=W[98]=12,Z[98]=$[98]=22,R[99]=$[99]=0,U[99]=W[99]=12,X[99]=Z[99]=19,U[38]=W[38]=12,Y[38]=ee[38]=21,Z[38]=$[38]=22,U[39]=ee[39]=5,W[39]=Y[39]=16,Z[39]=$[39]=22;var te=function(e,o,s){for(var r=e.length-1,p=e[0].length-1,u={rows:r,cols:p,cells:[]},h=o+Math.abs(s),l=0;l<r;++l){u.cells[l]=[];for(var a=0;a<p;++a){var f=0,n=e[l+1][a],i=e[l+1][a+1],c=e[l][a+1],b=e[l][a];if(!(isNaN(n)||isNaN(i)||isNaN(c)||isNaN(b))){f|=n<o?0:n>h?128:64,f|=i<o?0:i>h?32:16,f|=c<o?0:c>h?8:4,f|=b<o?0:b>h?2:1;var g=+f,d=0;if(17==f||18==f||33==f||34==f||38==f||68==f||72==f||98==f||102==f||132==f||136==f||137==f||152==f||153==f){var y=(n+i+c+b)/4;d=y>h?2:y<o?0:1,34===f?1===d?f=35:0===d&&(f=136):136===f?1===d?(f=35,d=4):0===d&&(f=34):17===f?1===d?(f=155,d=4):0===d&&(f=153):68===f?1===d?(f=103,d=4):0===d&&(f=102):153===f?1===d&&(f=155):102===f?1===d&&(f=103):152===f?d<2&&(f=156,d=1):137===f?d<2&&(f=139,d=1):98===f?d<2&&(f=99,d=1):38===f?d<2&&(f=39,d=1):18===f?d>0?(f=156,d=4):f=152:33===f?d>0?(f=139,d=4):f=137:72===f?d>0?(f=99,d=4):f=98:132===f&&(d>0?(f=39,d=4):f=38)}if(0!=f&&170!=f){var m,v,k,x,w,N,j,C;m=v=k=x=w=N=j=C=.5;var _=[];1===f?(k=1-t(o,c,b),C=1-t(o,n,b),_.push(X[f])):169===f?(k=t(h,b,c),C=t(h,b,n),_.push(X[f])):4===f?(N=1-t(o,i,c),x=t(o,b,c),_.push(U[f])):166===f?(N=t(h,c,i),x=1-t(h,c,b),_.push(U[f])):16===f?(w=t(o,c,i),v=t(o,n,i),_.push(R[f])):154===f?(w=1-t(h,i,c),v=1-t(h,i,n),_.push(R[f])):64===f?(j=t(o,b,n),m=1-t(o,i,n),_.push(Z[f])):106===f?(j=1-t(h,n,b),m=t(h,n,i),_.push(Z[f])):168===f?(x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),_.push(W[f]),_.push(X[f])):2===f?(x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),_.push(W[f]),_.push(X[f])):162===f?(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),_.push(W[f]),_.push(X[f])):8===f?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),_.push(R[f]),_.push(U[f])):138===f?(w=1-t(o,i,c),N=1-t(h,i,c),m=1-t(h,i,n),v=1-t(o,i,n),_.push(R[f]),_.push(U[f])):32===f?(w=t(h,c,i),N=t(o,c,i),m=t(o,n,i),v=t(h,n,i),_.push(R[f]),_.push(U[f])):42===f?(C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(Y[f]),_.push(Z[f])):128===f&&(C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(Y[f]),_.push(Z[f])),5===f?(N=1-t(o,i,c),C=1-t(o,n,b),_.push(U[f])):165===f?(N=t(h,c,i),C=t(h,b,n),_.push(U[f])):20===f?(x=t(o,b,c),v=t(o,n,i),_.push(W[f])):150===f?(x=1-t(h,c,b),v=1-t(h,i,n),_.push(W[f])):80===f?(w=t(o,c,i),j=t(o,b,n),_.push(R[f])):90===f?(w=1-t(h,i,c),j=1-t(h,n,b),_.push(R[f])):65===f?(k=1-t(o,c,b),m=1-t(o,i,n),_.push(X[f])):105===f?(k=t(h,b,c),m=t(h,n,i),_.push(X[f])):160===f?(w=t(h,c,i),N=t(o,c,i),C=t(o,b,n),j=t(h,b,n),_.push(R[f]),_.push(U[f])):10===f?(w=1-t(o,i,c),N=1-t(h,i,c),C=1-t(h,n,b),j=1-t(o,n,b),_.push(R[f]),_.push(U[f])):130===f?(x=1-t(o,c,b),k=1-t(h,c,b),m=1-t(h,i,n),v=1-t(o,i,n),_.push(W[f]),_.push(X[f])):40===f?(x=t(h,b,c),k=t(o,b,c),m=t(o,n,i),v=t(h,n,i),_.push(W[f]),_.push(X[f])):101===f?(N=t(h,c,i),m=t(h,n,i),_.push(U[f])):69===f?(N=1-t(o,i,c),m=1-t(o,i,n),_.push(U[f])):149===f?(C=t(h,b,n),v=1-t(h,i,n),_.push(Y[f])):21===f?(C=1-t(o,n,b),v=t(o,n,i),_.push(Y[f])):86===f?(x=1-t(h,c,b),j=1-t(h,n,b),_.push(W[f])):84===f?(x=t(o,b,c),j=t(o,b,n),_.push(W[f])):89===f?(w=1-t(h,i,c),k=t(h,b,c),_.push(X[f])):81===f?(w=t(o,c,i),k=1-t(o,c,b),_.push(X[f])):96===f?(w=t(h,c,i),N=t(o,c,i),j=t(o,b,n),m=t(h,n,i),_.push(R[f]),_.push(U[f])):74===f?(w=1-t(o,i,c),N=1-t(h,i,c),j=1-t(h,n,b),m=1-t(o,i,n),_.push(R[f]),_.push(U[f])):24===f?(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),v=t(o,n,i),_.push(R[f]),_.push(X[f])):146===f?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),v=1-t(h,i,n),_.push(R[f]),_.push(X[f])):6===f?(N=1-t(o,i,c),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),_.push(U[f]),_.push(W[f])):164===f?(N=t(h,c,i),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),_.push(U[f]),_.push(W[f])):129===f?(k=1-t(o,c,b),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(X[f]),_.push(Y[f])):41===f?(k=t(h,b,c),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(X[f]),_.push(Y[f])):66===f?(x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=1-t(o,i,n),_.push(W[f]),_.push(X[f])):104===f?(x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=t(h,n,i),_.push(X[f]),_.push($[f])):144===f?(w=t(o,c,i),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n),_.push(R[f]),_.push(Z[f])):26===f?(w=1-t(h,i,c),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i),_.push(R[f]),_.push(Z[f])):36===f?(N=t(h,c,i),x=t(o,b,c),m=t(o,n,i),v=t(h,n,i),_.push(U[f]),_.push(W[f])):134===f?(N=1-t(o,i,c),x=1-t(h,c,b),m=1-t(h,i,n),v=1-t(o,i,n),_.push(U[f]),_.push(W[f])):9===f?(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=1-t(o,n,b),_.push(R[f]),_.push(U[f])):161===f?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=t(h,b,n),_.push(R[f]),_.push(U[f])):37===f?(N=t(h,c,i),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(U[f]),_.push(Y[f])):133===f?(N=1-t(o,i,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(U[f]),_.push(Y[f])):148===f?(x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n),_.push(W[f]),_.push(Z[f])):22===f?(x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i),_.push(W[f]),_.push(Z[f])):82===f?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),_.push(R[f]),_.push(X[f])):88===f?(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),_.push(R[f]),_.push(X[f])):73===f?(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),m=1-t(o,i,n),_.push(R[f]),_.push(U[f])):97===f?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),m=t(h,n,i),_.push(R[f]),_.push(U[f])):145===f?(w=t(o,c,i),k=1-t(o,c,b),C=t(h,b,n),v=1-t(h,i,n),_.push(R[f]),_.push(Y[f])):25===f?(w=1-t(h,i,c),k=t(h,b,c),C=1-t(o,n,b),v=t(o,n,i),_.push(R[f]),_.push(Y[f])):70===f?(N=1-t(o,i,c),x=1-t(h,c,b),j=1-t(h,n,b),m=1-t(o,i,n),_.push(U[f]),_.push(W[f])):100===f?(N=t(h,c,i),x=t(o,b,c),j=t(o,b,n),m=t(h,n,i),_.push(U[f]),_.push(W[f])):34===f?(0===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):35===f?(4===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(X[f]),_.push(Z[f])):136===f?(0===d?(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):153===f?(0===d?(w=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(X[f])):102===f?(0===d?(N=1-t(o,i,c),x=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(U[f]),_.push(Z[f])):155===f?(4===d?(w=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(Y[f])):103===f?(4===d?(N=1-t(o,i,c),x=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(U[f]),_.push(W[f])):152===f?(0===d?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(W[f]),_.push(X[f])):156===f?(4===d?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(X[f]),_.push(Z[f])):137===f?(0===d?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(X[f])):139===f?(4===d?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(Y[f])):98===f?(0===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(Z[f])):99===f?(4===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(X[f])):38===f?(0===d?(N=1-t(o,i,c),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):39===f?(4===d?(N=1-t(o,i,c),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(U[f]),_.push(W[f]),_.push(Z[f])):85===f&&(w=1,N=0,x=1,k=0,C=0,j=1,m=0,v=1),(m<0||m>1||v<0||v>1||w<0||w>1||x<0||x>1||C<0||C>1||j<0||j>1)&&console.log(f+" "+g+" "+n+","+i+","+c+","+b+" "+d+" "+m+" "+v+" "+w+" "+N+" "+x+" "+k+" "+C+" "+j),u.cells[l][a]={cval:f,cval_real:g,flipped:d,topleft:m,topright:v,righttop:w,rightbottom:N,bottomright:x,bottomleft:k,leftbottom:C,lefttop:j,edges:_}}}}}return u},oe=function(e,t,o){for(var s={type:"FeatureCollection",features:[]},r=0;r<o.length;r++){var p=o[r],u=se(e,t,p);s.features.push({type:"Feature",geometry:{type:"MultiLineString",coordinates:u},properties:[{value:p}]})}return s},se=function(e,t,o){if(typeof t!=typeof new Array||6!=t.length)throw new Error("GeoTransform must be a 6 elements array");for(var s=pe(e,o),r=0;r<s.length;r++)for(var p=0;p<s[r].length;p++){var u=re(s[r][p][0],s[r][p][1],t);s[r][p][0]=u[0],s[r][p][1]=u[1]}return s},re=function(e,t,o){var s=o[0]+e*o[1]+t*o[2],r=o[3]+e*o[4]+t*o[5];return[s,r]},pe=function(e,t,o){var s={successCallback:null,progressCallback:null,verbose:!1},r={};o=o?o:{};for(var p=Object.keys(s),u=0;u<p.length;u++){var h=p[u],a=o[h];a="undefined"!=typeof a&&null!==a?a:s[h],r[h]=a}r.verbose&&console.log("computing isocontour for "+t);var f=c(l(e,t));return"function"==typeof r.successCallback&&r.successCallback(f),f};e.isoband=m,e.projectedIsoband=d,e.isobands=g,e.isoline=pe,e.projectedIsoline=se,e.isolines=oe,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.d3marchingsquares=e.d3marchingsquares||{})}(this,function(e){"use strict";function t(e,t,o){return(e-t)/(o-t)}function o(e){for(var t=[],o=e.rows,r=e.cols,h=[],l=0;l<o;l++)for(var a=0;a<r;a++)if("undefined"!=typeof e.cells[l][a]&&e.cells[l][a].edges.length>0){var f=e.cells[l][a],n=(f.cval,p(f)),i=null,c=a,b=l;null!==n&&h.push([n.p[0]+c,n.p[1]+b]);do{if(i=u(e.cells[b][c],n.x,n.y,n.o),null===i)break;if(h.push([i.p[0]+c,i.p[1]+b]),c+=i.x,b+=i.y,n=i,b<0||b>=o||c<0||c>=r||"undefined"==typeof e.cells[b][c]){c-=i.x,b-=i.y;var g=s(e,c,b,i.x,i.y,i.o);if(null===g)break;g.path.forEach(function(e){h.push(e)}),c=g.i,b=g.j,n=g}}while("undefined"!=typeof e.cells[b][c]&&e.cells[b][c].edges.length>0);t.push(h),h=[],e.cells[l][a].edges.length>0&&a--}return t}function s(e,t,o,s,r,p){for(var u=e.cells[o][t],h=u.cval_real,l=t+s,a=o+r,f=[],n=(e.rows,e.cols,!1);!n;){if("undefined"==typeof e.cells[a]||"undefined"==typeof e.cells[a][l])if(a-=r,l-=s,u=e.cells[a][l],h=u.cval_real,r===-1)if(0===p)if(h&w)f.push([l,a]),s=-1,r=0,p=0;else{if(!(h&x)){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l+1,a]),s=1,r=0,p=0}else{if(!(h&w)){if(h&x){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l+u.bottomleft,a]),s=0,r=1,p=0,n=!0;break}f.push([l,a]),s=-1,r=0,p=0}else if(1===r)if(0===p){if(!(h&k)){if(h&v){f.push([l+u.topleft,a+1]),s=0,r=-1,p=0,n=!0;break}f.push([l+u.topright,a+1]),s=0,r=-1,p=1,n=!0;break}f.push([l+1,a+1]),s=1,r=0,p=1}else h&k?(f.push([l+1,a+1]),s=1,r=0,p=1):(f.push([l+1,a+1]),s=1,r=0,p=1);else if(s===-1)if(0===p){if(!(h&v)){if(h&w){f.push([l,a+u.leftbottom]),s=1,r=0,p=0,n=!0;break}f.push([l,a+u.lefttop]),s=1,r=0,p=1,n=!0;break}f.push([l,a+1]),s=0,r=1,p=0}else{if(!(h&v)){console.log("wtf");break}f.push([l,a+1]),s=0,r=1,p=0}else{if(1!==s){console.log("we came from nowhere!");break}if(0===p){if(!(h&x)){f.push([l+1,a+u.rightbottom]),s=-1,r=0,p=0,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}else{if(!(h&x)){if(h&k){f.push([l+1,a+u.righttop]),s=-1,r=0,p=1;break}f.push([l+1,a+u.rightbottom]),s=-1,r=0,p=0,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}}else if(u=e.cells[a][l],h=u.cval_real,s===-1)if(0===p)if("undefined"!=typeof e.cells[a-1]&&"undefined"!=typeof e.cells[a-1][l])s=0,r=-1,p=1;else{if(!(h&w)){f.push([l+u.bottomright,a]),s=0,r=1,p=1,n=!0;break}f.push([l,a])}else{if(!(h&v)){console.log("found entry from top at "+l+","+a);break}console.log("proceeding in x-direction!")}else if(1===s){if(0===p){console.log("wtf");break}if("undefined"!=typeof e.cells[a+1]&&"undefined"!=typeof e.cells[a+1][l])s=0,r=1,p=0;else{if(!(h&k)){f.push([l+u.topleft,a+1]),s=0,r=-1,p=0,n=!0;break}f.push([l+1,a+1]),s=1,r=0,p=1}}else if(r===-1){if(1!==p){console.log("wtf");break}if("undefined"!=typeof e.cells[a][l+1])s=1,r=0,p=1;else{if(!(h&x)){f.push([l+1,a+u.righttop]),s=-1,r=0,p=1,n=!0;break}f.push([l+1,a]),s=0,r=-1,p=1}}else{if(1!==r){console.log("where did we came from???");break}if(0!==p){console.log("wtf");break}if("undefined"!=typeof e.cells[a][l-1])s=-1,r=0,p=0;else{if(!(h&v)){f.push([l,a+u.leftbottom]),s=1,r=0,p=0,n=!0;break}f.push([l,a+1]),s=0,r=1,p=0}}if(l+=s,a+=r,l===t&&a===o)break}return{path:f,i:l,j:a,x:s,y:r,o:p}}function r(e,t){delete e.edges[t];for(var o=t+1;o<e.edges.length;o++)e.edges[o-1]=e.edges[o];e.edges.pop()}function p(e){if(e.edges.length>0){var t=e.edges[e.edges.length-1],o=e.cval_real;switch(t){case 0:return o&k?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 1:return o&x?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 2:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 3:return o&w?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 4:return o&k?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 5:return o&x?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 6:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 7:return o&w?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 8:return o&x?{p:[e.bottomright],x:0,y:1,o:1}:{p:[1,e.righttop],x:-1,y:0,o:1};case 9:return o&w?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 10:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.righttop],x:-1,y:0,o:1};case 11:return o&v?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 12:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 13:return o&w?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 14:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 15:return o&v?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 16:return o&x?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 17:return o&v?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 18:return o&w?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 19:return o&v?{p:[e.bottomleft,0],x:0,y:1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 20:return o&v?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 21:return o&k?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.topright,1],x:0,y:-1,o:1};case 22:return o&v?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 23:return o&k?{p:[0,e.lefttop],x:1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};default:console.log("edge index out of range!"),console.log(e)}}return null}function u(e,t,o,s){var p,u,t,o,h,l,a,f=e.cval;switch(t){case-1:switch(s){case 0:p=U[f],h=q[f],l=A[f],a=G[f];break;default:p=R[f],h=F[f],l=O[f],a=I[f]}break;case 1:switch(s){case 0:p=Y[f],h=J[f],l=K[f],a=Q[f];break;default:p=Z[f],h=B[f],l=D[f],a=H[f]}break;default:switch(o){case-1:switch(s){case 0:p=$[f],h=N[f],l=j[f],a=C[f];break;default:p=ee[f],h=_[f],l=E[f],a=M[f]}break;case 1:switch(s){case 0:p=X[f],h=P[f],l=T[f],a=V[f];break;default:p=W[f],h=L[f],l=S[f],a=z[f]}}}if(u=e.edges.indexOf(p),"undefined"==typeof e.edges[u])return null;switch(r(e,u),f=e.cval_real,p){case 0:f&k?(t=e.topleft,o=1):(t=1,o=e.righttop);break;case 1:f&x?(t=1,o=e.rightbottom):(t=e.topleft,o=1);break;case 2:f&x?(t=e.topleft,o=1):(t=e.bottomright,o=0);break;case 3:f&w?(t=e.bottomleft,o=0):(t=e.topleft,o=1);break;case 4:f&k?(t=e.topright,o=1):(t=1,o=e.righttop);break;case 5:f&x?(t=1,o=e.rightbottom):(t=e.topright,o=1);break;case 6:f&x?(t=e.topright,o=1):(t=e.bottomright,o=0);break;case 7:f&w?(t=e.bottomleft,o=0):(t=e.topright,o=1);break;case 8:f&x?(t=1,o=e.righttop):(t=e.bottomright,o=0);break;case 9:f&w?(t=e.bottomleft,o=0):(t=1,o=e.righttop);break;case 10:f&w?(t=1,o=e.righttop):(t=0,o=e.leftbottom);break;case 11:f&v?(t=0,o=e.lefttop):(t=1,o=e.righttop);break;case 12:f&x?(t=1,o=e.rightbottom):(t=e.bottomright,o=0);break;case 13:f&w?(t=e.bottomleft,o=0):(t=1,o=e.rightbottom);break;case 14:f&w?(t=1,o=e.rightbottom):(t=0,o=e.leftbottom);break;case 15:f&v?(t=0,o=e.lefttop):(t=1,o=e.rightbottom);break;case 16:f&x?(t=0,o=e.leftbottom):(t=e.bottomright,o=0);break;case 17:f&v?(t=0,o=e.lefttop):(t=e.bottomright,o=0);break;case 18:f&w?(t=e.bottomleft,o=0):(t=0,o=e.leftbottom);break;case 19:f&v?(t=0,o=e.lefttop):(t=e.bottomleft,o=0);break;case 20:f&v?(t=0,o=e.leftbottom):(t=e.topleft,o=1);break;case 21:f&k?(t=e.topright,o=1):(t=0,o=e.leftbottom);break;case 22:f&v?(t=0,o=e.lefttop):(t=e.topleft,o=1);break;case 23:f&k?(t=e.topright,o=1):(t=0,o=e.lefttop);break;default:return console.log("edge index out of range!"),console.log(e),null}return"undefined"!=typeof t&&"undefined"!=typeof o&&"undefined"!=typeof h&&"undefined"!=typeof l&&"undefined"!=typeof a||(console.log("undefined value!"),console.log(e),console.log(t+" "+o+" "+h+" "+l+" "+a)),{p:[t,o],x:h,y:l,o:a}}function h(e,t,o){return(e-t)/(o-t)}function l(e,t){for(var o=e.length-1,s=e[0].length-1,r={rows:o,cols:s,cells:[]},p=0;p<o;++p){r.cells[p]=[];for(var u=0;u<s;++u){var l=0,a=e[p+1][u],f=e[p+1][u+1],n=e[p][u+1],i=e[p][u];if(!(isNaN(a)||isNaN(f)||isNaN(n)||isNaN(i))){l|=a>=t?8:0,l|=f>=t?4:0,l|=n>=t?2:0,l|=i>=t?1:0;var c=!1;if(5==l||10==l){var b=(a+f+n+i)/4;5==l&&b<t?(l=10,c=!0):10==l&&b<t&&(l=5,c=!0)}if(0!==l&&15!==l){var g,d,y,m;g=d=y=m=.5,1==l?(y=1-h(t,a,i),d=1-h(t,n,i)):2==l?(d=h(t,i,n),m=1-h(t,f,n)):3==l?(y=1-h(t,a,i),m=1-h(t,f,n)):4==l?(g=h(t,a,f),m=h(t,n,f)):5==l?(g=h(t,a,f),m=h(t,n,f),d=1-h(t,n,i),y=1-h(t,a,i)):6==l?(d=h(t,i,n),g=h(t,a,f)):7==l?(y=1-h(t,a,i),g=h(t,a,f)):8==l?(y=h(t,i,a),g=1-h(t,f,a)):9==l?(d=1-h(t,n,i),g=1-h(t,f,a)):10==l?(g=1-h(t,f,a),m=1-h(t,f,n),d=h(t,i,n),y=h(t,i,a)):11==l?(g=1-h(t,f,a),m=1-h(t,f,n)):12==l?(y=h(t,i,a),m=h(t,n,f)):13==l?(d=1-h(t,n,i),m=h(t,n,f)):14==l?(y=h(t,i,a),d=h(t,i,n)):console.log("Illegal cval detected: "+l),r.cells[p][u]={cval:l,flipped:c,top:g,right:m,bottom:d,left:y}}}}}return r}function a(e){return 5==e.cval||10==e.cval}function f(e){return 0===e.cval||15==e.cval}function n(e){f(e)||5==e.cval||10==e.cval||(e.cval=15)}function i(e,t){return"top"===t?[e.top,1]:"bottom"===t?[e.bottom,0]:"right"===t?[1,e.right]:"left"===t?[0,e.left]:void 0}function c(e){var t=[],o=0,s=(e.rows,e.cols,1e-7);return e.cells.forEach(function(r,p){r.forEach(function(r,u){if("undefined"!=typeof r&&!a(r)&&!f(r)){var h=b(e.cells,p,u),l=!1;if("mergeable"==h.info)for(var n=h.path[h.path.length-1][0],i=h.path[h.path.length-1][1],c=o-1;c>=0;c--)if(Math.abs(t[c][0][0]-n)<=s&&Math.abs(t[c][0][1]-i)<=s){for(var g=h.path.length-2;g>=0;--g)t[c].unshift(h.path[g]);l=!0;break}l||(t[o++]=h.path)}})}),t}function b(e,t,o){var s,r,p=e.length,u=[],h=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],l=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],a=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],f=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],c=(e[t][o],e[t][o]),b=c.cval,g=a[b],d=i(c,g);u.push([o+d[0],t+d[1]]),g=f[b],d=i(c,g),u.push([o+d[0],t+d[1]]),n(c);for(var y=o+h[b],m=t+l[b],v=b;y>=0&&m>=0&&m<p&&(y!=o||m!=t)&&(c=e[m][y],"undefined"!=typeof c);){if(b=c.cval,0===b||15===b)return{path:u,info:"mergeable"};g=f[b],s=h[b],r=l[b],5!=b&&10!=b||(5==b?c.flipped?l[v]==-1?(g="left",s=-1,r=0):(g="right",s=1,r=0):h[v]==-1&&(g="bottom",s=0,r=-1):10==b&&(c.flipped?h[v]==-1?(g="top",s=0,r=1):(g="bottom",s=0,r=-1):1==l[v]&&(g="left",s=-1,r=0))),d=i(c,g),u.push([y+d[0],m+d[1]]),n(c),y+=s,m+=r,v=b}return{path:u,info:"closed"}}var g=function(e,t,o){for(var s={type:"FeatureCollection",features:[]},r=1;r<o.length;r++){for(var p=o[r-1],u=o[r],h=d(e,t,p,u-p),l=0;l<h.length;l++)h[l].reverse();s.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:h},properties:[{lowerValue:p,upperValue:u}]})}return s},d=function(e,t,o,s){if(typeof t!=typeof new Array||6!=t.length)throw new Error("GeoTransform must be a 6 elements array");for(var r=m(e,o,s),p=0;p<r.length;p++)for(var u=0;u<r[p].length;u++){var h=y(r[p][u][0],r[p][u][1],t);r[p][u][0]=h[0],r[p][u][1]=h[1]}return r},y=function(e,t,o){var s=o[0]+e*o[1]+t*o[2],r=o[3]+e*o[4]+t*o[5];return[s,r]},m=function(e,t,s,r){var p={},u={successCallback:null,progressCallback:null,verbose:!1};r=r?r:{};for(var h=Object.keys(u),l=0;l<h.length;l++){var a=h[l],f=r[a];f="undefined"!=typeof f&&null!==f?f:u[a],p[a]=f}p.verbose&&console.log("computing isobands for ["+t+":"+(t+s)+"]");var n=te(e,t,s),i=o(n);return i},v=64,k=16,x=4,w=1,N=[],j=[],C=[],_=[],E=[],M=[],F=[],O=[],I=[],q=[],A=[],G=[],P=[],T=[],V=[],L=[],S=[],z=[],B=[],D=[],H=[],J=[],K=[],Q=[];F[85]=q[85]=-1,O[85]=A[85]=0,I[85]=G[85]=1,B[85]=J[85]=1,D[85]=K[85]=0,H[85]=Q[85]=1,N[85]=_[85]=0,j[85]=E[85]=-1,C[85]=V[85]=0,L[85]=P[85]=0,S[85]=T[85]=1,M[85]=z[85]=1,J[1]=J[169]=0,K[1]=K[169]=-1,Q[1]=Q[169]=0,P[1]=P[169]=-1,T[1]=T[169]=0,V[1]=V[169]=0,q[4]=q[166]=0,A[4]=A[166]=-1,G[4]=G[166]=1,L[4]=L[166]=1,S[4]=S[166]=0,z[4]=z[166]=0,F[16]=F[154]=0,O[16]=O[154]=1,I[16]=I[154]=1,_[16]=_[154]=1,E[16]=E[154]=0,M[16]=M[154]=1,B[64]=B[106]=0,D[64]=D[106]=1,H[64]=H[106]=0,N[64]=N[106]=-1,j[64]=j[106]=0,C[64]=C[106]=1,B[2]=B[168]=0,D[2]=D[168]=-1,H[2]=H[168]=1,J[2]=J[168]=0,K[2]=K[168]=-1,Q[2]=Q[168]=0,P[2]=P[168]=-1,T[2]=T[168]=0,V[2]=V[168]=0,L[2]=L[168]=-1,S[2]=S[168]=0,z[2]=z[168]=1,F[8]=F[162]=0,O[8]=O[162]=-1,I[8]=I[162]=0,q[8]=q[162]=0,A[8]=A[162]=-1,G[8]=G[162]=1,P[8]=P[162]=1,T[8]=T[162]=0,V[8]=V[162]=1,L[8]=L[162]=1,S[8]=S[162]=0,z[8]=z[162]=0,F[32]=F[138]=0,O[32]=O[138]=1,I[32]=I[138]=1,q[32]=q[138]=0,A[32]=A[138]=1,G[32]=G[138]=0,N[32]=N[138]=1,j[32]=j[138]=0,C[32]=C[138]=0,_[32]=_[138]=1,E[32]=E[138]=0,M[32]=M[138]=1,J[128]=J[42]=0,K[128]=K[42]=1,Q[128]=Q[42]=1,B[128]=B[42]=0,D[128]=D[42]=1,H[128]=H[42]=0,N[128]=N[42]=-1,j[128]=j[42]=0,C[128]=C[42]=1,_[128]=_[42]=-1,E[128]=E[42]=0,M[128]=M[42]=0,q[5]=q[165]=-1,A[5]=A[165]=0,G[5]=G[165]=0,J[5]=J[165]=1,K[5]=K[165]=0,Q[5]=Q[165]=0,L[20]=L[150]=0,S[20]=S[150]=1,z[20]=z[150]=1,_[20]=_[150]=0,E[20]=E[150]=-1,M[20]=M[150]=1,F[80]=F[90]=-1,O[80]=O[90]=0,I[80]=I[90]=1,B[80]=B[90]=1,D[80]=D[90]=0,H[80]=H[90]=1,P[65]=P[105]=0,T[65]=T[105]=1,V[65]=V[105]=0,N[65]=N[105]=0,j[65]=j[105]=-1,C[65]=C[105]=0,F[160]=F[10]=-1,O[160]=O[10]=0,I[160]=I[10]=1,q[160]=q[10]=-1,A[160]=A[10]=0,G[160]=G[10]=0,J[160]=J[10]=1,K[160]=K[10]=0,Q[160]=Q[10]=0,B[160]=B[10]=1,D[160]=D[10]=0,H[160]=H[10]=1,L[130]=L[40]=0,S[130]=S[40]=1,z[130]=z[40]=1,P[130]=P[40]=0,T[130]=T[40]=1,V[130]=V[40]=0,N[130]=N[40]=0,j[130]=j[40]=-1,C[130]=C[40]=0,_[130]=_[40]=0,E[130]=E[40]=-1,M[130]=M[40]=1,q[37]=q[133]=0,A[37]=A[133]=1,G[37]=G[133]=1,J[37]=J[133]=0,K[37]=K[133]=1,Q[37]=Q[133]=0,N[37]=N[133]=-1,j[37]=j[133]=0,C[37]=C[133]=0,_[37]=_[133]=1,E[37]=E[133]=0,M[37]=M[133]=0,L[148]=L[22]=-1,S[148]=S[22]=0,z[148]=z[22]=0,J[148]=J[22]=0,K[148]=K[22]=-1,Q[148]=Q[22]=1,B[148]=B[22]=0,D[148]=D[22]=1,H[148]=H[22]=1,_[148]=_[22]=-1,E[148]=E[22]=0,M[148]=M[22]=1,F[82]=F[88]=0,O[82]=O[88]=-1,I[82]=I[88]=1,L[82]=L[88]=1,S[82]=S[88]=0,z[82]=z[88]=1,P[82]=P[88]=-1,T[82]=T[88]=0,V[82]=V[88]=1,B[82]=B[88]=0,D[82]=D[88]=-1,H[82]=H[88]=0,F[73]=F[97]=0,O[73]=O[97]=1,I[73]=I[97]=0,q[73]=q[97]=0,A[73]=A[97]=-1,G[73]=G[97]=0,P[73]=P[97]=1,T[73]=T[97]=0,V[73]=V[97]=0,N[73]=N[97]=1,j[73]=j[97]=0,C[73]=C[97]=1,F[145]=F[25]=0,O[145]=O[25]=-1,I[145]=I[25]=0,P[145]=P[25]=1,T[145]=T[25]=0,V[145]=V[25]=1,J[145]=J[25]=0,K[145]=K[25]=1,Q[145]=Q[25]=1,_[145]=_[25]=-1,E[145]=E[25]=0,M[145]=M[25]=0,q[70]=q[100]=0,A[70]=A[100]=1,G[70]=G[100]=0,L[70]=L[100]=-1,S[70]=S[100]=0,z[70]=z[100]=1,B[70]=B[100]=0,D[70]=D[100]=-1;H[70]=H[100]=1;N[70]=N[100]=1,j[70]=j[100]=0,C[70]=C[100]=0,q[101]=q[69]=0,A[101]=A[69]=1,G[101]=G[69]=0,N[101]=N[69]=1,j[101]=j[69]=0,C[101]=C[69]=0,J[149]=J[21]=0,K[149]=K[21]=1,Q[149]=Q[21]=1,_[149]=_[21]=-1,E[149]=E[21]=0,M[149]=M[21]=0,L[86]=L[84]=-1,S[86]=S[84]=0,z[86]=z[84]=1,B[86]=B[84]=0,D[86]=D[84]=-1,H[86]=H[84]=1,F[89]=F[81]=0,O[89]=O[81]=-1,I[89]=I[81]=0,P[89]=P[81]=1,T[89]=T[81]=0,V[89]=V[81]=1,F[96]=F[74]=0,O[96]=O[74]=1,I[96]=I[74]=0,q[96]=q[74]=-1,A[96]=A[74]=0,G[96]=G[74]=1,B[96]=B[74]=1,D[96]=D[74]=0,H[96]=H[74]=0,N[96]=N[74]=1,j[96]=j[74]=0,C[96]=C[74]=1,F[24]=F[146]=0,O[24]=O[146]=-1,I[24]=I[146]=1,L[24]=L[146]=1,S[24]=S[146]=0,z[24]=z[146]=1,P[24]=P[146]=0,T[24]=T[146]=1,V[24]=V[146]=1,_[24]=_[146]=0,E[24]=E[146]=-1,M[24]=M[146]=0,q[6]=q[164]=-1,A[6]=A[164]=0,G[6]=G[164]=1,L[6]=L[164]=-1,S[6]=S[164]=0,z[6]=z[164]=0,J[6]=J[164]=0,K[6]=K[164]=-1,Q[6]=Q[164]=1,B[6]=B[164]=1,D[6]=D[164]=0,H[6]=H[164]=0,P[129]=P[41]=0,T[129]=T[41]=1,V[129]=V[41]=1,J[129]=J[41]=0,K[129]=K[41]=1,Q[129]=Q[41]=0,N[129]=N[41]=-1,j[129]=j[41]=0,C[129]=C[41]=0,_[129]=_[41]=0,E[129]=E[41]=-1,M[129]=M[41]=0,L[66]=L[104]=0,S[66]=S[104]=1,z[66]=z[104]=0,P[66]=P[104]=-1,T[66]=T[104]=0,V[66]=V[104]=1,B[66]=B[104]=0,D[66]=D[104]=-1,H[66]=H[104]=0,N[66]=N[104]=0,j[66]=j[104]=-1,C[66]=C[104]=1,F[144]=F[26]=-1,O[144]=O[26]=0,I[144]=I[26]=0,J[144]=J[26]=1,K[144]=K[26]=0,Q[144]=Q[26]=1,B[144]=B[26]=0,D[144]=D[26]=1,H[144]=H[26]=1,_[144]=_[26]=-1,E[144]=E[26]=0,M[144]=M[26]=1,q[36]=q[134]=0,A[36]=A[134]=1,G[36]=G[134]=1,L[36]=L[134]=0,S[36]=S[134]=1,z[36]=z[134]=0,N[36]=N[134]=0,j[36]=j[134]=-1,C[36]=C[134]=1,_[36]=_[134]=1,E[36]=E[134]=0,M[36]=M[134]=0,F[9]=F[161]=-1,O[9]=O[161]=0,I[9]=I[161]=0,q[9]=q[161]=0,A[9]=A[161]=-1,G[9]=G[161]=0,P[9]=P[161]=1,T[9]=T[161]=0,V[9]=V[161]=0,J[9]=J[161]=1,K[9]=K[161]=0,Q[9]=Q[161]=1,F[136]=0,O[136]=1,I[136]=1,q[136]=0,A[136]=1,G[136]=0,L[136]=-1,S[136]=0,z[136]=1,P[136]=-1,T[136]=0,V[136]=0,J[136]=0,K[136]=-1,Q[136]=0,B[136]=0,D[136]=-1,H[136]=1,N[136]=1,j[136]=0,C[136]=0,_[136]=1,E[136]=0,M[136]=1,F[34]=0,O[34]=-1,I[34]=0,q[34]=0,A[34]=-1,G[34]=1,L[34]=1,S[34]=0,z[34]=0,P[34]=1,T[34]=0,V[34]=1,J[34]=0,K[34]=1,Q[34]=1,B[34]=0,D[34]=1,H[34]=0,N[34]=-1,j[34]=0,C[34]=1,_[34]=-1,E[34]=0,M[34]=0,F[35]=0,O[35]=1,I[35]=1,q[35]=0,A[35]=-1,G[35]=1,L[35]=1,S[35]=0,z[35]=0,P[35]=-1,T[35]=0,V[35]=0,J[35]=0,K[35]=-1,Q[35]=0,B[35]=0,D[35]=1,H[35]=0,N[35]=-1,j[35]=0,C[35]=1,_[35]=1,E[35]=0,M[35]=1,F[153]=0,O[153]=1,I[153]=1,P[153]=-1,T[153]=0;V[153]=0;J[153]=0,K[153]=-1,Q[153]=0,_[153]=1,E[153]=0,M[153]=1,q[102]=0,A[102]=-1,G[102]=1,L[102]=1,S[102]=0,z[102]=0,B[102]=0,D[102]=1,H[102]=0,N[102]=-1,j[102]=0,C[102]=1,F[155]=0,O[155]=-1,I[155]=0,P[155]=1,T[155]=0,V[155]=1,J[155]=0,K[155]=1,Q[155]=1,_[155]=-1,E[155]=0,M[155]=0,q[103]=0,A[103]=1,G[103]=0,L[103]=-1,S[103]=0,z[103]=1,B[103]=0,D[103]=-1,H[103]=1,N[103]=1,j[103]=0,C[103]=0,F[152]=0,O[152]=1,I[152]=1,L[152]=-1,S[152]=0,z[152]=1,P[152]=-1,T[152]=0,V[152]=0,J[152]=0,K[152]=-1,Q[152]=0,B[152]=0,D[152]=-1,H[152]=1,_[152]=1,E[152]=0,M[152]=1,F[156]=0,O[156]=-1,I[156]=1,L[156]=1,S[156]=0,z[156]=1,P[156]=-1,T[156]=0,V[156]=0,J[156]=0,K[156]=-1,Q[156]=0,B[156]=0,D[156]=1,H[156]=1,_[156]=-1,E[156]=0,M[156]=1,F[137]=0,O[137]=1,I[137]=1,q[137]=0,A[137]=1,G[137]=0,P[137]=-1,T[137]=0,V[137]=0,J[137]=0,K[137]=-1,Q[137]=0,N[137]=1,j[137]=0,C[137]=0,_[137]=1,E[137]=0,M[137]=1,F[139]=0,O[139]=1,I[139]=1,q[139]=0,A[139]=-1,G[139]=0,P[139]=1,T[139]=0,V[139]=0,J[139]=0,K[139]=1,Q[139]=0,N[139]=-1,j[139]=0,C[139]=0,_[139]=1,E[139]=0,M[139]=1,F[98]=0,O[98]=-1,I[98]=0,q[98]=0,A[98]=-1,G[98]=1,L[98]=1,S[98]=0,z[98]=0,P[98]=1,T[98]=0,V[98]=1,B[98]=0,D[98]=1,H[98]=0,N[98]=-1,j[98]=0,C[98]=1,F[99]=0,O[99]=1,I[99]=0,q[99]=0,A[99]=-1,G[99]=1,L[99]=1,S[99]=0,z[99]=0,P[99]=-1,T[99]=0,V[99]=1,B[99]=0,D[99]=-1,H[99]=0,N[99]=1,j[99]=0,C[99]=1,q[38]=0,A[38]=-1,G[38]=1,L[38]=1,S[38]=0,z[38]=0,J[38]=0,K[38]=1,Q[38]=1,B[38]=0,D[38]=1,H[38]=0,N[38]=-1,j[38]=0,C[38]=1,_[38]=-1,E[38]=0,M[38]=0,q[39]=0,A[39]=1,G[39]=1,L[39]=-1,S[39]=0,z[39]=0,J[39]=0,K[39]=-1,Q[39]=1,B[39]=0,D[39]=1,H[39]=0,N[39]=-1,j[39]=0,C[39]=1,_[39]=1,E[39]=0,M[39]=0;var R=[],U=[],W=[],X=[],Y=[],Z=[],$=[],ee=[];X[1]=Y[1]=18,X[169]=Y[169]=18,W[4]=U[4]=12,W[166]=U[166]=12,R[16]=ee[16]=4,R[154]=ee[154]=4,Z[64]=$[64]=22,Z[106]=$[106]=22,W[2]=Z[2]=17,X[2]=Y[2]=18,W[168]=Z[168]=17,X[168]=Y[168]=18,R[8]=X[8]=9,U[8]=W[8]=12,R[162]=X[162]=9,U[162]=W[162]=12,R[32]=ee[32]=4,U[32]=$[32]=1,R[138]=ee[138]=4,U[138]=$[138]=1,Y[128]=ee[128]=21,Z[128]=$[128]=22,Y[42]=ee[42]=21,Z[42]=$[42]=22,U[5]=Y[5]=14,U[165]=Y[165]=14,W[20]=ee[20]=6,W[150]=ee[150]=6,R[80]=Z[80]=11,R[90]=Z[90]=11,X[65]=$[65]=3,X[105]=$[105]=3,R[160]=Z[160]=11,U[160]=Y[160]=14,R[10]=Z[10]=11,U[10]=Y[10]=14,W[130]=ee[130]=6,X[130]=$[130]=3,W[40]=ee[40]=6,X[40]=$[40]=3,U[101]=$[101]=1,U[69]=$[69]=1,Y[149]=ee[149]=21,Y[21]=ee[21]=21,W[86]=Z[86]=17,W[84]=Z[84]=17,R[89]=X[89]=9,R[81]=X[81]=9,R[96]=$[96]=0,U[96]=Z[96]=15,R[74]=$[74]=0,U[74]=Z[74]=15,R[24]=W[24]=8,X[24]=ee[24]=7,R[146]=W[146]=8,X[146]=ee[146]=7,U[6]=Z[6]=15,W[6]=Y[6]=16,U[164]=Z[164]=15,W[164]=Y[164]=16,X[129]=ee[129]=7,Y[129]=$[129]=20,X[41]=ee[41]=7,Y[41]=$[41]=20,W[66]=$[66]=2,X[66]=Z[66]=19,W[104]=$[104]=2,X[104]=Z[104]=19,R[144]=Y[144]=10,Z[144]=ee[144]=23,R[26]=Y[26]=10,Z[26]=ee[26]=23,U[36]=ee[36]=5,W[36]=$[36]=2,U[134]=ee[134]=5,W[134]=$[134]=2,R[9]=Y[9]=10,U[9]=X[9]=13,R[161]=Y[161]=10,U[161]=X[161]=13,U[37]=ee[37]=5,Y[37]=$[37]=20,U[133]=ee[133]=5,Y[133]=$[133]=20,W[148]=Y[148]=16,Z[148]=ee[148]=23,W[22]=Y[22]=16,Z[22]=ee[22]=23,R[82]=W[82]=8,X[82]=Z[82]=19,R[88]=W[88]=8,X[88]=Z[88]=19,R[73]=$[73]=0,U[73]=X[73]=13,R[97]=$[97]=0,U[97]=X[97]=13,R[145]=X[145]=9,Y[145]=ee[145]=21,R[25]=X[25]=9,Y[25]=ee[25]=21,U[70]=$[70]=1,W[70]=Z[70]=17,U[100]=$[100]=1,W[100]=Z[100]=17,R[34]=X[34]=9,U[34]=W[34]=12,Y[34]=ee[34]=21,Z[34]=$[34]=22,R[136]=ee[136]=4,U[136]=$[136]=1,W[136]=Z[136]=17,X[136]=Y[136]=18,R[35]=ee[35]=4,U[35]=W[35]=12,X[35]=Y[35]=18,Z[35]=$[35]=22,R[153]=ee[153]=4,X[153]=Y[153]=18,U[102]=W[102]=12,Z[102]=$[102]=22,R[155]=X[155]=9,Y[155]=ee[155]=23,U[103]=$[103]=1,W[103]=Z[103]=17,R[152]=ee[152]=4,W[152]=Z[152]=17,X[152]=Y[152]=18,R[156]=W[156]=8,X[156]=Y[156]=18,Z[156]=ee[156]=23,R[137]=ee[137]=4,U[137]=$[137]=1,X[137]=Y[137]=18,R[139]=ee[139]=4,U[139]=X[139]=13,Y[139]=$[139]=20,R[98]=X[98]=9,U[98]=W[98]=12,Z[98]=$[98]=22,R[99]=$[99]=0,U[99]=W[99]=12,X[99]=Z[99]=19,U[38]=W[38]=12,Y[38]=ee[38]=21,Z[38]=$[38]=22,U[39]=ee[39]=5,W[39]=Y[39]=16,Z[39]=$[39]=22;var te=function(e,o,s){for(var r=e.length-1,p=e[0].length-1,u={rows:r,cols:p,cells:[]},h=o+Math.abs(s),l=0;l<r;++l){u.cells[l]=[];for(var a=0;a<p;++a){var f=0,n=e[l+1][a],i=e[l+1][a+1],c=e[l][a+1],b=e[l][a];if(!(isNaN(n)||isNaN(i)||isNaN(c)||isNaN(b))){f|=n<o?0:n>h?128:64,f|=i<o?0:i>h?32:16,f|=c<o?0:c>h?8:4,f|=b<o?0:b>h?2:1;var g=+f,d=0;if(17==f||18==f||33==f||34==f||38==f||68==f||72==f||98==f||102==f||132==f||136==f||137==f||152==f||153==f){var y=(n+i+c+b)/4;d=y>h?2:y<o?0:1,34===f?1===d?f=35:0===d&&(f=136):136===f?1===d?(f=35,d=4):0===d&&(f=34):17===f?1===d?(f=155,d=4):0===d&&(f=153):68===f?1===d?(f=103,d=4):0===d&&(f=102):153===f?1===d&&(f=155):102===f?1===d&&(f=103):152===f?d<2&&(f=156,d=1):137===f?d<2&&(f=139,d=1):98===f?d<2&&(f=99,d=1):38===f?d<2&&(f=39,d=1):18===f?d>0?(f=156,d=4):f=152:33===f?d>0?(f=139,d=4):f=137:72===f?d>0?(f=99,d=4):f=98:132===f&&(d>0?(f=39,d=4):f=38)}if(0!=f&&170!=f){var m,v,k,x,w,N,j,C;m=v=k=x=w=N=j=C=.5;var _=[];1===f?(k=1-t(o,c,b),C=1-t(o,n,b),_.push(X[f])):169===f?(k=t(h,b,c),C=t(h,b,n),_.push(X[f])):4===f?(N=1-t(o,i,c),x=t(o,b,c),_.push(U[f])):166===f?(N=t(h,c,i),x=1-t(h,c,b),_.push(U[f])):16===f?(w=t(o,c,i),v=t(o,n,i),_.push(R[f])):154===f?(w=1-t(h,i,c),v=1-t(h,i,n),_.push(R[f])):64===f?(j=t(o,b,n),m=1-t(o,i,n),_.push(Z[f])):106===f?(j=1-t(h,n,b),m=t(h,n,i),_.push(Z[f])):168===f?(x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),_.push(W[f]),_.push(X[f])):2===f?(x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),_.push(W[f]),_.push(X[f])):162===f?(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),_.push(W[f]),_.push(X[f])):8===f?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),_.push(R[f]),_.push(U[f])):138===f?(w=1-t(o,i,c),N=1-t(h,i,c),m=1-t(h,i,n),v=1-t(o,i,n),_.push(R[f]),_.push(U[f])):32===f?(w=t(h,c,i),N=t(o,c,i),m=t(o,n,i),v=t(h,n,i),_.push(R[f]),_.push(U[f])):42===f?(C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(Y[f]),_.push(Z[f])):128===f&&(C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(Y[f]),_.push(Z[f])),5===f?(N=1-t(o,i,c),C=1-t(o,n,b),_.push(U[f])):165===f?(N=t(h,c,i),C=t(h,b,n),_.push(U[f])):20===f?(x=t(o,b,c),v=t(o,n,i),_.push(W[f])):150===f?(x=1-t(h,c,b),v=1-t(h,i,n),_.push(W[f])):80===f?(w=t(o,c,i),j=t(o,b,n),_.push(R[f])):90===f?(w=1-t(h,i,c),j=1-t(h,n,b),_.push(R[f])):65===f?(k=1-t(o,c,b),m=1-t(o,i,n),_.push(X[f])):105===f?(k=t(h,b,c),m=t(h,n,i),_.push(X[f])):160===f?(w=t(h,c,i),N=t(o,c,i),C=t(o,b,n),j=t(h,b,n),_.push(R[f]),_.push(U[f])):10===f?(w=1-t(o,i,c),N=1-t(h,i,c),C=1-t(h,n,b),j=1-t(o,n,b),_.push(R[f]),_.push(U[f])):130===f?(x=1-t(o,c,b),k=1-t(h,c,b),m=1-t(h,i,n),v=1-t(o,i,n),_.push(W[f]),_.push(X[f])):40===f?(x=t(h,b,c),k=t(o,b,c),m=t(o,n,i),v=t(h,n,i),_.push(W[f]),_.push(X[f])):101===f?(N=t(h,c,i),m=t(h,n,i),_.push(U[f])):69===f?(N=1-t(o,i,c),m=1-t(o,i,n),_.push(U[f])):149===f?(C=t(h,b,n),v=1-t(h,i,n),_.push(Y[f])):21===f?(C=1-t(o,n,b),v=t(o,n,i),_.push(Y[f])):86===f?(x=1-t(h,c,b),j=1-t(h,n,b),_.push(W[f])):84===f?(x=t(o,b,c),j=t(o,b,n),_.push(W[f])):89===f?(w=1-t(h,i,c),k=t(h,b,c),_.push(X[f])):81===f?(w=t(o,c,i),k=1-t(o,c,b),_.push(X[f])):96===f?(w=t(h,c,i),N=t(o,c,i),j=t(o,b,n),m=t(h,n,i),_.push(R[f]),_.push(U[f])):74===f?(w=1-t(o,i,c),N=1-t(h,i,c),j=1-t(h,n,b),m=1-t(o,i,n),_.push(R[f]),_.push(U[f])):24===f?(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),v=t(o,n,i),_.push(R[f]),_.push(X[f])):146===f?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),v=1-t(h,i,n),_.push(R[f]),_.push(X[f])):6===f?(N=1-t(o,i,c),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),_.push(U[f]),_.push(W[f])):164===f?(N=t(h,c,i),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),_.push(U[f]),_.push(W[f])):129===f?(k=1-t(o,c,b),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(X[f]),_.push(Y[f])):41===f?(k=t(h,b,c),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(X[f]),_.push(Y[f])):66===f?(x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=1-t(o,i,n),_.push(W[f]),_.push(X[f])):104===f?(x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=t(h,n,i),_.push(X[f]),_.push($[f])):144===f?(w=t(o,c,i),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n),_.push(R[f]),_.push(Z[f])):26===f?(w=1-t(h,i,c),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i),_.push(R[f]),_.push(Z[f])):36===f?(N=t(h,c,i),x=t(o,b,c),m=t(o,n,i),v=t(h,n,i),_.push(U[f]),_.push(W[f])):134===f?(N=1-t(o,i,c),x=1-t(h,c,b),m=1-t(h,i,n),v=1-t(o,i,n),_.push(U[f]),_.push(W[f])):9===f?(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=1-t(o,n,b),_.push(R[f]),_.push(U[f])):161===f?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=t(h,b,n),_.push(R[f]),_.push(U[f])):37===f?(N=t(h,c,i),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i),_.push(U[f]),_.push(Y[f])):133===f?(N=1-t(o,i,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n),_.push(U[f]),_.push(Y[f])):148===f?(x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n),_.push(W[f]),_.push(Z[f])):22===f?(x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i),_.push(W[f]),_.push(Z[f])):82===f?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),_.push(R[f]),_.push(X[f])):88===f?(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),_.push(R[f]),_.push(X[f])):73===f?(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),m=1-t(o,i,n),_.push(R[f]),_.push(U[f])):97===f?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),m=t(h,n,i),_.push(R[f]),_.push(U[f])):145===f?(w=t(o,c,i),k=1-t(o,c,b),C=t(h,b,n),v=1-t(h,i,n),_.push(R[f]),_.push(Y[f])):25===f?(w=1-t(h,i,c),k=t(h,b,c),C=1-t(o,n,b),v=t(o,n,i),_.push(R[f]),_.push(Y[f])):70===f?(N=1-t(o,i,c),x=1-t(h,c,b),j=1-t(h,n,b),m=1-t(o,i,n),_.push(U[f]),_.push(W[f])):100===f?(N=t(h,c,i),x=t(o,b,c),j=t(o,b,n),m=t(h,n,i),_.push(U[f]),_.push(W[f])):34===f?(0===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):35===f?(4===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(X[f]),_.push(Z[f])):136===f?(0===d?(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):153===f?(0===d?(w=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(X[f])):102===f?(0===d?(N=1-t(o,i,c),x=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(U[f]),_.push(Z[f])):155===f?(4===d?(w=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(Y[f])):103===f?(4===d?(N=1-t(o,i,c),x=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(U[f]),_.push(W[f])):152===f?(0===d?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(W[f]),_.push(X[f])):156===f?(4===d?(w=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),v=t(o,n,i)):(w=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),C=t(o,b,n),j=t(h,b,n),v=1-t(h,i,n)),_.push(R[f]),_.push(X[f]),_.push(Z[f])):137===f?(0===d?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(X[f])):139===f?(4===d?(w=t(h,c,i),N=t(o,c,i),k=1-t(o,c,b),C=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)):(w=1-t(o,i,c),N=1-t(h,i,c),k=t(h,b,c),C=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)),_.push(R[f]),_.push(U[f]),_.push(Y[f])):98===f?(0===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(Z[f])):99===f?(4===d?(w=1-t(o,i,c),N=1-t(h,i,c),x=t(h,b,c),k=t(o,b,c),j=t(o,b,n),m=1-t(o,i,n)):(w=t(h,c,i),N=t(o,c,i),x=1-t(o,c,b),k=1-t(h,c,b),j=1-t(h,n,b),m=t(h,n,i)),_.push(R[f]),_.push(U[f]),_.push(X[f])):38===f?(0===d?(N=1-t(o,i,c),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(U[f]),_.push(Y[f]),_.push(Z[f])):39===f?(4===d?(N=1-t(o,i,c),x=t(o,b,c),C=t(o,b,n),j=t(h,b,n),m=1-t(h,i,n),v=1-t(o,i,n)):(N=t(h,c,i),x=1-t(h,c,b),C=1-t(h,n,b),j=1-t(o,n,b),m=t(o,n,i),v=t(h,n,i)),_.push(U[f]),_.push(W[f]),_.push(Z[f])):85===f&&(w=1,N=0,x=1,k=0,C=0,j=1,m=0,v=1),(m<0||m>1||v<0||v>1||w<0||w>1||x<0||x>1||C<0||C>1||j<0||j>1)&&console.log(f+" "+g+" "+n+","+i+","+c+","+b+" "+d+" "+m+" "+v+" "+w+" "+N+" "+x+" "+k+" "+C+" "+j),u.cells[l][a]={cval:f,cval_real:g,flipped:d,topleft:m,topright:v,righttop:w,rightbottom:N,bottomright:x,bottomleft:k,leftbottom:C,lefttop:j,edges:_}}}}}return u},oe=function(e,t,o){for(var s={type:"FeatureCollection",features:[]},r=0;r<o.length;r++){var p=o[r],u=se(e,t,p);s.features.push({type:"Feature",geometry:{type:"MultiLineString",coordinates:u},properties:[{value:p}]})}return s},se=function(e,t,o){if(typeof t!=typeof new Array||6!=t.length)throw new Error("GeoTransform must be a 6 elements array");for(var s=pe(e,o),r=0;r<s.length;r++)for(var p=0;p<s[r].length;p++){var u=re(s[r][p][0],s[r][p][1],t);s[r][p][0]=u[0],s[r][p][1]=u[1]}return s},re=function(e,t,o){var s=o[0]+e*o[1]+t*o[2],r=o[3]+e*o[4]+t*o[5];return[s,r]},pe=function(e,t,o){var s={successCallback:null,progressCallback:null,verbose:!1},r={};o=o?o:{};for(var p=Object.keys(s),u=0;u<p.length;u++){var h=p[u],a=o[h];a="undefined"!=typeof a&&null!==a?a:s[h],r[h]=a}r.verbose&&console.log("computing isocontour for "+t);var f=c(l(e,t));return"function"==typeof r.successCallback&&r.successCallback(f),f};e.isoband=m,e.projectedIsoband=d,e.isobands=g,e.isoline=pe,e.projectedIsoline=se,e.isolines=oe,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "d3-marching-squares",
"version": "0.0.3",
"version": "0.0.4",
"description": "Tools for drawing your raster files with JavaScript",

@@ -24,3 +24,3 @@ "keywords": [

"scripts": {
"pretest": "rm -rf build && mkdir build && rollup -f umd -n rastertools -o build/d3-marching-squares.js -- index.js",
"pretest": "rm -rf build && mkdir build && rollup -f umd -n d3marchingsquares -o build/d3-marching-squares.js -- index.js",
"test": "tape 'test/**/*-test.js' && mkdir -p test/output && test/compare-images",

@@ -27,0 +27,0 @@ "prepublish": "npm run test && uglifyjs build/d3-marching-squares.js -c -m -o build/d3-marching-squares.min.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc