livebook/static/js/302.js

1 line
9.7 KiB
JavaScript
Raw Normal View History

2023-05-26 20:28:36 +08:00
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[302],{78302:(t,e,a)=>{a.d(e,{diagram:()=>g});var r=a(72970),n=a(74309),i=a(29451),d=a(45625),s=a(31460),o=a(12711);a(93628),a(17967),a(27856);let l={};const p=function(t){const e=Object.entries(l).find((e=>e[1].label===t));if(e)return e[0]},c={draw:function(t,e,a,r){const c=(0,s.c)().class;l={},s.l.info("Rendering diagram "+t);const g=(0,s.c)().securityLevel;let h;"sandbox"===g&&(h=(0,n.Ys)("#i"+e));const f="sandbox"===g?(0,n.Ys)(h.nodes()[0].contentDocument.body):(0,n.Ys)("body"),u=f.select(`[id='${e}']`);var x;(x=u).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),x.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),x.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),x.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),x.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),x.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),x.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),x.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");const y=new d.k({multigraph:!0});y.setGraph({isMultiGraph:!0}),y.setDefaultEdgeLabel((function(){return{}}));const b=r.db.getClasses(),m=Object.keys(b);for(const t of m){const e=b[t],a=o.s.drawClass(u,e,c,r);l[a.id]=a,y.setNode(a.id,a),s.l.info("Org height: "+a.height)}r.db.getRelations().forEach((function(t){s.l.info("tjoho"+p(t.id1)+p(t.id2)+JSON.stringify(t)),y.setEdge(p(t.id1),p(t.id2),{relation:t},t.title||"DEFAULT")})),r.db.getNotes().forEach((function(t){s.l.debug(`Adding note: ${JSON.stringify(t)}`);const e=o.s.drawNote(u,t,c,r);l[e.id]=e,y.setNode(e.id,e),t.class&&t.class in b&&y.setEdge(t.id,p(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),(0,i.bK)(y),y.nodes().forEach((function(t){void 0!==t&&void 0!==y.node(t)&&(s.l.debug("Node "+t+": "+JSON.stringify(y.node(t))),f.select("#"+(r.db.lookUpDomId(t)||t)).attr("transform","translate("+(y.node(t).x-y.node(t).width/2)+","+(y.node(t).y-y.node(t).height/2)+" )"))})),y.edges().forEach((function(t){void 0!==t&&void 0!==y.edge(t)&&(s.l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(y.edge(t))),o.s.drawEdge(u,y.edge(t),y.edge(t).relation,c,r))}));const w=u.node().getBBox(),k=w.width+40,E=w.height+40;(0,s.i)(u,E,k,c.useMaxWidth);const L=`${w.x-20} ${w.y-20} ${k} ${E}`;s.l.debug(`viewBox ${L}`),u.attr("viewBox",L)}},g={parser:r.p,db:r.d,renderer:c,styles:r.s,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,r.d.clear()}}},12711:(t,e,a)=>{a.d(e,{p:()=>s,s:()=>p});var r=a(74309),n=a(31460);let i=0;const d=function(t){let e=t.id;return t.type&&(e+="<"+t.type+">"),e},s=function(t){let e="",a="",r="",i="",d=t.substring(0,1),s=t.substring(t