9 lines
3.1 KiB
JavaScript
9 lines
3.1 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3805],{49127:(e,t,i)=>{i.d(t,{m:()=>a});var r=i(85448),a=class{constructor(e){this.init=e,this.records=this.init()}static{(0,r.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},73018:(e,t,i)=>{function r(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}i.d(t,{S:()=>r}),(0,i(85448).K2)(r,"populateCommonDb")},83805:(e,t,i)=>{i.d(t,{diagram:()=>D});var r=i(31311),a=i(73018),n=i(49127),s=i(50001),c=i(93913),d=i(85448),l=i(46229),o=new n.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),g=(0,d.K2)(()=>{o.reset(),(0,c.IU)()},"clear"),h=(0,d.K2)(()=>o.records.stack[0],"getRoot"),p=(0,d.K2)(()=>o.records.cnt,"getCount"),k=c.UI.treeView,w=(0,d.K2)(()=>(0,s.$t)(k,(0,c.zj)().treeView),"getConfig"),m={clear:g,addNode:(0,d.K2)((e,t)=>{for(;e<=o.records.stack[o.records.stack.length-1].level;)o.records.stack.pop();let i={id:o.records.cnt++,level:e,name:t,children:[]};o.records.stack[o.records.stack.length-1].children.push(i),o.records.stack.push(i)},"addNode"),getRoot:h,getCount:p,getConfig:w,getAccTitle:c.iN,getAccDescription:c.m7,getDiagramTitle:c.ab,setAccDescription:c.EI,setAccTitle:c.SV,setDiagramTitle:c.ke},b=(0,d.K2)(e=>{(0,a.S)(e,m),e.nodes.map(e=>m.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),u={parse:(0,d.K2)(async e=>{let t=await (0,l.qg)("treeView",e);d.Rm.debug(t),b(t)},"parse")},K=(0,d.K2)((e,t,i,r,a)=>{let n=r.append("text").text(i.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:c}=n.node().getBBox(),d=s+2*a.paddingY,l=c+2*a.paddingX;n.attr("x",e+a.paddingX),n.attr("y",t+d/2),i.BBox={x:e,y:t,width:l,height:d}},"positionLabel"),x=(0,d.K2)((e,t,i,r,a,n)=>e.append("line").attr("x1",t).attr("y1",i).attr("x2",r).attr("y2",a).attr("stroke-width",n).attr("class","treeView-node-line"),"positionLine"),T=(0,d.K2)((e,t,i)=>{let r=0,a=0,n=(0,d.K2)((e,t,i,n)=>{let s=n*(i.rowIndent+i.paddingX);K(s,r,t,e,i);let{height:c,width:d}=t.BBox;x(e,s-i.rowIndent,r+c/2,s,r+c/2,i.lineThickness),a=Math.max(a,s+d),r+=c},"drawNode"),s=(0,d.K2)((t,r=0)=>{n(e,t,i,r),t.children.forEach(e=>{s(e,r+1)});let{x:a,y:c,height:d}=t.BBox;if(t.children.length){let{y:r,height:n}=t.children[t.children.length-1].BBox;x(e,a+i.paddingX,c+d,a+i.paddingX,r+n/2+i.lineThickness/2,i.lineThickness)}},"processNode");return s(t),{totalHeight:r,totalWidth:a}},"drawTree"),f=(0,d.K2)((e,t,i,a)=>{d.Rm.debug("Rendering treeView diagram\n"+e);let n=a.db,s=n.getRoot(),l=n.getConfig(),o=(0,r.D)(t),g=o.append("g");g.attr("class","tree-view");let{totalHeight:h,totalWidth:p}=T(g,s,l);o.attr("viewBox",`-${l.lineThickness/2} 0 ${p} ${h}`),(0,c.a$)(o,h,p,l.useMaxWidth)},"draw"),B={labelFontSize:"16px",labelColor:"black",lineColor:"black"},D={db:m,renderer:{draw:f},parser:u,styles:(0,d.K2)(({treeView:e})=>{let{labelFontSize:t,labelColor:i,lineColor:r}=(0,s.$t)(B,e);return`
|
|
.treeView-node-label {
|
|
font-size: ${t};
|
|
fill: ${i};
|
|
}
|
|
.treeView-node-line {
|
|
stroke: ${r};
|
|
}
|
|
`},"styles")}}}]); |