You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[5947],{51916:(e,t,a)=>{a.d(t,{S:()=>l});var s=a(6047);function l(e,t){if(e.accDescr){t.setAccDescription?.(e.accDescr)}if(e.accTitle){t.setAccTitle?.(e.accTitle)}if(e.title){t.setDiagramTitle?.(e.title)}}(0,s.K2)(l,"populateCommonDb")},35645:(e,t,a)=>{a.d(t,{P:()=>l});var s=a(6047);var l=(0,s.K2)(((e,t,a,l)=>{e.attr("class",a);const{width:o,height:c,x:i,y:d}=n(e,t);(0,s.a$)(e,c,o,l);const p=r(i,d,o,c,t);e.attr("viewBox",p);s.Rm.debug(`viewBox configured: ${p} with padding: ${t}`)}),"setupViewPortForSVG");var n=(0,s.K2)(((e,t)=>{const a=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:a.width+t*2,height:a.height+t*2,x:a.x,y:a.y}}),"calculateDimensionsWithPadding");var r=(0,s.K2)(((e,t,a,s,l)=>`${e-l} ${t-l} ${a} ${s}`),"createViewBox")},95947:(e,t,a)=>{a.d(t,{diagram:()=>k});var s=a(35645);var l=a(80693);var n=a(51916);var r=a(52724);var o=a(84222);var c=a(6047);var i=a(24010);var d=a(1218);var p=class{constructor(){this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.setAccTitle=c.SV;this.getAccTitle=c.iN;this.setDiagramTitle=c.ke;this.getDiagramTitle=c.ab;this.getAccDescription=c.m7;this.setAccDescription=c.EI}static{(0,c.K2)(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const e=c.UI;const t=(0,c.zj)();return(0,r.$t)({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e);this.levels.set(e,t);if(t===0){this.outerNodes.push(e);this.root??=e}}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){const a=this.classes.get(e)??{id:e,styles:[],textStyles:[]};const s=t.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(s){s.forEach((e=>{if((0,l.KX)(e)){if(a?.textStyles){a.textStyles.push(e)}else{a.textStyles=[e]}}if(a?.styles){a.styles.push(e)}else{a.styles=[e]}}))}this.classes.set(e,a)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){(0,c.IU)();this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.root=void 0}};function h(e){if(!e.length){return[]}const t=[];const a=[];e.forEach((e=>{const s={name:e.name,children:e.type==="Leaf"?void 0:[]};s.classSelector=e?.classSelector;if(e?.cssCompiledStyles){s.cssCompiledStyles=[e.cssCompiledStyles]}if(e.type==="Leaf"&&e.value!==void 0){s.value=e.value}while(a.length>0&&a[a.length-1].level>=e.level){a.pop()}if(a.length===0){t.push(s)}else{const e=a[a.length-1].node;if(e.children){e.children.push(s)}else{e.children=[s]}}if(e.type!=="Leaf"){a.push({node:s,level:e.level})}}));return t}(0,c.K2)(h,"buildHierarchy");var f=(0,c.K2)(((e,t)=>{(0,n.S)(e,t);const a=[];for(const n of e.TreemapRows??[]){if(n.$type==="ClassDefStatement"){t.addClass(n.className??"",n.styleText??"")}}for(const n of e.TreemapRows??[]){const e=n.item;if(!e){continue}const s=n.indent?parseInt(n.indent):0;const l=m(e);const r=e.classSelector?t.getStylesForClass(e.classSelector):[];const o=r.length>0?r.join(";"):void 0;const c={level:s,name:l,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:o};a.push(c)}const s=h(a);const l=(0,c.K2)(((e,a)=>{for(const s of e){t.addNode(s,a);if(s.children&&s.children.length>0){l(s.children,a+1)}}}),"addNodesRecursively");l(s,0)}),"populate");var m=(0,c.K2)((e=>e.name?String(e.name):""),"getItemName");var y={parser:{yy:void 0},parse:(0,c.K2)((async e=>{try{const t=i.qg;const a=await t("treemap",e);c.Rm.debug("Treemap AST:",a);const s=y.parser?.yy;if(!(s instanceof p)){throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}f(a,s)}catch(t){c.Rm.error("Error parsing treemap:",t);throw t}}),"parse")};var u=10;var S=10;var g=25;var x=(0,c.K2)(((e,t,a,n)=>{const r=n.db;const i=r.getConfig();const p=i.padding??u;const h=r.getDiagramTitle();const f=r.getRoot();const{themeVariables:m}=(0,c.zj)();if(!f){return}const y=h?30:0;const x=(0,o.D)(t);const v=i.nodeWidth?i.nodeWidth*S:960;const b=i.nodeHeight?i.nodeHeight*S:500;const w=v;const $=b+y;x.attr("viewBox",`0 0 ${w} ${$}`);(0,c.a$)(x,$,w,i.useMaxWidth);let C;try{const e=i.valueFormat||",";if(e==="$0,0"){C=(0,c.K2)((e=>"$"+(0,d.GPZ)(",")(e)),"valueFormat")}else if(e.startsWith("$")&&e.includes(",")){const t=/\.\d+/.exec(e);const a=t?t[0]:"";C=(0,c.K2)((e=>"$"+(0,d.GPZ)(","+a)(e)),"valueFormat")}else if(e.startsWith("$")){const t=e.substring(1);C=(0,c.K2)((e=>"$"+(0,d.GPZ)(t||"")(e)),"valueFormat")}else{C=(0,d.GPZ)(e)}}catch(R){c.Rm.error("Error creating format function:",R);C=(0,d.GPZ)(",")}const k=(0,d.UMr)().range(["transparent",m.cScale0,m.cScale1,m.cScale2,m.cScale3,m.cScale4,m.cScale5,m.cScale6,m.cScale7,m.cScale8,m.cScale9,m.cScale10,m.cScale11]);const L=(0,d.UMr)().range(["transparent",m.cScalePeer0,m.cScalePeer1,m.cScalePeer2,m.cScalePeer3,m.cScalePeer4,m.cScalePeer5,m.cScalePeer6,m.cScalePeer7,m.cScalePeer8,m.cScalePeer9,m.cScalePeer10,m.cScalePeer11]);const T=(0,d.UMr)().range([m.cScaleLabel0,m.cScaleLabel1,m.cScaleLabel2,m.cScaleLabel3,m.cScaleLabel4,m.cScaleLabel5,m.cScaleLabel6,m.cScaleLabel7,m.cScaleLabel8,m.cScaleLabel9,m.cScaleLabel10,m.cScaleLabel11]);if(h){x.append("text").attr("x",w/2).attr("y",y/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h)}const M=x.append("g").attr("transform",`translate(0, ${y})`).attr("class","treemapContainer");const P=(0,d.Sk5)(f).sum((e=>e.value??0)).sort(((e,t)=>(t.value??0)-(e.value??0)));const z=(0,d.hkb)().size([v,b]).paddingTop((e=>e.children&&e.children.length>0?g+S:0)).paddingInner(p).paddingLeft((e=>e.children&&e.children.length>0?S:0)).paddingRight((e=>e.children&&e.children.length>0?S:0)).paddingBottom((e=>e.children&&e.children.length>0?S:0)).round(true);const F=z(P);const K=F.descendants().filter((e=>e.children&&e.children.length>0));const D=M.selectAll(".treemapSection").data(K).enter().append("g").attr("class","treemapSection").attr("transform",(e=>`translate(${e.x0},${e.y0})`));D.append("rect").attr("width",(e=>e.x1-e.x0)).attr("height",g).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",(e=>{if(e.depth===0){return"display: none;"}return""}));D.append("clipPath").attr("id",((e,a)=>`clip-section-${t}-${a}`)).append("rect").attr("width",(e=>Math.max(0,e.x1-e.x0-12))).attr("height",g);D.append("rect").attr("width",(e=>e.x1-e.x0)).attr("height",(e=>e.y1-e.y0)).attr("class",((e,t)=>`treemapSection section${t}`)).attr("fill",(e=>k(e.data.name))).attr("fill-opacity",.6).attr("stroke",(e=>L(e.data.name))).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",(e=>{if(e.depth===0){return"display: none;"}const t=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}));D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",g/2).attr("dominant-baseline","middle").text((e=>e.depth===0?"":e.data.name)).attr("font-weight","bold").attr("style",(e=>{if(e.depth===0){return"display: none;"}const t="dominant-baseline: middle; font-size: 12px; fill:"+T(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";const a=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t+a.labelStyles.replace("color:","fill:")})).each((function(e){if(e.depth===0){return}const t=(0,d.Ltv)(this);const a=e.data.name;t.text(a);const s=e.x1-e.x0;const l=6;let n;if(i.showValues!==false&&e.value){const e=s-10;const t=30;const a=10;const r=e-t-a;n=r-l}else{const e=6;n=s-l-e}const r=15;const o=Math.max(r,n);const c=t.node();const p=c.getComputedTextLength();if(p>o){const e="...";let s=a;while(s.length>0){s=a.substring(0,s.length-1);if(s.length===0){t.text(e);if(c.getComputedTextLength()>o){t.text("")}break}t.text(s+e);if(c.getComputedTextLength()<=o){break}}}}));if(i.showValues!==false){D.append("text").attr("class","treemapSectionValue").attr("x",(e=>e.x1-e.x0-10)).attr("y",g/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((e=>e.value?C(e.value):"")).attr("font-style","italic").attr("style",(e=>{if(e.depth===0){return"display: none;"}const t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+T(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";const a=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t+a.labelStyles.replace("color:","fill:")}))}const N=F.leaves();const G=M.selectAll(".treemapLeafGroup").data(N).enter().append("g").attr("class",((e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`)).attr("transform",(e=>`translate(${e.x0},${e.y0})`));G.append("rect").attr("width",(e=>e.x1-e.x0)).attr("height",(e=>e.y1-e.y0)).attr("class","treemapLeaf").attr("fill",(e=>e.parent?k(e.parent.data.name):k(e.data.name))).attr("style",(e=>{const t=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles})).attr("fill-opacity",.3).attr("stroke",(e=>e.parent?k(e.parent.data.name):k(e.data.name))).attr("stroke-width",3);G.append("clipPath").attr("id",((e,a)=>`clip-${t}-${a}`)).append("rect").attr("width",(e=>Math.max(0,e.x1-e.x0-4))).attr("height",(e=>Math.max(0,e.y1-e.y0-4)));const V=G.append("text").attr("class","treemapLabel").attr("x",(e=>(e.x1-e.x0)/2)).attr("y",(e=>(e.y1-e.y0)/2)).attr("style",(e=>{const t="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+T(e.data.name)+";";const a=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t+a.labelStyles.replace("color:","fill:")})).attr("clip-path",((e,a)=>`url(#clip-${t}-${a})`)).text((e=>e.data.name));V.each((function(e){const t=(0,d.Ltv)(this);const a=e.x1-e.x0;const s=e.y1-e.y0;const l=t.node();const n=4;const r=a-2*n;const o=s-2*n;if(r<10||o<10){t.style("display","none");return}let c=parseInt(t.style("font-size"),10);const i=8;const p=28;const h=.6;const f=6;const m=2;while(l.getComputedTextLength()>r&&c>i){c--;t.style("font-size",`${c}px`)}let y=Math.max(f,Math.min(p,Math.round(c*h)));let u=c+m+y;while(u>o&&c>i){c--;y=Math.max(f,Math.min(p,Math.round(c*h)));if(y<f&&c===i){break}t.style("font-size",`${c}px`);u=c+m+y;if(y<=f&&u>o){}}t.style("font-size",`${c}px`);if(l.getComputedTextLength()>r||c<i||o<c){t.style("display","none")}}));if(i.showValues!==false){const e=G.append("text").attr("class","treemapValue").attr("x",(e=>(e.x1-e.x0)/2)).attr("y",(function(e){return(e.y1-e.y0)/2})).attr("style",(e=>{const t="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+T(e.data.name)+";";const a=(0,l.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t+a.labelStyles.replace("color:","fill:")})).attr("clip-path",((e,a)=>`url(#clip-${t}-${a})`)).text((e=>e.value?C(e.value):""));e.each((function(e){const t=(0,d.Ltv)(this);const a=this.parentNode;if(!a){t.style("display","none");return}const s=(0,d.Ltv)(a).select(".treemapLabel");if(s.empty()||s.style("display")==="none"){t.style("display","none");return}const l=parseFloat(s.style("font-size"));const n=28;const r=.6;const o=6;const c=2;const i=Math.max(o,Math.min(n,Math.round(l*r)));t.style("font-size",`${i}px`);const p=(e.y1-e.y0)/2;const h=p+l/2+c;t.attr("y",h);const f=e.x1-e.x0;const m=e.y1-e.y0;const y=4;const u=m-y;const S=f-2*4;if(t.node().getComputedTextLength()>S||h+i>u||i<o){t.style("display","none")}else{t.style("display",null)}}))}const W=i.diagramPadding??8;(0,s.P)(x,W,"flowchart",i?.useMaxWidth||false)}),"draw");var v=(0,c.K2)((function(e,t){return t.db.getClasses()}),"getClasses");var b={draw:x,getClasses:v};var w={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"};var $=(0,c.K2)((({treemap:e}={})=>{const t=(0,r.$t)(w,e);return`\n .treemapNode.section {\n stroke: ${t.sectionStrokeColor};\n stroke-width: ${t.sectionStrokeWidth};\n fill: ${t.sectionFillColor};\n }\n .treemapNode.leaf {\n stroke: ${t.leafStrokeColor};\n stroke-width: ${t.leafStrokeWidth};\n fill: ${t.leafFillColor};\n }\n .treemapLabel {\n fill: ${t.labelColor};\n font-size: ${t.labelFontSize};\n }\n .treemapValue {\n fill: ${t.valueColor};\n font-size: ${t.valueFontSize};\n }\n .treemapTitle {\n fill: ${t.titleColor};\n font-size: ${t.titleFontSize};\n }\n `}),"getStyles");var C=$;var k={parser:y,get db(){return new p},renderer:b,styles:C}}}]); |