orbitchat 3.8.3 → 3.8.5
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/dist/assets/{ChartRenderer-DzIRvPxY.js → ChartRenderer-CsSmOeUS.js} +14 -14
- package/dist/assets/MermaidRenderer-DL5m_Hhz.js +312 -0
- package/dist/assets/{MusicRenderer-BwnX42th.js → MusicRenderer-CH3E0KH9.js} +2 -2
- package/dist/assets/SVGRenderer-B5HiQoJe.js +6 -0
- package/dist/assets/arc-DeiHBTsx.js +1 -0
- package/dist/assets/architectureDiagram-3BPJPVTR-B1ad2QoY.js +36 -0
- package/dist/assets/{band-CquvqAHh.js → band-BEGRCkg7.js} +1 -1
- package/dist/assets/blockDiagram-GPEHLZMM-BaaYuLLX.js +132 -0
- package/dist/assets/{c4Diagram-AHTNJAMY-BjSLTiBX.js → c4Diagram-AAUBKEIU-DJPHJtds.js} +1 -1
- package/dist/assets/channel-DDeCWDA1.js +1 -0
- package/dist/assets/chunk-2J33WTMH-BgKyXymK.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-CW_w7OX3.js → chunk-4BX2VUAB-B47fqcrV.js} +1 -1
- package/dist/assets/chunk-55IACEB6-mPPspevf.js +1 -0
- package/dist/assets/chunk-727SXJPM-D_UtOHAV.js +206 -0
- package/dist/assets/chunk-AQP2D5EJ-CuK_c5EV.js +231 -0
- package/dist/assets/{chunk-FMBD7UC4-DTCbHJhW.js → chunk-FMBD7UC4-CQ0E2DVU.js} +1 -1
- package/dist/assets/chunk-ND2GUHAM-Bs4KqGh8.js +1 -0
- package/dist/assets/{chunk-QZHKN3VN-myOJvS-u.js → chunk-QZHKN3VN-Ds5qvw-L.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-CzusQi-i.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-CzusQi-i.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-DtI7VR0m.js +1 -0
- package/dist/assets/cytoscape.esm-BHYC38rz.js +331 -0
- package/dist/assets/dagre-BM42HDAG-Dv9nzUP_.js +4 -0
- package/dist/assets/{defaultLocale-DX6XiGOO.js → defaultLocale-CrowFXzY.js} +1 -1
- package/dist/assets/diagram-2AECGRRQ-Bo72qc36.js +43 -0
- package/dist/assets/diagram-5GNKFQAL-CwfUjosP.js +10 -0
- package/dist/assets/diagram-KO2AKTUF-CfOTiGvD.js +3 -0
- package/dist/assets/diagram-LMA3HP47-CZhIRgOi.js +24 -0
- package/dist/assets/diagram-OG6HWLK6-juyail0b.js +24 -0
- package/dist/assets/docx-preview-1HZ2cBLf.js +38 -0
- package/dist/assets/{erDiagram-SMLLAGMA-CZeTEE4C.js → erDiagram-TEJ5UH35-DoFjAiB-.js} +2 -2
- package/dist/assets/{flowDiagram-DWJPFMVM-D0cOPhM6.js → flowDiagram-I6XJVG4X-i9Nk-RoE.js} +4 -4
- package/dist/assets/ganttDiagram-6RSMTGT7-D9FgT_n3.js +292 -0
- package/dist/assets/gitGraphDiagram-PVQCEYII-8T23BfbK.js +106 -0
- package/dist/assets/graph-Dqkl27Ch.js +1 -0
- package/dist/assets/{index--qPbXmBe.js → index-COrH62pB.js} +1 -1
- package/dist/assets/index-Chrzghtr.js +671 -0
- package/dist/assets/index-_tZnqtDb.css +1 -0
- package/dist/assets/index-mJaxTisw.js +13 -0
- package/dist/assets/infoDiagram-5YYISTIA-CSrQKxO4.js +2 -0
- package/dist/assets/{init-Dmth1JHB.js → init-BFKUnIhM.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-Ki90st18.js → ishikawaDiagram-YF4QCWOH-C0RacBnx.js} +6 -6
- package/dist/assets/{journeyDiagram-VCZTEJTY-YwSMXxeX.js → journeyDiagram-JHISSGLW-fn_Wigeb.js} +3 -3
- package/dist/assets/{kanban-definition-6JOO6SKY-Vy7WFwaZ.js → kanban-definition-UN3LZRKU-BCU8kzDU.js} +7 -7
- package/dist/assets/layout-DO9UvE1P.js +1 -0
- package/dist/assets/{linear-CKzVTQ0r.js → linear-BFc7NSuB.js} +1 -1
- package/dist/assets/mindmap-definition-RKZ34NQL-3dDKU3Ah.js +96 -0
- package/dist/assets/ordinal-BQ3KlzSu.js +1 -0
- package/dist/assets/pieDiagram-4H26LBE5-DtE_Cy6e.js +30 -0
- package/dist/assets/purify.es-DxCUJf2h.js +3 -0
- package/dist/assets/quadrantDiagram-W4KKPZXB-T2BQZBW5.js +7 -0
- package/dist/assets/{requirementDiagram-MS252O5E-eGb4gzyY.js → requirementDiagram-4Y6WPE33-F5q9pqAd.js} +1 -1
- package/dist/assets/sankeyDiagram-5OEKKPKP-1f5jZgij.js +40 -0
- package/dist/assets/sequenceDiagram-3UESZ5HK-B8LfPZVJ.js +162 -0
- package/dist/assets/stateDiagram-AJRCARHV-DUJIZEbV.js +1 -0
- package/dist/assets/stateDiagram-v2-BHNVJYJU-jwVk2opC.js +1 -0
- package/dist/assets/{step-EjIQ8UIn.js → step-D_f8mI9d.js} +1 -1
- package/dist/assets/{time-h5EapSZu.js → time-C-HXPWjm.js} +1 -1
- package/dist/assets/{timeline-definition-GMOUNBTQ-BMIPAICW.js → timeline-definition-PNZ67QCA-B7mA_bMt.js} +3 -3
- package/dist/assets/vennDiagram-CIIHVFJN-eQ_va4zK.js +34 -0
- package/dist/assets/wardley-L42UT6IY-DSnXDyTD.js +173 -0
- package/dist/assets/wardleyDiagram-YWT4CUSO-DsZtL4gF.js +78 -0
- package/dist/assets/{xychartDiagram-5P7HB3ND-BkCris5N.js → xychartDiagram-2RQKCTM6-iPTd2JhY.js} +3 -3
- package/dist/index.html +2 -2
- package/package.json +3 -1
- package/dist/assets/MermaidRenderer-CmXoyqXC.js +0 -313
- package/dist/assets/SVGRenderer-DhgAIuO1.js +0 -6
- package/dist/assets/_baseUniq-DloMpWiC.js +0 -1
- package/dist/assets/arc-BSnyvXPh.js +0 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-B8KMzkFt.js +0 -36
- package/dist/assets/blockDiagram-DXYQGD6D-BdL0TYPu.js +0 -132
- package/dist/assets/channel-DubFLvZS.js +0 -1
- package/dist/assets/chunk-4TB4RGXK-Ck4QqP3K.js +0 -206
- package/dist/assets/chunk-55IACEB6-DXdYcIT2.js +0 -1
- package/dist/assets/chunk-EDXVE4YY-TeBR2QKO.js +0 -1
- package/dist/assets/chunk-OYMX7WX6-1E0LKijl.js +0 -231
- package/dist/assets/chunk-YZCP3GAM-CCtc1vqk.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-CsFj_YsM.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-CsFj_YsM.js +0 -1
- package/dist/assets/clone-jZcgN-_G.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-B4rzpz-f.js +0 -1
- package/dist/assets/cytoscape.esm-BiciSPf8.js +0 -331
- package/dist/assets/dagre-KV5264BT-1iL4RYvS.js +0 -4
- package/dist/assets/diagram-5BDNPKRD-Xo_7fok6.js +0 -10
- package/dist/assets/diagram-G4DWMVQ6-C52EzwbV.js +0 -24
- package/dist/assets/diagram-MMDJMWI5-BukTxBI5.js +0 -43
- package/dist/assets/diagram-TYMM5635-CkBiNxnI.js +0 -24
- package/dist/assets/ganttDiagram-T4ZO3ILL-CSnn6uMq.js +0 -292
- package/dist/assets/gitGraphDiagram-UUTBAWPF-HrICfvGm.js +0 -106
- package/dist/assets/graph-BBTvQ5FI.js +0 -1
- package/dist/assets/index-9mqVdUba.js +0 -644
- package/dist/assets/index-D1X8PV1O.css +0 -1
- package/dist/assets/infoDiagram-42DDH7IO-Dw38VYFU.js +0 -2
- package/dist/assets/layout-Z9EF_Ub1.js +0 -1
- package/dist/assets/min-CgT8voI0.js +0 -1
- package/dist/assets/mindmap-definition-QFDTVHPH-B3Mpl_wP.js +0 -96
- package/dist/assets/ordinal-DILIJJjt.js +0 -1
- package/dist/assets/pieDiagram-DEJITSTG-Cs2Mu6Yg.js +0 -30
- package/dist/assets/purify.es-BlZidd4c.js +0 -2
- package/dist/assets/quadrantDiagram-34T5L4WZ-CUcOgh3E.js +0 -7
- package/dist/assets/sankeyDiagram-XADWPNL6-CJL3aIB5.js +0 -10
- package/dist/assets/sequenceDiagram-FGHM5R23-DghCZsr4.js +0 -157
- package/dist/assets/stateDiagram-FHFEXIEX-CEYXYE9a.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-BU1in3oP.js +0 -1
- package/dist/assets/vennDiagram-DHZGUBPP-BI2qFIdH.js +0 -34
- package/dist/assets/wardley-RL74JXVD-Cn_I5L_C.js +0 -162
- package/dist/assets/wardleyDiagram-NUSXRM2D-CAfUhUNM.js +0 -20
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{aB as Lt,K as zt,P as Tt,aE as At,L as Xt,aC as Et,a as y,$ as Yt,N as It,m as Q,ai as et,aA as Bt,w as Ft,n as Ot,O as V}from"./MermaidRenderer-DL5m_Hhz.js";import{p as Rt}from"./chunk-4BX2VUAB-B47fqcrV.js";import{p as Wt}from"./wardley-L42UT6IY-DSnXDyTD.js";import"./index-Chrzghtr.js";import"./purify.es-DxCUJf2h.js";import"./step-D_f8mI9d.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Rt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,z=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,z,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Et,getAccTitle:Xt,setDiagramTitle:At,getDiagramTitle:Tt,getAccDescription:zt,setAccDescription:Lt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,z,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((z=a.wardley)==null?void 0:z.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map
|
|
2
|
+
`+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),z=v.getDiagramTitle(),M=((U=g.size)==null?void 0:U.width)??r.width,k=((J=g.size)==null?void 0:J.height)??r.height,N=Bt(o);N.selectAll("*").remove(),Ft(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;z&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(z);const T=y(t=>r.padding+t/100*B,"projectX"),A=y(t=>k-r.padding-t/100*F,"projectY"),R=P.append("g").attr("class","wardley-axes");R.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const O=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(O.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===O.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/O.length;O.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}O.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const L=(h+l)/2;S.x=L,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+15*2).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const K=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(K).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(K.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,L=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${L} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const L=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(L)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const L=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-L,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",L).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
|
|
3
|
+
M ${s} ${i-l/2}
|
|
4
|
+
L ${s+h-x} ${i-l/2}
|
|
5
|
+
L ${s+h-x} ${i-l/2-8}
|
|
6
|
+
L ${s+h} ${i}
|
|
7
|
+
L ${s+h-x} ${i+l/2+8}
|
|
8
|
+
L ${s+h-x} ${i+l/2}
|
|
9
|
+
L ${s} ${i+l/2}
|
|
10
|
+
Z
|
|
11
|
+
`;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}if(g.deaccelerators.length>0){const t=P.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
|
|
12
|
+
M ${s+h} ${i-l/2}
|
|
13
|
+
L ${s+x} ${i-l/2}
|
|
14
|
+
L ${s+x} ${i-l/2-8}
|
|
15
|
+
L ${s} ${i}
|
|
16
|
+
L ${s+x} ${i+l/2+8}
|
|
17
|
+
L ${s+x} ${i+l/2}
|
|
18
|
+
L ${s+h} ${i+l/2}
|
|
19
|
+
Z
|
|
20
|
+
`;t.append("path").attr("d",f).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",s+h/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.name)})}},"draw"),Kt={draw:Zt},Ut=y(({wardley:a}={})=>{const o=Yt(),e=It(),p=Q(o,e.themeVariables),r=Q(p.wardley,a);return`
|
|
21
|
+
.wardley-background {
|
|
22
|
+
fill: ${r.backgroundColor};
|
|
23
|
+
}
|
|
24
|
+
.wardley-axes line, .wardley-axes path {
|
|
25
|
+
stroke: ${r.axisColor};
|
|
26
|
+
}
|
|
27
|
+
.wardley-axis-label {
|
|
28
|
+
fill: ${r.axisTextColor};
|
|
29
|
+
}
|
|
30
|
+
.wardley-stage-label {
|
|
31
|
+
fill: ${r.axisTextColor};
|
|
32
|
+
}
|
|
33
|
+
.wardley-grid line {
|
|
34
|
+
stroke: ${r.gridColor};
|
|
35
|
+
}
|
|
36
|
+
.wardley-node circle {
|
|
37
|
+
fill: ${r.componentFill};
|
|
38
|
+
stroke: ${r.componentStroke};
|
|
39
|
+
}
|
|
40
|
+
.wardley-node-label {
|
|
41
|
+
fill: ${r.componentLabelColor};
|
|
42
|
+
}
|
|
43
|
+
.wardley-link {
|
|
44
|
+
stroke: ${r.linkStroke};
|
|
45
|
+
}
|
|
46
|
+
.wardley-link--dashed {
|
|
47
|
+
stroke-dasharray: 4 4;
|
|
48
|
+
}
|
|
49
|
+
.wardley-link-label {
|
|
50
|
+
fill: ${r.axisTextColor};
|
|
51
|
+
}
|
|
52
|
+
.wardley-trend line {
|
|
53
|
+
stroke: ${r.evolutionStroke};
|
|
54
|
+
}
|
|
55
|
+
.wardley-annotation-line {
|
|
56
|
+
stroke: ${r.annotationStroke};
|
|
57
|
+
}
|
|
58
|
+
.wardley-annotation circle {
|
|
59
|
+
fill: ${r.annotationFill};
|
|
60
|
+
stroke: ${r.annotationStroke};
|
|
61
|
+
}
|
|
62
|
+
.wardley-annotation text {
|
|
63
|
+
fill: ${r.annotationTextColor};
|
|
64
|
+
}
|
|
65
|
+
.wardley-annotations-box rect {
|
|
66
|
+
fill: ${r.annotationFill};
|
|
67
|
+
stroke: ${r.annotationStroke};
|
|
68
|
+
}
|
|
69
|
+
.wardley-annotations-box text {
|
|
70
|
+
fill: ${r.annotationTextColor};
|
|
71
|
+
}
|
|
72
|
+
.wardley-pipeline-box {
|
|
73
|
+
stroke: ${r.componentStroke};
|
|
74
|
+
}
|
|
75
|
+
.wardley-notes text {
|
|
76
|
+
fill: ${r.axisTextColor};
|
|
77
|
+
}
|
|
78
|
+
`},"styles"),se={parser:at,db:Ht,renderer:Kt,styles:Ut};export{se as diagram};
|
package/dist/assets/{xychartDiagram-5P7HB3ND-BkCris5N.js → xychartDiagram-2RQKCTM6-iPTd2JhY.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aB as gi,K as xi,P as Xt,aE as di,L as pi,aC as fi,a as n,ai as Yt,aA as mi,w as yi,n as bi,N as St,ax as Ai,m as Nt,F as wi,$ as Ci,t as Si}from"./MermaidRenderer-DL5m_Hhz.js";import{b as Bt}from"./band-BEGRCkg7.js";import{l as Wt}from"./linear-BFc7NSuB.js";import{A as zt}from"./step-D_f8mI9d.js";import"./index-Chrzghtr.js";import"./purify.es-DxCUJf2h.js";import"./init-BFKUnIhM.js";import"./ordinal-BQ3KlzSu.js";import"./defaultLocale-CrowFXzY.js";var bt=function(){var s=n(function(O,r,c,u){for(c=c||{},u=O.length;u--;c[O[u]]=r);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],e=[1,3],a=[1,5],l=[1,6],g=[1,7],b=[1,5,10,12,14,16,18,19,21,23,34,35,36],w=[1,25],v=[1,26],M=[1,28],R=[1,29],E=[1,30],z=[1,31],F=[1,32],D=[1,33],B=[1,34],p=[1,35],_=[1,36],h=[1,37],I=[1,43],W=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],f=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],y=[1,64],P={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n(function(r,c,u,x,A,o,ot){var d=o.length-1;switch(A){case 5:x.setOrientation(o[d]);break;case 9:x.setDiagramTitle(o[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[d]);break;case 13:x.setLineData(o[d-1],o[d]);break;case 14:x.setBarData({text:"",type:"text"},o[d]);break;case 15:x.setBarData(o[d-1],o[d]);break;case 16:this.$=o[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[d-1];break;case 20:this.$=[Number(o[d-2]),...o[d]];break;case 21:this.$=[Number(o[d])];break;case 22:x.setXAxisTitle(o[d]);break;case 23:x.setXAxisTitle(o[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(o[d]);break;case 26:x.setXAxisRangeData(Number(o[d-2]),Number(o[d]));break;case 27:this.$=o[d-1];break;case 28:this.$=[o[d-2],...o[d]];break;case 29:this.$=[o[d]];break;case 30:x.setYAxisTitle(o[d]);break;case 31:x.setYAxisTitle(o[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(o[d-2]),Number(o[d]));break;case 37:this.$={text:o[d],type:"text"};break;case 38:this.$={text:o[d],type:"text"};break;case 39:this.$={text:o[d],type:"markdown"};break;case 40:this.$=o[d];break;case 41:this.$=o[d-1]+""+o[d];break}},"anonymous"),table:[s(t,i,{3:1,4:2,7:4,5:e,34:a,35:l,36:g}),{1:[3]},s(t,i,{4:2,7:4,3:8,5:e,34:a,35:l,36:g}),s(t,i,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:a,35:l,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},s(b,[2,34]),s(b,[2,35]),s(b,[2,36]),{1:[2,1]},s(t,i,{4:2,7:4,3:21,5:e,34:a,35:l,36:g}),{1:[2,3]},s(b,[2,5]),s(t,[2,7],{4:22,34:a,35:l,36:g}),{11:23,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},{11:39,13:38,24:I,27:W,29:40,30:41,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},{11:45,15:44,27:X,33:46,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},{11:49,17:48,24:Y,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},{11:52,17:51,24:Y,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},{20:[1,53]},{22:[1,54]},s(C,[2,18]),{1:[2,2]},s(C,[2,8]),s(C,[2,9]),s(U,[2,37],{40:55,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h}),s(U,[2,38]),s(U,[2,39]),s(f,[2,40]),s(f,[2,42]),s(f,[2,43]),s(f,[2,44]),s(f,[2,45]),s(f,[2,46]),s(f,[2,47]),s(f,[2,48]),s(f,[2,49]),s(f,[2,50]),s(f,[2,51]),s(C,[2,10]),s(C,[2,22],{30:41,29:56,24:I,27:W}),s(C,[2,24]),s(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},s(C,[2,11]),s(C,[2,30],{33:60,27:X}),s(C,[2,32]),{31:[1,61]},s(C,[2,12]),{17:62,24:Y},{25:63,27:y},s(C,[2,14]),{17:65,24:Y},s(C,[2,16]),s(C,[2,17]),s(f,[2,41]),s(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},s(C,[2,31]),{27:[1,69]},s(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},s(C,[2,15]),s(C,[2,26]),s(C,[2,27]),{11:59,32:72,37:24,38:w,39:v,40:27,41:M,42:R,43:E,44:z,45:F,46:D,47:B,48:p,49:_,50:h},s(C,[2,33]),s(C,[2,19]),{25:73,27:y},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n(function(r,c){if(c.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=c,u}},"parseError"),parse:n(function(r){var c=this,u=[0],x=[],A=[null],o=[],ot=this.table,d="",ct=0,Et=0,hi=2,It=1,li=o.slice.call(arguments,1),k=Object.create(this.lexer),$={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&($.yy[pt]=this.yy[pt]);k.setInput(r,$.yy),$.yy.lexer=k,$.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var ft=k.yylloc;o.push(ft);var ci=k.options&&k.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(L){u.length=u.length-2*L,A.length=A.length-L,o.length=o.length-L}n(ui,"popStack");function Vt(){var L;return L=x.pop()||k.lex()||It,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=c.symbols_[L]||L),L}n(Vt,"lex");for(var T,q,V,mt,G={},ut,N,Mt,gt;;){if(q=u[u.length-1],this.defaultActions[q]?V=this.defaultActions[q]:((T===null||typeof T>"u")&&(T=Vt()),V=ot[q]&&ot[q][T]),typeof V>"u"||!V.length||!V[0]){var yt="";gt=[];for(ut in ot[q])this.terminals_[ut]&&ut>hi&>.push("'"+this.terminals_[ut]+"'");k.showPosition?yt="Parse error on line "+(ct+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+gt.join(", ")+", got '"+(this.terminals_[T]||T)+"'":yt="Parse error on line "+(ct+1)+": Unexpected "+(T==It?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(yt,{text:k.match,token:this.terminals_[T]||T,line:k.yylineno,loc:ft,expected:gt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+T);switch(V[0]){case 1:u.push(T),A.push(k.yytext),o.push(k.yylloc),u.push(V[1]),T=null,Et=k.yyleng,d=k.yytext,ct=k.yylineno,ft=k.yylloc;break;case 2:if(N=this.productions_[V[1]][1],G.$=A[A.length-N],G._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},ci&&(G._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),mt=this.performAction.apply(G,[d,Et,ct,$.yy,V[1],A,o].concat(li)),typeof mt<"u")return mt;N&&(u=u.slice(0,-1*N*2),A=A.slice(0,-1*N),o=o.slice(0,-1*N)),u.push(this.productions_[V[1]][0]),A.push(G.$),o.push(G._$),Mt=ot[u[u.length-2]][u[u.length-1]],u.push(Mt);break;case 3:return!0}}return!0},"parse")},S=function(){var O={EOF:1,parseError:n(function(c,u){if(this.yy.parser)this.yy.parser.parseError(c,u);else throw new Error(c)},"parseError"),setInput:n(function(r,c){return this.yy=c||this.yy||{},this._input=r,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 r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.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),r},"input"),unput:n(function(r){var c=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var x=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),u.length-1&&(this.yylineno-=u.length-1);var A=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:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-c]),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
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+c+"^"},"showPosition"),test_match:n(function(r,c){var u,x,A;if(this.options.backtrack_lexer&&(A={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&&(A.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],u=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var o in A)this[o]=A[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,c,u,x;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),o=0;o<A.length;o++)if(u=this._input.match(this.rules[A[o]]),u&&(!c||u[0].length>c[0].length)){if(c=u,x=o,this.options.backtrack_lexer){if(r=this.test_match(u,A[o]),r!==!1)return r;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(r=this.test_match(c,A[x]),r!==!1?r:!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 c=this.next();return c||this.lex()},"lex"),begin:n(function(c){this.conditionStack.push(c)},"begin"),popState:n(function(){var c=this.conditionStack.length-1;return c>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(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:n(function(c){this.begin(c)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(c,u,x,A){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O}();P.lexer=S;function H(){this.yy={}}return n(H,"Parser"),H.prototype=P,P.Parser=H,new H}();bt.parser=bt;var _i=bt;function At(s){return s.type==="bar"}n(At,"isBarPlot");function _t(s){return s.type==="band"}n(_t,"isBandAxisData");function j(s){return s.type==="linear"}n(j,"isLinearAxisData");var Q,Ht=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((l,g)=>Math.max(g.length,l),0)*i,height:i};const e={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const l of t){const g=Si(a,1,l),b=g?g.width:l.length*i,w=g?g.height:i;e.width=Math.max(e.width,b),e.height=Math.max(e.height,w)}return a.remove(),e}},n(Q,"TextDimensionCalculatorWithFont"),Q),Ft=.7,Ot=.2,K,Ut=(K=class{constructor(t,i,e,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ft*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ft*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.width;this.outerPadding=Math.min(e.width/2,a);const l=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,l<=i&&(i-=l,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.height;this.outerPadding=Math.min(e.height/2,a);const l=e.width+this.axisConfig.labelPadding*2;l<=i&&(i-=l,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n(K,"BaseAxis"),K),Z,ki=(Z=class extends Ut{constructor(t,i,e,a,l){super(t,a,l,i),this.categories=e,this.scale=Bt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Bt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Yt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(Z,"BandAxis"),Z),J,Ti=(J=class extends Ut{constructor(t,i,e,a,l){super(t,a,l,i),this.domain=e,this.scale=Wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Wt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(J,"LinearAxis"),J);function wt(s,t,i,e){const a=new Ht(e);return _t(s)?new ki(t,i,s.categories,s.title,a):new Ti(t,i,[s.min,s.max],s.title,a)}n(wt,"getAxis");var tt,Ri=(tt=class{constructor(t,i,e,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n(tt,"ChartTitle"),tt);function $t(s,t,i,e){const a=new Ht(e);return new Ri(a,s,t,i)}n($t,"getChartTitleComponent");var it,Di=(it=class{constructor(t,i,e,a,l){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=a,this.plotIndex=l}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=zt().y(e=>e[0]).x(e=>e[1])(t):i=zt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},n(it,"LinePlot"),it),et,Pi=(et=class{constructor(t,i,e,a,l,g){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=a,this.orientation=l,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(l=>[this.xAxis.getScaleValue(l[0]),this.yAxis.getScaleValue(l[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(l=>({x:this.boundingRect.x,y:l[0]-a,height:e,width:l[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(l=>({x:l[0]-a,y:l[1],width:e,height:this.boundingRect.y+this.boundingRect.height-l[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(et,"BarPlot"),et),st,vi=(st=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const a=new Di(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Pi(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(st,"BasePlot"),st);function qt(s,t,i){return new vi(s,t,i)}n(qt,"getPlotComponent");var at,Li=(at=class{constructor(t,i,e,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:$t(t,i,e,a),plot:qt(t,i,e),xAxis:wt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},a),yAxis:wt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),b=this.componentStore.plot.calculateSpace({width:l,height:g});t-=b.width,i-=b.height,b=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=b.height,i-=b.height,this.componentStore.xAxis.setAxisPosition("bottom"),b=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=b.height,this.componentStore.yAxis.setAxisPosition("left"),b=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=b.width,t-=b.width,t>0&&(l+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:g}),this.componentStore.plot.setBoundingBoxXY({x:e,y:a}),this.componentStore.xAxis.setRange([e,e+l]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:a+g}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(w=>At(w))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,l=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),b=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),w=this.componentStore.plot.calculateSpace({width:g,height:b});t-=w.width,i-=w.height,w=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=w.height,i-=w.height,this.componentStore.xAxis.setAxisPosition("left"),w=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=w.width,a=w.width,this.componentStore.yAxis.setAxisPosition("top"),w=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=w.height,l=e+w.height,t>0&&(g+=t,t=0),i>0&&(b+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:b}),this.componentStore.plot.setBoundingBoxXY({x:a,y:l}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:e}),this.componentStore.xAxis.setRange([l,l+b]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:l}),this.chartData.plots.some(L=>At(L))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},n(at,"Orchestrator"),at),nt,Ei=(nt=class{static build(t,i,e,a){return new Li(t,i,e,a).getDrawableElement()}},n(nt,"XYChartBuilder"),nt),rt=0,Gt,ht=Rt(),lt=Tt(),m=Dt(),Ct=lt.plotColorPalette.split(",").map(s=>s.trim()),xt=!1,kt=!1;function Tt(){const s=Ci(),t=St();return Nt(s.xyChart,t.themeVariables.xyChart)}n(Tt,"getChartDefaultThemeConfig");function Rt(){const s=St();return Nt(wi.xyChart,s.xyChart)}n(Rt,"getChartDefaultConfig");function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Dt,"getChartDefaultData");function dt(s){const t=St();return Ai(s.trim(),t)}n(dt,"textSanitizer");function jt(s){Gt=s}n(jt,"setTmpSVGG");function Qt(s){s==="horizontal"?ht.chartOrientation="horizontal":ht.chartOrientation="vertical"}n(Qt,"setOrientation");function Kt(s){m.xAxis.title=dt(s.text)}n(Kt,"setXAxisTitle");function Pt(s,t){m.xAxis={type:"linear",title:m.xAxis.title,min:s,max:t},xt=!0}n(Pt,"setXAxisRangeData");function Zt(s){m.xAxis={type:"band",title:m.xAxis.title,categories:s.map(t=>dt(t.text))},xt=!0}n(Zt,"setXAxisBand");function Jt(s){m.yAxis.title=dt(s.text)}n(Jt,"setYAxisTitle");function ti(s,t){m.yAxis={type:"linear",title:m.yAxis.title,min:s,max:t},kt=!0}n(ti,"setYAxisRangeData");function ii(s){const t=Math.min(...s),i=Math.max(...s),e=j(m.yAxis)?m.yAxis.min:1/0,a=j(m.yAxis)?m.yAxis.max:-1/0;m.yAxis={type:"linear",title:m.yAxis.title,min:Math.min(e,t),max:Math.max(a,i)}}n(ii,"setYAxisRangeFromPlotData");function vt(s){let t=[];if(s.length===0)return t;if(!xt){const i=j(m.xAxis)?m.xAxis.min:1/0,e=j(m.xAxis)?m.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(e,s.length))}if(kt||ii(s),_t(m.xAxis)&&(t=m.xAxis.categories.map((i,e)=>[i,s[e]])),j(m.xAxis)){const i=m.xAxis.min,e=m.xAxis.max,a=(e-i)/(s.length-1),l=[];for(let g=i;g<=e;g+=a)l.push(`${g}`);t=l.map((g,b)=>[g,s[b]])}return t}n(vt,"transformDataWithoutCategory");function Lt(s){return Ct[s===0?0:s%Ct.length]}n(Lt,"getPlotColorFromPalette");function ei(s,t){const i=vt(t);m.plots.push({type:"line",strokeFill:Lt(rt),strokeWidth:2,data:i}),rt++}n(ei,"setLineData");function si(s,t){const i=vt(t);m.plots.push({type:"bar",fill:Lt(rt),data:i}),rt++}n(si,"setBarData");function ai(){if(m.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return m.title=Xt(),Ei.build(ht,m,lt,Gt)}n(ai,"getDrawableElem");function ni(){return lt}n(ni,"getChartThemeConfig");function oi(){return ht}n(oi,"getChartConfig");function ri(){return m}n(ri,"getXYChartData");var Ii=n(function(){bi(),rt=0,ht=Rt(),m=Dt(),lt=Tt(),Ct=lt.plotColorPalette.split(",").map(s=>s.trim()),xt=!1,kt=!1},"clear"),Vi={getDrawableElem:ai,clear:Ii,setAccTitle:fi,getAccTitle:pi,setDiagramTitle:di,getDiagramTitle:Xt,getAccDescription:xi,setAccDescription:gi,setOrientation:Qt,setXAxisTitle:Kt,setXAxisRangeData:Pt,setXAxisBand:Zt,setYAxisTitle:Jt,setYAxisRangeData:ti,setLineData:ei,setBarData:si,setTmpSVGG:jt,getChartThemeConfig:ni,getChartConfig:oi,getXYChartData:ri},Mi=n((s,t,i,e)=>{const a=e.db,l=a.getChartThemeConfig(),g=a.getChartConfig(),b=a.getXYChartData().plots[0].data.map(p=>p[1]);function w(p){return p==="top"?"text-before-edge":"middle"}n(w,"getDominantBaseLine");function L(p){return p==="left"?"start":p==="right"?"end":"middle"}n(L,"getTextAnchor");function M(p){return`translate(${p.x}, ${p.y}) rotate(${p.rotation||0})`}n(M,"getTextTransformation"),Yt.debug(`Rendering xychart chart
|
|
7
|
-
`+s);const R=mi(t),E=R.append("g").attr("class","main"),z=E.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");yi(R,g.height,g.width,!0),R.attr("viewBox",`0 0 ${g.width} ${g.height}`),z.attr("fill",l.backgroundColor),a.setTmpSVGG(R.append("g").attr("class","mermaid-tmp-group"));const F=a.getDrawableElem(),D={};function B(p){let _=E,h="";for(const[I]of p.entries()){let W=E;I>0&&D[h]&&(W=D[h]),h+=p[I],_=D[h],_||(_=D[h]=W.append("g").attr("class",p[I]))}return _}n(B,"getGroup");for(const p of F){if(p.data.length===0)continue;const _=B(p.groupTexts);switch(p.type){case"rect":if(_.selectAll("rect").data(p.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),g.showDataLabel){const h=g.showDataLabelOutsideBar;if(g.chartOrientation==="horizontal"){let I=function(y,P){const{data:S,label:H}=y;return P*H.length*W<=S.width-X};n(I,"fitsHorizontally");const W=.7,X=10,Y=p.data.map((y,P)=>({data:y,label:b[P].toString()})).filter(y=>y.data.width>0&&y.data.height>0),C=Y.map(y=>{const{data:P}=y;let S=P.height*.7;for(;!I(y,S)&&S>0;)S-=1;return S}),U=Math.floor(Math.min(...C)),f=n(y=>h?y.data.x+y.data.width+X:y.data.x+y.data.width-X,"determineLabelXPosition");_.selectAll("text").data(Y).enter().append("text").attr("x",f).attr("y",y=>y.data.y+y.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",l.dataLabelColor).attr("font-size",`${U}px`).text(y=>y.label)}else{let I=function(f,y,P){const{data:S,label:H}=f,r=y*H.length*.7,c=S.x+S.width/2,u=c-r/2,x=c+r/2,A=u>=S.x&&x<=S.x+S.width,o=S.y+P+y<=S.y+S.height;return A&&o};n(I,"fitsInBar");const W=10,X=p.data.map((f,y)=>({data:f,label:b[y].toString()})).filter(f=>f.data.width>0&&f.data.height>0),Y=X.map(f=>{const{data:y,label:P}=f;let S=y.width/(P.length*.7);for(;!I(f,S,W)&&S>0;)S-=1;return S}),C=Math.floor(Math.min(...Y)),U=n(f=>h?f.data.y-W:f.data.y+W,"determineLabelYPosition");_.selectAll("text").data(X).enter().append("text").attr("x",f=>f.data.x+f.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",l.dataLabelColor).attr("font-size",`${C}px`).text(f=>f.label)}}break;case"text":_.selectAll("text").data(p.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>w(h.verticalPos)).attr("text-anchor",h=>
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var c=this.next();return c||this.lex()},"lex"),begin:n(function(c){this.conditionStack.push(c)},"begin"),popState:n(function(){var c=this.conditionStack.length-1;return c>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(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:n(function(c){this.begin(c)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(c,u,x,A){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O}();P.lexer=S;function H(){this.yy={}}return n(H,"Parser"),H.prototype=P,P.Parser=H,new H}();bt.parser=bt;var _i=bt;function At(s){return s.type==="bar"}n(At,"isBarPlot");function _t(s){return s.type==="band"}n(_t,"isBandAxisData");function j(s){return s.type==="linear"}n(j,"isLinearAxisData");var Q,Ht=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((l,g)=>Math.max(g.length,l),0)*i,height:i};const e={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const l of t){const g=Si(a,1,l),b=g?g.width:l.length*i,w=g?g.height:i;e.width=Math.max(e.width,b),e.height=Math.max(e.height,w)}return a.remove(),e}},n(Q,"TextDimensionCalculatorWithFont"),Q),Ft=.7,Ot=.2,K,Ut=(K=class{constructor(t,i,e,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ft*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ft*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.width;this.outerPadding=Math.min(e.width/2,a);const l=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,l<=i&&(i-=l,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.height;this.outerPadding=Math.min(e.height/2,a);const l=e.width+this.axisConfig.labelPadding*2;l<=i&&(i-=l,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n(K,"BaseAxis"),K),Z,ki=(Z=class extends Ut{constructor(t,i,e,a,l){super(t,a,l,i),this.categories=e,this.scale=Bt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Bt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Yt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(Z,"BandAxis"),Z),J,Ti=(J=class extends Ut{constructor(t,i,e,a,l){super(t,a,l,i),this.domain=e,this.scale=Wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Wt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(J,"LinearAxis"),J);function wt(s,t,i,e){const a=new Ht(e);return _t(s)?new ki(t,i,s.categories,s.title,a):new Ti(t,i,[s.min,s.max],s.title,a)}n(wt,"getAxis");var tt,Ri=(tt=class{constructor(t,i,e,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n(tt,"ChartTitle"),tt);function $t(s,t,i,e){const a=new Ht(e);return new Ri(a,s,t,i)}n($t,"getChartTitleComponent");var it,Di=(it=class{constructor(t,i,e,a,l){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=a,this.plotIndex=l}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=zt().y(e=>e[0]).x(e=>e[1])(t):i=zt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},n(it,"LinePlot"),it),et,Pi=(et=class{constructor(t,i,e,a,l,g){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=a,this.orientation=l,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(l=>[this.xAxis.getScaleValue(l[0]),this.yAxis.getScaleValue(l[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(l=>({x:this.boundingRect.x,y:l[0]-a,height:e,width:l[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(l=>({x:l[0]-a,y:l[1],width:e,height:this.boundingRect.y+this.boundingRect.height-l[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(et,"BarPlot"),et),st,Li=(st=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const a=new Di(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Pi(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(st,"BasePlot"),st);function qt(s,t,i){return new Li(s,t,i)}n(qt,"getPlotComponent");var at,vi=(at=class{constructor(t,i,e,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:$t(t,i,e,a),plot:qt(t,i,e),xAxis:wt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},a),yAxis:wt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),b=this.componentStore.plot.calculateSpace({width:l,height:g});t-=b.width,i-=b.height,b=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=b.height,i-=b.height,this.componentStore.xAxis.setAxisPosition("bottom"),b=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=b.height,this.componentStore.yAxis.setAxisPosition("left"),b=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=b.width,t-=b.width,t>0&&(l+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:g}),this.componentStore.plot.setBoundingBoxXY({x:e,y:a}),this.componentStore.xAxis.setRange([e,e+l]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:a+g}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(w=>At(w))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,l=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),b=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),w=this.componentStore.plot.calculateSpace({width:g,height:b});t-=w.width,i-=w.height,w=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=w.height,i-=w.height,this.componentStore.xAxis.setAxisPosition("left"),w=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=w.width,a=w.width,this.componentStore.yAxis.setAxisPosition("top"),w=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=w.height,l=e+w.height,t>0&&(g+=t,t=0),i>0&&(b+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:b}),this.componentStore.plot.setBoundingBoxXY({x:a,y:l}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:e}),this.componentStore.xAxis.setRange([l,l+b]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:l}),this.chartData.plots.some(v=>At(v))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},n(at,"Orchestrator"),at),nt,Ei=(nt=class{static build(t,i,e,a){return new vi(t,i,e,a).getDrawableElement()}},n(nt,"XYChartBuilder"),nt),rt=0,Gt,ht=Rt(),lt=Tt(),m=Dt(),Ct=lt.plotColorPalette.split(",").map(s=>s.trim()),xt=!1,kt=!1;function Tt(){const s=Ci(),t=St();return Nt(s.xyChart,t.themeVariables.xyChart)}n(Tt,"getChartDefaultThemeConfig");function Rt(){const s=St();return Nt(wi.xyChart,s.xyChart)}n(Rt,"getChartDefaultConfig");function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Dt,"getChartDefaultData");function dt(s){const t=St();return Ai(s.trim(),t)}n(dt,"textSanitizer");function jt(s){Gt=s}n(jt,"setTmpSVGG");function Qt(s){s==="horizontal"?ht.chartOrientation="horizontal":ht.chartOrientation="vertical"}n(Qt,"setOrientation");function Kt(s){m.xAxis.title=dt(s.text)}n(Kt,"setXAxisTitle");function Pt(s,t){m.xAxis={type:"linear",title:m.xAxis.title,min:s,max:t},xt=!0}n(Pt,"setXAxisRangeData");function Zt(s){m.xAxis={type:"band",title:m.xAxis.title,categories:s.map(t=>dt(t.text))},xt=!0}n(Zt,"setXAxisBand");function Jt(s){m.yAxis.title=dt(s.text)}n(Jt,"setYAxisTitle");function ti(s,t){m.yAxis={type:"linear",title:m.yAxis.title,min:s,max:t},kt=!0}n(ti,"setYAxisRangeData");function ii(s){const t=Math.min(...s),i=Math.max(...s),e=j(m.yAxis)?m.yAxis.min:1/0,a=j(m.yAxis)?m.yAxis.max:-1/0;m.yAxis={type:"linear",title:m.yAxis.title,min:Math.min(e,t),max:Math.max(a,i)}}n(ii,"setYAxisRangeFromPlotData");function Lt(s){let t=[];if(s.length===0)return t;if(!xt){const i=j(m.xAxis)?m.xAxis.min:1/0,e=j(m.xAxis)?m.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(e,s.length))}if(kt||ii(s),_t(m.xAxis)&&(t=m.xAxis.categories.map((i,e)=>[i,s[e]])),j(m.xAxis)){const i=m.xAxis.min,e=m.xAxis.max,a=(e-i)/(s.length-1),l=[];for(let g=i;g<=e;g+=a)l.push(`${g}`);t=l.map((g,b)=>[g,s[b]])}return t}n(Lt,"transformDataWithoutCategory");function vt(s){return Ct[s===0?0:s%Ct.length]}n(vt,"getPlotColorFromPalette");function ei(s,t){const i=Lt(t);m.plots.push({type:"line",strokeFill:vt(rt),strokeWidth:2,data:i}),rt++}n(ei,"setLineData");function si(s,t){const i=Lt(t);m.plots.push({type:"bar",fill:vt(rt),data:i}),rt++}n(si,"setBarData");function ai(){if(m.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return m.title=Xt(),Ei.build(ht,m,lt,Gt)}n(ai,"getDrawableElem");function ni(){return lt}n(ni,"getChartThemeConfig");function oi(){return ht}n(oi,"getChartConfig");function ri(){return m}n(ri,"getXYChartData");var Ii=n(function(){bi(),rt=0,ht=Rt(),m=Dt(),lt=Tt(),Ct=lt.plotColorPalette.split(",").map(s=>s.trim()),xt=!1,kt=!1},"clear"),Vi={getDrawableElem:ai,clear:Ii,setAccTitle:fi,getAccTitle:pi,setDiagramTitle:di,getDiagramTitle:Xt,getAccDescription:xi,setAccDescription:gi,setOrientation:Qt,setXAxisTitle:Kt,setXAxisRangeData:Pt,setXAxisBand:Zt,setYAxisTitle:Jt,setYAxisRangeData:ti,setLineData:ei,setBarData:si,setTmpSVGG:jt,getChartThemeConfig:ni,getChartConfig:oi,getXYChartData:ri},Mi=n((s,t,i,e)=>{const a=e.db,l=a.getChartThemeConfig(),g=a.getChartConfig(),b=a.getXYChartData().plots[0].data.map(p=>p[1]);function w(p){return p==="top"?"text-before-edge":"middle"}n(w,"getDominantBaseLine");function v(p){return p==="left"?"start":p==="right"?"end":"middle"}n(v,"getTextAnchor");function M(p){return`translate(${p.x}, ${p.y}) rotate(${p.rotation||0})`}n(M,"getTextTransformation"),Yt.debug(`Rendering xychart chart
|
|
7
|
+
`+s);const R=mi(t),E=R.append("g").attr("class","main"),z=E.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");yi(R,g.height,g.width,!0),R.attr("viewBox",`0 0 ${g.width} ${g.height}`),z.attr("fill",l.backgroundColor),a.setTmpSVGG(R.append("g").attr("class","mermaid-tmp-group"));const F=a.getDrawableElem(),D={};function B(p){let _=E,h="";for(const[I]of p.entries()){let W=E;I>0&&D[h]&&(W=D[h]),h+=p[I],_=D[h],_||(_=D[h]=W.append("g").attr("class",p[I]))}return _}n(B,"getGroup");for(const p of F){if(p.data.length===0)continue;const _=B(p.groupTexts);switch(p.type){case"rect":if(_.selectAll("rect").data(p.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),g.showDataLabel){const h=g.showDataLabelOutsideBar;if(g.chartOrientation==="horizontal"){let I=function(y,P){const{data:S,label:H}=y;return P*H.length*W<=S.width-X};n(I,"fitsHorizontally");const W=.7,X=10,Y=p.data.map((y,P)=>({data:y,label:b[P].toString()})).filter(y=>y.data.width>0&&y.data.height>0),C=Y.map(y=>{const{data:P}=y;let S=P.height*.7;for(;!I(y,S)&&S>0;)S-=1;return S}),U=Math.floor(Math.min(...C)),f=n(y=>h?y.data.x+y.data.width+X:y.data.x+y.data.width-X,"determineLabelXPosition");_.selectAll("text").data(Y).enter().append("text").attr("x",f).attr("y",y=>y.data.y+y.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",l.dataLabelColor).attr("font-size",`${U}px`).text(y=>y.label)}else{let I=function(f,y,P){const{data:S,label:H}=f,r=y*H.length*.7,c=S.x+S.width/2,u=c-r/2,x=c+r/2,A=u>=S.x&&x<=S.x+S.width,o=S.y+P+y<=S.y+S.height;return A&&o};n(I,"fitsInBar");const W=10,X=p.data.map((f,y)=>({data:f,label:b[y].toString()})).filter(f=>f.data.width>0&&f.data.height>0),Y=X.map(f=>{const{data:y,label:P}=f;let S=y.width/(P.length*.7);for(;!I(f,S,W)&&S>0;)S-=1;return S}),C=Math.floor(Math.min(...Y)),U=n(f=>h?f.data.y-W:f.data.y+W,"determineLabelYPosition");_.selectAll("text").data(X).enter().append("text").attr("x",f=>f.data.x+f.data.width/2).attr("y",U).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",l.dataLabelColor).attr("font-size",`${C}px`).text(f=>f.label)}}break;case"text":_.selectAll("text").data(p.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>w(h.verticalPos)).attr("text-anchor",h=>v(h.horizontalPos)).attr("transform",h=>M(h)).text(h=>h.text);break;case"path":_.selectAll("path").data(p.data).enter().append("path").attr("d",h=>h.path).attr("fill",h=>h.fill?h.fill:"none").attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth);break}}},"draw"),Bi={draw:Mi},$i={parser:_i,db:Vi,renderer:Bi};export{$i as diagram};
|
package/dist/index.html
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
22
22
|
}
|
|
23
23
|
</style>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
25
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-Chrzghtr.js"></script>
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-_tZnqtDb.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
28
28
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orbitchat",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.8.
|
|
4
|
+
"version": "3.8.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"orbitchat": "./bin/orbitchat.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@auth0/auth0-react": "^2.15.0",
|
|
28
28
|
"abcjs": "^6.5.2",
|
|
29
29
|
"ajv": "^8.17.1",
|
|
30
|
+
"docx-preview": "^0.3.7",
|
|
30
31
|
"dompurify": "^3.0.8",
|
|
31
32
|
"express": "^5.0.1",
|
|
32
33
|
"express-rate-limit": "^8.2.1",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"react-dom": "^19.0.0",
|
|
41
42
|
"react-markdown": "^10.1.0",
|
|
42
43
|
"react-syntax-highlighter": "^15.5.0",
|
|
44
|
+
"read-excel-file": "^9.0.10",
|
|
43
45
|
"recharts": "^3.8.1",
|
|
44
46
|
"rehype-katex": "^7.0.1",
|
|
45
47
|
"remark-gfm": "^4.0.1",
|