graphane
Version:
Data Visualization Microframework
1 lines • 866 B
JavaScript
/* graphane - 1.0.1 [module:plugin.shapes] */ var h=n=>Math.round(n*1e4)/1e4;function f(n){return(n-90)*Math.PI/180}function u(n,e,i,t){let o=f(t);return{x:h(n+i*Math.cos(o)),y:h(e+i*Math.sin(o))}}function l(n,e,i,t,o=0){o=Math.abs(o)>=360?o%360:o,t=Math.abs(t)>360?t%360:t,t=Math.abs(t)===360?t>0?359.9:-359.9:t;let c=o+t,a=t>0?1:0,$=Math.abs(c-o)<=180?0:1,b=o<0?(360+o)%360:o,s=c<0?(360+c)%360:c,r=u(n,e,i,b),M=u(n,e,i,s);return`M${r.x},${r.y}A${i},${i},0,${$},${a},${M.x},${M.y}`}function x(n,e,i,t,o,c=0){let a=l(n,e,i+t/2,o,c),$=l(n,e,i-t/2,-o,c+o);return a+"L"+$.substring(1)+"Z"}function d(n,e,i,t,o=0){return`${l(n,e,i,t,o)}L${n},${e}Z`}function m(n){n.extendConstructor({polar2cartesian:u,degrees2radians:f}),n.extendComposer&&n.extendComposer({polar2cartesian:u,degrees2radians:f}),n.extendPath({arc:l,barArc:x,circleSlice:d})}var P=m;export{P as default};