New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-canvas-path-generator

Package Overview
Dependencies
Maintainers
61
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-canvas-path-generator - npm Package Compare versions

Comparing version 1.1.28 to 1.1.29

2

dist/index.umd.min.js

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

!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 a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function n(t,e){var a=e.r;t.arc(a,a,a,0,2*Math.PI,!1)}function r(t,e){var a=e.rx,n=e.ry;if(t.ellipse)t.ellipse(a,n,a,n,0,0,2*Math.PI,!1);else{var r=a>n?a:n,o=a>n?1:a/n,i=a>n?n/a:1;t.save(),t.scale(o,i),t.arc(0,0,r,0,2*Math.PI)}}function o(t,a){var n,r,o=a.x1,i=a.y1,s=a.x2,c=a.y2,h=a.defX,f=void 0===h?0:h,l=a.defY,p=void 0===l?0:l,d=a.markerStart,v=a.markerEnd,M=a.markerStartOffset,u=a.markerEndOffset,T=0,m=0,y=0,P=0,b=0;d&&d instanceof e.DisplayObject&&M&&(n=s-o,r=c-i,b=Math.atan2(r,n),T=Math.cos(b)*(M||0),m=Math.sin(b)*(M||0)),v&&v instanceof e.DisplayObject&&u&&(n=o-s,r=i-c,b=Math.atan2(r,n),y=Math.cos(b)*(u||0),P=Math.sin(b)*(u||0)),t.moveTo(o-f+T,i-p+m),t.lineTo(s-f+y,c-p+P)}function i(t,a){var n,r,o=a.defX,i=void 0===o?0:o,s=a.defY,c=void 0===s?0:s,h=a.markerStart,f=a.markerEnd,l=a.markerStartOffset,p=a.markerEndOffset,d=a.path,v=d.absolutePath,M=d.segments,u=0,T=0,m=0,y=0,P=0;if(h&&h instanceof e.DisplayObject&&l){var b=h.parentNode.getStartTangent(),O=b[0],S=b[1];n=O[0]-S[0],r=O[1]-S[1],P=Math.atan2(r,n),u=Math.cos(P)*(l||0),T=Math.sin(P)*(l||0)}if(f&&f instanceof e.DisplayObject&&p){var g=f.parentNode.getEndTangent(),k=g[0],I=g[1];n=k[0]-I[0],r=k[1]-I[1],P=Math.atan2(r,n),m=Math.cos(P)*(p||0),y=Math.sin(P)*(p||0)}for(var E=0;v.length>E;E++){var j=v[E],x=v[E+1],G=0===E&&(0!==u||0!==T),L=(E===v.length-1||x&&("M"===x[0]||"Z"===x[0]))&&0!==m&&0!==y;switch(j[0]){case"M":G?(t.moveTo(j[1]-i+u,j[2]-c+T),t.lineTo(j[1]-i,j[2]-c)):t.moveTo(j[1]-i,j[2]-c);break;case"L":L?t.lineTo(j[1]-i+m,j[2]-c+y):t.lineTo(j[1]-i,j[2]-c);break;case"Q":t.quadraticCurveTo(j[1]-i,j[2]-c,j[3]-i,j[4]-c),L&&t.lineTo(j[3]-i+m,j[4]-c+y);break;case"C":t.bezierCurveTo(j[1]-i,j[2]-c,j[3]-i,j[4]-c,j[5]-i,j[6]-c),L&&t.lineTo(j[5]-i+m,j[6]-c+y);break;case"A":var D=M[E].arcParams,A=D.cx,C=D.cy,w=D.rx,Y=D.ry,_=D.startAngle,N=D.endAngle,R=D.xRotation,X=D.sweepFlag;if(t.ellipse)t.ellipse(A-i,C-c,w,Y,R,_,N,!!(1-X));else{var F=w>Y?w:Y,H=w>Y?1:w/Y,q=w>Y?Y/w:1;t.translate(A-i,C-c),t.rotate(R),t.scale(H,q),t.arc(0,0,F,_,N,!!(1-X)),t.scale(1/H,1/q),t.rotate(-R),t.translate(-(A-i),-(C-c))}L&&t.lineTo(j[6]-i+m,j[7]-c+y);break;case"Z":t.closePath()}}}function s(t,a){var n,r,o=a.defX,i=void 0===o?0:o,s=a.defY,c=void 0===s?0:s,h=a.markerStart,f=a.markerEnd,l=a.markerStartOffset,p=a.markerEndOffset,d=a.points.points,v=d.length,M=d[0][0]-i,u=d[0][1]-c,T=d[v-1][0]-i,m=d[v-1][1]-c,y=0,P=0,b=0,O=0,S=0;h&&h instanceof e.DisplayObject&&l&&(n=d[1][0]-d[0][0],r=d[1][1]-d[0][1],S=Math.atan2(r,n),y=Math.cos(S)*(l||0),P=Math.sin(S)*(l||0)),f&&f instanceof e.DisplayObject&&p&&(n=d[v-1][0]-d[0][0],r=d[v-1][1]-d[0][1],S=Math.atan2(r,n),b=Math.cos(S)*(p||0),O=Math.sin(S)*(p||0)),t.moveTo(M+(y||b),u+(P||O));for(var g=1;v-1>g;g++){var k=d[g];t.lineTo(k[0]-i,k[1]-c)}t.lineTo(T,m)}function c(t,a){var n,r,o=a.defX,i=void 0===o?0:o,s=a.defY,c=void 0===s?0:s,h=a.markerStart,f=a.markerEnd,l=a.markerStartOffset,p=a.markerEndOffset,d=a.points.points,v=d.length,M=d[0][0]-i,u=d[0][1]-c,T=d[v-1][0]-i,m=d[v-1][1]-c,y=0,P=0,b=0,O=0,S=0;h&&h instanceof e.DisplayObject&&l&&(n=d[1][0]-d[0][0],r=d[1][1]-d[0][1],S=Math.atan2(r,n),y=Math.cos(S)*(l||0),P=Math.sin(S)*(l||0)),f&&f instanceof e.DisplayObject&&p&&(n=d[v-2][0]-d[v-1][0],r=d[v-2][1]-d[v-1][1],S=Math.atan2(r,n),b=Math.cos(S)*(p||0),O=Math.sin(S)*(p||0)),t.moveTo(M+y,u+P);for(var g=1;v-1>g;g++){var k=d[g];t.lineTo(k[0]-i,k[1]-c)}t.lineTo(T+b,m+O)}function h(t,e){var a=e.radius,n=e.width,r=e.height,o=n,i=r;if(a&&a.some((function(t){return 0!==t}))){var s=n>0?1:-1,c=r>0?1:-1,h=s+c===0,f=a.map((function(t){return e=t,a=0,n=Math.min(Math.abs(o)/2,Math.abs(i)/2),a>e?a:e>n?n:e;var e,a,n})),l=f[0],p=f[1],d=f[2],v=f[3];t.moveTo(s*l,0),t.lineTo(o-s*p,0),0!==p&&t.arc(o-s*p,c*p,p,-c*Math.PI/2,s>0?0:Math.PI,h),t.lineTo(o,i-c*d),0!==d&&t.arc(o-s*d,i-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(s*v,i),0!==v&&t.arc(s*v,i-c*v,v,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,h),t.lineTo(0,c*l),0!==l&&t.arc(s*l,c*l,l,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(0,0,o,i)}var f=function(t){var f,l;function p(){for(var e,a=arguments.length,n=new Array(a),r=0;a>r;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}l=t,(f=p).prototype=Object.create(l.prototype),f.prototype.constructor=f,a(f,l);var d=p.prototype;return d.init=function(){var t,a=((t={})[e.Shape.CIRCLE]=n,t[e.Shape.ELLIPSE]=r,t[e.Shape.RECT]=h,t[e.Shape.LINE]=o,t[e.Shape.POLYLINE]=c,t[e.Shape.POLYGON]=s,t[e.Shape.PATH]=i,t[e.Shape.TEXT]=void 0,t[e.Shape.GROUP]=void 0,t[e.Shape.IMAGE]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.pathGeneratorFactory=a},d.destroy=function(){delete this.context.pathGeneratorFactory},p}(e.AbstractRendererPlugin);t.Plugin=f,Object.defineProperty(t,"__esModule",{value:!0})}));
!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 a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function n(t,e){var a=e.r;t.arc(a,a,a,0,2*Math.PI,!1)}function r(t,e){var a=e.rx,n=e.ry;if(t.ellipse)t.ellipse(a,n,a,n,0,0,2*Math.PI,!1);else{var r=a>n?a:n,o=a>n?1:a/n,i=a>n?n/a:1;t.save(),t.scale(o,i),t.arc(0,0,r,0,2*Math.PI)}}function o(t,a){var n=a.x1,r=a.y1,o=a.x2,i=a.y2,s=a.defX,c=void 0===s?0:s,h=a.defY,f=void 0===h?0:h,l=a.markerStart,p=a.markerEnd,d=a.markerStartOffset,v=a.markerEndOffset,M=0,u=0,T=0,m=0,y=0;l&&l instanceof e.DisplayObject&&d&&(M=Math.cos(y=Math.atan2(i-r,o-n))*(d||0),u=Math.sin(y)*(d||0)),p&&p instanceof e.DisplayObject&&v&&(T=Math.cos(y=Math.atan2(r-i,n-o))*(v||0),m=Math.sin(y)*(v||0)),t.moveTo(n-c+M,r-f+u),t.lineTo(o-c+T,i-f+m)}function i(t,a){var n=a.defX,r=void 0===n?0:n,o=a.defY,i=void 0===o?0:o,s=a.markerStart,c=a.markerEnd,h=a.markerStartOffset,f=a.markerEndOffset,l=a.path,p=l.absolutePath,d=l.segments,v=0,M=0,u=0,T=0,m=0;if(s&&s instanceof e.DisplayObject&&h){var y=s.parentNode.getStartTangent(),P=y[0],b=y[1];v=Math.cos(m=Math.atan2(P[1]-b[1],P[0]-b[0]))*(h||0),M=Math.sin(m)*(h||0)}if(c&&c instanceof e.DisplayObject&&f){var O=c.parentNode.getEndTangent(),S=O[0],g=O[1];u=Math.cos(m=Math.atan2(S[1]-g[1],S[0]-g[0]))*(f||0),T=Math.sin(m)*(f||0)}for(var k=0;p.length>k;k++){var I=p[k],E=p[k+1],j=0===k&&(0!==v||0!==M),x=(k===p.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==u&&0!==T;switch(I[0]){case"M":j?(t.moveTo(I[1]-r+v,I[2]-i+M),t.lineTo(I[1]-r,I[2]-i)):t.moveTo(I[1]-r,I[2]-i);break;case"L":x?t.lineTo(I[1]-r+u,I[2]-i+T):t.lineTo(I[1]-r,I[2]-i);break;case"Q":t.quadraticCurveTo(I[1]-r,I[2]-i,I[3]-r,I[4]-i),x&&t.lineTo(I[3]-r+u,I[4]-i+T);break;case"C":t.bezierCurveTo(I[1]-r,I[2]-i,I[3]-r,I[4]-i,I[5]-r,I[6]-i),x&&t.lineTo(I[5]-r+u,I[6]-i+T);break;case"A":var G=d[k].arcParams,L=G.cx,D=G.cy,A=G.rx,C=G.ry,Y=G.startAngle,_=G.endAngle,w=G.xRotation,N=G.sweepFlag;if(t.ellipse)t.ellipse(L-r,D-i,A,C,w,Y,_,!!(1-N));else{var R=A>C?A:C,X=A>C?1:A/C,F=A>C?C/A:1;t.translate(L-r,D-i),t.rotate(w),t.scale(X,F),t.arc(0,0,R,Y,_,!!(1-N)),t.scale(1/X,1/F),t.rotate(-w),t.translate(-(L-r),-(D-i))}x&&t.lineTo(I[6]-r+u,I[7]-i+T);break;case"Z":t.closePath()}}}function s(t,a){var n=a.defX,r=void 0===n?0:n,o=a.defY,i=void 0===o?0:o,s=a.markerStart,c=a.markerEnd,h=a.markerStartOffset,f=a.markerEndOffset,l=a.points.points,p=l.length,d=l[0][0]-r,v=l[0][1]-i,M=l[p-1][0]-r,u=l[p-1][1]-i,T=0,m=0,y=0,P=0,b=0;s&&s instanceof e.DisplayObject&&h&&(T=Math.cos(b=Math.atan2(l[1][1]-l[0][1],l[1][0]-l[0][0]))*(h||0),m=Math.sin(b)*(h||0)),c&&c instanceof e.DisplayObject&&f&&(y=Math.cos(b=Math.atan2(l[p-1][1]-l[0][1],l[p-1][0]-l[0][0]))*(f||0),P=Math.sin(b)*(f||0)),t.moveTo(d+(T||y),v+(m||P));for(var O=1;p-1>O;O++){var S=l[O];t.lineTo(S[0]-r,S[1]-i)}t.lineTo(M,u)}function c(t,a){var n=a.defX,r=void 0===n?0:n,o=a.defY,i=void 0===o?0:o,s=a.markerStart,c=a.markerEnd,h=a.markerStartOffset,f=a.markerEndOffset,l=a.points.points,p=l.length,d=l[0][0]-r,v=l[0][1]-i,M=l[p-1][0]-r,u=l[p-1][1]-i,T=0,m=0,y=0,P=0,b=0;s&&s instanceof e.DisplayObject&&h&&(T=Math.cos(b=Math.atan2(l[1][1]-l[0][1],l[1][0]-l[0][0]))*(h||0),m=Math.sin(b)*(h||0)),c&&c instanceof e.DisplayObject&&f&&(y=Math.cos(b=Math.atan2(l[p-2][1]-l[p-1][1],l[p-2][0]-l[p-1][0]))*(f||0),P=Math.sin(b)*(f||0)),t.moveTo(d+T,v+m);for(var O=1;p-1>O;O++){var S=l[O];t.lineTo(S[0]-r,S[1]-i)}t.lineTo(M+y,u+P)}function h(t,e){var a=e.radius,n=e.width,r=e.height,o=n,i=r;if(a&&a.some((function(t){return 0!==t}))){var s=n>0?1:-1,c=r>0?1:-1,h=s+c===0,f=a.map((function(t){return e=t,a=0,n=Math.min(Math.abs(o)/2,Math.abs(i)/2),a>e?a:e>n?n:e;var e,a,n})),l=f[0],p=f[1],d=f[2],v=f[3];t.moveTo(s*l,0),t.lineTo(o-s*p,0),0!==p&&t.arc(o-s*p,c*p,p,-c*Math.PI/2,s>0?0:Math.PI,h),t.lineTo(o,i-c*d),0!==d&&t.arc(o-s*d,i-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(s*v,i),0!==v&&t.arc(s*v,i-c*v,v,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,h),t.lineTo(0,c*l),0!==l&&t.arc(s*l,c*l,l,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(0,0,o,i)}var f=function(t){var f,l;function p(){for(var e,a=arguments.length,n=Array(a),r=0;a>r;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}(f=p).prototype=Object.create((l=t).prototype),f.prototype.constructor=f,a(f,l);var d=p.prototype;return d.init=function(){var t,a=((t={})[e.Shape.CIRCLE]=n,t[e.Shape.ELLIPSE]=r,t[e.Shape.RECT]=h,t[e.Shape.LINE]=o,t[e.Shape.POLYLINE]=c,t[e.Shape.POLYGON]=s,t[e.Shape.PATH]=i,t[e.Shape.TEXT]=void 0,t[e.Shape.GROUP]=void 0,t[e.Shape.IMAGE]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.pathGeneratorFactory=a},d.destroy=function(){delete this.context.pathGeneratorFactory},p}(e.AbstractRendererPlugin);t.Plugin=f,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -5,3 +5,3 @@ import type { ParsedBaseStyleProps } from '@antv/g-lite';

*/
export declare type PathGenerator<T extends ParsedBaseStyleProps> = (context: CanvasRenderingContext2D, attributes: T) => void;
export type PathGenerator<T extends ParsedBaseStyleProps> = (context: CanvasRenderingContext2D, attributes: T) => void;
//# sourceMappingURL=interfaces.d.ts.map
{
"name": "@antv/g-plugin-canvas-path-generator",
"version": "1.1.28",
"version": "1.1.29",
"description": "A G plugin of path generator with Canvas2D API",

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

"dependencies": {
"@antv/g-math": "^1.7.28",
"@antv/g-math": "^1.7.29",
"@antv/util": "^3.3.1",

@@ -47,3 +47,3 @@ "tslib": "^2.3.1"

},
"gitHead": "c92278756907344ff54ebc6f6a83630559ef36ff"
"gitHead": "9c99243a29308d12fc22ab4f3290033771e53fcb"
}

Sorry, the diff of this file is not supported yet

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