livebook/static/assets/chunk-RNCRXQUO.js

5 lines
31 KiB
JavaScript
Raw Normal View History

2024-01-24 23:02:24 +08:00
import{a as Q}from"./chunk-RB5OF3IH.js";import{$a as w,F as K,Fa as x,H as G,Ha as V,Ia as N,Ya as W,h as E,ob as A}from"./chunk-KR7JTV7U.js";var ct=(a,t,r,n)=>{t.forEach(e=>{ut[e](a,r,n)})},ht=(a,t,r)=>{x.trace("Making markers for ",r),a.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),a.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},ot=(a,t,r)=>{a.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).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"),a.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).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")},ft=(a,t,r)=>{a.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).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"),a.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).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")},pt=(a,t,r)=>{a.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).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"),a.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).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")},yt=(a,t,r)=>{a.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),a.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},dt=(a,t,r)=>{a.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),a.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},xt=(a,t,r)=>{a.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","a
2023-10-06 00:34:57 +08:00
outsidePoint: ${JSON.stringify(t)}
insidePoint : ${JSON.stringify(r)}
node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);let n=a.x,e=a.y,i=Math.abs(n-r.x),s=a.width/2,l=r.x<t.x?s-i:s+i,c=a.height/2,o=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(e-t.y)*s>Math.abs(n-t.x)*c){let f=r.y<t.y?t.y-c-e:e-c-t.y;l=h*f/o;let y={x:r.x<t.x?r.x+l:r.x-h+l,y:r.y<t.y?r.y+o-f:r.y-o+f};return l===0&&(y.x=t.x,y.y=t.y),h===0&&(y.x=t.x),o===0&&(y.y=t.y),x.warn(`abc89 topp/bott calc, Q ${o}, q ${f}, R ${h}, r ${l}`,y),y}else{r.x<t.x?l=t.x-s-n:l=n-s-t.x;let f=o*l/h,y=r.x<t.x?r.x+h-l:r.x-h+l,p=r.y<t.y?r.y+f:r.y-f;return x.warn(`sides calc abc89, Q ${o}, q ${f}, R ${h}, r ${l}`,{_x:y,_y:p}),l===0&&(y=t.x,p=t.y),h===0&&(y=t.x),o===0&&(p=t.y),{x:y,y:p}}},st=(a,t)=>{x.warn("abc88 cutPathAtIntersect",a,t);let r=[],n=a[0],e=!1;return a.forEach(i=>{if(x.info("abc88 checking point",i,t),!qt(t,i)&&!e){let s=Kt(t,n,i);x.warn("abc88 inside",i,n,s),x.warn("abc88 intersection",s);let l=!1;r.forEach(c=>{l=l||c.x===s.x&&c.y===s.y}),r.some(c=>c.x===s.x&&c.y===s.y)?x.warn("abc88 no intersect",s,r):r.push(s),e=!0}else x.warn("abc88 outside",i,n),n=i,e||r.push(i)}),x.warn("abc88 returning points",r),r},hr=function(a,t,r,n,e,i,s){let l=r.points,c=!1,o=i.node(t.v);var h=i.node(t.w);x.info("abc88 InsertEdge: ",r),h.intersect&&o.intersect&&(l=l.slice(1,r.points.length-1),l.unshift(o.intersect(l[0])),x.info("Last point",l[l.length-1],h,h.intersect(l[l.length-1])),l.push(h.intersect(l[l.length-1]))),r.toCluster&&(x.info("to cluster abc88",n[r.toCluster]),l=st(r.points,n[r.toCluster].node),c=!0),r.fromCluster&&(x.info("from cluster abc88",n[r.fromCluster]),l=st(l.reverse(),n[r.fromCluster].node).reverse(),c=!0);let f=l.filter(C=>!Number.isNaN(C.y)),y=G;r.curve&&(e==="graph"||e==="flowchart")&&(y=r.curve);let{x:p,y:u}=Vt(r),k=K().x(p).y(u).curve(y),g;switch(r.thickness){case"normal":g="edge-thickness-normal";break;case"thick":g="edge-thickness-thick";break;case"invisible":g="edge-thickness-thick";break;default:g=""}switch(r.pattern){case"solid":g+=" edge-pattern-solid";break;case"dotted":g+=" edge-pattern-dotted";break;case"dashed":g+=" edge-pattern-dashed";break}let d=a.append("path").attr("d",k(f)).attr("id",r.id).attr("class"," "+g+(r.classes?" "+r.classes:"")).attr("style",r.style),b="";switch((w().flowchart.arrowMarkerAbsolute||w().state.arrowMarkerAbsolute)&&(b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)")),x.info("arrowTypeStart",r.arrowTypeStart),x.info("arrowTypeEnd",r.arrowTypeEnd),r.arrowTypeStart){case"arrow_cross":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-crossStart)");break;case"arrow_point":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-pointStart)");break;case"arrow_barb":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-barbStart)");break;case"arrow_circle":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-circleStart)");break;case"aggregation":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-aggregationStart)");break;case"extension":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-extensionStart)");break;case"composition":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-compositionStart)");break;case"dependency":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-dependencyStart)");break;case"lollipop":d.attr("marker-start","url("+b+"#"+s+"_"+e+"-lollipopStart)");break}switch(r.arrowTypeEnd){case"arrow_cross":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-crossEnd)");break;case"arrow_point":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-pointEnd)");break;case"arrow_barb":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-barbEnd)");break;case"arrow_circle":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-circleEnd)");break;case"aggregation":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-aggregationEnd)");break;case"extension":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-extensionEnd)");break;case"composition":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-compositionEnd)");break;case"dependency":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-dependencyEnd)");break;case"lollipop":d.attr("marker-end","url("+b+"#"+s+"_"+e+"-lollipopEnd)");break}let M={};return c&&(M.upda