@glycanage/web-components 1.216.0 → 1.217.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as J,S as K,i as Q,f as U,s as _,e as M,b as O,n as t,p as j,g as q,q as z,u as G,k as I,o as tt,A as et}from"./index2.js";import{g as it}from"./globals.js";import{f as L}from"./helpers.js";const{document:st}=it;function ot(C){let i,m,w,s,b,e,o,x;return{c(){i=M("div"),m=M("div"),w=O(),s=M("div"),s.textContent="Age",b=O(),e=M("div"),e.textContent="Immune resilience index",o=O(),x=M("link"),t(m,"width","100%"),t(m,"height","100%"),t(s,"position","absolute"),t(s,"bottom","
|
|
1
|
+
import{c as J,S as K,i as Q,f as U,s as _,e as M,b as O,n as t,p as j,g as q,q as z,u as G,k as I,o as tt,A as et}from"./index2.js";import{g as it}from"./globals.js";import{f as L}from"./helpers.js";const{document:st}=it;function ot(C){let i,m,w,s,b,e,o,x;return{c(){i=M("div"),m=M("div"),w=O(),s=M("div"),s.textContent="Age",b=O(),e=M("div"),e.textContent="Immune resilience index",o=O(),x=M("link"),t(m,"width","100%"),t(m,"height","100%"),t(s,"position","absolute"),t(s,"bottom","6px"),t(s,"left","50%"),t(s,"transform","translateX(-50%)"),t(s,"font-family","Sen, sans-serif"),t(s,"font-size","12px"),t(s,"color","#09341F"),t(s,"opacity","0.8"),t(e,"position","absolute"),t(e,"top","50%"),t(e,"right","83%"),t(e,"transform","translateY(-50%) rotate(-90deg)"),t(e,"font-family","Sen, sans-serif"),t(e,"font-size","12px"),t(e,"color","#09341F"),t(e,"opacity","0.8"),t(e,"white-space","nowrap"),t(i,"width","100%"),t(i,"height","100%"),t(i,"position","relative"),t(i,"border","1px solid #09341F33"),t(i,"border-radius","10px"),j(x,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),j(x,"rel","stylesheet")},m(a,k){q(a,i,k),z(i,m),C[2](m),z(i,w),z(i,s),z(i,b),z(i,e),q(a,o,k),z(st.head,x)},p:G,i:G,o:G,d(a){a&&(I(i),I(o)),C[2](null),I(x)}}}function rt(C,i,m){let{service:w=window.GaReportService}=i,s,b,e=0,o={},x="",a=0,k=0,W=0,v,p=0;function X(){v&&(o=echarts.init(v,null,{devicePixelRatio:4,renderer:"svg"}));const n=v.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"15px",left:"50px",right:"45px",bottom:"45px"},dataset:[{source:b.data.map(r=>[r.x,r.y])}],tooltip:{show:!1},xAxis:{min:15,max:95,interval:20,nameTextStyle:{color:"#09341F",opacity:.8},axisLine:{show:!1,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",opacity:.8,formatter(r){return r===0||r===100?"":r}},splitLine:{show:!0}},yAxis:{min:0,max:x==="M"?3:3.5,interval:.5,nameTextStyle:{color:"#09341F",opacity:.8},axisLine:{show:!1,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!1,color:"#09341F",opacity:.8,formatter(r){return r===0||r===.6?"":r}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},symbolSize:4,itemStyle:{color:"#09341F",opacity:.15,borderWidth:1,lineWidth:12}},{name:"Resilience index",type:"scatter",data:[{x:a,y:e}],itemStyle:{color:L(p)}}],graphic:[]};o.setOption(d);const A=10,B=6,f=2,N=1.5,h=1.5,H=L(p);{const r=o.convertToPixel("xAxis",a),u=o.convertToPixel("yAxis",0),T=o.convertToPixel("yAxis",e),P=Math.abs(T-u),R=T<u?-1:1;let c=0;for(;c<P;){const F=Math.min(A,P-c),$=R===-1?u-c-F:u+c;d.graphic.push({type:"rect",zlevel:10,shape:{x:r-f/2-h,y:$-h,width:f+h*2,height:F+h*2,r:N+h},style:{fill:"#FFFFFF"},z:14}),d.graphic.push({type:"rect",zlevel:10,shape:{x:r-f/2,y:$,width:f,height:F,r:N},style:{fill:H},z:15}),c+=A+B}}{const r=o.convertToPixel("yAxis",e),u=o.convertToPixel("xAxis",15),T=o.convertToPixel("xAxis",a),P=Math.abs(T-u),R=T>u?1:-1;let c=0;for(;c<P;){const F=Math.min(A,P-c),$=R===1?u+c:u-c-F;d.graphic.push({type:"rect",zlevel:10,shape:{x:$-h,y:r-f/2-h,width:F+h*2,height:f+h*2,r:N+h},style:{fill:"#FFFFFF"},z:14}),d.graphic.push({type:"rect",zlevel:10,shape:{x:$,y:r-f/2,width:F,height:f,r:N},style:{fill:H},z:15}),c+=A+B}}d.graphic.push({name:"Measured result",type:"circle",zlevel:10,shape:{cx:o.convertToPixel("xAxis",a),cy:o.convertToPixel("yAxis",e),r:6},style:{fill:L(p),stroke:"#FFFFFF",lineWidth:2},z:15});const V=o.convertToPixel("xAxis",a),Z=o.convertToPixel("yAxis",e),l=document.createElementNS("http://www.w3.org/2000/svg","svg"),y=document.createElement("div");l.setAttribute("width","75"),l.setAttribute("height","36"),l.setAttribute("viewBox","-2 -2 75 36"),l.setAttribute("fill","none"),l.setAttribute("xmlns","http://www.w3.org/2000/svg");const S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d","M7 4C7 1.79086 8.79086 0 11 0H67C69.2091 0 71 1.79086 71 4V28C71 30.2091 69.2091 32 67 32H11C8.79086 32 7 30.2091 7 28V4Z"),S.setAttribute("fill",L(p)),S.setAttribute("stroke","#FFFFFF"),S.setAttribute("stroke-width","4"),S.setAttribute("paint-order","stroke");const g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("d","M7 10L1.13333 14.4C0.0666666 15.2 0.0666666 16.8 1.13333 17.6L7 22"),g.setAttribute("fill","none"),g.setAttribute("stroke","#FFFFFF"),g.setAttribute("stroke-width","2.5"),g.setAttribute("stroke-linejoin","round"),g.setAttribute("stroke-linecap","round");const E=document.createElementNS("http://www.w3.org/2000/svg","path");E.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),E.setAttribute("fill",L(p)),l.appendChild(g),l.appendChild(S),l.appendChild(E),l.style.position="absolute",l.style.left=`${n.left+V+8}px`,l.style.top=`${n.top+Z-17}px`,l.style.zIndex="8",y.innerText=`${Number.parseFloat(e).toFixed(3)}`,y.style.position="absolute",y.style.left=`${n.left+V+28}px`,y.style.top=`${n.top+Z-8}px`,y.style.font="bold 16px sans-serif",y.style.color="white",y.style.zIndex="999",y.style.fontFamily="Sen",document.body.appendChild(y),document.body.appendChild(l),o.setOption(d)}tt(async()=>{s=await w.getReport(),x=s.sex,b=await w.getResilienceData(x),W=Number(s.G0yourscore),k=Number(s.G2yourscore),a=Number(s.chronologicalage),e=Number((k/W).toFixed(3));let n=b.data.filter(A=>A.y<e).length,d=b.data.length;p=Math.round(n/d*100),(p===100||p===0)&&(p=p===100?99:1),X()});function Y(n){et[n?"unshift":"push"](()=>{v=n,m(0,v)})}return C.$$set=n=>{"service"in n&&m(1,w=n.service)},[v,w,Y]}class D extends K{constructor(i){super(),Q(this,i,rt,ot,_,{service:1})}get service(){return this.$$.ctx[1]}set service(i){this.$$set({service:i}),U()}}customElements.define("ga-immune-resilience-index-scatter",J(D,{service:{}},[],[],!1));export{D as default};
|