grapper
Version:
Data Visualization Microframework
1 lines • 958 B
JavaScript
/* grapper - 1.1.0-beta.3 [plugin.shapes] */ (()=>{var M=n=>Math.round(n*1e4)/1e4;function h(n){return(n-90)*Math.PI/180}function c(n,e,o,i){let t=h(i);return{x:M(n+o*Math.cos(t)),y:M(e+o*Math.sin(t))}}function a(n,e,o,i,t=0){t=Math.abs(t)>=360?t%360:t,i=Math.abs(i)>360?i%360:i,i=Math.abs(i)===360?i>0?359.9:-359.9:i;let l=t+i,u=i>0?1:0,f=Math.abs(l-t)<=180?0:1,b=t<0?(360+t)%360:t,m=l<0?(360+l)%360:l,$=c(n,e,o,b),s=c(n,e,o,m);return`M${$.x},${$.y}A${o},${o},0,${f},${u},${s.x},${s.y}`}function d(n,e,o,i,t,l=0){let u=a(n,e,o+i/2,t,l),f=a(n,e,o-i/2,-t,l+t);return u+"L"+f.substring(1)+"Z"}function x(n,e,o,i,t=0){return`${a(n,e,o,i,t)}L${n},${e}Z`}function P(n){n.extendConstructor({polar2cartesian:c,degrees2radians:h}),n.extendview&&n.extendview({polar2cartesian:c,degrees2radians:h}),n.extendPath({arc:a,barArc:d,circleSlice:x})}var r=P;globalThis.gSVG&&globalThis.gSVG.install(r);customElements.whenDefined("grapper-view").then(n=>{n.install(r)});})();