ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
2 lines (1 loc) • 2.53 kB
JavaScript
const g=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs");var O=g.__name((r,n)=>{if(n)return"translate("+-r.width/2+", "+-r.height/2+")";const f=r.x??0,e=r.y??0;return"translate("+-(f+r.width/2)+", "+-(e+r.height/2)+")"},"computeLabelTransform"),c={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},_={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function T(r,n){if(r===void 0||n===void 0)return{angle:0,deltaX:0,deltaY:0};r=t(r),n=t(n);const[f,e]=[r.x,r.y],[s,i]=[n.x,n.y],a=s-f,m=i-e;return{angle:Math.atan(m/a),deltaX:a,deltaY:m}}g.__name(T,"calculateDeltaAndAngle");var t=g.__name(r=>Array.isArray(r)?{x:r[0],y:r[1]}:r,"pointTransformer"),b=g.__name(r=>({x:g.__name(function(n,f,e){let s=0;const i=t(e[0]).x<t(e[e.length-1]).x?"left":"right";if(f===0&&Object.hasOwn(c,r.arrowTypeStart)){const{angle:o,deltaX:y}=T(e[0],e[1]);s=c[r.arrowTypeStart]*Math.cos(o)*(y>=0?1:-1)}else if(f===e.length-1&&Object.hasOwn(c,r.arrowTypeEnd)){const{angle:o,deltaX:y}=T(e[e.length-1],e[e.length-2]);s=c[r.arrowTypeEnd]*Math.cos(o)*(y>=0?1:-1)}const a=Math.abs(t(n).x-t(e[e.length-1]).x),m=Math.abs(t(n).y-t(e[e.length-1]).y),l=Math.abs(t(n).x-t(e[0]).x),p=Math.abs(t(n).y-t(e[0]).y),h=c[r.arrowTypeStart],u=c[r.arrowTypeEnd],w=1;if(a<u&&a>0&&m<u){let o=u+w-a;o*=i==="right"?-1:1,s-=o}if(l<h&&l>0&&p<h){let o=h+w-l;o*=i==="right"?-1:1,s+=o}return t(n).x+s},"x"),y:g.__name(function(n,f,e){let s=0;const i=t(e[0]).y<t(e[e.length-1]).y?"down":"up";if(f===0&&Object.hasOwn(c,r.arrowTypeStart)){const{angle:o,deltaY:y}=T(e[0],e[1]);s=c[r.arrowTypeStart]*Math.abs(Math.sin(o))*(y>=0?1:-1)}else if(f===e.length-1&&Object.hasOwn(c,r.arrowTypeEnd)){const{angle:o,deltaY:y}=T(e[e.length-1],e[e.length-2]);s=c[r.arrowTypeEnd]*Math.abs(Math.sin(o))*(y>=0?1:-1)}const a=Math.abs(t(n).y-t(e[e.length-1]).y),m=Math.abs(t(n).x-t(e[e.length-1]).x),l=Math.abs(t(n).y-t(e[0]).y),p=Math.abs(t(n).x-t(e[0]).x),h=c[r.arrowTypeStart],u=c[r.arrowTypeEnd],w=1;if(a<u&&a>0&&m<u){let o=u+w-a;o*=i==="up"?-1:1,s-=o}if(l<h&&l>0&&p<h){let o=h+w-l;o*=i==="up"?-1:1,s+=o}return t(n).y+s},"y")}),"getLineFunctionsWithOffset");Object.defineProperty(exports,"computeLabelTransform",{enumerable:!0,get:function(){return O}});Object.defineProperty(exports,"getLineFunctionsWithOffset",{enumerable:!0,get:function(){return b}});Object.defineProperty(exports,"markerOffsets",{enumerable:!0,get:function(){return c}});Object.defineProperty(exports,"markerOffsets2",{enumerable:!0,get:function(){return _}});