ruru
Version:
Grafast-flavoured GraphiQL distribution
2 lines • 11.7 kB
JavaScript
export const __webpack_id__=9789;export const __webpack_ids__=[9789];export const __webpack_modules__={23960:(e,t,a)=>{function l(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>l}),(0,a(58084).K2)(l,"populateCommonDb")},39789:(e,t,a)=>{a.d(t,{diagram:()=>k});var l=a(95994),s=a(97996),r=a(23960),n=a(40718),o=a(65323),c=a(5162),i=a(58084),d=a(73744),p=a(81352),h={nodes:[],levels:new Map,outerNodes:[],classes:new Map},m=new n.m(()=>structuredClone(h)),y=(0,i.K2)(()=>{const e=i.UI,t=(0,i.zj)();return(0,o.$t)({...e.treemap,...t.treemap??{}})},"getConfig"),f=(0,i.K2)(()=>m.records.nodes,"getNodes"),S=(0,i.K2)((e,t)=>{const a=m.records;a.nodes.push(e),a.levels.set(e,t),0===t&&a.outerNodes.push(e),0!==t||a.root||(a.root=e)},"addNode"),g=(0,i.K2)(()=>({name:"",children:m.records.outerNodes}),"getRoot"),u=(0,i.K2)((e,t)=>{const a=m.records.classes,l=a.get(e)??{id:e,styles:[],textStyles:[]};a.set(e,l);const r=t.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(e=>{(0,s.KX)(e)&&(l?.textStyles?l.textStyles.push(e):l.textStyles=[e]),l?.styles?l.styles.push(e):l.styles=[e]}),a.set(e,l)},"addClass"),x=(0,i.K2)(()=>m.records.classes,"getClasses"),b=(0,i.K2)(e=>m.records.classes.get(e)?.styles??[],"getStylesForClass"),C={getNodes:f,addNode:S,getRoot:g,getConfig:y,clear:(0,i.K2)(()=>{(0,i.IU)(),m.reset()},"clear"),setAccTitle:i.SV,getAccTitle:i.iN,setDiagramTitle:i.ke,getDiagramTitle:i.ab,getAccDescription:i.m7,setAccDescription:i.EI,addClass:u,getClasses:x,getStylesForClass:b};function $(e){if(!e.length)return[];const t=[],a=[];return e.forEach(e=>{const l={name:e.name,children:"Leaf"===e.type?void 0:[]};for(l.classSelector=e?.classSelector,e?.cssCompiledStyles&&(l.cssCompiledStyles=[e.cssCompiledStyles]),"Leaf"===e.type&&void 0!==e.value&&(l.value=e.value);a.length>0&&a[a.length-1].level>=e.level;)a.pop();if(0===a.length)t.push(l);else{const e=a[a.length-1].node;e.children?e.children.push(l):e.children=[l]}"Leaf"!==e.type&&a.push({node:l,level:e.level})}),t}(0,i.K2)($,"buildHierarchy");var v=(0,i.K2)(e=>{(0,r.S)(e,C);const t=[];for(const t of e.TreemapRows??[])"ClassDefStatement"===t.$type&&C.addClass(t.className??"",t.styleText??"");for(const a of e.TreemapRows??[]){const e=a.item;if(!e)continue;const l=a.indent?parseInt(a.indent):0,s=w(e),r=e.classSelector?C.getStylesForClass(e.classSelector):[],n=r.length>0?r.join(";"):void 0,o={level:l,name:s,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:n};t.push(o)}const a=$(t),l=(0,i.K2)((e,t)=>{for(const a of e)C.addNode(a,t),a.children&&a.children.length>0&&l(a.children,t+1)},"addNodesRecursively");l(a,0)},"populate"),w=(0,i.K2)(e=>e.name?String(e.name):"","getItemName"),L={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},k={parser:{parse:(0,i.K2)(async e=>{try{const t=d.qg,a=await t("treemap",e);i.Rm.debug("Treemap AST:",a),v(a)}catch(e){throw i.Rm.error("Error parsing treemap:",e),e}},"parse")},db:C,renderer:{draw:(0,i.K2)((e,t,a,r)=>{const n=r.db,o=n.getConfig(),d=o.padding??10,h=n.getDiagramTitle(),m=n.getRoot(),{themeVariables:y}=(0,i.zj)();if(!m)return;const f=h?30:0,S=(0,c.D)(t),g=o.nodeWidth?10*o.nodeWidth:960,u=o.nodeHeight?10*o.nodeHeight:500,x=g,b=u+f;let C;S.attr("viewBox",`0 0 ${x} ${b}`),(0,i.a$)(S,b,x,o.useMaxWidth);try{const e=o.valueFormat||",";if("$0,0"===e)C=(0,i.K2)(e=>"$"+(0,p.GPZ)(",")(e),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const t=/\.\d+/.exec(e),a=t?t[0]:"";C=(0,i.K2)(e=>"$"+(0,p.GPZ)(","+a)(e),"valueFormat")}else if(e.startsWith("$")){const t=e.substring(1);C=(0,i.K2)(e=>"$"+(0,p.GPZ)(t||"")(e),"valueFormat")}else C=(0,p.GPZ)(e)}catch(e){i.Rm.error("Error creating format function:",e),C=(0,p.GPZ)(",")}const $=(0,p.UMr)().range(["transparent",y.cScale0,y.cScale1,y.cScale2,y.cScale3,y.cScale4,y.cScale5,y.cScale6,y.cScale7,y.cScale8,y.cScale9,y.cScale10,y.cScale11]),v=(0,p.UMr)().range(["transparent",y.cScalePeer0,y.cScalePeer1,y.cScalePeer2,y.cScalePeer3,y.cScalePeer4,y.cScalePeer5,y.cScalePeer6,y.cScalePeer7,y.cScalePeer8,y.cScalePeer9,y.cScalePeer10,y.cScalePeer11]),w=(0,p.UMr)().range([y.cScaleLabel0,y.cScaleLabel1,y.cScaleLabel2,y.cScaleLabel3,y.cScaleLabel4,y.cScaleLabel5,y.cScaleLabel6,y.cScaleLabel7,y.cScaleLabel8,y.cScaleLabel9,y.cScaleLabel10,y.cScaleLabel11]);h&&S.append("text").attr("x",x/2).attr("y",f/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const L=S.append("g").attr("transform",`translate(0, ${f})`).attr("class","treemapContainer"),k=(0,p.Sk5)(m).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),K=(0,p.hkb)().size([g,u]).paddingTop(e=>e.children&&e.children.length>0?35:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?10:0).paddingRight(e=>e.children&&e.children.length>0?10:0).paddingBottom(e=>e.children&&e.children.length>0?10:0).round(!0)(k),P=K.descendants().filter(e=>e.children&&e.children.length>0),T=L.selectAll(".treemapSection").data(P).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);T.append("rect").attr("width",e=>e.x1-e.x0).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>0===e.depth?"display: none;":""),T.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",25),T.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=>$(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>v(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(0===e.depth)return"display: none;";const t=(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),T.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text(e=>0===e.depth?"":e.data.name).attr("font-weight","bold").attr("style",e=>0===e.depth?"display: none;":"dominant-baseline: middle; font-size: 12px; fill:"+w(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).each(function(e){if(0===e.depth)return;const t=(0,p.Ltv)(this),a=e.data.name;t.text(a);const l=e.x1-e.x0;let s;s=!1!==o.showValues&&e.value?l-10-30-10-6:l-6-6;const r=Math.max(15,s),n=t.node();if(n.getComputedTextLength()>r){const e="...";let l=a;for(;l.length>0;){if(l=a.substring(0,l.length-1),0===l.length){t.text(e),n.getComputedTextLength()>r&&t.text("");break}if(t.text(l+e),n.getComputedTextLength()<=r)break}}}),!1!==o.showValues&&T.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?C(e.value):"").attr("font-style","italic").attr("style",e=>0===e.depth?"display: none;":"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+w(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"));const z=K.leaves(),M=L.selectAll(".treemapLeafGroup").data(z).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})`);M.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?$(e.parent.data.name):$(e.data.name)).attr("style",e=>(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?$(e.parent.data.name):$(e.data.name)).attr("stroke-width",3),M.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)),M.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+w(e.data.name)+";"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,a)=>`url(#clip-${t}-${a})`).text(e=>e.data.name).each(function(e){const t=(0,p.Ltv)(this),a=e.x1-e.x0,l=e.y1-e.y0,s=t.node(),r=a-8,n=l-8;if(r<10||n<10)return void t.style("display","none");let o=parseInt(t.style("font-size"),10);for(;s.getComputedTextLength()>r&&o>8;)o--,t.style("font-size",`${o}px`);let c=Math.max(6,Math.min(28,Math.round(.6*o))),i=o+2+c;for(;i>n&&o>8&&(o--,c=Math.max(6,Math.min(28,Math.round(.6*o))),!(c<6&&8===o));)t.style("font-size",`${o}px`),i=o+2+c;t.style("font-size",`${o}px`),(s.getComputedTextLength()>r||o<8||n<o)&&t.style("display","none")}),!1!==o.showValues&&M.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=>"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+w(e.data.name)+";"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,a)=>`url(#clip-${t}-${a})`).text(e=>e.value?C(e.value):"").each(function(e){const t=(0,p.Ltv)(this),a=this.parentNode;if(!a)return void t.style("display","none");const l=(0,p.Ltv)(a).select(".treemapLabel");if(l.empty()||"none"===l.style("display"))return void t.style("display","none");const s=parseFloat(l.style("font-size")),r=Math.max(6,Math.min(28,Math.round(.6*s)));t.style("font-size",`${r}px`);const n=(e.y1-e.y0)/2+s/2+2;t.attr("y",n);const o=e.x1-e.x0,c=e.y1-e.y0-4,i=o-8;t.node().getComputedTextLength()>i||n+r>c||r<6?t.style("display","none"):t.style("display",null)});const F=o.diagramPadding??8;(0,l.P)(S,F,"flowchart",o?.useMaxWidth||!1)},"draw"),getClasses:(0,i.K2)(function(e,t){return t.db.getClasses()},"getClasses")},styles:(0,i.K2)(({treemap:e}={})=>{const t=(0,o.$t)(L,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")}},40718:(e,t,a)=>{a.d(t,{m:()=>s});var l=a(58084),s=class{constructor(e){this.init=e,this.records=this.init()}static{(0,l.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},95994:(e,t,a)=>{a.d(t,{P:()=>s});var l=a(58084),s=(0,l.K2)((e,t,a,s)=>{e.attr("class",a);const{width:o,height:c,x:i,y:d}=r(e,t);(0,l.a$)(e,c,o,s);const p=n(i,d,o,c,t);e.attr("viewBox",p),l.Rm.debug(`viewBox configured: ${p} with padding: ${t}`)},"setupViewPortForSVG"),r=(0,l.K2)((e,t)=>{const a=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:a.width+2*t,height:a.height+2*t,x:a.x,y:a.y}},"calculateDimensionsWithPadding"),n=(0,l.K2)((e,t,a,l,s)=>`${e-s} ${t-s} ${a} ${l}`,"createViewBox")}};
//# sourceMappingURL=9789.js.map