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.
11 lines
7.9 KiB
11 lines
7.9 KiB
|
4 months ago
|
/*!
|
||
|
|
* @antv/g-plugin-canvas-path-generator
|
||
|
|
* @description A G plugin of path generator with Canvas2D API
|
||
|
|
* @version 2.1.22
|
||
|
|
* @date 7/30/2025, 1:35:25 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/
|
||
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CanvasPathGenerator={}),t.window.G)}(this,function(t,e){"use strict";function r(t){return r="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},r(t)}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function a(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 o(t,e){for(var r=0;e.length>r;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,n(a.key),a)}}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}function l(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)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 u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function f(t,e){var r=e.cx,n=e.cy;t.arc(void 0===r?0:r,void 0===n?0:n,e.r,0,2*Math.PI,!1)}function s(t,e){var r=e.cx,n=void 0===r?0:r,a=e.cy,o=void 0===a?0:a,i=e.rx,c=e.ry;if(t.ellipse)t.ellipse(n,o,i,c,0,0,2*Math.PI,!1);else{var l=i>c?i:c,u=i>c?1:i/c,f=i>c?c/i:1;t.save(),t.scale(u,f),t.arc(n,o,l,0,2*Math.PI)}}function h(t,r){var n=r.x1,a=r.y1,o=r.x2,i=r.y2,c=r.markerStart,l=r.markerEnd,u=r.markerStartOffset,f=r.markerEndOffset,s=0,h=0,p=0,y=0,v=0;c&&e.isDisplayObject(c)&&u&&(s=Math.cos(v=Math.atan2(i-a,o-n))*(u||0),h=Math.sin(v)*(u||0)),l&&e.isDisplayObject(l)&&f&&(p=Math.cos(v=Math.atan2(a-i,n-o))*(f||0),y=Math.sin(v)*(f||0)),t.moveTo(n+s,a+h),t.lineTo(o+p,i+y)}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);e>r;r++)n[r]=t[r];return n}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o,i,c=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,a=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,r){var n=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,i=r.markerEndOffset,c=r.d,l=c.absolutePath,u=c.segments,f=0,s=0,h=0,p=0,v=0;if(n&&e.isDisplayObject(n)&&o){var b=y(n.parentNode.getStartTangent(),2),d=b[0],m=b[1];f=Math.cos(v=Math.atan2(d[1]-m[1],d[0]-m[0]))*(o||0),s=Math.sin(v)*(o||0)}if(a&&e.isDisplayObject(a)&&i){var M=y(a.parentNode.getEndTangent(),2),O=M[0],S=M[1];h=Math.cos(v=Math.atan2(O[1]-S[1],O[0]-S[0]))*(i||0),p=Math.sin(v)*(i||0)}for(var g=0;l.length>g;g++){var P=l[g],T=P[0],j=l[g+1],E=(g===l.length-1||j&&("M"
|
||
|
|
//# sourceMappingURL=index.umd.min.js.map
|