@glycanage/web-components 1.213.0 → 1.215.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 W,S as M,i as O,f as D,s as G,e as b,b as T,n as t,p as L,g as k,q as f,u as C,k as P,o as I,A as B}from"./index2.js";import{g as H}from"./globals.js";import{f as g}from"./helpers.js";const{document:V}=H;function q(v){let o,x,h,s,d,e,i,y;return{c(){o=b("div"),x=b("div"),h=T(),s=b("div"),s.textContent="Age",d=T(),e=b("div"),e.textContent="Immune resilience index",i=T(),y=b("link"),t(x,"width","100%"),t(x,"height","100%"),t(s,"position","absolute"),t(s,"bottom","3px"),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(o,"width","100%"),t(o,"height","100%"),t(o,"position","relative"),L(y,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),L(y,"rel","stylesheet")},m(n,w){k(n,o,w),f(o,x),v[2](x),f(o,h),f(o,s),f(o,d),f(o,e),k(n,i,w),f(V.head,y)},p:C,i:C,o:C,d(n){n&&(P(o),P(i)),v[2](null),P(y)}}}function Z(v,o,x){let{service:h=window.GaReportService}=o,s,d,e=0,i={},y="",n=0,w=0,$=0,u,a=0;function R(){u&&(i=echarts.init(u,null,{devicePixelRatio:4,renderer:"svg"}));const r=u.getBoundingClientRect();var m={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"5px",left:"50px",right:"45px",bottom:"40px"},dataset:[{source:d.data.map(c=>[c.x,c.y])}],tooltip:{show:!1},xAxis:{min:10,max:100,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(c){return c===0||c===100?"":c}},splitLine:{show:!0}},yAxis:{min:0,max:4.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(c){return c===0||c===.6?"":c}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},symbolSize:4,itemStyle:{color:"#09341F",opacity:.4,borderWidth:1,lineWidth:12}},{name:"Resilience index",type:"scatter",data:[{x:n,y:e}],itemStyle:{color:g(a)}}],graphic:[]};i.setOption(m),m.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",n),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",n),y2:i.convertToPixel("yAxis",e)},style:{stroke:g(a),lineDash:[8,8],lineWidth:1},z:8}),m.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",e),x2:i.convertToPixel("xAxis",n),y2:i.convertToPixel("yAxis",e)},style:{stroke:g(a),lineDash:[8,8],lineWidth:1},z:8}),m.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",n),cy:i.convertToPixel("yAxis",e),r:6},style:{fill:g(a),stroke:"#FFFFFF",lineWidth:1},z:15});const A=i.convertToPixel("xAxis",n),z=i.convertToPixel("yAxis",e),l=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=document.createElement("div");l.setAttribute("width","71"),l.setAttribute("height","32"),l.setAttribute("viewBox","0 0 71 32"),l.setAttribute("fill","none"),l.setAttribute("xmlns","http://www.w3.org/2000/svg");const F=document.createElementNS("http://www.w3.org/2000/svg","path");F.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"),F.setAttribute("fill",g(a));const S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),S.setAttribute("fill",g(a)),l.appendChild(F),l.appendChild(S),l.style.position="absolute",l.style.left=`${r.left+A+10}px`,l.style.top=`${r.top+z-15}px`,l.style.zIndex="8",p.innerText=`${Number.parseFloat(e).toFixed(3)}`,p.style.position="absolute",p.style.left=`${r.left+A+28}px`,p.style.top=`${r.top+z-8}px`,p.style.font="bold 16px sans-serif",p.style.color="white",p.style.zIndex="999",p.style.fontFamily="Sen",document.body.appendChild(p),document.body.appendChild(l),i.setOption(m)}I(async()=>{s=await h.getReport(),y=s.sex,d=await h.getResilienceData(y),$=Number(s.G0yourscore),w=Number(s.G2yourscore),n=Number(s.chronologicalage),e=Number((w/$).toFixed(3));let r=d.data.filter(A=>A.y<e).length,m=d.data.length;a=Math.round(r/m*100),(a===100||a===0)&&(a=a===100?99:1),R()});function E(r){B[r?"unshift":"push"](()=>{u=r,x(0,u)})}return v.$$set=r=>{"service"in r&&x(1,h=r.service)},[u,h,E]}class N extends M{constructor(o){super(),O(this,o,Z,q,G,{service:1})}get service(){return this.$$.ctx[1]}set service(o){this.$$set({service:o}),D()}}customElements.define("ga-immune-resilience-index-scatter",W(N,{service:{}},[],[],!1));export{N as default};
1
+ import{c as J,S as K,i as Q,f as U,s as _,e as L,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 M}from"./helpers.js";const{document:st}=it;function ot(C){let i,y,w,s,g,e,o,m;return{c(){i=L("div"),y=L("div"),w=O(),s=L("div"),s.textContent="Age",g=O(),e=L("div"),e.textContent="Immune resilience index",o=O(),m=L("link"),t(y,"width","100%"),t(y,"height","100%"),t(s,"position","absolute"),t(s,"bottom","3px"),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"),j(m,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),j(m,"rel","stylesheet")},m(a,k){q(a,i,k),z(i,y),C[2](y),z(i,w),z(i,s),z(i,g),z(i,e),q(a,o,k),z(st.head,m)},p:G,i:G,o:G,d(a){a&&(I(i),I(o)),C[2](null),I(m)}}}function rt(C,i,y){let{service:w=window.GaReportService}=i,s,g,e=0,o={},m="",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 x={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"5px",left:"50px",right:"45px",bottom:"40px"},dataset:[{source:g.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: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:M(p)}}],graphic:[]};o.setOption(x);const A=10,B=6,f=2,N=1.5,h=1.5,H=M(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;x.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}),x.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;x.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}),x.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}}x.graphic.push({name:"Measured result",type:"circle",zlevel:10,shape:{cx:o.convertToPixel("xAxis",a),cy:o.convertToPixel("yAxis",e),r:6},style:{fill:M(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"),d=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",M(p)),S.setAttribute("stroke","#FFFFFF"),S.setAttribute("stroke-width","4"),S.setAttribute("paint-order","stroke");const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d","M7 10L1.13333 14.4C0.0666666 15.2 0.0666666 16.8 1.13333 17.6L7 22"),b.setAttribute("fill","none"),b.setAttribute("stroke","#FFFFFF"),b.setAttribute("stroke-width","2.5"),b.setAttribute("stroke-linejoin","round"),b.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",M(p)),l.appendChild(b),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",d.innerText=`${Number.parseFloat(e).toFixed(3)}`,d.style.position="absolute",d.style.left=`${n.left+V+28}px`,d.style.top=`${n.top+Z-8}px`,d.style.font="bold 16px sans-serif",d.style.color="white",d.style.zIndex="999",d.style.fontFamily="Sen",document.body.appendChild(d),document.body.appendChild(l),o.setOption(x)}tt(async()=>{s=await w.getReport(),m=s.sex,g=await w.getResilienceData(m),W=Number(s.G0yourscore),k=Number(s.G2yourscore),a=Number(s.chronologicalage),e=Number((k/W).toFixed(3));let n=g.data.filter(A=>A.y<e).length,x=g.data.length;p=Math.round(n/x*100),(p===100||p===0)&&(p=p===100?99:1),X()});function Y(n){et[n?"unshift":"push"](()=>{v=n,y(0,v)})}return C.$$set=n=>{"service"in n&&y(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};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@glycanage/web-components",
3
3
  "description": "A collection of web-components",
4
- "version": "1.213.0",
4
+ "version": "1.215.0",
5
5
  "type": "module",
6
6
  "main": "dist/lib/@glycanage/web-components.js",
7
7
  "scripts": {