Buckets:
| import{p as Mt}from"./Dr3kGfLs.js";import{g as Nt,j as zt,z as Lt,y as Tt,k as At,l as Xt,_ as u,R as Et,L as Yt,N as U,o as K,Q as It,p as Bt,A as Ft,m as V}from"./BZtIR7es.js";import{p as Rt}from"./BeYTgSQf.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),J=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);K.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{K.debug(`Rendering Wardley map | |
| `+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const Q=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(Q).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(Q.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=` | |
| M ${n} ${i-l/2} | |
| L ${n+p-f} ${i-l/2} | |
| L ${n+p-f} ${i-l/2-8} | |
| L ${n+p} ${i} | |
| L ${n+p-f} ${i+l/2+8} | |
| L ${n+p-f} ${i+l/2} | |
| L ${n} ${i+l/2} | |
| Z | |
| `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=` | |
| M ${n+p} ${i-l/2} | |
| L ${n+f} ${i-l/2} | |
| L ${n+f} ${i-l/2-8} | |
| L ${n} ${i} | |
| L ${n+f} ${i+l/2+8} | |
| L ${n+f} ${i+l/2} | |
| L ${n+p} ${i+l/2} | |
| Z | |
| `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),_t={draw:Vt},Zt=u(({wardley:o}={})=>{const r=Et(),e=Yt(),h=U(r,e.themeVariables),a=U(h.wardley,o);return` | |
| .wardley-background { | |
| fill: ${a.backgroundColor}; | |
| } | |
| .wardley-axes line, .wardley-axes path { | |
| stroke: ${a.axisColor}; | |
| } | |
| .wardley-axis-label { | |
| fill: ${a.axisTextColor}; | |
| } | |
| .wardley-stage-label { | |
| fill: ${a.axisTextColor}; | |
| } | |
| .wardley-grid line { | |
| stroke: ${a.gridColor}; | |
| } | |
| .wardley-node circle { | |
| fill: ${a.componentFill}; | |
| stroke: ${a.componentStroke}; | |
| } | |
| .wardley-node-label { | |
| fill: ${a.componentLabelColor}; | |
| } | |
| .wardley-link { | |
| stroke: ${a.linkStroke}; | |
| } | |
| .wardley-link--dashed { | |
| stroke-dasharray: 4 4; | |
| } | |
| .wardley-link-label { | |
| fill: ${a.axisTextColor}; | |
| } | |
| .wardley-trend line { | |
| stroke: ${a.evolutionStroke}; | |
| } | |
| .wardley-annotation-line { | |
| stroke: ${a.annotationStroke}; | |
| } | |
| .wardley-annotation circle { | |
| fill: ${a.annotationFill}; | |
| stroke: ${a.annotationStroke}; | |
| } | |
| .wardley-annotation text { | |
| fill: ${a.annotationTextColor}; | |
| } | |
| .wardley-annotations-box rect { | |
| fill: ${a.annotationFill}; | |
| stroke: ${a.annotationStroke}; | |
| } | |
| .wardley-annotations-box text { | |
| fill: ${a.annotationTextColor}; | |
| } | |
| .wardley-pipeline-box { | |
| stroke: ${a.componentStroke}; | |
| } | |
| .wardley-notes text { | |
| fill: ${a.axisTextColor}; | |
| } | |
| `},"styles"),te={parser:tt,db:Gt,renderer:_t,styles:Zt};export{te as diagram}; | |
Xet Storage Details
- Size:
- 25.4 kB
- Xet hash:
- d06522f31c964d0cf1f12feb1e4354886908c29780f1a8e799605fa13329a8bd
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.