Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cobe

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cobe - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

3

dist/index.d.ts

@@ -16,2 +16,3 @@ import Phenomenon from 'phenomenon'

mapBrightness: number
mapBaseBrightness?: number
baseColor: [number, number, number]

@@ -24,4 +25,6 @@ markerColor: [number, number, number]

dark: number
opacity?: number
offset?: [number, number]
scale?: number
context?: WebGLContextAttributes
}

@@ -28,0 +31,0 @@

2

dist/index.esm.js

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

import B from"phenomenon";var M="phi",R="theta",c="mapSamples",O="mapBrightness",N="baseColor",s="markerColor",G="glowColor",S="markers",P="diffuse",X="devicePixelRatio",f="dark",u="offset",m="scale",x="opacity",l="mapBaseBrightness",I={[M]:"A",[R]:"B",[c]:"l",[O]:"E",[N]:"R",[s]:"S",[G]:"y",[P]:"F",[f]:"G",[u]:"x",[m]:"C",[x]:"H",[l]:"I"},{PI:i,sin:d,cos:U}=Math,C=r=>[].concat(...r.map(o=>{let[t,n]=o.location;t=t*i/180,n=n*i/180-i;let a=U(t);return[-a*U(n),d(t),a*d(n),o.size]}),[0,0,0,0]),D=(r,o)=>{let t=(e,_,E)=>({type:e,value:typeof o[_]=="undefined"?E:o[_]}),n=r.getContext("webgl")?"webgl":"experimental-webgl",a=new B({canvas:r,contextType:n,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1},settings:{[X]:o[X]||1,onSetup:e=>{let _=e.RGB,E=e.UNSIGNED_BYTE,L=e.TEXTURE_2D,T=e.createTexture();e.bindTexture(L,T),e.texImage2D(L,0,_,1,1,0,_,E,new Uint8Array([0,0,0,0]));let A=new Image;A.onload=()=>{e.bindTexture(L,T),e.texImage2D(L,0,_,_,E,A),e.generateMipmap(L);let h=e.getParameter(e.CURRENT_PROGRAM),v=e.getUniformLocation(h,"J");e.texParameteri(L,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(L,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(v,0)},A.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAAAXNSR0IArs4c6QAABA5JREFUeNrV179uHEUAx/Hf3JpbF+E2VASBsmVKTBcpKJs3SMEDcDwBiVJAAewYEBUivIHT0uUBIt0YCovKD0CRjUC4QfHYh8hYXu+P25vZ2Zm9c66gMd/GJ/tz82d3bk8GN4SrByYF2366FNTACIAkivVAAazQdnf3MvAlbNUQfOPAdQDvSAimMWhwy4I2g4SU+Kp04ISLpPBAKLxPyic3O/CCi+Y7rUJbiodcpDOFY7CgxCEXmdYD2EYK2s5lApOx5pEDDYCUwM1XdJUwBV11QQMg59kePSCaPAASQMEL2hwo6TJFgxpg+TgC2ymXPbuvc40awr3D1QCFfbH9kcoqAOkZozpQo0aqAGQRKCog/+tjkgbNFEtg2FffBvBGlSxHoAaAa1u6X4PBAwDiR8FFsrQgeUhfJTSALaB9jy5NCybJPn1SVFiWk7ywN+KzhH1aKAuydhGkbEF4lWohLXDXavlyFgHY7LBnLRdlAP6BS5Cc8RfVDXbkwN/oIvmY+6obbNeBP0JwTuMGu9gTzy1Q4RS/cWpfzszeYwd+CAFrtBW/Hur0gLbJGlD+/OjVwe/drfBxkbbg63dndEDfiEBlAd7ac0BPe1D6Jd8dfbLH+RI0OzseFB5s01/M+gMdAeluLOCAuaUA9Lezo/vSgXoCX9rtEiXnp7Q1W/CNyWcd8DXoS6jH/YZ5vAJEWY2dXFQe2TUgaFaNejCzJ98g6HnlVrsE58sDcYqg+9XY75fPqdoh/kRQWiXKg8MWlJQxUFMPjqnyujhFBE7UxIMjyszk0QwQlFsezImsyvUYYYVED2pk6m0Tg8T04Fwjk2kdAwSACqlM6gRRt3vQYAFGX0Ah7Ebx1H+MDRI5ui0QldH4j7FGcm90XdxD2Jg1AOEAVAKhEFXSn4cKUELurIAKwJ3MArypPscQaLhJFICJ0ohjDySAdH8AhDtCiTuMycH8CXzhH9jUACAO5uMhoAwA5i+T6WAKmmAqnLy80wxHqIPFYpqCwxGaYLt4Dyievg5kEoVEUAhs6pqKgFtDQYOuaXypaWKQfIuwwoGSZgfLsu/XAtI8cGN+h7Cc1A5oLOMhwlIPXuhu48AIvsSBkvtV9wsJRKCyYLfq5lTrQMFd1a262oqBck9K1V0YjQg0iEYYgpS1A9GlXQV5cykwm4A7BzVsxQqo7E+zCegO7Ma7yKgsuOcfKbMBwLC8wvVNYDsANYalEpOAa6zpWjTeMKGwEwC1CiQewJc5EKfgy7GmRAZA4vUVGwE2dPM/g0xuAInE/yG5aZ8ISxWGfYigUVbdyBElTHh2uCwGdfCkOLGgQVBh3Ewp+/QK4CDlR5Ws/Zf7yhCf8pH7vinWAvoVCQ6zz0NX5V/6GkAVV+2/5qsJ/gU8bsxpM8IeAQAAAABJRU5ErkJggg=="}}});return a.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:"precision highp float;uniform vec2 s,x;uniform vec3 R,S,y;uniform vec4 z[64];uniform float A,B,l,C,D,E,F,G,H,I;uniform sampler2D J;const vec3 K=vec3(0.,0.,1.);float L=1./l;mat3 M(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 v(vec3 c,out float w){c=c.xzy;float p=max(2.,floor(log2(2.236068*l*3.141593*(1.-c.z*c.z))*.72021));vec2 g=floor(pow(1.618034,p)/2.236068*vec2(1.,1.618034)+.5),d=fract((g+1.)*.618034)*6.283185-3.883222,e=-2.*g,f=vec2(atan(c.y,c.x),c.z-1.),q=floor(vec2(e.y*f.x-d.y*(f.y*l+1.),-e.x*f.x+d.x*(f.y*l+1.))/(d.x*e.y-e.x*d.y));float n=3.141593;vec3 r;for(float h=0.;h<4.;h+=1.){vec2 t=vec2(mod(h,2.),floor(h*.5));float j=dot(g,q+t);if(j>l)continue;float a=j,b=0.;if(a>=524288.)a-=524288.,b+=.803894;if(a>=262144.)a-=262144.,b+=.901947;if(a>=131072.)a-=131072.,b+=.950973;if(a>=65536.)a-=65536.,b+=.475487;if(a>=32768.)a-=32768.,b+=.737743;if(a>=16384.)a-=16384.,b+=.868872;if(a>=8192.)a-=8192.,b+=.934436;if(a>=4096.)a-=4096.,b+=.467218;if(a>=2048.)a-=2048.,b+=.733609;if(a>=1024.)a-=1024.,b+=.866804;if(a>=512.)a-=512.,b+=.433402;if(a>=256.)a-=256.,b+=.216701;if(a>=128.)a-=128.,b+=.108351;if(a>=64.)a-=64.,b+=.554175;if(a>=32.)a-=32.,b+=.777088;if(a>=16.)a-=16.,b+=.888544;if(a>=8.)a-=8.,b+=.944272;if(a>=4.)a-=4.,b+=.472136;if(a>=2.)a-=2.,b+=.236068;if(a>=1.)a-=1.,b+=.618034;float k=fract(b)*6.283185,i=1.-2.*j*L,m=sqrt(1.-i*i);vec3 o=vec3(cos(k)*m,sin(k)*m,i);float u=length(c-o);if(u<n)n=u,r=o;}w=n;return r.xzy;}void main(){vec2 a=(gl_FragCoord.xy/s*2.-1.)/C-x*vec2(1.,-1.)/s;a.x*=s.x/s.y;float c=dot(a,a);vec4 w=vec4(0.);if(c<=.64)for(int d=0;d<2;d++){vec4 e=vec4(0.);float b;vec3 t=vec3(0.,0.,1.),f=normalize(vec3(a,sqrt(.64-c)));f.z*=d>0?-1.:1.,t.z*=d>0?-1.:1.;vec3 g=f*M(B,A),h=v(g,b);float m=asin(h.y),i=acos(-h.x/cos(m));i=h.z<0.?-i:i;float N=max(texture2D(J,vec2(i*.5/3.141593,-(m/3.141593+.5))).x,I),O=smoothstep(8e-3,0.,b),j=dot(f,t),u=pow(j,F)*E,n=N*O*u,T=mix((1.-n)*pow(j,.4),n,G)+.1;e+=vec4(R*T,1.);int U=int(D);float o=0.;for(int k=0;k<64;k++){if(k>=U)break;vec4 p=z[k];vec3 q=p.xyz,P=q-g;float r=p.w;if(dot(P,P)>r*r*4.)continue;vec3 V=v(q,b);b=length(V-g),b<r?o+=smoothstep(r*.5,0.,b):0.;}o=min(1.,o*u),e.xyz=mix(e.xyz,S,o),e.xyz+=pow(1.-j,4.)*y,w+=e*(1.+(d>0?-H:H))/2.;}float Q=pow(dot(normalize(vec3(-a,sqrt(1.-c))),K),4.)*smoothstep(.1,1.,.2/(c-.64));gl_FragColor=w+vec4(Q*y,Q);}",uniforms:{s:{type:"vec2",value:[o.width,o.height]},A:t("float",M),B:t("float",R),l:t("float",c),E:t("float",O),I:t("float",l),R:t("vec3",N),S:t("vec3",s),F:t("float",P),y:t("vec3",G),G:t("float",f),z:{type:"vec4",value:C(o[S])},D:{type:"float",value:o[S].length},x:t("vec2",u,[0,0]),C:t("float",m,1),H:t("float",x,1)},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let _={};if(o.onRender){o.onRender(_);for(let E in I)_[E]!==void 0&&(e[I[E]].value=_[E]);_[S]!==void 0&&(e["z"].value=C(_[S]),e["D"].value=_[S].length),_.width&&_.height&&(e["s"].value=[_.width,_.height])}}}),a};export{D as default};
import B from"phenomenon";var M="phi",R="theta",c="mapSamples",O="mapBrightness",N="baseColor",G="markerColor",s="glowColor",S="markers",P="diffuse",X="devicePixelRatio",f="dark",u="offset",m="scale",x="opacity",l="mapBaseBrightness",I={[M]:"A",[R]:"B",[c]:"l",[O]:"E",[N]:"R",[G]:"S",[s]:"y",[P]:"F",[f]:"G",[u]:"x",[m]:"C",[x]:"H",[l]:"I"},{PI:i,sin:d,cos:U}=Math,C=r=>[].concat(...r.map(E=>{let[_,o]=E.location;_=_*i/180,o=o*i/180-i;let a=U(_);return[-a*U(o),d(_),a*d(o),E.size]}),[0,0,0,0]),p=(r,E)=>{let _=(e,t,L)=>({type:e,value:typeof E[t]=="undefined"?L:E[t]}),o=r.getContext("webgl")?"webgl":"experimental-webgl",a=new B({canvas:r,contextType:o,context:{alpha:!0,stencil:!1,antialias:!0,depth:!1,preserveDrawingBuffer:!1,...E.context},settings:{[X]:E[X]||1,onSetup:e=>{let t=e.RGB,L=e.UNSIGNED_BYTE,n=e.TEXTURE_2D,T=e.createTexture();e.bindTexture(n,T),e.texImage2D(n,0,t,1,1,0,t,L,new Uint8Array([0,0,0,0]));let A=new Image;A.onload=()=>{e.bindTexture(n,T),e.texImage2D(n,0,t,t,L,A),e.generateMipmap(n);let h=e.getParameter(e.CURRENT_PROGRAM),v=e.getUniformLocation(h,"J");e.texParameteri(n,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(n,e.TEXTURE_MAG_FILTER,e.NEAREST),e.uniform1i(v,0)},A.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAAAXNSR0IArs4c6QAABA5JREFUeNrV179uHEUAx/Hf3JpbF+E2VASBsmVKTBcpKJs3SMEDcDwBiVJAAewYEBUivIHT0uUBIt0YCovKD0CRjUC4QfHYh8hYXu+P25vZ2Zm9c66gMd/GJ/tz82d3bk8GN4SrByYF2366FNTACIAkivVAAazQdnf3MvAlbNUQfOPAdQDvSAimMWhwy4I2g4SU+Kp04ISLpPBAKLxPyic3O/CCi+Y7rUJbiodcpDOFY7CgxCEXmdYD2EYK2s5lApOx5pEDDYCUwM1XdJUwBV11QQMg59kePSCaPAASQMEL2hwo6TJFgxpg+TgC2ymXPbuvc40awr3D1QCFfbH9kcoqAOkZozpQo0aqAGQRKCog/+tjkgbNFEtg2FffBvBGlSxHoAaAa1u6X4PBAwDiR8FFsrQgeUhfJTSALaB9jy5NCybJPn1SVFiWk7ywN+KzhH1aKAuydhGkbEF4lWohLXDXavlyFgHY7LBnLRdlAP6BS5Cc8RfVDXbkwN/oIvmY+6obbNeBP0JwTuMGu9gTzy1Q4RS/cWpfzszeYwd+CAFrtBW/Hur0gLbJGlD+/OjVwe/drfBxkbbg63dndEDfiEBlAd7ac0BPe1D6Jd8dfbLH+RI0OzseFB5s01/M+gMdAeluLOCAuaUA9Lezo/vSgXoCX9rtEiXnp7Q1W/CNyWcd8DXoS6jH/YZ5vAJEWY2dXFQe2TUgaFaNejCzJ98g6HnlVrsE58sDcYqg+9XY75fPqdoh/kRQWiXKg8MWlJQxUFMPjqnyujhFBE7UxIMjyszk0QwQlFsezImsyvUYYYVED2pk6m0Tg8T04Fwjk2kdAwSACqlM6gRRt3vQYAFGX0Ah7Ebx1H+MDRI5ui0QldH4j7FGcm90XdxD2Jg1AOEAVAKhEFXSn4cKUELurIAKwJ3MArypPscQaLhJFICJ0ohjDySAdH8AhDtCiTuMycH8CXzhH9jUACAO5uMhoAwA5i+T6WAKmmAqnLy80wxHqIPFYpqCwxGaYLt4Dyievg5kEoVEUAhs6pqKgFtDQYOuaXypaWKQfIuwwoGSZgfLsu/XAtI8cGN+h7Cc1A5oLOMhwlIPXuhu48AIvsSBkvtV9wsJRKCyYLfq5lTrQMFd1a262oqBck9K1V0YjQg0iEYYgpS1A9GlXQV5cykwm4A7BzVsxQqo7E+zCegO7Ma7yKgsuOcfKbMBwLC8wvVNYDsANYalEpOAa6zpWjTeMKGwEwC1CiQewJc5EKfgy7GmRAZA4vUVGwE2dPM/g0xuAInE/yG5aZ8ISxWGfYigUVbdyBElTHh2uCwGdfCkOLGgQVBh3Ewp+/QK4CDlR5Ws/Zf7yhCf8pH7vinWAvoVCQ6zz0NX5V/6GkAVV+2/5qsJ/gU8bsxpM8IeAQAAAABJRU5ErkJggg=="}}});return a.add("",{vertex:"attribute vec3 aPosition;uniform mat4 uProjectionMatrix;uniform mat4 uModelMatrix;uniform mat4 uViewMatrix;void main(){gl_Position=uProjectionMatrix*uModelMatrix*uViewMatrix*vec4(aPosition,1.);}",fragment:"precision highp float;uniform vec2 s,x;uniform vec3 R,S,y;uniform vec4 z[64];uniform float A,B,l,C,D,E,F,G,H,I;uniform sampler2D J;const vec3 K=vec3(0.,0.,1.);float L=1./l;mat3 M(float a,float b){float c=cos(a),d=cos(b),e=sin(a),f=sin(b);return mat3(d,f*e,-f*c,0.,c,e,f,d*-e,d*c);}vec3 v(vec3 c,out float w){c=c.xzy;float p=max(2.,floor(log2(2.236068*l*3.141593*(1.-c.z*c.z))*.72021));vec2 g=floor(pow(1.618034,p)/2.236068*vec2(1.,1.618034)+.5),d=fract((g+1.)*.618034)*6.283185-3.883222,e=-2.*g,f=vec2(atan(c.y,c.x),c.z-1.),q=floor(vec2(e.y*f.x-d.y*(f.y*l+1.),-e.x*f.x+d.x*(f.y*l+1.))/(d.x*e.y-e.x*d.y));float n=3.141593;vec3 r;for(float h=0.;h<4.;h+=1.){vec2 t=vec2(mod(h,2.),floor(h*.5));float j=dot(g,q+t);if(j>l)continue;float a=j,b=0.;if(a>=524288.)a-=524288.,b+=.803894;if(a>=262144.)a-=262144.,b+=.901947;if(a>=131072.)a-=131072.,b+=.950973;if(a>=65536.)a-=65536.,b+=.475487;if(a>=32768.)a-=32768.,b+=.737743;if(a>=16384.)a-=16384.,b+=.868872;if(a>=8192.)a-=8192.,b+=.934436;if(a>=4096.)a-=4096.,b+=.467218;if(a>=2048.)a-=2048.,b+=.733609;if(a>=1024.)a-=1024.,b+=.866804;if(a>=512.)a-=512.,b+=.433402;if(a>=256.)a-=256.,b+=.216701;if(a>=128.)a-=128.,b+=.108351;if(a>=64.)a-=64.,b+=.554175;if(a>=32.)a-=32.,b+=.777088;if(a>=16.)a-=16.,b+=.888544;if(a>=8.)a-=8.,b+=.944272;if(a>=4.)a-=4.,b+=.472136;if(a>=2.)a-=2.,b+=.236068;if(a>=1.)a-=1.,b+=.618034;float k=fract(b)*6.283185,i=1.-2.*j*L,m=sqrt(1.-i*i);vec3 o=vec3(cos(k)*m,sin(k)*m,i);float u=length(c-o);if(u<n)n=u,r=o;}w=n;return r.xzy;}void main(){vec2 a=(gl_FragCoord.xy/s*2.-1.)/C-x*vec2(1.,-1.)/s;a.x*=s.x/s.y;float c=dot(a,a);vec4 w=vec4(0.);if(c<=.64)for(int d=0;d<2;d++){vec4 e=vec4(0.);float b;vec3 t=vec3(0.,0.,1.),f=normalize(vec3(a,sqrt(.64-c)));f.z*=d>0?-1.:1.,t.z*=d>0?-1.:1.;vec3 g=f*M(B,A),h=v(g,b);float m=asin(h.y),i=acos(-h.x/cos(m));i=h.z<0.?-i:i;float N=max(texture2D(J,vec2(i*.5/3.141593,-(m/3.141593+.5))).x,I),O=smoothstep(8e-3,0.,b),j=dot(f,t),u=pow(j,F)*E,n=N*O*u,T=mix((1.-n)*pow(j,.4),n,G)+.1;e+=vec4(R*T,1.);int U=int(D);float o=0.;for(int k=0;k<64;k++){if(k>=U)break;vec4 p=z[k];vec3 q=p.xyz,P=q-g;float r=p.w;if(dot(P,P)>r*r*4.)continue;vec3 V=v(q,b);b=length(V-g),b<r?o+=smoothstep(r*.5,0.,b):0.;}o=min(1.,o*u),e.xyz=mix(e.xyz,S,o),e.xyz+=pow(1.-j,4.)*y,w+=e*(1.+(d>0?-H:H))/2.;}float Q=pow(dot(normalize(vec3(-a,sqrt(1.-c))),K),4.)*smoothstep(.1,1.,.2/(c-.64));gl_FragColor=w+vec4(Q*y,Q);}",uniforms:{s:{type:"vec2",value:[E.width,E.height]},A:_("float",M),B:_("float",R),l:_("float",c),E:_("float",O),I:_("float",l),R:_("vec3",N),S:_("vec3",G),F:_("float",P),y:_("vec3",s),G:_("float",f),z:{type:"vec4",value:C(E[S])},D:{type:"float",value:E[S].length},x:_("vec2",u,[0,0]),C:_("float",m,1),H:_("float",x,1)},mode:4,geometry:{vertices:[{x:-100,y:100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0},{x:100,y:-100,z:0},{x:-100,y:-100,z:0},{x:100,y:100,z:0}]},onRender:({uniforms:e})=>{let t={};if(E.onRender){t=E.onRender(t)||t;for(let L in I)t[L]!==void 0&&(e[I[L]].value=t[L]);t[S]!==void 0&&(e["z"].value=C(t[S]),e["D"].value=t[S].length),t.width&&t.height&&(e["s"].value=[t.width,t.height])}}}),a};export{p as default};
{
"name": "cobe",
"version": "0.6.1",
"version": "0.6.2",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/index.esm.js",

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