%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/
Upload File :
Create Path :
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/pieDiagram-bb1d19e5-BiJye3qS.chunk.mjs

/*! third party licenses: js/vendor.LICENSE.txt */
import{aI as Z,aJ as rt,x as at,y as lt,s as ot,g as ct,b as ht,a as ut,A as yt,d as pt,c as tt,l as et,aK as gt,aH as ft,aL as mt,i as dt}from"./mermaid.core-CHhv7cmw.chunk.mjs";import"./NcNoteCard-CImn6F9p-7OG_jBLc.chunk.mjs";import{a as Y}from"./arc-igYUh7LQ.chunk.mjs";import{o as _t}from"./ordinal-Bt1svyuw.chunk.mjs";import{a as bt}from"./array-CNYCUCI1.chunk.mjs";import{c as V}from"./path-D16fQfbf.chunk.mjs";import"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import"./emoji-picker-SoWZqoso.chunk.mjs";import"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import"./init-q33yAy1W.chunk.mjs";function xt(e,h){return h<e?-1:h>e?1:h>=e?0:NaN}function vt(e){return e}function kt(){var e=vt,h=xt,p=null,S=V(0),w=V(Z),A=V(0);function u(r){var l,m=(r=bt(r)).length,d,I,T=0,_=new Array(m),x=new Array(m),o=+S.apply(this,arguments),v=Math.min(Z,Math.max(-Z,w.apply(this,arguments)-o)),D,E=Math.min(Math.abs(v)/m,A.apply(this,arguments)),f=E*(v<0?-1:1),t;for(l=0;l<m;++l)(t=x[_[l]=l]=+e(r[l],l,r))>0&&(T+=t);for(h!=null?_.sort(function(i,s){return h(x[i],x[s])}):p!=null&&_.sort(function(i,s){return p(r[i],r[s])}),l=0,I=T?(v-m*f)/T:0;l<m;++l,o=D)d=_[l],t=x[d],D=o+(t>0?t*I:0)+f,x[d]={data:r[d],index:l,value:t,startAngle:o,endAngle:D,padAngle:E};return x}return u.value=function(r){return arguments.length?(e=typeof r=="function"?r:V(+r),u):e},u.sortValues=function(r){return arguments.length?(h=r,p=null,u):h},u.sort=function(r){return arguments.length?(p=r,h=null,u):p},u.startAngle=function(r){return arguments.length?(S=typeof r=="function"?r:V(+r),u):S},u.endAngle=function(r){return arguments.length?(w=typeof r=="function"?r:V(+r),u):w},u.padAngle=function(r){return arguments.length?(A=typeof r=="function"?r:V(+r),u):A},u}var J=function(){var e=function(f,t,i,s){for(i=i||{},s=f.length;s--;i[f[s]]=t);return i},h=[1,3],p=[1,4],S=[1,5],w=[1,6],A=[1,10,12,14,16,18,19,20,21,22],u=[2,4],r=[1,5,10,12,14,16,18,19,20,21,22],l=[20,21,22],m=[2,7],d=[1,12],I=[1,13],T=[1,14],_=[1,15],x=[1,16],o=[1,17],v={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,PIE:5,document:6,showData:7,line:8,statement:9,txt:10,value:11,title:12,title_value:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,section:19,NEWLINE:20,";":21,EOF:22,$accept:0,$end:1},terminals_:{2:"error",5:"PIE",7:"showData",10:"txt",11:"value",12:"title",13:"title_value",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"section",20:"NEWLINE",21:";",22:"EOF"},productions_:[0,[3,2],[3,2],[3,3],[6,0],[6,2],[8,2],[9,0],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[4,1],[4,1],[4,1]],performAction:function(f,t,i,s,a,n,y){var k=n.length-1;switch(a){case 3:s.setShowData(!0);break;case 6:this.$=n[k-1];break;case 8:s.addSection(n[k-1],s.cleanupValue(n[k]));break;case 9:this.$=n[k].trim(),s.setDiagramTitle(this.$);break;case 10:this.$=n[k].trim(),s.setAccTitle(this.$);break;case 11:case 12:this.$=n[k].trim(),s.setAccDescription(this.$);break;case 13:s.addSection(n[k].substr(8)),this.$=n[k].substr(8);break}},table:[{3:1,4:2,5:h,20:p,21:S,22:w},{1:[3]},{3:7,4:2,5:h,20:p,21:S,22:w},e(A,u,{6:8,7:[1,9]}),e(r,[2,14]),e(r,[2,15]),e(r,[2,16]),{1:[2,1]},e(l,m,{8:10,9:11,1:[2,2],10:d,12:I,14:T,16:_,18:x,19:o}),e(A,u,{6:18}),e(A,[2,5]),{4:19,20:p,21:S,22:w},{11:[1,20]},{13:[1,21]},{15:[1,22]},{17:[1,23]},e(l,[2,12]),e(l,[2,13]),e(l,m,{8:10,9:11,1:[2,3],10:d,12:I,14:T,16:_,18:x,19:o}),e(A,[2,6]),e(l,[2,8]),e(l,[2,9]),e(l,[2,10]),e(l,[2,11])],defaultActions:{7:[2,1]},parseError:function(f,t){if(t.recoverable)this.trace(f);else{var i=new Error(f);throw i.hash=t,i}},parse:function(f){var t=this,i=[0],s=[],a=[null],n=[],y=this.table,k="",F=0,g=0,O=2,M=1,W=n.slice.call(arguments,1),c=Object.create(this.lexer),C={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(C.yy[H]=this.yy[H]);c.setInput(f,C.yy),C.yy.lexer=c,C.yy.parser=this,typeof c.yylloc>"u"&&(c.yylloc={});var q=c.yylloc;n.push(q);var nt=c.options&&c.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function st(){var N;return N=s.pop()||c.lex()||M,typeof N!="number"&&(N instanceof Array&&(s=N,N=s.pop()),N=t.symbols_[N]||N),N}for(var b,R,$,G,j={},L,P,X,z;;){if(R=i[i.length-1],this.defaultActions[R]?$=this.defaultActions[R]:((b===null||typeof b>"u")&&(b=st()),$=y[R]&&y[R][b]),typeof $>"u"||!$.length||!$[0]){var Q="";z=[];for(L in y[R])this.terminals_[L]&&L>O&&z.push("'"+this.terminals_[L]+"'");c.showPosition?Q="Parse error on line "+(F+1)+":\n"+c.showPosition()+"\nExpecting "+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":Q="Parse error on line "+(F+1)+": Unexpected "+(b==M?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(Q,{text:c.match,token:this.terminals_[b]||b,line:c.yylineno,loc:q,expected:z})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+b);switch($[0]){case 1:i.push(b),a.push(c.yytext),n.push(c.yylloc),i.push($[1]),b=null,g=c.yyleng,k=c.yytext,F=c.yylineno,q=c.yylloc;break;case 2:if(P=this.productions_[$[1]][1],j.$=a[a.length-P],j._$={first_line:n[n.length-(P||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(P||1)].first_column,last_column:n[n.length-1].last_column},nt&&(j._$.range=[n[n.length-(P||1)].range[0],n[n.length-1].range[1]]),G=this.performAction.apply(j,[k,g,F,C.yy,$[1],a,n].concat(W)),typeof G<"u")return G;P&&(i=i.slice(0,-1*P*2),a=a.slice(0,-1*P),n=n.slice(0,-1*P)),i.push(this.productions_[$[1]][0]),a.push(j.$),n.push(j._$),X=y[i[i.length-2]][i[i.length-1]],i.push(X);break;case 3:return!0}}return!0}},D=function(){var f={EOF:1,parseError:function(t,i){if(this.yy.parser)this.yy.parser.parseError(t,i);else throw new Error(t)},setInput:function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var i=t.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===a.length?this.yylloc.first_column:0)+a[a.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},test_match:function(t,i){var s,a,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),a=t[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var y in n)this[y]=n[y];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,i,s,a;this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),y=0;y<n.length;y++)if(s=this._input.match(this.rules[n[y]]),s&&(!i||s[0].length>i[0].length)){if(i=s,a=y,this.options.backtrack_lexer){if(t=this.test_match(s,n[y]),t!==!1)return t;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(t=this.test_match(i,n[a]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,i,s,a){switch(s){case 0:break;case 1:break;case 2:return 20;case 3:break;case 4:break;case 5:return this.begin("title"),12;case 6:return this.popState(),"title_value";case 7:return this.begin("acc_title"),14;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),16;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 15:this.popState();break;case 16:return"txt";case 17:return 5;case 18:return 7;case 19:return"value";case 20:return 22}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[6],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,7,9,11,14,17,18,19,20],inclusive:!0}}};return f}();v.lexer=D;function E(){this.yy={}}return E.prototype=v,v.Parser=E,new E}();J.parser=J;const wt=J,it=rt.pie,B={sections:{},showData:!1,config:it};let U=B.sections,K=B.showData;const $t=structuredClone(it),St=()=>structuredClone($t),At=()=>{U=structuredClone(B.sections),K=B.showData,yt()},Et=(e,h)=>{e=pt(e,tt()),U[e]===void 0&&(U[e]=h,et.debug("added new section: ".concat(e,", with value: ").concat(h)))},Tt=()=>U,It=e=>(e.substring(0,1)===":"&&(e=e.substring(1).trim()),Number(e.trim())),Ot=e=>{K=e},Ct=()=>K,Pt={getConfig:St,clear:At,setDiagramTitle:at,getDiagramTitle:lt,setAccTitle:ot,getAccTitle:ct,setAccDescription:ht,getAccDescription:ut,addSection:Et,getSections:Tt,cleanupValue:It,setShowData:Ot,getShowData:Ct},Nt=e=>"\n  .pieCircle{\n    stroke: ".concat(e.pieStrokeColor,";\n    stroke-width : ").concat(e.pieStrokeWidth,";\n    opacity : ").concat(e.pieOpacity,";\n  }\n  .pieOuterCircle{\n    stroke: ").concat(e.pieOuterStrokeColor,";\n    stroke-width: ").concat(e.pieOuterStrokeWidth,";\n    fill: none;\n  }\n  .pieTitleText {\n    text-anchor: middle;\n    font-size: ").concat(e.pieTitleTextSize,";\n    fill: ").concat(e.pieTitleTextColor,";\n    font-family: ").concat(e.fontFamily,";\n  }\n  .slice {\n    font-family: ").concat(e.fontFamily,";\n    fill: ").concat(e.pieSectionTextColor,";\n    font-size:").concat(e.pieSectionTextSize,";\n    // fill: white;\n  }\n  .legend text {\n    fill: ").concat(e.pieLegendTextColor,";\n    font-family: ").concat(e.fontFamily,";\n    font-size: ").concat(e.pieLegendTextSize,";\n  }\n"),Dt=Nt,Ft=e=>{const h=Object.entries(e).map(p=>({label:p[0],value:p[1]})).sort((p,S)=>S.value-p.value);return kt().value(p=>p.value)(h)},Mt=(e,h,p,S)=>{et.debug("rendering pie chart\n"+e);const w=S.db,A=tt(),u=gt(w.getConfig(),A.pie),r=40,l=18,m=4,d=450,I=d,T=ft(h),_=T.append("g"),x=w.getSections();_.attr("transform","translate("+I/2+","+d/2+")");const{themeVariables:o}=A;let[v]=mt(o.pieOuterStrokeWidth);v!=null||(v=2);const D=u.textPosition,E=Math.min(I,d)/2-r,f=Y().innerRadius(0).outerRadius(E),t=Y().innerRadius(E*D).outerRadius(E*D);_.append("circle").attr("cx",0).attr("cy",0).attr("r",E+v/2).attr("class","pieOuterCircle");const i=Ft(x),s=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12],a=_t(s);_.selectAll("mySlices").data(i).enter().append("path").attr("d",f).attr("fill",g=>a(g.data.label)).attr("class","pieCircle");let n=0;Object.keys(x).forEach(g=>{n+=x[g]}),_.selectAll("mySlices").data(i).enter().append("text").text(g=>(g.data.value/n*100).toFixed(0)+"%").attr("transform",g=>"translate("+t.centroid(g)+")").style("text-anchor","middle").attr("class","slice"),_.append("text").text(w.getDiagramTitle()).attr("x",0).attr("y",-(d-50)/2).attr("class","pieTitleText");const y=_.selectAll(".legend").data(a.domain()).enter().append("g").attr("class","legend").attr("transform",(g,O)=>{const M=l+m,W=M*a.domain().length/2,c=12*l,C=O*M-W;return"translate("+c+","+C+")"});y.append("rect").attr("width",l).attr("height",l).style("fill",a).style("stroke",a),y.data(i).append("text").attr("x",l+m).attr("y",l-m).text(g=>{const{label:O,value:M}=g.data;return w.getShowData()?"".concat(O," [").concat(M,"]"):O});const k=Math.max(...y.selectAll("text").nodes().map(g=>{var O;return(O=g==null?void 0:g.getBoundingClientRect().width)!=null?O:0})),F=I+r+l+m+k;T.attr("viewBox","0 0 ".concat(F," ").concat(d)),dt(T,d,F,u.useMaxWidth)},Rt={draw:Mt},Qt={parser:wt,db:Pt,renderer:Rt,styles:Dt};export{Qt as diagram};

Zerion Mini Shell 1.0