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

@antv/g-camera-api

Package Overview
Dependencies
Maintainers
61
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-camera-api - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18

2

dist/index.umd.min.js

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

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],i):i(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CameraAPI={}),t.window.G)}(this,(function(t,i){"use strict";function n(t,i){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},n(t,i)}var o="undefined"!=typeof Float32Array?Float32Array:Array;function e(t){var i=new o(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function r(t,i,n){var o,e,r,a,s,h,l,u,c,m,d,f,p=n[0],v=n[1],g=n[2];return i===t?(t[12]=i[0]*p+i[4]*v+i[8]*g+i[12],t[13]=i[1]*p+i[5]*v+i[9]*g+i[13],t[14]=i[2]*p+i[6]*v+i[10]*g+i[14],t[15]=i[3]*p+i[7]*v+i[11]*g+i[15]):(e=i[1],r=i[2],a=i[3],s=i[4],h=i[5],l=i[6],u=i[7],c=i[8],m=i[9],d=i[10],f=i[11],t[0]=o=i[0],t[1]=e,t[2]=r,t[3]=a,t[4]=s,t[5]=h,t[6]=l,t[7]=u,t[8]=c,t[9]=m,t[10]=d,t[11]=f,t[12]=o*p+s*v+c*g+i[12],t[13]=e*p+h*v+m*g+i[13],t[14]=r*p+l*v+d*g+i[14],t[15]=a*p+u*v+f*g+i[15]),t}function a(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var i=new o(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}function h(t,i,n){var e=new o(3);return e[0]=t,e[1]=i,e[2]=n,e}function l(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t}function u(t,i,n){return t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function c(t,i,n){return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t}function m(t,i,n){var o=i[0],e=i[1],r=i[2],a=n[0],s=n[1],h=n[2];return t[0]=e*h-r*s,t[1]=r*a-o*h,t[2]=o*s-e*a,t}function d(t,i,n,o){var e=i[0],r=i[1],a=i[2];return t[0]=e+o*(n[0]-e),t[1]=r+o*(n[1]-r),t[2]=a+o*(n[2]-a),t}Math.hypot||(Math.hypot=function(){for(var t=0,i=arguments.length;i--;)t+=arguments[i]*arguments[i];return Math.sqrt(t)});var f,p=function(t,i){return Math.hypot(i[0]-t[0],i[1]-t[1],i[2]-t[2])},v=function(t){return Math.hypot(t[0],t[1],t[2])};f=a();!function(){var t,i=(t=new o(4),o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function g(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function y(t,i,n){n*=.5;var o=Math.sin(n);return t[0]=o*i[0],t[1]=o*i[1],t[2]=o*i[2],t[3]=Math.cos(n),t}function A(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=n[0],h=n[1],l=n[2],u=n[3];return t[0]=o*u+a*s+e*l-r*h,t[1]=e*u+a*h+r*s-o*l,t[2]=r*u+a*l+o*h-e*s,t[3]=a*u-o*s-e*h-r*l,t}function P(t,i,n,o){var e,r,a,s,h,l=i[0],u=i[1],c=i[2],m=i[3],d=n[0],f=n[1],p=n[2],v=n[3];return 0>(r=l*d+u*f+c*p+m*v)&&(r=-r,d=-d,f=-f,p=-p,v=-v),1-r>1e-6?(e=Math.acos(r),a=Math.sin(e),s=Math.sin((1-o)*e)/a,h=Math.sin(o*e)/a):(s=1-o,h=o),t[0]=s*l+h*d,t[1]=s*u+h*f,t[2]=s*c+h*p,t[3]=s*m+h*v,t}var x,z,F,M,w,R,C,T=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n*n+o*o+e*e+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=o*a,t[2]=e*a,t[3]=r*a,t},I=(x=a(),z=h(1,0,0),F=h(0,1,0),M=g(),w=g(),R=new o(9),o!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,C=R,{}.toString),b=function(t,i){return I.call(t)==="[object "+i+"]"},_=function(t){var h,m;function f(){for(var i,n=arguments.length,o=new Array(n),e=0;n>e;e++)o[e]=arguments[e];return(i=t.call.apply(t,[this].concat(o))||this).landmarks=[],i.landmarkAnimationID=void 0,i}m=t,(h=f).prototype=Object.create(m.prototype),h.prototype.constructor=h,n(h,m);var v=f.prototype;return v.rotate=function(t,n,e){if(this.relElevation=i.getAngle(n),this.relAzimuth=i.getAngle(t),this.relRoll=i.getAngle(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===i.CameraType.EXPLORING){var a=y(g(),[1,0,0],i.deg2rad((this.rotateWorld?1:-1)*this.relElevation)),s=y(g(),[0,1,0],i.deg2rad((this.rotateWorld?1:-1)*this.relAzimuth)),h=y(g(),[0,0,1],i.deg2rad(this.relRoll)),l=A(g(),s,a);l=A(g(),l,h);var u=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n+n,s=o+o,h=e+e,l=n*a,u=o*a,c=o*s,m=e*a,d=e*s,f=e*h,p=r*a,v=r*s,g=r*h;return t[0]=1-c-f,t[1]=u+g,t[2]=m-v,t[3]=0,t[4]=u-g,t[5]=1-l-f,t[6]=d+p,t[7]=0,t[8]=m+v,t[9]=d-p,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(function(){var t=new o(16);return o!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}(),l);r(this.matrix,this.matrix,[0,0,-this.distance]),function(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=i[4],h=i[5],l=i[6],u=i[7],c=i[8],m=i[9],d=i[10],f=i[11],p=i[12],v=i[13],g=i[14],y=i[15],A=n[0],P=n[1],x=n[2],z=n[3];t[0]=A*o+P*s+x*c+z*p,t[1]=A*e+P*h+x*m+z*v,t[2]=A*r+P*l+x*d+z*g,t[3]=A*a+P*u+x*f+z*y,t[4]=(A=n[4])*o+(P=n[5])*s+(x=n[6])*c+(z=n[7])*p,t[5]=A*e+P*h+x*m+z*v,t[6]=A*r+P*l+x*d+z*g,t[7]=A*a+P*u+x*f+z*y,t[8]=(A=n[8])*o+(P=n[9])*s+(x=n[10])*c+(z=n[11])*p,t[9]=A*e+P*h+x*m+z*v,t[10]=A*r+P*l+x*d+z*g,t[11]=A*a+P*u+x*f+z*y,t[12]=(A=n[12])*o+(P=n[13])*s+(x=n[14])*c+(z=n[15])*p,t[13]=A*e+P*h+x*m+z*v,t[14]=A*r+P*l+x*d+z*g,t[15]=A*a+P*u+x*f+z*y}(this.matrix,this.matrix,u),r(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getPosition():this.type===i.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},v.pan=function(t,n){var o=i.createVec3(t,n,0),e=s(this.position);return u(e,e,c(a(),this.right,o[0])),u(e,e,c(a(),this.up,o[1])),this._setPosition(e),this.triggerUpdate(),this},v.dolly=function(t){var n,o=this.forward,e=s(this.position);return n=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,e[0]+=n*o[0],e[1]+=n*o[1],e[2]+=n*o[2],this._setPosition(e),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getDistance():this.type===i.CameraType.TRACKING&&u(this.focalPoint,e,this.distanceVector),this.triggerUpdate(),this},v.createLandmark=function(t,n){void 0===n&&(n={});var o=n.position,r=void 0===o?this.position:o,a=n.focalPoint,h=void 0===a?this.focalPoint:a,l=n.roll,u=n.zoom,c=new i.runtime.CameraContribution;c.setType(this.type,void 0),c.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),c.setFocalPoint(h[0],h[1]||this.focalPoint[1],h[2]||this.focalPoint[2]),c.setRoll(l||this.roll),c.setZoom(u||this.zoom);var m={name:t,matrix:e(c.getWorldTransform()),right:s(c.right),up:s(c.up),forward:s(c.forward),position:s(c.getPosition()),focalPoint:s(c.getFocalPoint()),distanceVector:s(c.getDistanceVector()),distance:c.getDistance(),dollyingStep:c.getDollyingStep(),azimuth:c.getAzimuth(),elevation:c.getElevation(),roll:c.getRoll(),relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.getZoom()};return this.landmarks.push(m),m},v.gotoLandmark=function(t,n){var o=this;void 0===n&&(n={});var e=b(t,"String")?this.landmarks.find((function(i){return i.name===t})):t;if(e){var r=b(n,"Number")?{duration:n}:n,s=r.easing,h=void 0===s?"linear":s,l=r.duration,u=void 0===l?100:l,c=r.easingFunction,m=void 0===c?void 0:c,f=r.onfinish,v=void 0===f?void 0:f;if(0===u)return this.syncFromLandmark(e),void(v&&v());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var g,y=e.position,A=e.focalPoint,P=e.zoom,x=e.roll,z=m||i.runtime.EasingFunction(h),F=function(){o.setFocalPoint(A),o.setPosition(y),o.setRoll(x),o.setZoom(P),o.computeMatrix(),o.triggerUpdate(),v&&v()};this.canvas.requestAnimationFrame((function t(i){void 0===g&&(g=i);var n=i-g;if(u<n)F();else{var e,r,s=z(n/u),h=a(),l=a();d(h,o.focalPoint,A,s),d(l,o.position,y,s),r=o.roll*(1-s)+x*s,e=o.zoom*(1-s)+P*s,o.setFocalPoint(h),o.setPosition(l),o.setRoll(r),o.setZoom(e),p(h,A)+p(l,y)>.01?(o.computeMatrix(),o.triggerUpdate(),u>n&&(o.landmarkAnimationID=o.canvas.requestAnimationFrame(t))):F()}}))}},v.syncFromLandmark=function(t){this.matrix=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t}(this.matrix,t.matrix),this.right=l(this.right,t.right),this.up=l(this.up,t.up),this.forward=l(this.forward,t.forward),this.position=l(this.position,t.position),this.focalPoint=l(this.focalPoint,t.focalPoint),this.distanceVector=l(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},f}(i.Camera);i.runtime.CameraContribution=_,t.AdvancedCamera=_,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],i):i(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CameraAPI={}),t.window.G)}(this,(function(t,i){"use strict";function n(t,i){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},n(t,i)}var o="undefined"!=typeof Float32Array?Float32Array:Array;function e(t){var i=new o(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function r(t,i,n){var o,e,r,a,s,h,l,u,c,m,d,f,p=n[0],v=n[1],g=n[2];return i===t?(t[12]=i[0]*p+i[4]*v+i[8]*g+i[12],t[13]=i[1]*p+i[5]*v+i[9]*g+i[13],t[14]=i[2]*p+i[6]*v+i[10]*g+i[14],t[15]=i[3]*p+i[7]*v+i[11]*g+i[15]):(e=i[1],r=i[2],a=i[3],s=i[4],h=i[5],l=i[6],u=i[7],c=i[8],m=i[9],d=i[10],f=i[11],t[0]=o=i[0],t[1]=e,t[2]=r,t[3]=a,t[4]=s,t[5]=h,t[6]=l,t[7]=u,t[8]=c,t[9]=m,t[10]=d,t[11]=f,t[12]=o*p+s*v+c*g+i[12],t[13]=e*p+h*v+m*g+i[13],t[14]=r*p+l*v+d*g+i[14],t[15]=a*p+u*v+f*g+i[15]),t}function a(){var t=new o(3);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var i=new o(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}function h(t,i,n){var e=new o(3);return e[0]=t,e[1]=i,e[2]=n,e}function l(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t}function u(t,i,n){return t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function c(t,i,n){return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t}function m(t,i,n){var o=i[0],e=i[1],r=i[2],a=n[0],s=n[1],h=n[2];return t[0]=e*h-r*s,t[1]=r*a-o*h,t[2]=o*s-e*a,t}function d(t,i,n,o){var e=i[0],r=i[1],a=i[2];return t[0]=e+o*(n[0]-e),t[1]=r+o*(n[1]-r),t[2]=a+o*(n[2]-a),t}Math.hypot||(Math.hypot=function(){for(var t=0,i=arguments.length;i--;)t+=arguments[i]*arguments[i];return Math.sqrt(t)});var f,p=function(t,i){return Math.hypot(i[0]-t[0],i[1]-t[1],i[2]-t[2])},v=function(t){return Math.hypot(t[0],t[1],t[2])};f=a();!function(){var t,i=(t=new o(4),o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function g(){var t=new o(4);return o!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function y(t,i,n){var o=Math.sin(n*=.5);return t[0]=o*i[0],t[1]=o*i[1],t[2]=o*i[2],t[3]=Math.cos(n),t}function A(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=n[0],h=n[1],l=n[2],u=n[3];return t[0]=o*u+a*s+e*l-r*h,t[1]=e*u+a*h+r*s-o*l,t[2]=r*u+a*l+o*h-e*s,t[3]=a*u-o*s-e*h-r*l,t}function P(t,i,n,o){var e,r,a,s,h,l=i[0],u=i[1],c=i[2],m=i[3],d=n[0],f=n[1],p=n[2],v=n[3];return 0>(r=l*d+u*f+c*p+m*v)&&(r=-r,d=-d,f=-f,p=-p,v=-v),1-r>1e-6?(a=Math.sin(e=Math.acos(r)),s=Math.sin((1-o)*e)/a,h=Math.sin(o*e)/a):(s=1-o,h=o),t[0]=s*l+h*d,t[1]=s*u+h*f,t[2]=s*c+h*p,t[3]=s*m+h*v,t}var x,z,F,M,R,w,C,T=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n*n+o*o+e*e+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=o*a,t[2]=e*a,t[3]=r*a,t},I=(x=a(),z=h(1,0,0),F=h(0,1,0),M=g(),R=g(),w=new o(9),o!=Float32Array&&(w[1]=0,w[2]=0,w[3]=0,w[5]=0,w[6]=0,w[7]=0),w[0]=1,w[4]=1,w[8]=1,C=w,{}.toString),b=function(t,i){return I.call(t)==="[object "+i+"]"},_=function(t){var h,m;function f(){for(var i,n=arguments.length,o=Array(n),e=0;n>e;e++)o[e]=arguments[e];return(i=t.call.apply(t,[this].concat(o))||this).landmarks=[],i.landmarkAnimationID=void 0,i}(h=f).prototype=Object.create((m=t).prototype),h.prototype.constructor=h,n(h,m);var v=f.prototype;return v.rotate=function(t,n,e){if(this.relElevation=i.getAngle(n),this.relAzimuth=i.getAngle(t),this.relRoll=i.getAngle(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===i.CameraType.EXPLORING){var a=y(g(),[1,0,0],i.deg2rad((this.rotateWorld?1:-1)*this.relElevation)),s=y(g(),[0,1,0],i.deg2rad((this.rotateWorld?1:-1)*this.relAzimuth)),h=y(g(),[0,0,1],i.deg2rad(this.relRoll)),l=A(g(),s,a);l=A(g(),l,h);var u=function(t,i){var n=i[0],o=i[1],e=i[2],r=i[3],a=n+n,s=o+o,h=e+e,l=n*a,u=o*a,c=o*s,m=e*a,d=e*s,f=e*h,p=r*a,v=r*s,g=r*h;return t[0]=1-c-f,t[1]=u+g,t[2]=m-v,t[3]=0,t[4]=u-g,t[5]=1-l-f,t[6]=d+p,t[7]=0,t[8]=m+v,t[9]=d-p,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(function(){var t=new o(16);return o!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}(),l);r(this.matrix,this.matrix,[0,0,-this.distance]),function(t,i,n){var o=i[0],e=i[1],r=i[2],a=i[3],s=i[4],h=i[5],l=i[6],u=i[7],c=i[8],m=i[9],d=i[10],f=i[11],p=i[12],v=i[13],g=i[14],y=i[15],A=n[0],P=n[1],x=n[2],z=n[3];t[0]=A*o+P*s+x*c+z*p,t[1]=A*e+P*h+x*m+z*v,t[2]=A*r+P*l+x*d+z*g,t[3]=A*a+P*u+x*f+z*y,t[4]=(A=n[4])*o+(P=n[5])*s+(x=n[6])*c+(z=n[7])*p,t[5]=A*e+P*h+x*m+z*v,t[6]=A*r+P*l+x*d+z*g,t[7]=A*a+P*u+x*f+z*y,t[8]=(A=n[8])*o+(P=n[9])*s+(x=n[10])*c+(z=n[11])*p,t[9]=A*e+P*h+x*m+z*v,t[10]=A*r+P*l+x*d+z*g,t[11]=A*a+P*u+x*f+z*y,t[12]=(A=n[12])*o+(P=n[13])*s+(x=n[14])*c+(z=n[15])*p,t[13]=A*e+P*h+x*m+z*v,t[14]=A*r+P*l+x*d+z*g,t[15]=A*a+P*u+x*f+z*y}(this.matrix,this.matrix,u),r(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getPosition():this.type===i.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},v.pan=function(t,n){var o=i.createVec3(t,n,0),e=s(this.position);return u(e,e,c(a(),this.right,o[0])),u(e,e,c(a(),this.up,o[1])),this._setPosition(e),this.triggerUpdate(),this},v.dolly=function(t){var n,o=this.forward,e=s(this.position);return e[0]+=(n=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*o[0],e[1]+=n*o[1],e[2]+=n*o[2],this._setPosition(e),this.type===i.CameraType.ORBITING||this.type===i.CameraType.EXPLORING?this._getDistance():this.type===i.CameraType.TRACKING&&u(this.focalPoint,e,this.distanceVector),this.triggerUpdate(),this},v.createLandmark=function(t,n){void 0===n&&(n={});var o=n.position,r=void 0===o?this.position:o,a=n.focalPoint,h=void 0===a?this.focalPoint:a,l=n.roll,u=n.zoom,c=new i.runtime.CameraContribution;c.setType(this.type,void 0),c.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),c.setFocalPoint(h[0],h[1]||this.focalPoint[1],h[2]||this.focalPoint[2]),c.setRoll(l||this.roll),c.setZoom(u||this.zoom);var m={name:t,matrix:e(c.getWorldTransform()),right:s(c.right),up:s(c.up),forward:s(c.forward),position:s(c.getPosition()),focalPoint:s(c.getFocalPoint()),distanceVector:s(c.getDistanceVector()),distance:c.getDistance(),dollyingStep:c.getDollyingStep(),azimuth:c.getAzimuth(),elevation:c.getElevation(),roll:c.getRoll(),relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.getZoom()};return this.landmarks.push(m),m},v.gotoLandmark=function(t,n){var o=this;void 0===n&&(n={});var e=b(t,"String")?this.landmarks.find((function(i){return i.name===t})):t;if(e){var r=b(n,"Number")?{duration:n}:n,s=r.easing,h=void 0===s?"linear":s,l=r.duration,u=void 0===l?100:l,c=r.easingFunction,m=void 0===c?void 0:c,f=r.onfinish,v=void 0===f?void 0:f;if(0===u)return this.syncFromLandmark(e),void(v&&v());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var g,y=e.position,A=e.focalPoint,P=e.zoom,x=e.roll,z=m||i.runtime.EasingFunction(h),F=function(){o.setFocalPoint(A),o.setPosition(y),o.setRoll(x),o.setZoom(P),o.computeMatrix(),o.triggerUpdate(),v&&v()};this.canvas.requestAnimationFrame((function t(i){void 0===g&&(g=i);var n=i-g;if(u<n)F();else{var e,r,s=z(n/u),h=a(),l=a();d(h,o.focalPoint,A,s),d(l,o.position,y,s),r=o.roll*(1-s)+x*s,e=o.zoom*(1-s)+P*s,o.setFocalPoint(h),o.setPosition(l),o.setRoll(r),o.setZoom(e),p(h,A)+p(l,y)>.01?(o.computeMatrix(),o.triggerUpdate(),u>n&&(o.landmarkAnimationID=o.canvas.requestAnimationFrame(t))):F()}}))}},v.syncFromLandmark=function(t){this.matrix=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t}(this.matrix,t.matrix),this.right=l(this.right,t.right),this.up=l(this.up,t.up),this.forward=l(this.forward,t.forward),this.position=l(this.position,t.position),this.focalPoint=l(this.focalPoint,t.focalPoint),this.distanceVector=l(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},f}(i.Camera);i.runtime.CameraContribution=_,t.AdvancedCamera=_,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "@antv/g-camera-api",
"version": "1.0.17",
"version": "1.0.18",
"description": "A simple implementation of Camera API.",

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

},
"gitHead": "c92278756907344ff54ebc6f6a83630559ef36ff"
"gitHead": "9c99243a29308d12fc22ab4f3290033771e53fcb"
}
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