@codragraph/cli 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -13
- package/dist/cli/analyze.d.ts +9 -4
- package/dist/cli/analyze.js +37 -13
- package/dist/cli/index.js +9 -3
- package/dist/cli/status.d.ts +1 -1
- package/dist/cli/status.js +8 -0
- package/dist/cli/tool.d.ts +10 -2
- package/dist/cli/tool.js +27 -6
- package/dist/core/adaptive-profile.d.ts +52 -0
- package/dist/core/adaptive-profile.js +180 -0
- package/dist/core/cgdb/cgdb-adapter.d.ts +34 -5
- package/dist/core/cgdb/cgdb-adapter.js +418 -5
- package/dist/core/cgdb/pool-adapter.js +1 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +3 -1
- package/dist/core/ingestion/pipeline-phases/structure.js +19 -3
- package/dist/core/ingestion/pipeline.d.ts +10 -0
- package/dist/core/run-analyze.d.ts +27 -2
- package/dist/core/run-analyze.js +598 -27
- package/dist/core/search/bm25-index.d.ts +19 -0
- package/dist/core/search/bm25-index.js +68 -29
- package/dist/mcp/local/local-backend.js +6 -3
- package/dist/storage/repo-manager.d.ts +29 -0
- package/dist/web/assets/__vite-browser-external-BIHI7g3E.js +1 -0
- package/dist/web/assets/agent-DcdaQnmu.js +1104 -0
- package/dist/web/assets/architectureDiagram-UL44E2DR-DFSpa3Hb.js +36 -0
- package/dist/web/assets/blockDiagram-7IZFK4PR-DlFaxH1b.js +132 -0
- package/dist/web/assets/{c4Diagram-DFAF54RM-C4Hl3J2U.js → c4Diagram-Y2BXMSZH-BjJ_Yrim.js} +1 -1
- package/dist/web/assets/{chunk-7RZVMHOQ-BitYcNVR.js → chunk-3SSMPTDK-KGZSzG3Y.js} +1 -1
- package/dist/web/assets/{chunk-TBF5ZNIQ-DL5stGM1.js → chunk-6764PJDD-p1sGJgVm.js} +1 -1
- package/dist/web/assets/{chunk-KSICW3F5-BYzvDLNI.js → chunk-AZZRMDJM-DIDkQA4V.js} +1 -1
- package/dist/web/assets/{chunk-AEOMTBSW-BgTIXPsY.js → chunk-JQRUD6KW-DAwg-yCU.js} +1 -1
- package/dist/web/assets/chunk-KRXBNO2N-ChVO_XdS.js +1 -0
- package/dist/web/assets/chunk-LCXTWHL2-DGYdb_Eh.js +231 -0
- package/dist/web/assets/{chunk-O5ABG6QK-dHwHzA6n.js → chunk-LII3EMHJ-Bzh9SNgD.js} +1 -1
- package/dist/web/assets/chunk-RG4AUYOV-Bcl7U_IV.js +206 -0
- package/dist/web/assets/{chunk-TU3PZOEN-RLyvLcv-.js → chunk-T5OCTHI4-CZYMg5sc.js} +1 -1
- package/dist/web/assets/chunk-W44A43WB-REOI67PN.js +13 -0
- package/dist/web/assets/{chunk-RWUO3TPN-BgRTY0_k.js → chunk-ZXARS5L4-BfFdV1tf.js} +1 -1
- package/dist/web/assets/classDiagram-KGZ6W3CR-B-qkKMYi.js +1 -0
- package/dist/web/assets/classDiagram-v2-72OJOZXJ-B-qkKMYi.js +1 -0
- package/dist/web/assets/{cose-bilkent-PNC4W37J-DVhePRYg.js → cose-bilkent-UX7MHV2Q-D6vANJGG.js} +1 -1
- package/dist/web/assets/dagre-ND4H6XIP-BiHe5Lal.js +4 -0
- package/dist/web/assets/diagram-3NCE3AQN-CEutBCOW.js +43 -0
- package/dist/web/assets/diagram-GF46GFSD-CZns6HPQ.js +24 -0
- package/dist/web/assets/diagram-HNR7UZ2L-Vz8fE5of.js +3 -0
- package/dist/web/assets/diagram-QXG6HAR7-D60HKZ_y.js +24 -0
- package/dist/web/assets/diagram-WEQXMOUZ-vGAf1p3E.js +10 -0
- package/dist/web/assets/{erDiagram-GCSMX5X6-C3dhDFA8.js → erDiagram-L5TCEMPS-DZaplJA6.js} +5 -5
- package/dist/web/assets/{flowDiagram-OTCZ4VVT-CWSFWmhr.js → flowDiagram-H6V6AXG4-BqUqeAsI.js} +9 -9
- package/dist/web/assets/ganttDiagram-JCBTUEKG-XEB6H-0G.js +292 -0
- package/dist/web/assets/gitGraphDiagram-S2ZK5IYY-7G50u1Cd.js +106 -0
- package/dist/web/assets/index-B5WxtMpv.js +1415 -0
- package/dist/web/assets/infoDiagram-3YFTVSEB-Cut_rzaf.js +2 -0
- package/dist/web/assets/{ishikawaDiagram-YMYX4NHK-DUoJvNP2.js → ishikawaDiagram-BNXS4ZKH-B4DGfGi3.js} +3 -3
- package/dist/web/assets/{journeyDiagram-SO5T7YLQ-RMFPNNqz.js → journeyDiagram-M6C3CM3L-BBFhsL3E.js} +1 -1
- package/dist/web/assets/{kanban-definition-LJHFXRCJ-BzpDs1K9.js → kanban-definition-75IXJCU3-DarGRyn3.js} +4 -4
- package/dist/web/assets/{katex-GD7MH7QM-DBQvrix-.js → katex-K3KEBU37-W5XTYMhr.js} +1 -1
- package/dist/web/assets/mindmap-definition-2TDM6QVE-BgeczIJM.js +96 -0
- package/dist/web/assets/pieDiagram-CU6KROY3-Kkoo-Noq.js +30 -0
- package/dist/web/assets/quadrantDiagram-VICAPDV7-CDQFeRWN.js +7 -0
- package/dist/web/assets/{requirementDiagram-M5DCFWZL-DLHOVTSv.js → requirementDiagram-JXO7QTGE-Cz9-XnkA.js} +2 -2
- package/dist/web/assets/sankeyDiagram-URQDO5SZ-CU26z0n7.js +40 -0
- package/dist/web/assets/sequenceDiagram-VS2MUI6T-OGK1FLOt.js +162 -0
- package/dist/web/assets/stateDiagram-7D4R322I-DJ9brq0U.js +1 -0
- package/dist/web/assets/stateDiagram-v2-36443NZ5-DhJ4Ky-7.js +1 -0
- package/dist/web/assets/{timeline-definition-5SPVSISX-TRSDRgPw.js → timeline-definition-O6YCAMPW-XZvnjqTT.js} +4 -4
- package/dist/web/assets/{vennDiagram-IE5QUKF5-DNy7HRBM.js → vennDiagram-MWXL3ELB-CJUssEjA.js} +6 -6
- package/dist/web/assets/wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js +173 -0
- package/dist/web/assets/wardleyDiagram-CUQ6CDDI-C276iqrN.js +78 -0
- package/dist/web/assets/{xychartDiagram-ZHJ5623Y-Dr9r7a35.js → xychartDiagram-N2JHSOCM-B9-uCZyP.js} +4 -4
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/vendor/node_modules/node-addon-api/node_addon_api_except.stamp +0 -0
- package/dist/web/assets/agent-D5lb0zXz.js +0 -1089
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +0 -36
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +0 -132
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +0 -231
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +0 -1
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +0 -13
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +0 -1
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +0 -206
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +0 -1
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +0 -1
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +0 -4
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +0 -43
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +0 -24
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +0 -10
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +0 -24
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +0 -292
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +0 -106
- package/dist/web/assets/index-BgeqpYgd.js +0 -1415
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +0 -2
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +0 -96
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +0 -30
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +0 -7
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +0 -10
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +0 -157
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +0 -1
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +0 -1
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +0 -161
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +0 -20
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{m as e,p as s,a7 as n,b as o}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var p={parse:e(async r=>{let a=await d("info",r);s.debug(a)},"parse")},m={version:"11.14.0"},g=e(()=>m.version,"getVersion"),v={getVersion:g},f=e((r,a,i)=>{s.debug(`rendering info diagram
|
|
2
|
-
`+r);let t=n(a);o(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${i}`)},"draw"),l={draw:f},u={parser:p,db:v,renderer:l};export{u as diagram};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import{m as ue}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as pe}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as h,p as C,g as ye,P as me,O as fe,y as H,q as B,c as j,au as be,ap as _e,aq as ke,ar as Ee}from"./index-BgeqpYgd.js";var Q=function(){var t=h(function(D,n,o,a){for(o=o||{},a=D.length;a--;o[D[a]]=n);return o},"o"),e=[1,4],r=[1,13],l=[1,12],i=[1,15],c=[1,16],u=[1,20],f=[1,19],p=[6,7,8],x=[1,26],L=[1,24],I=[1,25],_=[6,7,11],y=[1,6,13,15,16,19,22],A=[1,33],Y=[1,34],U=[1,6,7,11,13,15,16,19,22],z={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(D,n,o,a,d,s,E){var g=s.length-1;switch(d){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",s[g].id),a.addNode(s[g-1].length,s[g].id,s[g].descr,s[g].type);break;case 16:a.getLogger().trace("Icon: ",s[g]),a.decorateNode({icon:s[g]});break;case 17:case 21:a.decorateNode({class:s[g]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",s[g].id),a.addNode(0,s[g].id,s[g].descr,s[g].type);break;case 20:a.decorateNode({icon:s[g]});break;case 25:a.getLogger().trace("node found ..",s[g-2]),this.$={id:s[g-1],descr:s[g-1],type:a.getType(s[g-2],s[g])};break;case 26:this.$={id:s[g],descr:s[g],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",s[g-3]),this.$={id:s[g-3],descr:s[g-1],type:a.getType(s[g-2],s[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:r,12:21,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},{6:r,9:22,12:11,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},{6:x,7:L,10:23,11:I},t(_,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:f}),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),t(_,[2,21]),t(_,[2,23]),t(_,[2,24]),t(_,[2,26],{19:[1,30]}),{20:[1,31]},{6:x,7:L,10:32,11:I},{1:[2,7],6:r,12:21,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},t(y,[2,14],{7:A,11:Y}),t(U,[2,8]),t(U,[2,9]),t(U,[2,10]),t(_,[2,15]),t(_,[2,16]),t(_,[2,17]),{20:[1,35]},{21:[1,36]},t(y,[2,13],{7:A,11:Y}),t(U,[2,11]),t(U,[2,12]),{21:[1,37]},t(_,[2,25]),t(_,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(D,n){if(n.recoverable)this.trace(D);else{var o=new Error(D);throw o.hash=n,o}},"parseError"),parse:h(function(D){var n=this,o=[0],a=[],d=[null],s=[],E=this.table,g="",P=0,Z=0,ce=0,le=2,ee=1,he=s.slice.call(arguments,1),m=Object.create(this.lexer),$={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&($.yy[V]=this.yy[V]);m.setInput(D,$.yy),$.yy.lexer=m,$.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var W=m.yylloc;s.push(W);var de=m.options&&m.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(S){o.length=o.length-2*S,d.length=d.length-S,s.length=s.length-S}h(ge,"popStack");function te(){var S;return S=a.pop()||m.lex()||ee,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}h(te,"lex");for(var k,q,w,N,Re,X,T={},F,v,ne,G;;){if(w=o[o.length-1],this.defaultActions[w]?N=this.defaultActions[w]:((k===null||typeof k>"u")&&(k=te()),N=E[w]&&E[w][k]),typeof N>"u"||!N.length||!N[0]){var J="";G=[];for(F in E[w])this.terminals_[F]&&F>le&&G.push("'"+this.terminals_[F]+"'");m.showPosition?J="Parse error on line "+(P+1)+`:
|
|
2
|
-
`+m.showPosition()+`
|
|
3
|
-
Expecting `+G.join(", ")+", got '"+(this.terminals_[k]||k)+"'":J="Parse error on line "+(P+1)+": Unexpected "+(k==ee?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:W,expected:G})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+k);switch(N[0]){case 1:o.push(k),d.push(m.yytext),s.push(m.yylloc),o.push(N[1]),k=null,q?(k=q,q=null):(Z=m.yyleng,g=m.yytext,P=m.yylineno,W=m.yylloc,ce>0);break;case 2:if(v=this.productions_[N[1]][1],T.$=d[d.length-v],T._$={first_line:s[s.length-(v||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(v||1)].first_column,last_column:s[s.length-1].last_column},de&&(T._$.range=[s[s.length-(v||1)].range[0],s[s.length-1].range[1]]),X=this.performAction.apply(T,[g,Z,P,$.yy,N[1],d,s].concat(he)),typeof X<"u")return X;v&&(o=o.slice(0,-1*v*2),d=d.slice(0,-1*v),s=s.slice(0,-1*v)),o.push(this.productions_[N[1]][0]),d.push(T.$),s.push(T._$),ne=E[o[o.length-2]][o[o.length-1]],o.push(ne);break;case 3:return!0}}return!0},"parse")},ae=function(){var D={EOF:1,parseError:h(function(n,o){if(this.yy.parser)this.yy.parser.parseError(n,o);else throw new Error(n)},"parseError"),setInput:h(function(n,o){return this.yy=o||this.yy||{},this._input=n,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},"setInput"),input:h(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:h(function(n){var o=n.length,a=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var d=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),a.length-1&&(this.yylineno-=a.length-1);var s=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:a?(a.length===d.length?this.yylloc.first_column:0)+d[d.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(n){this.unput(this.match.slice(n))},"less"),pastInput:h(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
-
`+o+"^"},"showPosition"),test_match:h(function(n,o){var a,d,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),d=n[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,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(n[0].length),this.matched+=n[0],a=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var E in s)this[E]=s[E];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,a,d;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),E=0;E<s.length;E++)if(a=this._input.match(this.rules[s[E]]),a&&(!o||a[0].length>o[0].length)){if(o=a,d=E,this.options.backtrack_lexer){if(n=this.test_match(a,s[E]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,s[d]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var n=this.next();return n||this.lex()},"lex"),begin:h(function(n){this.conditionStack.push(n)},"begin"),popState:h(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:h(function(n){this.begin(n)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(n,o,a,d){switch(a){case 0:return n.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return n.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:n.getLogger().trace("end icon"),this.popState();break;case 10:return n.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return n.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return n.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),n.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 35:return n.getLogger().trace("Long description:",o.yytext),20;case 36:return n.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D}();z.lexer=ae;function M(){this.yy={}}return h(M,"Parser"),M.prototype=z,z.Parser=M,new M}();Q.parser=Q;var Se=Q,b=[];for(let t=0;t<256;++t)b.push((t+256).toString(16).slice(1));function se(t,e=0){return(b[t[e+0]]+b[t[e+1]]+b[t[e+2]]+b[t[e+3]]+"-"+b[t[e+4]]+b[t[e+5]]+"-"+b[t[e+6]]+b[t[e+7]]+"-"+b[t[e+8]]+b[t[e+9]]+"-"+b[t[e+10]]+b[t[e+11]]+b[t[e+12]]+b[t[e+13]]+b[t[e+14]]+b[t[e+15]]).toLowerCase()}h(se,"unsafeStringify");var K,Ne=new Uint8Array(16);function oe(){if(!K){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");K=crypto.getRandomValues.bind(crypto)}return K(Ne)}h(oe,"rng");var Le=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:Le};function re(t,e,r){var i;if(ie.randomUUID&&!e&&!t)return ie.randomUUID();t=t||{};let l=t.random??((i=t.rng)==null?void 0:i.call(t))??oe();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let c=0;c<16;++c)e[r+c]=l[c];return e}return se(l)}h(re,"v4");var xe=re,De=12,O={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},R,ve=(R=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=O,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level<e)return this.nodes[r];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,r,l,i){var L,I;C.info("addNode",e,r,l,i);let c=!1;this.nodes.length===0?(this.baseLevel=e,e=0,c=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,c=!1);let u=B(),f=((L=u.mindmap)==null?void 0:L.padding)??H.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}let p={id:this.count++,nodeId:j(r,u),level:e,descr:j(l,u),type:i,children:[],width:((I=u.mindmap)==null?void 0:I.maxNodeWidth)??H.mindmap.maxNodeWidth,padding:f,isRoot:c},x=this.getParent(e);if(x)x.children.push(p),this.nodes.push(p);else if(c)this.nodes.push(p);else throw new Error(`There can be only one root. No parent could be found for ("${p.descr}")`)}getType(e,r){switch(C.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let r=B(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=j(e.icon,r)),e.class&&(l.class=j(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(let[l,i]of e.children.entries()){let c=e.level===0?l%(De-1):r;this.assignSections(i,c)}}flattenNodes(e,r){let l=B(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);let c=i.join(" "),u=h(p=>{var L;let x=(((L=l.theme)==null?void 0:L.toLowerCase())??"").includes("redux");switch(p){case O.CIRCLE:return"mindmapCircle";case O.RECT:return"rect";case O.ROUNDED_RECT:return"rounded";case O.CLOUD:return"cloud";case O.BANG:return"bang";case O.HEXAGON:return"hexagon";case O.DEFAULT:return x?"rounded":"defaultMindmapNode";case O.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:u(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:c,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(f),e.children)for(let p of e.children)this.flattenNodes(p,r)}generateEdges(e,r){if(!e.children)return;let l=B();for(let i of e.children){let c="edge";i.section!==void 0&&(c+=` section-edge-${i.section}`);let u=e.level+1;c+=` edge-depth-${u}`;let f={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:c,depth:e.level,section:i.section};r.push(f),this.generateEdges(i,r)}}getData(){let e=this.getMindmap(),r=B(),l=be().layout!==void 0,i=r;if(l||(i.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:i};C.debug("getData: mindmapRoot",e,r),this.assignSections(e);let c=[],u=[];this.flattenNodes(e,c),this.generateEdges(e,u),C.debug(`getData: processed ${c.length} nodes and ${u.length} edges`);let f=new Map;for(let p of c)f.set(p.id,{shape:p.shape,width:p.width,height:p.height,padding:p.padding});return{nodes:c,edges:u,config:i,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(f),type:"mindmap",diagramId:"mindmap-"+xe()}}getLogger(){return C}},h(R,"MindmapDB"),R),Oe=h(async(t,e,r,l)=>{var I,_;C.debug(`Rendering mindmap diagram
|
|
7
|
-
`+t);let i=l.db,c=i.getData(),u=ue(e,c.config.securityLevel);if(c.type=l.type,c.layoutAlgorithm=ye(c.config.layout,{fallback:"cose-bilkent"}),c.diagramId=e,!i.getMindmap())return;c.nodes.forEach(y=>{y.shape==="rounded"?(y.radius=15,y.taper=15,y.stroke="none",y.width=0,y.padding=15):y.shape==="circle"?y.padding=10:y.shape==="rect"?(y.width=0,y.padding=10):y.shape==="hexagon"&&(y.width=0,y.height=0)}),await me(c,u);let{themeVariables:f}=fe(),{useGradient:p,gradientStart:x,gradientStop:L}=f;if(p&&x&&L){let y=u.attr("id"),A=u.append("defs").append("linearGradient").attr("id",`${y}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",L).attr("stop-opacity",1)}pe(u,((I=c.config.mindmap)==null?void 0:I.padding)??H.mindmap.padding,"mindmapDiagram",((_=c.config.mindmap)==null?void 0:_.useMaxWidth)??H.mindmap.useMaxWidth)},"draw"),Ie={draw:Oe},$e=h(t=>{let{theme:e,look:r}=t,l="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],_e(t["lineColor"+i])?t["lineColor"+i]=ke(t["lineColor"+i],20):t["lineColor"+i]=Ee(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){let c=""+(r==="neo"?Math.max(10-(i-1)*2,2):17-3*i);l+=`
|
|
8
|
-
.section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {
|
|
9
|
-
fill: ${t["cScale"+i]};
|
|
10
|
-
}
|
|
11
|
-
.section-${i-1} text {
|
|
12
|
-
fill: ${t["cScaleLabel"+i]};
|
|
13
|
-
}
|
|
14
|
-
.section-${i-1} span {
|
|
15
|
-
color: ${t["cScaleLabel"+i]};
|
|
16
|
-
}
|
|
17
|
-
.node-icon-${i-1} {
|
|
18
|
-
font-size: 40px;
|
|
19
|
-
color: ${t["cScaleLabel"+i]};
|
|
20
|
-
}
|
|
21
|
-
.section-edge-${i-1}{
|
|
22
|
-
stroke: ${t["cScale"+i]};
|
|
23
|
-
}
|
|
24
|
-
.edge-depth-${i-1}{
|
|
25
|
-
stroke-width: ${c};
|
|
26
|
-
}
|
|
27
|
-
.section-${i-1} line {
|
|
28
|
-
stroke: ${t["cScaleInv"+i]} ;
|
|
29
|
-
stroke-width: 3;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.disabled, .disabled circle, .disabled text {
|
|
33
|
-
fill: lightgray;
|
|
34
|
-
}
|
|
35
|
-
.disabled text {
|
|
36
|
-
fill: #efefef;
|
|
37
|
-
}
|
|
38
|
-
[data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
|
|
39
|
-
fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+i]};
|
|
40
|
-
stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+i]};
|
|
41
|
-
stroke-width: ${t.strokeWidth??2}px;
|
|
42
|
-
}
|
|
43
|
-
[data-look="neo"].section-edge-${i-1}{
|
|
44
|
-
stroke: ${e!=null&&e.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+i]};
|
|
45
|
-
}
|
|
46
|
-
[data-look="neo"].mindmap-node.section-${i-1} text {
|
|
47
|
-
fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:i)]};
|
|
48
|
-
}
|
|
49
|
-
`}return l},"genSections"),we=h((t,e,r)=>{let l="";for(let i=0;i<t;i++)l+=`
|
|
50
|
-
[data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
|
|
51
|
-
stroke: url(${e}-gradient);
|
|
52
|
-
fill: ${r};
|
|
53
|
-
}
|
|
54
|
-
.section-${i-1} line {
|
|
55
|
-
stroke-width: 0;
|
|
56
|
-
}`;return l},"genGradient"),Te=h(t=>{let{theme:e}=t,r=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return`
|
|
57
|
-
.edge {
|
|
58
|
-
stroke-width: 3;
|
|
59
|
-
}
|
|
60
|
-
${$e(t)}
|
|
61
|
-
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
62
|
-
fill: ${t.git0};
|
|
63
|
-
}
|
|
64
|
-
.section-root text {
|
|
65
|
-
fill: ${t.gitBranchLabel0};
|
|
66
|
-
}
|
|
67
|
-
.section-root span {
|
|
68
|
-
color: ${e!=null&&e.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
|
|
69
|
-
}
|
|
70
|
-
.icon-container {
|
|
71
|
-
height:100%;
|
|
72
|
-
display: flex;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
align-items: center;
|
|
75
|
-
}
|
|
76
|
-
.edge {
|
|
77
|
-
fill: none;
|
|
78
|
-
}
|
|
79
|
-
.mindmap-node-label {
|
|
80
|
-
dy: 1em;
|
|
81
|
-
alignment-baseline: middle;
|
|
82
|
-
text-anchor: middle;
|
|
83
|
-
dominant-baseline: middle;
|
|
84
|
-
text-align: center;
|
|
85
|
-
}
|
|
86
|
-
[data-look="neo"].mindmap-node {
|
|
87
|
-
filter: ${l};
|
|
88
|
-
}
|
|
89
|
-
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
|
|
90
|
-
fill: ${e!=null&&e.includes("redux")?t.mainBkg:t.git0};
|
|
91
|
-
}
|
|
92
|
-
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
|
|
93
|
-
fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
|
|
94
|
-
}
|
|
95
|
-
${t.useGradient&&r&&t.mainBkg?we(t.THEME_COLOR_LIMIT,r,t.mainBkg):""}
|
|
96
|
-
`},"getStyles"),Ce=Te,Me={get db(){return new ve},renderer:Ie,parser:Se,styles:Ce};export{Me as diagram};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{c as U}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as X}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{l as Z,a as _,s as ee,e as te,n as ae,h as ie,m as l,p as S,q as le,L as re,a7 as se,a8 as oe,a9 as W,aa as ne,b as pe,o as de,ab as ce,y as ue}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var he=ue.pie,v={sections:new Map,showData:!1},g=v.sections,y=v.showData,ge=structuredClone(he),me=l(()=>structuredClone(ge),"getConfig"),fe=l(()=>{g=new Map,y=v.showData,de()},"clear"),xe=l(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);g.has(e)||(g.set(e,a),S.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),$e=l(()=>g,"getSections"),we=l(e=>{y=e},"setShowData"),Se=l(()=>y,"getShowData"),E={getConfig:me,clear:fe,setDiagramTitle:ie,getDiagramTitle:ae,setAccTitle:te,getAccTitle:ee,setAccDescription:_,getAccDescription:Z,addSection:xe,getSections:$e,setShowData:we,getShowData:Se},ve=l((e,a)=>{U(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:l(async e=>{let a=await X("pie",e);S.debug(a),ve(a,E)},"parse")},Te=l(e=>`
|
|
2
|
-
.pieCircle{
|
|
3
|
-
stroke: ${e.pieStrokeColor};
|
|
4
|
-
stroke-width : ${e.pieStrokeWidth};
|
|
5
|
-
opacity : ${e.pieOpacity};
|
|
6
|
-
}
|
|
7
|
-
.pieOuterCircle{
|
|
8
|
-
stroke: ${e.pieOuterStrokeColor};
|
|
9
|
-
stroke-width: ${e.pieOuterStrokeWidth};
|
|
10
|
-
fill: none;
|
|
11
|
-
}
|
|
12
|
-
.pieTitleText {
|
|
13
|
-
text-anchor: middle;
|
|
14
|
-
font-size: ${e.pieTitleTextSize};
|
|
15
|
-
fill: ${e.pieTitleTextColor};
|
|
16
|
-
font-family: ${e.fontFamily};
|
|
17
|
-
}
|
|
18
|
-
.slice {
|
|
19
|
-
font-family: ${e.fontFamily};
|
|
20
|
-
fill: ${e.pieSectionTextColor};
|
|
21
|
-
font-size:${e.pieSectionTextSize};
|
|
22
|
-
// fill: white;
|
|
23
|
-
}
|
|
24
|
-
.legend text {
|
|
25
|
-
fill: ${e.pieLegendTextColor};
|
|
26
|
-
font-family: ${e.fontFamily};
|
|
27
|
-
font-size: ${e.pieLegendTextSize};
|
|
28
|
-
}
|
|
29
|
-
`,"getStyles"),be=Te,De=l(e=>{let a=[...e.values()].reduce((r,s)=>r+s,0),T=[...e.entries()].map(([r,s])=>({label:r,value:s})).filter(r=>r.value/a*100>=1);return ce().value(r=>r.value).sort(null)(T)},"createPieArcs"),Ce=l((e,a,T,r)=>{var B;S.debug(`rendering pie chart
|
|
30
|
-
`+e);let s=r.db,b=le(),D=re(s.getConfig(),b.pie),C=40,o=18,c=4,p=450,d=p,m=se(a),n=m.append("g");n.attr("transform","translate("+d/2+","+p/2+")");let{themeVariables:i}=b,[k]=oe(i.pieOuterStrokeWidth);k??(k=2);let A=D.textPosition,u=Math.min(d,p)/2-C,P=W().innerRadius(0).outerRadius(u),q=W().innerRadius(u*A).outerRadius(u*A);n.append("circle").attr("cx",0).attr("cy",0).attr("r",u+k/2).attr("class","pieOuterCircle");let h=s.getSections(),j=De(h),G=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12],f=0;h.forEach(t=>{f+=t});let M=j.filter(t=>(t.data.value/f*100).toFixed(0)!=="0"),x=ne(G).domain([...h.keys()]);n.selectAll("mySlices").data(M).enter().append("path").attr("d",P).attr("fill",t=>x(t.data.label)).attr("class","pieCircle"),n.selectAll("mySlices").data(M).enter().append("text").text(t=>(t.data.value/f*100).toFixed(0)+"%").attr("transform",t=>"translate("+q.centroid(t)+")").style("text-anchor","middle").attr("class","slice");let H=n.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),O=[...h.entries()].map(([t,w])=>({label:t,value:w})),$=n.selectAll(".legend").data(O).enter().append("g").attr("class","legend").attr("transform",(t,w)=>{let L=o+c,J=L*O.length/2,K=12*o,Q=w*L-J;return"translate("+K+","+Q+")"});$.append("rect").attr("width",o).attr("height",o).style("fill",t=>x(t.label)).style("stroke",t=>x(t.label)),$.append("text").attr("x",o+c).attr("y",o-c).text(t=>s.getShowData()?`${t.label} [${t.value}]`:t.label);let N=Math.max(...$.selectAll("text").nodes().map(t=>(t==null?void 0:t.getBoundingClientRect().width)??0)),V=d+C+o+c+N,R=((B=H.node())==null?void 0:B.getBoundingClientRect().width)??0,Y=d/2-R/2,I=d/2+R/2,z=Math.min(0,Y),F=Math.max(V,I)-z;m.attr("viewBox",`${z} 0 ${F} ${p}`),pe(m,p,F,D.useMaxWidth)},"draw"),ke={draw:Ce},ze={parser:ye,db:E,renderer:ke,styles:be};export{ze as diagram};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as _e,l as ke,n as ie,h as Fe,s as Pe,e as Ce,m as l,q as wt,p as bt,i as Et,b as ve,o as Le,y as E,Z as ee,c as Ee,ac as De}from"./index-BgeqpYgd.js";var Dt=function(){var t=l(function(H,s,c,o){for(c=c||{},o=H.length;o--;c[H[o]]=s);return c},"o"),n=[1,3],d=[1,4],u=[1,5],h=[1,6],f=[1,7],g=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],T=[2,36],p=[1,37],y=[1,36],A=[1,38],q=[1,35],x=[1,43],m=[1,41],U=[1,14],j=[1,23],K=[1,18],pt=[1,19],ut=[1,20],dt=[1,21],xt=[1,22],ft=[1,24],gt=[1,25],i=[1,26],zt=[1,27],Nt=[1,28],Wt=[1,29],$=[1,32],Q=[1,33],_=[1,34],k=[1,39],F=[1,40],P=[1,42],C=[1,44],M=[1,62],O=[1,61],v=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,65],Rt=[1,66],$t=[1,67],Qt=[1,68],Ht=[1,69],Xt=[1,70],Ut=[1,71],Mt=[1,72],Ot=[1,73],Yt=[1,74],jt=[1,75],Kt=[1,76],z=[4,5,6,7,8,9,10,11,12,13,14,15,18],V=[1,90],J=[1,91],tt=[1,92],et=[1,99],it=[1,93],at=[1,96],nt=[1,94],st=[1,95],rt=[1,97],lt=[1,98],_t=[1,102],Zt=[10,55,56,57],B=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:l(function(H,s,c,o,b,e,N){var r=e.length-1;switch(b){case 23:this.$=e[r];break;case 24:this.$=e[r-1]+""+e[r];break;case 26:this.$=e[r-1]+e[r];break;case 27:this.$=[e[r].trim()];break;case 28:e[r-2].push(e[r].trim()),this.$=e[r-2];break;case 29:this.$=e[r-4],o.addClass(e[r-2],e[r]);break;case 37:this.$=[];break;case 42:this.$=e[r].trim(),o.setDiagramTitle(this.$);break;case 43:this.$=e[r].trim(),o.setAccTitle(this.$);break;case 44:case 45:this.$=e[r].trim(),o.setAccDescription(this.$);break;case 46:o.addSection(e[r].substr(8)),this.$=e[r].substr(8);break;case 47:o.addPoint(e[r-3],"",e[r-1],e[r],[]);break;case 48:o.addPoint(e[r-4],e[r-3],e[r-1],e[r],[]);break;case 49:o.addPoint(e[r-4],"",e[r-2],e[r-1],e[r]);break;case 50:o.addPoint(e[r-5],e[r-4],e[r-2],e[r-1],e[r]);break;case 51:o.setXAxisLeftText(e[r-2]),o.setXAxisRightText(e[r]);break;case 52:e[r-1].text+=" ⟶ ",o.setXAxisLeftText(e[r-1]);break;case 53:o.setXAxisLeftText(e[r]);break;case 54:o.setYAxisBottomText(e[r-2]),o.setYAxisTopText(e[r]);break;case 55:e[r-1].text+=" ⟶ ",o.setYAxisBottomText(e[r-1]);break;case 56:o.setYAxisBottomText(e[r]);break;case 57:o.setQuadrant1Text(e[r]);break;case 58:o.setQuadrant2Text(e[r]);break;case 59:o.setQuadrant3Text(e[r]);break;case 60:o.setQuadrant4Text(e[r]);break;case 64:this.$={text:e[r],type:"text"};break;case 65:this.$={text:e[r-1].text+""+e[r],type:e[r-1].type};break;case 66:this.$={text:e[r],type:"text"};break;case 67:this.$={text:e[r],type:"markdown"};break;case 68:this.$=e[r];break;case 69:this.$=e[r-1]+""+e[r];break}},"anonymous"),table:[{18:n,26:1,27:2,28:d,55:u,56:h,57:f},{1:[3]},{18:n,26:8,27:2,28:d,55:u,56:h,57:f},{18:n,26:9,27:2,28:d,55:u,56:h,57:f},t(g,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,T,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:p,5:y,10:A,12:q,13:x,14:m,18:U,25:j,35:K,37:pt,39:ut,41:dt,42:xt,48:ft,50:gt,51:i,52:zt,53:Nt,54:Wt,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(g,[2,34]),{27:45,55:u,56:h,57:f},t(a,[2,37]),t(a,T,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:p,5:y,10:A,12:q,13:x,14:m,18:U,25:j,35:K,37:pt,39:ut,41:dt,42:xt,48:ft,50:gt,51:i,52:zt,53:Nt,54:Wt,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:p,5:y,10:A,12:q,13:x,14:m,43:51,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:52,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:53,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:54,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:55,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:56,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,44:[1,57],47:[1,58],58:60,59:59,63:_,64:k,65:F,66:P,67:C},t(v,[2,64]),t(v,[2,66]),t(v,[2,67]),t(v,[2,70]),t(v,[2,71]),t(v,[2,72]),t(v,[2,73]),t(v,[2,74]),t(v,[2,75]),t(v,[2,76]),t(v,[2,77]),t(v,[2,78]),t(v,[2,79]),t(v,[2,80]),t(g,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Bt,5:Rt,6:$t,7:Qt,8:Ht,9:Xt,10:Ut,11:Mt,12:Ot,13:Yt,14:jt,15:Kt,21:63},t(a,[2,53],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,49:[1,77],63:_,64:k,65:F,66:P,67:C}),t(a,[2,56],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,49:[1,78],63:_,64:k,65:F,66:P,67:C}),t(a,[2,57],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,58],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,59],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,60],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),{45:[1,79]},{44:[1,80]},t(v,[2,65]),t(v,[2,81]),t(v,[2,82]),t(v,[2,83]),{3:82,4:Bt,5:Rt,6:$t,7:Qt,8:Ht,9:Xt,10:Ut,11:Mt,12:Ot,13:Yt,14:jt,15:Kt,18:[1,81]},t(z,[2,23]),t(z,[2,1]),t(z,[2,2]),t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),t(z,[2,9]),t(z,[2,10]),t(z,[2,11]),t(z,[2,12]),t(a,[2,52],{58:31,43:83,4:p,5:y,10:A,12:q,13:x,14:m,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(a,[2,55],{58:31,43:84,4:p,5:y,10:A,12:q,13:x,14:m,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),{46:[1,85]},{45:[1,86]},{4:V,5:J,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:lt,22:88,23:87},t(z,[2,24]),t(a,[2,51],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,54],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),{46:[1,101]},t(a,[2,29],{10:_t}),t(Zt,[2,27],{16:103,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),t(B,[2,25]),t(B,[2,13]),t(B,[2,14]),t(B,[2,15]),t(B,[2,16]),t(B,[2,17]),t(B,[2,18]),t(B,[2,19]),t(B,[2,20]),t(B,[2,21]),t(B,[2,22]),t(a,[2,49],{10:_t}),t(a,[2,48],{22:88,16:89,23:104,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),{4:V,5:J,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:lt,22:105},t(B,[2,26]),t(a,[2,50],{10:_t}),t(Zt,[2,28],{16:103,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:l(function(H,s){if(s.recoverable)this.trace(H);else{var c=new Error(H);throw c.hash=s,c}},"parseError"),parse:l(function(H){var s=this,c=[0],o=[],b=[null],e=[],N=this.table,r="",Tt=0,Gt=0,qe=0,me=2,Vt=1,Ae=e.slice.call(arguments,1),L=Object.create(this.lexer),Z={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(Z.yy[Ft]=this.yy[Ft]);L.setInput(H,Z.yy),Z.yy.lexer=L,Z.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var Pt=L.yylloc;e.push(Pt);var be=L.options&&L.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(W){c.length=c.length-2*W,b.length=b.length-W,e.length=e.length-W}l(Se,"popStack");function Jt(){var W;return W=o.pop()||L.lex()||Vt,typeof W!="number"&&(W instanceof Array&&(o=W,W=o.pop()),W=s.symbols_[W]||W),W}l(Jt,"lex");for(var I,Ct,G,R,$e,vt,ot={},qt,Y,te,mt;;){if(G=c[c.length-1],this.defaultActions[G]?R=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Jt()),R=N[G]&&N[G][I]),typeof R>"u"||!R.length||!R[0]){var Lt="";mt=[];for(qt in N[G])this.terminals_[qt]&&qt>me&&mt.push("'"+this.terminals_[qt]+"'");L.showPosition?Lt="Parse error on line "+(Tt+1)+`:
|
|
2
|
-
`+L.showPosition()+`
|
|
3
|
-
Expecting `+mt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Lt="Parse error on line "+(Tt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Lt,{text:L.match,token:this.terminals_[I]||I,line:L.yylineno,loc:Pt,expected:mt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+I);switch(R[0]){case 1:c.push(I),b.push(L.yytext),e.push(L.yylloc),c.push(R[1]),I=null,Ct?(I=Ct,Ct=null):(Gt=L.yyleng,r=L.yytext,Tt=L.yylineno,Pt=L.yylloc,qe>0);break;case 2:if(Y=this.productions_[R[1]][1],ot.$=b[b.length-Y],ot._$={first_line:e[e.length-(Y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(Y||1)].first_column,last_column:e[e.length-1].last_column},be&&(ot._$.range=[e[e.length-(Y||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(ot,[r,Gt,Tt,Z.yy,R[1],b,e].concat(Ae)),typeof vt<"u")return vt;Y&&(c=c.slice(0,-1*Y*2),b=b.slice(0,-1*Y),e=e.slice(0,-1*Y)),c.push(this.productions_[R[1]][0]),b.push(ot.$),e.push(ot._$),te=N[c[c.length-2]][c[c.length-1]],c.push(te);break;case 3:return!0}}return!0},"parse")},Te=function(){var H={EOF:1,parseError:l(function(s,c){if(this.yy.parser)this.yy.parser.parseError(s,c);else throw new Error(s)},"parseError"),setInput:l(function(s,c){return this.yy=c||this.yy||{},this._input=s,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},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var c=s.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var c=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var b=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),o.length-1&&(this.yylineno-=o.length-1);var e=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:o?(o.length===b.length?this.yylloc.first_column:0)+b[b.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),c=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
-
`+c+"^"},"showPosition"),test_match:l(function(s,c){var o,b,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),b=s[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var N in e)this[N]=e[N];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,c,o,b;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),N=0;N<e.length;N++)if(o=this._input.match(this.rules[e[N]]),o&&(!c||o[0].length>c[0].length)){if(c=o,b=N,this.options.backtrack_lexer){if(s=this.test_match(o,e[N]),s!==!1)return s;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(s=this.test_match(c,e[b]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,c,o,b){switch(o){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/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,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return H}();kt.lexer=Te;function yt(){this.yy={}}return l(yt,"Parser"),yt.prototype=kt,kt.Parser=yt,new yt}();Dt.parser=Dt;var Ie=Dt,w=De(),ht,we=(ht=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var n,d,u,h,f,g,S,a,T,p,y,A,q,x,m,U,j,K;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((n=E.quadrantChart)==null?void 0:n.chartWidth)||500,chartWidth:((d=E.quadrantChart)==null?void 0:d.chartHeight)||500,titlePadding:((u=E.quadrantChart)==null?void 0:u.titlePadding)||10,titleFontSize:((h=E.quadrantChart)==null?void 0:h.titleFontSize)||20,quadrantPadding:((f=E.quadrantChart)==null?void 0:f.quadrantPadding)||5,xAxisLabelPadding:((g=E.quadrantChart)==null?void 0:g.xAxisLabelPadding)||5,yAxisLabelPadding:((S=E.quadrantChart)==null?void 0:S.yAxisLabelPadding)||5,xAxisLabelFontSize:((a=E.quadrantChart)==null?void 0:a.xAxisLabelFontSize)||16,yAxisLabelFontSize:((T=E.quadrantChart)==null?void 0:T.yAxisLabelFontSize)||16,quadrantLabelFontSize:((p=E.quadrantChart)==null?void 0:p.quadrantLabelFontSize)||16,quadrantTextTopPadding:((y=E.quadrantChart)==null?void 0:y.quadrantTextTopPadding)||5,pointTextPadding:((A=E.quadrantChart)==null?void 0:A.pointTextPadding)||5,pointLabelFontSize:((q=E.quadrantChart)==null?void 0:q.pointLabelFontSize)||12,pointRadius:((x=E.quadrantChart)==null?void 0:x.pointRadius)||5,xAxisPosition:((m=E.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((U=E.quadrantChart)==null?void 0:U.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((j=E.quadrantChart)==null?void 0:j.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((K=E.quadrantChart)==null?void 0:K.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:w.quadrant1Fill,quadrant2Fill:w.quadrant2Fill,quadrant3Fill:w.quadrant3Fill,quadrant4Fill:w.quadrant4Fill,quadrant1TextFill:w.quadrant1TextFill,quadrant2TextFill:w.quadrant2TextFill,quadrant3TextFill:w.quadrant3TextFill,quadrant4TextFill:w.quadrant4TextFill,quadrantPointFill:w.quadrantPointFill,quadrantPointTextFill:w.quadrantPointTextFill,quadrantXAxisTextFill:w.quadrantXAxisTextFill,quadrantYAxisTextFill:w.quadrantYAxisTextFill,quadrantTitleFill:w.quadrantTitleFill,quadrantInternalBorderStrokeFill:w.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:w.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,d){this.classes.set(n,d)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,d,u,h){let f=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,g={top:n==="top"&&d?f:0,bottom:n==="bottom"&&d?f:0},S=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&u?S:0,right:this.config.yAxisPosition==="right"&&u?S:0},T=this.config.titleFontSize+this.config.titlePadding*2,p={top:h?T:0},y=this.config.quadrantPadding+a.left,A=this.config.quadrantPadding+g.top+p.top,q=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,x=this.config.chartHeight-this.config.quadrantPadding*2-g.top-g.bottom-p.top,m=q/2,U=x/2;return{xAxisSpace:g,yAxisSpace:a,titleSpace:p,quadrantSpace:{quadrantLeft:y,quadrantTop:A,quadrantWidth:q,quadrantHalfWidth:m,quadrantHeight:x,quadrantHalfHeight:U}}}getAxisLabels(n,d,u,h){let{quadrantSpace:f,titleSpace:g}=h,{quadrantHalfHeight:S,quadrantHeight:a,quadrantLeft:T,quadrantHalfWidth:p,quadrantTop:y,quadrantWidth:A}=f,q=!!this.data.xAxisRightText,x=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&d&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:T+(q?p/2:0),y:n==="top"?this.config.xAxisLabelPadding+g.top:this.config.xAxisLabelPadding+y+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&d&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:T+p+(q?p/2:0),y:n==="top"?this.config.xAxisLabelPadding+g.top:this.config.xAxisLabelPadding+y+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&u&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+T+A+this.config.quadrantPadding,y:y+a-(x?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&u&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+T+A+this.config.quadrantPadding,y:y+S-(x?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(n){let{quadrantSpace:d}=n,{quadrantHalfHeight:u,quadrantLeft:h,quadrantHalfWidth:f,quadrantTop:g}=d,S=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+f,y:g,width:f,height:u,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:g,width:f,height:u,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:g+u,width:f,height:u,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+f,y:g+u,width:f,height:u,fill:this.themeConfig.quadrant4Fill}];for(let a of S)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return S}getQuadrantPoints(n){let{quadrantSpace:d}=n,{quadrantHeight:u,quadrantLeft:h,quadrantTop:f,quadrantWidth:g}=d,S=ee().domain([0,1]).range([h,g+h]),a=ee().domain([0,1]).range([u+f,f]);return this.data.points.map(T=>{let p=this.classes.get(T.className);return p&&(T={...p,...T}),{x:S(T.x),y:a(T.y),fill:T.color??this.themeConfig.quadrantPointFill,radius:T.radius??this.config.pointRadius,text:{text:T.text,fill:this.themeConfig.quadrantPointTextFill,x:S(T.x),y:a(T.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:T.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:T.strokeWidth??"0px"}})}getBorders(n){let d=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:u}=n,{quadrantHalfHeight:h,quadrantHeight:f,quadrantLeft:g,quadrantHalfWidth:S,quadrantTop:a,quadrantWidth:T}=u;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g-d,y1:a,x2:g+T+d,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g+T,y1:a+d,x2:g+T,y2:a+f-d},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g-d,y1:a+f,x2:g+T+d,y2:a+f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g,y1:a+d,x2:g,y2:a+f-d},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:g+S,y1:a+d,x2:g+S,y2:a+f-d},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:g+d,y1:a+h,x2:g+T-d,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){let n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),d=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),u=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,f=this.calculateSpace(h,n,d,u);return{points:this.getQuadrantPoints(f),quadrants:this.getQuadrants(f),axisLabels:this.getAxisLabels(h,n,d,f),borderLines:this.getBorders(f),title:this.getTitle(u)}}},l(ht,"QuadrantBuilder"),ht),ct,At=(ct=class extends Error{constructor(n,d,u){super(`value for ${n} ${d} is invalid, please use a valid ${u}`),this.name="InvalidStyleError"}},l(ct,"InvalidStyleError"),ct);function It(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}l(It,"validateHexCode");function ae(t){return!/^\d+$/.test(t)}l(ae,"validateNumber");function ne(t){return!/^\d+px$/.test(t)}l(ne,"validateSizeInPixels");var ze=wt();function X(t){return Ee(t.trim(),ze)}l(X,"textSanitizer");var D=new we;function se(t){D.setData({quadrant1Text:X(t.text)})}l(se,"setQuadrant1Text");function re(t){D.setData({quadrant2Text:X(t.text)})}l(re,"setQuadrant2Text");function le(t){D.setData({quadrant3Text:X(t.text)})}l(le,"setQuadrant3Text");function oe(t){D.setData({quadrant4Text:X(t.text)})}l(oe,"setQuadrant4Text");function he(t){D.setData({xAxisLeftText:X(t.text)})}l(he,"setXAxisLeftText");function ce(t){D.setData({xAxisRightText:X(t.text)})}l(ce,"setXAxisRightText");function ue(t){D.setData({yAxisTopText:X(t.text)})}l(ue,"setYAxisTopText");function de(t){D.setData({yAxisBottomText:X(t.text)})}l(de,"setYAxisBottomText");function St(t){let n={};for(let d of t){let[u,h]=d.trim().split(/\s*:\s*/);if(u==="radius"){if(ae(h))throw new At(u,h,"number");n.radius=parseInt(h)}else if(u==="color"){if(It(h))throw new At(u,h,"hex code");n.color=h}else if(u==="stroke-color"){if(It(h))throw new At(u,h,"hex code");n.strokeColor=h}else if(u==="stroke-width"){if(ne(h))throw new At(u,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${u} is not supported.`)}return n}l(St,"parseStyles");function xe(t,n,d,u,h){let f=St(h);D.addPoints([{x:d,y:u,text:X(t.text),className:n,...f}])}l(xe,"addPoint");function fe(t,n){D.addClass(t,St(n))}l(fe,"addClass");function ge(t){D.setConfig({chartWidth:t})}l(ge,"setWidth");function pe(t){D.setConfig({chartHeight:t})}l(pe,"setHeight");function ye(){let t=wt(),{themeVariables:n,quadrantChart:d}=t;return d&&D.setConfig(d),D.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),D.setData({titleText:ie()}),D.build()}l(ye,"getQuadrantData");var Ne=l(function(){D.clear(),Le()},"clear"),We={setWidth:ge,setHeight:pe,setQuadrant1Text:se,setQuadrant2Text:re,setQuadrant3Text:le,setQuadrant4Text:oe,setXAxisLeftText:he,setXAxisRightText:ce,setYAxisTopText:ue,setYAxisBottomText:de,parseStyles:St,addPoint:xe,addClass:fe,getQuadrantData:ye,clear:Ne,setAccTitle:Ce,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ie,getAccDescription:ke,setAccDescription:_e},Be=l((t,n,d,u)=>{var xt,ft,gt;function h(i){return i==="top"?"hanging":"middle"}l(h,"getDominantBaseLine");function f(i){return i==="left"?"start":"middle"}l(f,"getTextAnchor");function g(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}l(g,"getTransformation");let S=wt();bt.debug(`Rendering quadrant chart
|
|
7
|
-
`+t);let a=S.securityLevel,T;a==="sandbox"&&(T=Et("#i"+n));let p=(a==="sandbox"?Et(T.nodes()[0].contentDocument.body):Et("body")).select(`[id="${n}"]`),y=p.append("g").attr("class","main"),A=((xt=S.quadrantChart)==null?void 0:xt.chartWidth)??500,q=((ft=S.quadrantChart)==null?void 0:ft.chartHeight)??500;ve(p,q,A,((gt=S.quadrantChart)==null?void 0:gt.useMaxWidth)??!0),p.attr("viewBox","0 0 "+A+" "+q),u.db.setHeight(q),u.db.setWidth(A);let x=u.db.getQuadrantData(),m=y.append("g").attr("class","quadrants"),U=y.append("g").attr("class","border"),j=y.append("g").attr("class","data-points"),K=y.append("g").attr("class","labels"),pt=y.append("g").attr("class","title");x.title&&pt.append("text").attr("x",0).attr("y",0).attr("fill",x.title.fill).attr("font-size",x.title.fontSize).attr("dominant-baseline",h(x.title.horizontalPos)).attr("text-anchor",f(x.title.verticalPos)).attr("transform",g(x.title)).text(x.title.text),x.borderLines&&U.selectAll("line").data(x.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);let ut=m.selectAll("g.quadrant").data(x.quadrants).enter().append("g").attr("class","quadrant");ut.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ut.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>f(i.text.verticalPos)).attr("transform",i=>g(i.text)).text(i=>i.text.text),K.selectAll("g.label").data(x.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>f(i.verticalPos)).attr("transform",i=>g(i));let dt=j.selectAll("g.data-point").data(x.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>f(i.text.verticalPos)).attr("transform",i=>g(i.text))},"draw"),Re={draw:Be},He={parser:Ie,db:We,renderer:Re,styles:l(()=>"","styles")};export{He as diagram};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{h as zt,n as jt,a as Bt,l as Ft,e as qt,s as Rt,m as n,q as dt,t as Ut,i as K,aa as Wt,as as Gt,o as Vt,C as Ht,ay as Qt}from"./index-BgeqpYgd.js";var rt=function(){var t=n(function(x,s,a,f){for(a=a||{},f=x.length;f--;a[x[f]]=s);return a},"o"),i=[1,9],r=[1,10],l=[1,5,10,12],h={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:n(function(x,s,a,f,k,d,b){var v=d.length-1;switch(k){case 7:let I=f.findOrCreateNode(d[v-4].trim().replaceAll('""','"')),A=f.findOrCreateNode(d[v-2].trim().replaceAll('""','"')),N=parseFloat(d[v].trim());f.addLink(I,A,N);break;case 8:case 9:case 11:this.$=d[v];break;case 10:this.$=d[v-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:r},{15:18,16:7,17:8,18:i,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:n(function(x,s){if(s.recoverable)this.trace(x);else{var a=new Error(x);throw a.hash=s,a}},"parseError"),parse:n(function(x){var s=this,a=[0],f=[],k=[null],d=[],b=this.table,v="",I=0,A=0,N=0,z=2,M=1,j=d.slice.call(arguments,1),L=Object.create(this.lexer),C={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(C.yy[D]=this.yy[D]);L.setInput(x,C.yy),C.yy.lexer=L,C.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var g=L.yylloc;d.push(g);var S=L.options&&L.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(E){a.length=a.length-2*E,k.length=k.length-E,d.length=d.length-E}n(G,"popStack");function q(){var E;return E=f.pop()||L.lex()||M,typeof E!="number"&&(E instanceof Array&&(f=E,E=f.pop()),E=s.symbols_[E]||E),E}n(q,"lex");for(var T,R,P,e,y,u,c={},o,p,w,$;;){if(P=a[a.length-1],this.defaultActions[P]?e=this.defaultActions[P]:((T===null||typeof T>"u")&&(T=q()),e=b[P]&&b[P][T]),typeof e>"u"||!e.length||!e[0]){var O="";$=[];for(o in b[P])this.terminals_[o]&&o>z&&$.push("'"+this.terminals_[o]+"'");L.showPosition?O="Parse error on line "+(I+1)+`:
|
|
2
|
-
`+L.showPosition()+`
|
|
3
|
-
Expecting `+$.join(", ")+", got '"+(this.terminals_[T]||T)+"'":O="Parse error on line "+(I+1)+": Unexpected "+(T==M?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(O,{text:L.match,token:this.terminals_[T]||T,line:L.yylineno,loc:g,expected:$})}if(e[0]instanceof Array&&e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+T);switch(e[0]){case 1:a.push(T),k.push(L.yytext),d.push(L.yylloc),a.push(e[1]),T=null,R?(T=R,R=null):(A=L.yyleng,v=L.yytext,I=L.yylineno,g=L.yylloc,N>0);break;case 2:if(p=this.productions_[e[1]][1],c.$=k[k.length-p],c._$={first_line:d[d.length-(p||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(p||1)].first_column,last_column:d[d.length-1].last_column},S&&(c._$.range=[d[d.length-(p||1)].range[0],d[d.length-1].range[1]]),u=this.performAction.apply(c,[v,A,I,C.yy,e[1],k,d].concat(j)),typeof u<"u")return u;p&&(a=a.slice(0,-1*p*2),k=k.slice(0,-1*p),d=d.slice(0,-1*p)),a.push(this.productions_[e[1]][0]),k.push(c.$),d.push(c._$),w=b[a[a.length-2]][a[a.length-1]],a.push(w);break;case 3:return!0}}return!0},"parse")},m=function(){var x={EOF:1,parseError:n(function(s,a){if(this.yy.parser)this.yy.parser.parseError(s,a);else throw new Error(s)},"parseError"),setInput:n(function(s,a){return this.yy=a||this.yy||{},this._input=s,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},"setInput"),input:n(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:n(function(s){var a=s.length,f=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var k=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),f.length-1&&(this.yylineno-=f.length-1);var d=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:f?(f.length===k.length?this.yylloc.first_column:0)+k[k.length-f.length].length-f[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(s){this.unput(this.match.slice(s))},"less"),pastInput:n(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
-
`+a+"^"},"showPosition"),test_match:n(function(s,a){var f,k,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),k=s[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],f=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var b in d)this[b]=d[b];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,f,k;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),b=0;b<d.length;b++)if(f=this._input.match(this.rules[d[b]]),f&&(!a||f[0].length>a[0].length)){if(a=f,k=b,this.options.backtrack_lexer){if(s=this.test_match(f,d[b]),s!==!1)return s;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(s=this.test_match(a,d[k]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var s=this.next();return s||this.lex()},"lex"),begin:n(function(s){this.conditionStack.push(s)},"begin"),popState:n(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:n(function(s){this.begin(s)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(s,a,f,k){switch(f){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return x}();h.lexer=m;function _(){this.yy={}}return n(_,"Parser"),_.prototype=h,h.Parser=_,new _}();rt.parser=rt;var J=rt,nt=[],it=[],tt=new Map,Xt=n(()=>{nt=[],it=[],tt=new Map,Vt()},"clear"),U,Kt=(U=class{constructor(i,r,l=0){this.source=i,this.target=r,this.value=l}},n(U,"SankeyLink"),U),Zt=n((t,i,r)=>{nt.push(new Kt(t,i,r))},"addLink"),W,Yt=(W=class{constructor(i){this.ID=i}},n(W,"SankeyNode"),W),Jt=n(t=>{t=Ht.sanitizeText(t,dt());let i=tt.get(t);return i===void 0&&(i=new Yt(t),tt.set(t,i),it.push(i)),i},"findOrCreateNode"),te=n(()=>it,"getNodes"),ee=n(()=>nt,"getLinks"),ne=n(()=>({nodes:it.map(t=>({id:t.ID})),links:nt.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ie={nodesMap:tt,getConfig:n(()=>dt().sankey,"getConfig"),getNodes:te,getLinks:ee,getGraph:ne,addLink:Zt,findOrCreateNode:Jt,getAccTitle:Rt,setAccTitle:qt,getAccDescription:Ft,setAccDescription:Bt,getDiagramTitle:jt,setDiagramTitle:zt,clear:Xt};function ot(t,i){let r;if(i===void 0)for(let l of t)l!=null&&(r<l||r===void 0&&l>=l)&&(r=l);else{let l=-1;for(let h of t)(h=i(h,++l,t))!=null&&(r<h||r===void 0&&h>=h)&&(r=h)}return r}n(ot,"max");function gt(t,i){let r;if(i===void 0)for(let l of t)l!=null&&(r>l||r===void 0&&l>=l)&&(r=l);else{let l=-1;for(let h of t)(h=i(h,++l,t))!=null&&(r>h||r===void 0&&h>=h)&&(r=h)}return r}n(gt,"min");function Z(t,i){let r=0;if(i===void 0)for(let l of t)(l=+l)&&(r+=l);else{let l=-1;for(let h of t)(h=+i(h,++l,t))&&(r+=h)}return r}n(Z,"sum");function kt(t){return t.target.depth}n(kt,"targetDepth");function xt(t){return t.depth}n(xt,"left");function vt(t,i){return i-1-t.height}n(vt,"right");function pt(t,i){return t.sourceLinks.length?t.depth:i-1}n(pt,"justify");function wt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?gt(t.sourceLinks,kt)-1:0}n(wt,"center");function Q(t){return function(){return t}}n(Q,"constant");function at(t,i){return X(t.source,i.source)||t.index-i.index}n(at,"ascendingSourceBreadth");function lt(t,i){return X(t.target,i.target)||t.index-i.index}n(lt,"ascendingTargetBreadth");function X(t,i){return t.y0-i.y0}n(X,"ascendingBreadth");function Y(t){return t.value}n(Y,"value");function bt(t){return t.index}n(bt,"defaultId");function Lt(t){return t.nodes}n(Lt,"defaultNodes");function Et(t){return t.links}n(Et,"defaultLinks");function ht(t,i){let r=t.get(i);if(!r)throw new Error("missing: "+i);return r}n(ht,"find");function ut({nodes:t}){for(let i of t){let r=i.y0,l=r;for(let h of i.sourceLinks)h.y0=r+h.width/2,r+=h.width;for(let h of i.targetLinks)h.y1=l+h.width/2,l+=h.width}}n(ut,"computeLinkBreadths");function Tt(){let t=0,i=0,r=1,l=1,h=24,m=8,_,x=bt,s=pt,a,f,k=Lt,d=Et,b=6;function v(){let e={nodes:k.apply(null,arguments),links:d.apply(null,arguments)};return I(e),A(e),N(e),z(e),L(e),ut(e),e}n(v,"sankey"),v.update=function(e){return ut(e),e},v.nodeId=function(e){return arguments.length?(x=typeof e=="function"?e:Q(e),v):x},v.nodeAlign=function(e){return arguments.length?(s=typeof e=="function"?e:Q(e),v):s},v.nodeSort=function(e){return arguments.length?(a=e,v):a},v.nodeWidth=function(e){return arguments.length?(h=+e,v):h},v.nodePadding=function(e){return arguments.length?(m=_=+e,v):m},v.nodes=function(e){return arguments.length?(k=typeof e=="function"?e:Q(e),v):k},v.links=function(e){return arguments.length?(d=typeof e=="function"?e:Q(e),v):d},v.linkSort=function(e){return arguments.length?(f=e,v):f},v.size=function(e){return arguments.length?(t=i=0,r=+e[0],l=+e[1],v):[r-t,l-i]},v.extent=function(e){return arguments.length?(t=+e[0][0],r=+e[1][0],i=+e[0][1],l=+e[1][1],v):[[t,i],[r,l]]},v.iterations=function(e){return arguments.length?(b=+e,v):b};function I({nodes:e,links:y}){for(let[c,o]of e.entries())o.index=c,o.sourceLinks=[],o.targetLinks=[];let u=new Map(e.map((c,o)=>[x(c,o,e),c]));for(let[c,o]of y.entries()){o.index=c;let{source:p,target:w}=o;typeof p!="object"&&(p=o.source=ht(u,p)),typeof w!="object"&&(w=o.target=ht(u,w)),p.sourceLinks.push(o),w.targetLinks.push(o)}if(f!=null)for(let{sourceLinks:c,targetLinks:o}of e)c.sort(f),o.sort(f)}n(I,"computeNodeLinks");function A({nodes:e}){for(let y of e)y.value=y.fixedValue===void 0?Math.max(Z(y.sourceLinks,Y),Z(y.targetLinks,Y)):y.fixedValue}n(A,"computeNodeValues");function N({nodes:e}){let y=e.length,u=new Set(e),c=new Set,o=0;for(;u.size;){for(let p of u){p.depth=o;for(let{target:w}of p.sourceLinks)c.add(w)}if(++o>y)throw new Error("circular link");u=c,c=new Set}}n(N,"computeNodeDepths");function z({nodes:e}){let y=e.length,u=new Set(e),c=new Set,o=0;for(;u.size;){for(let p of u){p.height=o;for(let{source:w}of p.targetLinks)c.add(w)}if(++o>y)throw new Error("circular link");u=c,c=new Set}}n(z,"computeNodeHeights");function M({nodes:e}){let y=ot(e,o=>o.depth)+1,u=(r-t-h)/(y-1),c=new Array(y);for(let o of e){let p=Math.max(0,Math.min(y-1,Math.floor(s.call(null,o,y))));o.layer=p,o.x0=t+p*u,o.x1=o.x0+h,c[p]?c[p].push(o):c[p]=[o]}if(a)for(let o of c)o.sort(a);return c}n(M,"computeNodeLayers");function j(e){let y=gt(e,u=>(l-i-(u.length-1)*_)/Z(u,Y));for(let u of e){let c=i;for(let o of u){o.y0=c,o.y1=c+o.value*y,c=o.y1+_;for(let p of o.sourceLinks)p.width=p.value*y}c=(l-c+_)/(u.length+1);for(let o=0;o<u.length;++o){let p=u[o];p.y0+=c*(o+1),p.y1+=c*(o+1)}T(u)}}n(j,"initializeNodeBreadths");function L(e){let y=M(e);_=Math.min(m,(l-i)/(ot(y,u=>u.length)-1)),j(y);for(let u=0;u<b;++u){let c=Math.pow(.99,u),o=Math.max(1-c,(u+1)/b);D(y,c,o),C(y,c,o)}}n(L,"computeNodeBreadths");function C(e,y,u){for(let c=1,o=e.length;c<o;++c){let p=e[c];for(let w of p){let $=0,O=0;for(let{source:V,value:st}of w.targetLinks){let H=st*(w.layer-V.layer);$+=R(V,w)*H,O+=H}if(!(O>0))continue;let E=($/O-w.y0)*y;w.y0+=E,w.y1+=E,q(w)}a===void 0&&p.sort(X),g(p,u)}}n(C,"relaxLeftToRight");function D(e,y,u){for(let c=e.length,o=c-2;o>=0;--o){let p=e[o];for(let w of p){let $=0,O=0;for(let{target:V,value:st}of w.sourceLinks){let H=st*(V.layer-w.layer);$+=P(w,V)*H,O+=H}if(!(O>0))continue;let E=($/O-w.y0)*y;w.y0+=E,w.y1+=E,q(w)}a===void 0&&p.sort(X),g(p,u)}}n(D,"relaxRightToLeft");function g(e,y){let u=e.length>>1,c=e[u];G(e,c.y0-_,u-1,y),S(e,c.y1+_,u+1,y),G(e,l,e.length-1,y),S(e,i,0,y)}n(g,"resolveCollisions");function S(e,y,u,c){for(;u<e.length;++u){let o=e[u],p=(y-o.y0)*c;p>1e-6&&(o.y0+=p,o.y1+=p),y=o.y1+_}}n(S,"resolveCollisionsTopToBottom");function G(e,y,u,c){for(;u>=0;--u){let o=e[u],p=(o.y1-y)*c;p>1e-6&&(o.y0-=p,o.y1-=p),y=o.y0-_}}n(G,"resolveCollisionsBottomToTop");function q({sourceLinks:e,targetLinks:y}){if(f===void 0){for(let{source:{sourceLinks:u}}of y)u.sort(lt);for(let{target:{targetLinks:u}}of e)u.sort(at)}}n(q,"reorderNodeLinks");function T(e){if(f===void 0)for(let{sourceLinks:y,targetLinks:u}of e)y.sort(lt),u.sort(at)}n(T,"reorderLinks");function R(e,y){let u=e.y0-(e.sourceLinks.length-1)*_/2;for(let{target:c,width:o}of e.sourceLinks){if(c===y)break;u+=o+_}for(let{source:c,width:o}of y.targetLinks){if(c===e)break;u-=o}return u}n(R,"targetTop");function P(e,y){let u=y.y0-(y.targetLinks.length-1)*_/2;for(let{source:c,width:o}of y.targetLinks){if(c===e)break;u+=o+_}for(let{target:c,width:o}of e.sourceLinks){if(c===y)break;u-=o}return u}return n(P,"sourceTop"),v}n(Tt,"Sankey");var ct=Math.PI,ft=2*ct,F=1e-6,se=ft-F;function et(){this._x0=this._y0=this._x1=this._y1=null,this._=""}n(et,"Path");function mt(){return new et}n(mt,"path");et.prototype=mt.prototype={constructor:et,moveTo:n(function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},"moveTo"),closePath:n(function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:n(function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},"lineTo"),quadraticCurveTo:n(function(t,i,r,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+r)+","+(this._y1=+l)},"quadraticCurveTo"),bezierCurveTo:n(function(t,i,r,l,h,m){this._+="C"+ +t+","+ +i+","+ +r+","+ +l+","+(this._x1=+h)+","+(this._y1=+m)},"bezierCurveTo"),arcTo:n(function(t,i,r,l,h){t=+t,i=+i,r=+r,l=+l,h=+h;var m=this._x1,_=this._y1,x=r-t,s=l-i,a=m-t,f=_-i,k=a*a+f*f;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(k>F)if(!(Math.abs(f*x-s*a)>F)||!h)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var d=r-m,b=l-_,v=x*x+s*s,I=d*d+b*b,A=Math.sqrt(v),N=Math.sqrt(k),z=h*Math.tan((ct-Math.acos((v+k-I)/(2*A*N)))/2),M=z/N,j=z/A;Math.abs(M-1)>F&&(this._+="L"+(t+M*a)+","+(i+M*f)),this._+="A"+h+","+h+",0,0,"+ +(f*d>a*b)+","+(this._x1=t+j*x)+","+(this._y1=i+j*s)}},"arcTo"),arc:n(function(t,i,r,l,h,m){t=+t,i=+i,r=+r,m=!!m;var _=r*Math.cos(l),x=r*Math.sin(l),s=t+_,a=i+x,f=1^m,k=m?l-h:h-l;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+s+","+a:(Math.abs(this._x1-s)>F||Math.abs(this._y1-a)>F)&&(this._+="L"+s+","+a),r&&(k<0&&(k=k%ft+ft),k>se?this._+="A"+r+","+r+",0,1,"+f+","+(t-_)+","+(i-x)+"A"+r+","+r+",0,1,"+f+","+(this._x1=s)+","+(this._y1=a):k>F&&(this._+="A"+r+","+r+",0,"+ +(k>=ct)+","+f+","+(this._x1=t+r*Math.cos(h))+","+(this._y1=i+r*Math.sin(h))))},"arc"),rect:n(function(t,i,r,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +r+"v"+ +l+"h"+-r+"Z"},"rect"),toString:n(function(){return this._},"toString")};var re=mt;function yt(t){return n(function(){return t},"constant")}n(yt,"default");function St(t){return t[0]}n(St,"x");function Mt(t){return t[1]}n(Mt,"y");var oe=Array.prototype.slice;function At(t){return t.source}n(At,"linkSource");function Nt(t){return t.target}n(Nt,"linkTarget");function Ct(t){var i=At,r=Nt,l=St,h=Mt,m=null;function _(){var x,s=oe.call(arguments),a=i.apply(this,s),f=r.apply(this,s);if(m||(m=x=re()),t(m,+l.apply(this,(s[0]=a,s)),+h.apply(this,s),+l.apply(this,(s[0]=f,s)),+h.apply(this,s)),x)return m=null,x+""||null}return n(_,"link"),_.source=function(x){return arguments.length?(i=x,_):i},_.target=function(x){return arguments.length?(r=x,_):r},_.x=function(x){return arguments.length?(l=typeof x=="function"?x:yt(+x),_):l},_.y=function(x){return arguments.length?(h=typeof x=="function"?x:yt(+x),_):h},_.context=function(x){return arguments.length?(m=x??null,_):m},_}n(Ct,"link");function It(t,i,r,l,h){t.moveTo(i,r),t.bezierCurveTo(i=(i+l)/2,r,i,h,l,h)}n(It,"curveHorizontal");function Dt(){return Ct(It)}n(Dt,"linkHorizontal");function Ot(t){return[t.source.x1,t.y0]}n(Ot,"horizontalSource");function Pt(t){return[t.target.x0,t.y1]}n(Pt,"horizontalTarget");function $t(){return Dt().source(Ot).target(Pt)}n($t,"default");var B,_t=(B=class{static next(i){return new B(i+ ++B.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},n(B,"Uid"),B.count=0,B),ae={left:xt,right:vt,center:wt,justify:pt},le=n(function(t,i,r,l){let{securityLevel:h,sankey:m}=dt(),_=Ut.sankey,x;h==="sandbox"&&(x=K("#i"+i));let s=h==="sandbox"?K(x.nodes()[0].contentDocument.body):K("body"),a=h==="sandbox"?s.select(`[id="${i}"]`):K(`[id="${i}"]`),f=(m==null?void 0:m.width)??_.width,k=(m==null?void 0:m.height)??_.width,d=(m==null?void 0:m.useMaxWidth)??_.useMaxWidth,b=(m==null?void 0:m.nodeAlignment)??_.nodeAlignment,v=(m==null?void 0:m.prefix)??_.prefix,I=(m==null?void 0:m.suffix)??_.suffix,A=(m==null?void 0:m.showValues)??_.showValues,N=l.db.getGraph(),z=ae[b];Tt().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(A?15:0)).nodeAlign(z).extent([[0,0],[f,k]])(N);let M=Wt(Qt);a.append("g").attr("class","nodes").selectAll(".node").data(N.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=_t.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>M(g.id));let j=n(({id:g,value:S})=>A?`${g}
|
|
7
|
-
${v}${Math.round(S*100)/100}${I}`:g,"getText");a.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(N.nodes).join("text").attr("x",g=>g.x0<f/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<f/2?"start":"end").text(j);let L=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(N.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),C=(m==null?void 0:m.linkColor)??"gradient";if(C==="gradient"){let g=L.append("linearGradient").attr("id",S=>(S.uid=_t.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",S=>S.source.x1).attr("x2",S=>S.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",S=>M(S.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",S=>M(S.target.id))}let D;switch(C){case"gradient":D=n(g=>g.uid,"coloring");break;case"source":D=n(g=>M(g.source.id),"coloring");break;case"target":D=n(g=>M(g.target.id),"coloring");break;default:D=C}L.append("path").attr("d",$t()).attr("stroke",D).attr("stroke-width",g=>Math.max(1,g.width)),Gt(void 0,a,0,d)},"draw"),he={draw:le},ue=n(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
-
`).trim(),"prepareTextForParsing"),ce=n(t=>`.label {
|
|
9
|
-
font-family: ${t.fontFamily};
|
|
10
|
-
}`,"getStyles"),fe=ce,ye=J.parse.bind(J);J.parse=t=>ye(ue(t));var ge={styles:fe,parser:J,db:ie,renderer:he};export{ge as diagram};
|