You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
212 KiB

4 months ago
/*!
* @antv/g-camera-api
* @description A simple implementation of Camera API.
* @version 2.0.41
* @date 7/30/2025, 1:34:37 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CameraAPI={}))}(this,function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;e.length>r;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function h(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function v(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function p(t,e,n){return e=f(e),v(t,d()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o
/*!
* @antv/g-math
* @description Geometry util
* @version 3.0.1
* @date 7/30/2025, 1:34:14 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/function _e(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Ge(t,e){var n=Math.min.apply(Math,h(t)),r=Math.min.apply(Math,h(e));return{x:n,y:r,width:Math.max.apply(Math,h(t))-n,height:Math.max.apply(Math,h(e))-r}}function Fe(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function Be(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Ue(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=Fe(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,m=-1/0,g=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var k=p+x;o>a?k>a&&o>k&&g.push(k):k>o&&a>k&&g.push(k)}for(var M=0;g.length>M;M++){var b=Be(0,e,n,r,i,g[M]);y>b&&(y=b),b>m&&(m=b)}return{x:u,y:y,width:l-u,height:m-y}}function Ye(t,e,n,r){return _e(t,e,n,r)}function Ve(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function ze(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function je(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(jt(s,0))jt(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;jt(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function Xe(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=je(t,n,i,o),h=je(e,r,a,s),f=0;c.length>f;f++)u.push(ze(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(ze(e,r,a,s,h[d]));return Ge(u,l)}function We(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=_e(r[0],r[1],i[0],i[1])}return e}(t)}function He(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qe(t,e,n){var r=t+n-2*e;if(jt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ze(t,e,n,r,i,a){var o=qe(t,n,i)[0],s=qe(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(He(t,n,i,o)),void 0!==s&&l.push(He(e,r,a,s)),Ge(u,l)}function Ke(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Qe(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,v=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);v>d;){for(n(t,d,v),d++,v--;0>o(t[d],f);)d++;for(;o(t[v],f)>0;)v--}0===o(t[i],f)?n(t,i,v):n(t,++v,a),v>r||(i=v+1),r>v||(a=v-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}funct
//# sourceMappingURL=index.umd.min.js.map