@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 1.63 kB
JavaScript
function mxShapeNetworksBus(e,o,t,r){mxShape.call(this),this.bounds=e,this.fill=o,this.stroke=t,this.strokewidth=null!=r?r:1}function mxShapeNetworksCommLinkEdge(){mxArrow.call(this)}mxUtils.extend(mxShapeNetworksBus,mxShape),mxShapeNetworksBus.prototype.cst={SHAPE_BUS:"mxgraph.networks.bus"},mxShapeNetworksBus.prototype.paintVertexShape=function(e,o,t,r,s){e.translate(o,t),this.background(e,o,t,r,s),e.setShadow(!1),this.foreground(e,o,t,r,s)},mxShapeNetworksBus.prototype.background=function(e,o,t,r,s){e.begin(),e.moveTo(8,.5*s+10),e.arcTo(12,12,0,0,1,8,.5*s-10),e.lineTo(r-8,.5*s-10),e.arcTo(12,12,0,0,1,r-8,.5*s+10),e.close(),e.fillAndStroke()},mxShapeNetworksBus.prototype.foreground=function(e,o,t,r,s){e.setFillColor("#ffffff"),e.begin(),e.moveTo(r-8,.5*s-10),e.arcTo(12,12,0,0,1,r-8,.5*s+10),e.arcTo(12,12,0,0,1,r-8,.5*s-10),e.fillAndStroke()},mxCellRenderer.registerShape(mxShapeNetworksBus.prototype.cst.SHAPE_BUS,mxShapeNetworksBus),mxUtils.extend(mxShapeNetworksCommLinkEdge,mxArrow),mxShapeNetworksCommLinkEdge.prototype.paintEdgeShape=function(e,o){var t=o[0],r=o[o.length-1],s=r.x-t.x,n=r.y-t.y;t.x=t.x+.05*s,t.y=t.y+.05*n,r.x=r.x-.05*s,r.y=r.y-.05*n,s=r.x-t.x,n=r.y-t.y;var i=Math.sqrt(s*s+n*n),a=s/i,x=n/i,m=t.x+.5*s,l=t.y+.5*n,p=m+a*i/3*.1-x/3*i*.1,h=l+x*i/3*.1+a/3*i*.1,k=m+a*i*.1+x*i*.1,S=l+x*i*.1-a*i*.1,u=m-a*i/3*.1+x/3*i*.1,d=l-x*i/3*.1-a/3*i*.1,c=m-a*i*.1-x*i*.1,f=l-x*i*.1+a*i*.1;e.begin(),e.moveTo(t.x,t.y),e.lineTo(k,S),e.lineTo(p,h),e.lineTo(r.x,r.y),e.lineTo(c,f),e.lineTo(u,d),e.close(),e.fillAndStroke()},mxCellRenderer.registerShape("mxgraph.networks.comm_link_edge",mxShapeNetworksCommLinkEdge);