@glycanage/web-components 1.209.0 → 1.211.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.
@@ -0,0 +1 @@
1
+ import{c as R,S as D,i as M,f as C,s as W,e as L,b as H,n as b,p as E,g as z,q as I,u as A,k as F,o as O,A as V}from"./index2.js";import{g as Z}from"./globals.js";import{i as q}from"./index3.js";import{s as j}from"./helpers.js";const{document:J}=Z;function K(c){let t,r,l;return{c(){t=L("div"),r=H(),l=L("link"),b(t,"width","100%"),b(t,"height","100%"),b(t,"position","relative"),E(l,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),E(l,"rel","stylesheet")},m(o,a){z(o,t,a),c[4](t),z(o,r,a),I(J.head,l)},p:A,i:A,o:A,d(o){o&&(F(t),F(r)),c[4](null),F(l)}}}const m="#008F8C",Q="rgba(0,143,140,0.35)";function _(c,t,r){let l,{type:o}=t,{service:a=window.GaReportService}=t,B=[{name:"mature",csvPerc:"G0percentile",csvScore:"G0yourscore"},{name:"youth",csvPerc:"G2percentile",csvScore:"G2yourscore"},{name:"shield",csvPerc:"Spercentile",csvScore:"Syourscore"},{name:"lifestyle",csvPerc:"Bpercentile",csvScore:"Byourscore"},{name:"median",csvPerc:"G1percentile",csvScore:"G1yourscore"}],u,$,g=0,p=0,i={},v="",y=0,h;const w=B.find(e=>e.name===o);function G(){h&&(i=q(h,null,{devicePixelRatio:4,renderer:"svg"}));const e=h.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"#FFFFFF",grid:{top:36,left:64,right:32,bottom:52},dataset:[{source:$.data.map(x=>[x.x,x.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:"Chronological age",nameTextStyle:{color:"#4F5B67",opacity:.9,fontSize:10,padding:[18,0,0,0]},nameLocation:"middle",axisLine:{show:!0,lineStyle:{color:"#E0E3E6",width:1},symbol:["none","none"]},axisTick:{show:!1},axisLabel:{show:!0,color:"#7A8794",fontSize:10,opacity:1,formatter(x){return x===0||x===100?"":x}},splitLine:{show:!0,lineStyle:{color:"#F0F2F4"}}},yAxis:{min:0,max:.6,name:"Biological age",nameTextStyle:{color:"#4F5B67",opacity:.9,fontSize:10,padding:[0,0,28,0]},nameLocation:"middle",nameRotate:90,axisLine:{show:!0,lineStyle:{color:"#E0E3E6",width:1},symbol:["none","none"]},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!0,lineStyle:{color:"#F0F2F4"}}},series:[{type:"scatter",tooltip:{},symbolSize:5,itemStyle:{color:Q,opacity:1,borderWidth:1}},{name:"Result",type:"scatter",data:[{x:y,y:p}],itemStyle:{color:m},symbolSize:8}],graphic:[],legend:{show:!1}};i.setOption(d),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",y),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:m,lineDash:[8,8],lineWidth:2},z:8}),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",p),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:m,lineDash:[8,8],lineWidth:2},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:4},style:{fill:m,stroke:"#FFFFFF",lineWidth:1.5},z:15});const P=i.convertToPixel("xAxis",y),T=i.convertToPixel("yAxis",p),s=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElement("div");s.setAttribute("width","80"),s.setAttribute("height","28"),s.setAttribute("viewBox","0 0 71 32"),s.setAttribute("fill","none"),s.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",m);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",m),s.appendChild(f),s.appendChild(S),s.style.position="absolute",s.style.left=`${e.left+P+2}px`,s.style.top=`${e.top+T-14}px`,s.style.zIndex="8",n.innerText=l,n.style.position="absolute",n.style.left=`${e.left+P+20}px`,n.style.top=`${e.top+T-8}px`,n.style.font="bold 11px sans-serif",n.style.color="white",n.style.zIndex="999",n.style.fontFamily="Sen",n.style.paddingLeft="4px",document.body.appendChild(n),document.body.appendChild(s),i.setOption(d)}O(async()=>{u=await a.getReport(),v=u.sex,$=await a.getScatterData(o,v),await a.getLineData(o,v),y=Number(u.chronologicalage),w&&(r(3,g=Number(u[w.csvPerc])),p=Number(u[w.csvScore])),G()});function N(e){V[e?"unshift":"push"](()=>{h=e,r(0,h)})}return c.$$set=e=>{"type"in e&&r(1,o=e.type),"service"in e&&r(2,a=e.service)},c.$$.update=()=>{c.$$.dirty&8&&(l=(()=>{const e=Math.round(g||0),d=j(e,"english");return`${e}${d} pct`})())},[h,o,a,g,N]}class k extends D{constructor(t){super(),M(this,t,_,K,W,{type:1,service:2})}get type(){return this.$$.ctx[1]}set type(t){this.$$set({type:t}),C()}get service(){return this.$$.ctx[2]}set service(t){this.$$set({service:t}),C()}}customElements.define("ga-biological-age-rank-scatter",R(k,{type:{},service:{}},[],[],!1));export{k as default};
@@ -0,0 +1 @@
1
+ import{c as M,S as O,i as W,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(w){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,v){k(n,o,v),f(o,x),w[2](x),f(o,h),f(o,s),f(o,d),f(o,e),k(n,i,v),f(V.head,y)},p:C,i:C,o:C,d(n){n&&(P(o),P(i)),w[2](null),P(y)}}}function Z(w,o,x){let{service:h=window.GaReportService}=o,s,d,e=0,i={},y="",n=0,v=0,$=0,u,l=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:"65px",left:"50px",right:"55px",bottom:"40px"},dataset:[{source:d.data.map(c=>[c.x,c.y])}],tooltip:{show:!1},xAxis:{min:0,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:2,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:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Resilience index",type:"scatter",data:[{x:n,y:e}],itemStyle:{color:g(l)}}],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(l),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(l),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(l),stroke:"#FFFFFF",lineWidth:1},z:15});const A=i.convertToPixel("xAxis",n),z=i.convertToPixel("yAxis",e),a=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=document.createElement("div");a.setAttribute("width","71"),a.setAttribute("height","32"),a.setAttribute("viewBox","0 0 71 32"),a.setAttribute("fill","none"),a.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(l));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(l)),a.appendChild(F),a.appendChild(S),a.style.position="absolute",a.style.left=`${r.left+A+10}px`,a.style.top=`${r.top+z-15}px`,a.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(a),i.setOption(m)}I(async()=>{s=await h.getReport(),y=s.sex,d=await h.getResilienceData(y),$=Number(s.G0yourscore),v=Number(s.G2yourscore),n=Number(s.chronologicalage),e=Number((v/$).toFixed(3));let r=d.data.filter(A=>A.y<e).length,m=d.data.length;l=Math.round(r/m*100),(l===100||l===0)&&(l=l===100?99:1),R()});function E(r){B[r?"unshift":"push"](()=>{u=r,x(0,u)})}return w.$$set=r=>{"service"in r&&x(1,h=r.service)},[u,h,E]}class N extends O{constructor(o){super(),W(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",M(N,{service:{}},[],[],!1));export{N as default};
@@ -1 +1,3 @@
1
- import{c as H,S as L,i as T,f as q,s as A,a as E,e as d,m as k,b as f,p as o,n as b,g as N,q as s,r as S,u as X,k as O}from"./index2.js";import{s as C,j as D}from"./helpers.js";function F(e){E(e,"svelte-e93mjh",".graph-card.svelte-e93mjh{font-family:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;width:560px;height:133px;padding:52px 1.25rem 1rem;background:#f5f5f5;border-radius:8px;border:1px solid #e0e0e0;box-sizing:border-box}.bubble.svelte-e93mjh{position:absolute;bottom:18px;display:inline-block;transform:translateX(-50%)}.bubble-text.svelte-e93mjh{display:block;padding:0.35rem 0.75rem;background:#008f8c;color:#fff;font-weight:bold;font-size:0.875rem;border-radius:6px;white-space:nowrap;box-shadow:0 1px 3px rgba(0, 0, 0, 0.15)}.bubble-arrow.svelte-e93mjh{position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #008f8c}.bar-wrap.svelte-e93mjh{position:relative;width:-moz-fit-content;width:fit-content;max-width:100%;margin-bottom:8px}.slider-bar.svelte-e93mjh{display:flex;gap:2px;width:-moz-fit-content;width:fit-content}.colorBox.svelte-e93mjh,.colorBoxShort.svelte-e93mjh{height:7px;flex-shrink:0;border-radius:24px}.colorBoxShort.svelte-e93mjh{width:16px}.colorBox.svelte-e93mjh{width:64px}.seg-1.svelte-e93mjh{background-color:#b71c1c}.seg-2.svelte-e93mjh{background-color:#d92429}.seg-3.svelte-e93mjh{background-color:#f78d1e}.seg-4.svelte-e93mjh,.seg-5.svelte-e93mjh,.seg-6.svelte-e93mjh{background-color:#51c7b8}.seg-7.svelte-e93mjh{background-color:#008f8c}.seg-8.svelte-e93mjh{background-color:#005f6e}.median-triangle.svelte-e93mjh{position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid #5dade2;pointer-events:none;z-index:0}.marker-triangle.svelte-e93mjh{position:absolute;bottom:-2px;transform:translateX(-50%);width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;pointer-events:none;z-index:1}.labels.svelte-e93mjh{display:flex;gap:2px;width:-moz-fit-content;width:fit-content;font-size:0.7rem;color:#9e9e9e;align-items:center}.label.svelte-e93mjh{text-align:center;flex-shrink:0;box-sizing:border-box;border-left:1px solid #d0d0d0;padding:0 4px}.label-optimal.svelte-e93mjh{border-right:1px solid #d0d0d0}.label-suboptimal.svelte-e93mjh{width:148px}.label-average.svelte-e93mjh{width:130px}.label-optimal.svelte-e93mjh{width:148px}")}function P(e){let l,t,r,a,n=Math.round(e[1])+"",h,v,m,g,$,y,u,B,x,z,p,M,j,w;return{c(){l=d("div"),t=d("div"),r=d("div"),a=d("span"),h=k(n),v=k(e[3]),m=k(" percentile"),g=f(),$=d("div"),y=f(),u=d("div"),u.innerHTML='<div class="colorBoxShort seg-1 svelte-e93mjh"></div> <div class="colorBox seg-2 svelte-e93mjh"></div> <div class="colorBox seg-3 svelte-e93mjh"></div> <div class="colorBox seg-4 svelte-e93mjh"></div> <div class="colorBox seg-5 svelte-e93mjh"></div> <div class="colorBox seg-6 svelte-e93mjh"></div> <div class="colorBox seg-7 svelte-e93mjh"></div> <div class="colorBoxShort seg-8 svelte-e93mjh"></div>',B=f(),x=d("div"),z=f(),p=d("div"),M=f(),j=d("div"),j.innerHTML='<span class="label label-suboptimal svelte-e93mjh">Suboptimal</span> <span class="label label-average svelte-e93mjh">Average</span> <span class="label label-optimal svelte-e93mjh">Optimal</span>',o(a,"class","bubble-text svelte-e93mjh"),o($,"class","bubble-arrow svelte-e93mjh"),o(r,"class","bubble svelte-e93mjh"),b(r,"left",e[0]+"%"),o(u,"class","slider-bar svelte-e93mjh"),o(x,"class","median-triangle svelte-e93mjh"),b(x,"left","50%"),o(x,"aria-hidden","true"),o(x,"title","50th percentile (median)"),o(p,"class","marker-triangle svelte-e93mjh"),b(p,"left",e[0]+"%"),b(p,"border-bottom-color",e[2]),o(p,"aria-hidden","true"),o(t,"class","bar-wrap svelte-e93mjh"),o(j,"class","labels svelte-e93mjh"),o(l,"class","graph-card svelte-e93mjh"),o(l,"role","img"),o(l,"aria-label",w="Immune resilience index in the "+Math.round(e[1])+e[3]+" percentile, from suboptimal to optimal")},m(i,c){N(i,l,c),s(l,t),s(t,r),s(r,a),s(a,h),s(a,v),s(a,m),s(r,g),s(r,$),s(t,y),s(t,u),s(t,B),s(t,x),s(t,z),s(t,p),s(l,M),s(l,j)},p(i,[c]){c&2&&n!==(n=Math.round(i[1])+"")&&S(h,n),c&8&&S(v,i[3]),c&1&&b(r,"left",i[0]+"%"),c&1&&b(p,"left",i[0]+"%"),c&4&&b(p,"border-bottom-color",i[2]),c&10&&w!==(w="Immune resilience index in the "+Math.round(i[1])+i[3]+" percentile, from suboptimal to optimal")&&o(l,"aria-label",w)},i:X,o:X,d(i){i&&O(l)}}}function W(e,l,t){let r,a,n,h,v,{percentile:m=50}=l;return e.$$set=g=>{"percentile"in g&&t(4,m=g.percentile)},e.$$.update=()=>{e.$$.dirty&16&&t(1,r=typeof m=="string"?parseInt(m,10):Number(m)),e.$$.dirty&2&&t(3,a=C(Math.round(r),"english")),e.$$.dirty&2&&t(0,n=D(r)),e.$$.dirty&1&&t(5,h=n<34.5?"suboptimal":n<64.5?"average":"optimal"),e.$$.dirty&32&&t(2,v=h==="suboptimal"?"#d92429":"#008f8c")},[n,r,v,a,m,h]}class I extends L{constructor(l){super(),T(this,l,W,P,A,{percentile:4},F)}get percentile(){return this.$$.ctx[4]}set percentile(l){this.$$set({percentile:l}),q()}}customElements.define("ga-immune-resilience-index",H(I,{percentile:{}},[],[],!0));export{I as default};
1
+ import{c as je,S as be,i as we,f as ye,s as Be,a as ke,d as Fe,g as pe,u as xe,k as ue,o as Ce,e as o,m as w,b as d,v as U,n as i,p as t,q as e,r as V}from"./index2.js";import{s as W,f as m,j as S}from"./helpers.js";function ze(r){ke(r,"svelte-8jht07",".main.svelte-8jht07{height:100%;width:100%;display:flex;flex-direction:column}.label.svelte-8jht07{height:15%;width:100%;display:flex;justify-content:center}.graph.svelte-8jht07{height:85%;width:100%;display:flex;align-items:center;justify-content:center;border:1px solid #09341F33;border-radius:10px}.graph-container.svelte-8jht07{width:85%;height:100%;display:flex;align-items:center;justify-content:space-between;position:relative}.colorBox.svelte-8jht07{height:7px;width:14.3%;border-radius:24px}.colorBoxShort.svelte-8jht07{height:7px;width:5%;border-radius:24px}.slider.svelte-8jht07{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -90%);width:24%;max-height:70px}.slider-number.svelte-8jht07{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -120%);width:24%;font-size:0.71rem;color:white}.text-left.svelte-8jht07{position:absolute;height:15%;border-left:1px solid #09341F33;border-right:1px solid #09341F33;top:62%;left:0;display:flex;align-items:center;justify-content:center;font-size:0.8rem;color:#09341F80}.text-middle.svelte-8jht07{position:absolute;height:15%;top:62%;left:35%;display:flex;align-items:center;justify-content:center;font-size:0.8rem;color:#09341F80}.text-right.svelte-8jht07{position:absolute;height:15%;border-left:1px solid #09341F33;border-right:1px solid #09341F33;top:62%;right:0;display:flex;align-items:center;justify-content:center;font-size:0.8rem;color:#09341F80}.slider-triangle.svelte-8jht07{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -90%);width:24%}")}function me(r){let n,l,a,c,f,y,$,p,B,g=W(r[0],"english")+"",k,j,R,F,s,_,ee,q,te,E,se,I,le,O,ie,Z,oe,H,re,J,ne,C,x,b,K,ae,z,D,X,P,Q=W(r[0],"english")+"",Y,ce,he,A,u,N,T,de,G,ve,L,ge,M;return{c(){n=o("div"),l=o("div"),a=w(`Immune resilience index ranks in the\xA0
2
+ `),c=o("span"),f=o("b"),y=w(r[0]),$=d(),p=o("sup"),B=o("b"),k=w(g),j=w(`
3
+ \xA0percentile:`),R=d(),F=o("div"),s=o("div"),_=o("div"),ee=d(),q=o("div"),te=d(),E=o("div"),se=d(),I=o("div"),le=d(),O=o("div"),ie=d(),Z=o("div"),oe=d(),H=o("div"),re=d(),J=o("div"),ne=d(),C=o("div"),x=U("svg"),b=U("rect"),ae=d(),z=o("div"),D=o("b"),X=w(r[0]),P=o("sup"),Y=w(Q),ce=w(" percentile"),he=d(),A=o("div"),u=U("svg"),N=U("path"),de=d(),G=o("div"),G.textContent="Suboptimal",ve=d(),L=o("div"),L.textContent="Average",ge=d(),M=o("div"),M.textContent="Optimal",i(c,"color",m(r[0])),i(c,"height","80%"),i(c,"display","flex"),i(p,"color",m(r[0])),i(p,"font-size","0.65rem"),t(l,"class","label svelte-8jht07"),t(_,"class","colorBoxShort svelte-8jht07"),i(_,"background-color","#DF2120"),t(q,"class","colorBox svelte-8jht07"),i(q,"background-color","#DF2120"),t(E,"class","colorBox svelte-8jht07"),i(E,"background-color","#F2800D"),t(I,"class","colorBox svelte-8jht07"),i(I,"background-color","#66CCAA"),t(O,"class","colorBox svelte-8jht07"),i(O,"background-color","#66CCAA"),t(Z,"class","colorBox svelte-8jht07"),i(Z,"background-color","#13A195"),t(H,"class","colorBox svelte-8jht07"),i(H,"background-color","#015566"),t(J,"class","colorBoxShort svelte-8jht07"),i(J,"background-color","#015566"),t(b,"width","100"),t(b,"height","24"),t(b,"rx","4"),t(b,"fill",K=m(r[0])),t(x,"width","100"),t(x,"height","24"),t(x,"viewBox","0 0 100 24"),t(x,"fill","none"),t(x,"xmlns","http://www.w3.org/2000/svg"),t(C,"class","slider svelte-8jht07"),i(C,"left",S(r[0])+"%"),i(P,"font-size","0.5rem"),t(z,"class","slider-number svelte-8jht07"),i(z,"left",S(r[0])+"%"),t(N,"d","M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L0 8.07577e-07L12 0L6.8 6.93333Z"),t(N,"fill",T=m(r[0])),t(u,"width","12"),t(u,"height","8"),t(u,"viewBox","0 0 12 8"),t(u,"fill","none"),t(u,"xmlns","http://www.w3.org/2000/svg"),t(A,"class","slider-triangle svelte-8jht07"),i(A,"left",S(r[0])+"%"),t(G,"class","text-left svelte-8jht07"),i(G,"width","34.7%"),t(L,"class","text-middle svelte-8jht07"),i(L,"width","29.5%"),t(M,"class","text-right svelte-8jht07"),i(M,"width","34.7%"),t(s,"class","graph-container svelte-8jht07"),t(F,"class","graph svelte-8jht07"),t(n,"class","main svelte-8jht07")},m(h,v){pe(h,n,v),e(n,l),e(l,a),e(l,c),e(c,f),e(f,y),e(l,$),e(l,p),e(p,B),e(B,k),e(l,j),e(n,R),e(n,F),e(F,s),e(s,_),e(s,ee),e(s,q),e(s,te),e(s,E),e(s,se),e(s,I),e(s,le),e(s,O),e(s,ie),e(s,Z),e(s,oe),e(s,H),e(s,re),e(s,J),e(s,ne),e(s,C),e(C,x),e(x,b),e(s,ae),e(s,z),e(z,D),e(D,X),e(D,P),e(P,Y),e(D,ce),e(s,he),e(s,A),e(A,u),e(u,N),e(s,de),e(s,G),e(s,ve),e(s,L),e(s,ge),e(s,M)},p(h,v){v&1&&V(y,h[0]),v&1&&i(c,"color",m(h[0])),v&1&&g!==(g=W(h[0],"english")+"")&&V(k,g),v&1&&i(p,"color",m(h[0])),v&1&&K!==(K=m(h[0]))&&t(b,"fill",K),v&1&&i(C,"left",S(h[0])+"%"),v&1&&V(X,h[0]),v&1&&Q!==(Q=W(h[0],"english")+"")&&V(Y,Q),v&1&&i(z,"left",S(h[0])+"%"),v&1&&T!==(T=m(h[0]))&&t(N,"fill",T),v&1&&i(A,"left",S(h[0])+"%")},d(h){h&&ue(n)}}}function Ae(r){let n,l=r[1]&&me(r);return{c(){l&&l.c(),n=Fe()},m(a,c){l&&l.m(a,c),pe(a,n,c)},p(a,[c]){a[1]?l?l.p(a,c):(l=me(a),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i:xe,o:xe,d(a){a&&ue(n),l&&l.d(a)}}}function Se(r,n,l){let{service:a=window.GaReportService}=n,c,f,y="",$=0,p=0,B=0,g=0,k=!1;return Ce(async()=>{c=await a.getReport(),y=c.sex,f=await a.getResilienceData(y),p=Number(c.G0yourscore),$=Number(c.G2yourscore),B=Number($/p);let j=f.data.filter(F=>F.y<B).length,R=f.data.length;l(0,g=Math.round(j/R*100)),(g===100||g===0)&&l(0,g=g===100?99:1),l(1,k=!0)}),r.$$set=j=>{"service"in j&&l(2,a=j.service)},[g,k,a]}class fe extends be{constructor(n){super(),we(this,n,Se,Ae,Be,{service:2},ze)}get service(){return this.$$.ctx[2]}set service(n){this.$$set({service:n}),ye()}}customElements.define("ga-immune-resilience-index",je(fe,{service:{}},[],[],!0));export{fe as default};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- const t=()=>{import("./arthritis.wc.js"),import("./colitis.wc.js"),import("./crohn.wc.js"),import("./lupus.wc.js"),import("./diabetes.wc.js"),import("./myocardial.wc.js"),import("./menopause.wc.js"),import("./hypertension.wc.js"),import("./chronic.wc.js"),import("./dyslipidemia.wc.js"),import("./atherosclerosis.wc.js"),import("./coronary.wc.js"),import("./copd.wc.js"),import("./hypertension-risk.wc.js"),import("./pre-hypertension.wc.js"),import("./language.interface.js"),import("./colorectal.wc.js"),import("./endometrial.wc.js"),import("./ovarian.wc.js"),import("./age-graph.wc.js"),import("./index-graph.wc.js"),import("./median-graph.wc.js"),import("./median-graph-japanese.wc.js"),import("./index-graph-japanese.wc.js"),import("./results-overview.wc.js"),import("./results-overview-custom.wc.js"),import("./results-overview-custom-clinical.wc.js"),import("./single-overview.wc.js"),import("./single-overview-custom.wc.js"),import("./single-overview-custom-clinical.wc.js"),import("./main-result.wc.js"),import("./main-result-custom.wc.js"),import("./main-result-custom-clinical.wc.js"),import("./main-result-three.wc.js"),import("./main-result-three-client.wc.js"),import("./results-overview-three.wc.js"),import("./results-overview-three-clp-ch.wc.js"),import("./insights-overview.wc.js"),import("./insights-overview-three.wc.js"),import("./insights-overview-three-clp.wc.js"),import("./insights-overview-three-clp-ch.wc.js"),import("./insights-overview-custom.wc.js"),import("./insights-overview-custom-clinical.wc.js"),import("./insights-overview-three-client.wc.js"),import("./insights-overview-latest.wc.js"),import("./action-steps-three.wc.js"),import("./action-steps-three-clp.wc.js"),import("./action-steps-three-clp-ch.wc.js"),import("./action-steps-three-client.wc.js"),import("./arrow-graph.wc.js"),import("./arrow-graph-three.wc.js"),import("./overlap-title.wc.js"),import("./overlap-title-three.wc.js"),import("./scatter-plot.wc.js"),import("./scatter-plot-custom.wc.js"),import("./scatter-plot-custom-clinical.wc.js"),import("./results-overview-clp.wc.js"),import("./insights-overview-clp.wc.js"),import("./insights-overview-clp-ch.wc.js"),import("./main-result-clp.wc.js"),import("./main-result-clp-ch.wc.js"),import("./single-overview-clp.wc.js"),import("./single-overview-clp-new.wc.js"),import("./single-overview-clp-new-ch.wc.js"),import("./single-overview-three.wc.js"),import("./arrow-graph-clp.wc.js"),import("./arrow-graph-clp-ch.wc.js"),import("./overlap-title-clp.wc.js"),import("./overlap-title-clp-ch.wc.js"),import("./scatter-plot-clp.wc.js"),import("./scatter-plot-clp-ch.wc.js"),import("./over-time.wc.js"),import("./over-time-clp.wc.js"),import("./over-time-indexes.wc.js"),import("./over-time-indexes-clp-ch.wc.js"),import("./biological-age-rank.wc.js"),import("./immune-resilience-index.wc.js")};export{t as default};
1
+ const t=()=>{import("./arthritis.wc.js"),import("./colitis.wc.js"),import("./crohn.wc.js"),import("./lupus.wc.js"),import("./diabetes.wc.js"),import("./myocardial.wc.js"),import("./menopause.wc.js"),import("./hypertension.wc.js"),import("./chronic.wc.js"),import("./dyslipidemia.wc.js"),import("./atherosclerosis.wc.js"),import("./coronary.wc.js"),import("./copd.wc.js"),import("./hypertension-risk.wc.js"),import("./pre-hypertension.wc.js"),import("./language.interface.js"),import("./colorectal.wc.js"),import("./endometrial.wc.js"),import("./ovarian.wc.js"),import("./age-graph.wc.js"),import("./index-graph.wc.js"),import("./median-graph.wc.js"),import("./median-graph-japanese.wc.js"),import("./index-graph-japanese.wc.js"),import("./results-overview.wc.js"),import("./results-overview-custom.wc.js"),import("./results-overview-custom-clinical.wc.js"),import("./single-overview.wc.js"),import("./single-overview-custom.wc.js"),import("./single-overview-custom-clinical.wc.js"),import("./main-result.wc.js"),import("./main-result-custom.wc.js"),import("./main-result-custom-clinical.wc.js"),import("./main-result-three.wc.js"),import("./main-result-three-client.wc.js"),import("./results-overview-three.wc.js"),import("./results-overview-three-clp-ch.wc.js"),import("./insights-overview.wc.js"),import("./insights-overview-three.wc.js"),import("./insights-overview-three-clp.wc.js"),import("./insights-overview-three-clp-ch.wc.js"),import("./insights-overview-custom.wc.js"),import("./insights-overview-custom-clinical.wc.js"),import("./insights-overview-three-client.wc.js"),import("./insights-overview-latest.wc.js"),import("./action-steps-three.wc.js"),import("./action-steps-three-clp.wc.js"),import("./action-steps-three-clp-ch.wc.js"),import("./action-steps-three-client.wc.js"),import("./arrow-graph.wc.js"),import("./arrow-graph-three.wc.js"),import("./overlap-title.wc.js"),import("./overlap-title-three.wc.js"),import("./scatter-plot.wc.js"),import("./scatter-plot-custom.wc.js"),import("./scatter-plot-custom-clinical.wc.js"),import("./results-overview-clp.wc.js"),import("./insights-overview-clp.wc.js"),import("./insights-overview-clp-ch.wc.js"),import("./main-result-clp.wc.js"),import("./main-result-clp-ch.wc.js"),import("./single-overview-clp.wc.js"),import("./single-overview-clp-new.wc.js"),import("./single-overview-clp-new-ch.wc.js"),import("./single-overview-three.wc.js"),import("./arrow-graph-clp.wc.js"),import("./arrow-graph-clp-ch.wc.js"),import("./overlap-title-clp.wc.js"),import("./overlap-title-clp-ch.wc.js"),import("./scatter-plot-clp.wc.js"),import("./scatter-plot-clp-ch.wc.js"),import("./over-time.wc.js"),import("./over-time-clp.wc.js"),import("./over-time-indexes.wc.js"),import("./over-time-indexes-clp-ch.wc.js"),import("./biological-age-rank.wc.js"),import("./immune-resilience-index.wc.js"),import("./biological-age-rank-scatter.wc.js"),import("./immune-resilience-index-scatter.wc.js")};export{t as default};
package/dist/init.js CHANGED
@@ -1 +1 @@
1
- class t{getReport(){return Promise.resolve(!0)}getScatterData(e,r){return Promise.resolve(!0)}getLineData(e,r){return Promise.resolve(!0)}getOverTimeData(){return Promise.resolve(!0)}getOverTimeDataIndexes(){return Promise.resolve(!0)}}function o(){window.GaWebComponentService=new t}export{o as init};
1
+ class t{getReport(){return Promise.resolve(!0)}getScatterData(e,r){return Promise.resolve(!0)}getResilienceData(e){return Promise.resolve(!0)}getLineData(e,r){return Promise.resolve(!0)}getOverTimeData(){return Promise.resolve(!0)}getOverTimeDataIndexes(){return Promise.resolve(!0)}}function o(){window.GaWebComponentService=new t}export{o as init};
@@ -1 +1 @@
1
- import{c as W,S as B,i as I,f as b,s as M,e as L,b as H,n as A,p as G,g as k,q as V,u as P,k as F,o as Z,A as q}from"./index2.js";import{g as X}from"./globals.js";import{i as _}from"./index3.js";import{a as E,f as j,h as J}from"./helpers.js";const{document:K}=X;function Q(u){let e,a,t;return{c(){e=L("div"),a=H(),t=L("link"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),G(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),G(t,"rel","stylesheet")},m(n,c){k(n,e,c),u[4](e),k(n,a,c),V(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(a)),u[4](null),F(t)}}}function U(u,e,a){let{type:t}=e,{lang:n}=e,{service:c=window.GaReportService}=e,R=[{name:"mature",csvPerc:"G0percentile",csvScore:"G0yourscore"},{name:"youth",csvPerc:"G2percentile",csvScore:"G2yourscore"},{name:"shield",csvPerc:"Spercentile",csvScore:"Syourscore"},{name:"lifestyle",csvPerc:"Bpercentile",csvScore:"Byourscore"},{name:"median",csvPerc:"G1percentile",csvScore:"G1yourscore"}],h,$,T,f=0,p=0,i={},v="",y=0,m;const g=R.find(o=>o.name===t);function x(){if(t=="shield"||t=="youth"||t=="median")return j(f);if(t=="mature"||t=="lifestyle")return J(f)}function D(){m&&(i=_(m,null,{devicePixelRatio:4,renderer:"svg"}));const o=m.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"34px",left:"37px",right:"44px",bottom:"28px"},dataset:[{source:$.data.map(s=>[s.x,s.y])},{source:T.data.map(s=>[s.x,s.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:E(n,"AGE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===100?"":s}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:E(n,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===.6?"":s}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},symbolSize:5,itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Result",type:"scatter",data:[{x:y,y:p}],itemStyle:{color:x()}},{name:"Average population",type:"line",smooth:!0,datasetIndex:1,symbol:"line",lineStyle:{name:"line",type:"line",color:"#09341F",opacity:.5,symbol:"none",width:2},showSymbol:!1}],graphic:[],legend:{show:!0,right:"50%",top:"1%",left:"67%",itemGap:.2,itemWidth:10,itemHeight:6,textStyle:{color:"#09341F",opacity:.8,fontSize:8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};i.setOption(d),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",y),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:x(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",p),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:x(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:4},style:{fill:x(),stroke:"#FFFFFF",lineWidth:1},z:15});const z=i.convertToPixel("xAxis",y),C=i.convertToPixel("yAxis",p),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");r.setAttribute("width","52"),r.setAttribute("height","18"),r.setAttribute("viewBox","0 0 71 32"),r.setAttribute("fill","none"),r.setAttribute("xmlns","http://www.w3.org/2000/svg");const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.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"),w.setAttribute("fill",x());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",x()),r.appendChild(w),r.appendChild(S),r.style.position="absolute",r.style.left=`${o.left+z-95}px`,r.style.top=`${o.top+C-10}px`,r.style.zIndex="8",l.innerText=`${Number.parseFloat(p).toFixed(3)}`,l.style.position="absolute",l.style.left=`${o.left+z-79}px`,l.style.top=`${o.top+C-7}px`,l.style.font="bold 10px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(r),i.setOption(d)}Z(async()=>{h=await c.getReport(),v=h.sex,$=await c.getScatterData(t,v),T=await c.getLineData(t,v),y=Number(h.chronologicalage),g&&(f=Number(h[g.csvPerc]),p=Number(h[g.csvScore])),D()});function O(o){q[o?"unshift":"push"](()=>{m=o,a(0,m)})}return u.$$set=o=>{"type"in o&&a(1,t=o.type),"lang"in o&&a(2,n=o.lang),"service"in o&&a(3,c=o.service)},[m,t,n,c,O]}class N extends B{constructor(e){super(),I(this,e,U,Q,M,{type:1,lang:2,service:3})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),b()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),b()}get service(){return this.$$.ctx[3]}set service(e){this.$$set({service:e}),b()}}customElements.define("ga-scatter-plot-custom-clinical",W(N,{type:{},lang:{},service:{}},[],[],!1));export{N as default};
1
+ import{c as W,S as B,i as I,f as b,s as M,e as L,b as H,n as A,p as G,g as k,q as V,u as P,k as F,o as Z,A as q}from"./index2.js";import{g as X}from"./globals.js";import{a as E,f as _,h as j}from"./helpers.js";const{document:J}=X;function K(h){let e,a,t;return{c(){e=L("div"),a=H(),t=L("link"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),G(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),G(t,"rel","stylesheet")},m(r,c){k(r,e,c),h[4](e),k(r,a,c),V(J.head,t)},p:P,i:P,o:P,d(r){r&&(F(e),F(a)),h[4](null),F(t)}}}function Q(h,e,a){let{type:t}=e,{lang:r}=e,{service:c=window.GaReportService}=e,R=[{name:"mature",csvPerc:"G0percentile",csvScore:"G0yourscore"},{name:"youth",csvPerc:"G2percentile",csvScore:"G2yourscore"},{name:"shield",csvPerc:"Spercentile",csvScore:"Syourscore"},{name:"lifestyle",csvPerc:"Bpercentile",csvScore:"Byourscore"},{name:"median",csvPerc:"G1percentile",csvScore:"G1yourscore"}],u,$,T,f=0,p=0,i={},v="",y=0,x;const g=R.find(o=>o.name===t);function m(){if(t=="shield"||t=="youth"||t=="median")return _(f);if(t=="mature"||t=="lifestyle")return j(f)}function D(){x&&(i=echarts.init(x,null,{devicePixelRatio:4,renderer:"svg"}));const o=x.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"34px",left:"37px",right:"44px",bottom:"28px"},dataset:[{source:$.data.map(s=>[s.x,s.y])},{source:T.data.map(s=>[s.x,s.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:E(r,"AGE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===100?"":s}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:E(r,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===.6?"":s}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},symbolSize:5,itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Result",type:"scatter",data:[{x:y,y:p}],itemStyle:{color:m()}},{name:"Average population",type:"line",smooth:!0,datasetIndex:1,symbol:"line",lineStyle:{name:"line",type:"line",color:"#09341F",opacity:.5,symbol:"none",width:2},showSymbol:!1}],graphic:[],legend:{show:!0,right:"50%",top:"1%",left:"67%",itemGap:.2,itemWidth:10,itemHeight:6,textStyle:{color:"#09341F",opacity:.8,fontSize:8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};i.setOption(d),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",y),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:m(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",p),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:m(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:4},style:{fill:m(),stroke:"#FFFFFF",lineWidth:1},z:15});const z=i.convertToPixel("xAxis",y),C=i.convertToPixel("yAxis",p),n=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");n.setAttribute("width","52"),n.setAttribute("height","18"),n.setAttribute("viewBox","0 0 71 32"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg");const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.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"),w.setAttribute("fill",m());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",m()),n.appendChild(w),n.appendChild(S),n.style.position="absolute",n.style.left=`${o.left+z-95}px`,n.style.top=`${o.top+C-10}px`,n.style.zIndex="8",l.innerText=`${Number.parseFloat(p).toFixed(3)}`,l.style.position="absolute",l.style.left=`${o.left+z-79}px`,l.style.top=`${o.top+C-7}px`,l.style.font="bold 10px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(n),i.setOption(d)}Z(async()=>{u=await c.getReport(),v=u.sex,$=await c.getScatterData(t,v),T=await c.getLineData(t,v),y=Number(u.chronologicalage),g&&(f=Number(u[g.csvPerc]),p=Number(u[g.csvScore])),D()});function O(o){q[o?"unshift":"push"](()=>{x=o,a(0,x)})}return h.$$set=o=>{"type"in o&&a(1,t=o.type),"lang"in o&&a(2,r=o.lang),"service"in o&&a(3,c=o.service)},[x,t,r,c,O]}class N extends B{constructor(e){super(),I(this,e,Q,K,M,{type:1,lang:2,service:3})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),b()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),b()}get service(){return this.$$.ctx[3]}set service(e){this.$$set({service:e}),b()}}customElements.define("ga-scatter-plot-custom-clinical",W(N,{type:{},lang:{},service:{}},[],[],!1));export{N as default};
@@ -1 +1 @@
1
- import{c as W,S as B,i as I,f as F,s as H,e as L,b as j,n as $,p as k,g as E,q as V,u as T,k as z,o as Z,A as X}from"./index2.js";import{g as _}from"./globals.js";import{i as q}from"./index3.js";import{a as N,f as J,h as K}from"./helpers.js";const{document:Q}=_;function U(f){let t,p,o;return{c(){t=L("div"),p=j(),o=L("link"),$(t,"width","100%"),$(t,"height","100%"),$(t,"position","relative"),k(o,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),k(o,"rel","stylesheet")},m(l,m){E(l,t,m),f[4](t),E(l,p,m),V(Q.head,o)},p:T,i:T,o:T,d(l){l&&(z(t),z(p)),f[4](null),z(o)}}}function Y(f,t,p){let{type:o}=t,{lang:l}=t,{service:m=window.GaReportService}=t,M=[{name:"mature",csvPerc:"G0percentile",csvScore:"G0yourscore"},{name:"youth",csvPerc:"G2percentile",csvScore:"G2yourscore"},{name:"shield",csvPerc:"Spercentile",csvScore:"Syourscore"},{name:"lifestyle",csvPerc:"Bpercentile",csvScore:"Byourscore"},{name:"median",csvPerc:"G1percentile",csvScore:"G1yourscore"}],a,v,g,w=0,c=0,i={},S="",x=0,h;const b=M.find(e=>e.name===o);function d(){if(o=="shield"||o=="youth"||o=="median")return J(w);if(o=="mature"||o=="lifestyle")return K(w)}function C(){a={chronologicalage:42,sex:"M"},S="M",x=42,w=25,c=.41,v={data:[{x:25,y:.35},{x:28,y:.38},{x:30,y:.36},{x:32,y:.4},{x:33,y:.39},{x:35,y:.42},{x:38,y:.41},{x:40,y:.44},{x:42,y:.43},{x:45,y:.46},{x:48,y:.45},{x:50,y:.48},{x:52,y:.47},{x:55,y:.5},{x:58,y:.49},{x:60,y:.52},{x:62,y:.51},{x:65,y:.54},{x:68,y:.53},{x:70,y:.55},{x:22,y:.32},{x:26,y:.37},{x:34,y:.4},{x:36,y:.41},{x:44,y:.45},{x:46,y:.44},{x:54,y:.49},{x:56,y:.48},{x:64,y:.52},{x:66,y:.51}]},g={data:[20,25,30,35,40,45,50,55,60,65,70,75,80].map((e,r)=>({x:e,y:.25+r/13*.25}))}}function D(){h&&(i=q(h,null,{devicePixelRatio:4,renderer:"svg"}));const e=h.getBoundingClientRect();var r={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"34px",left:"37px",right:"44px",bottom:"28px"},dataset:[{source:v.data.map(s=>[s.x,s.y])},{source:g.data.map(s=>[s.x,s.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:N(l,"AGE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===100?"":s}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:N(l,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(s){return s===0||s===.6?"":s}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Rezultat",type:"scatter",data:[{x,y:c}],itemStyle:{color:d()}},{name:"Prosje\u010Dna populacija",type:"line",smooth:!0,datasetIndex:1,symbol:"line",lineStyle:{name:"line",type:"line",color:"#09341F",opacity:.5,symbol:"none",width:5},showSymbol:!1}],graphic:[],legend:{show:!0,right:"50%",top:"1%",left:"67%",itemGap:.2,itemWidth:10,itemHeight:6,textStyle:{color:"#09341F",opacity:.8,fontSize:8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};i.setOption(r),r.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",x),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",x),y2:i.convertToPixel("yAxis",c)},style:{stroke:d(),lineDash:[8,8],lineWidth:1.7},z:8}),r.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",c),x2:i.convertToPixel("xAxis",x),y2:i.convertToPixel("yAxis",c)},style:{stroke:d(),lineDash:[8,8],lineWidth:1.7},z:8}),r.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",x),cy:i.convertToPixel("yAxis",c),r:4},style:{fill:d(),stroke:"#FFFFFF",lineWidth:1},z:15});const u=i.convertToPixel("xAxis",x),G=i.convertToPixel("yAxis",c),n=document.createElementNS("http://www.w3.org/2000/svg","svg"),y=document.createElement("div");n.setAttribute("width","52"),n.setAttribute("height","18"),n.setAttribute("viewBox","0 0 71 32"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg");const A=document.createElementNS("http://www.w3.org/2000/svg","path");A.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"),A.setAttribute("fill",d());const P=document.createElementNS("http://www.w3.org/2000/svg","path");P.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),P.setAttribute("fill",d()),n.appendChild(A),n.appendChild(P),n.style.position="absolute",n.style.left=`${e.left+u-95}px`,n.style.top=`${e.top+G-10}px`,n.style.zIndex="8",y.innerText=`${Number.parseFloat(c).toFixed(3)}`,y.style.position="absolute",y.style.left=`${e.left+u-79}px`,y.style.top=`${e.top+G-7}px`,y.style.font="bold 10px sans-serif",y.style.color="white",y.style.zIndex="999",y.style.fontFamily="Sen",document.body.appendChild(y),document.body.appendChild(n),i.setOption(r)}Z(async()=>{var e,r;const u=m||(typeof window<"u"?window.GaReportService:null);if(u&&typeof u.getReport=="function")try{a=await u.getReport(),S=a?.sex??"M",v=await u.getScatterData(o,S),g=await u.getLineData(o,S),x=Number(a?.chronologicalage??42),b&&a&&(w=Number(a[b.csvPerc]),c=Number(a[b.csvScore]))}catch{C()}(!((e=v?.data)!=null&&e.length)||!((r=g?.data)!=null&&r.length))&&C(),D()});function O(e){X[e?"unshift":"push"](()=>{h=e,p(0,h)})}return f.$$set=e=>{"type"in e&&p(1,o=e.type),"lang"in e&&p(2,l=e.lang),"service"in e&&p(3,m=e.service)},[h,o,l,m,O]}class R extends B{constructor(t){super(),I(this,t,Y,U,H,{type:1,lang:2,service:3})}get type(){return this.$$.ctx[1]}set type(t){this.$$set({type:t}),F()}get lang(){return this.$$.ctx[2]}set lang(t){this.$$set({lang:t}),F()}get service(){return this.$$.ctx[3]}set service(t){this.$$set({service:t}),F()}}customElements.define("ga-scatter-plot-custom",W(R,{type:{},lang:{},service:{}},[],[],!1));export{R as default};
1
+ import{c as W,S as B,i as I,f as b,s as M,e as L,b as H,n as A,p as G,g as k,q as j,u as P,k as F,o as V,A as Z}from"./index2.js";import{g as q}from"./globals.js";import{a as E,f as X,h as _}from"./helpers.js";const{document:J}=q;function K(m){let e,a,t;return{c(){e=L("div"),a=H(),t=L("link"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),G(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),G(t,"rel","stylesheet")},m(r,c){k(r,e,c),m[4](e),k(r,a,c),j(J.head,t)},p:P,i:P,o:P,d(r){r&&(F(e),F(a)),m[4](null),F(t)}}}function Q(m,e,a){let{type:t}=e,{lang:r}=e,{service:c=window.GaReportService}=e,R=[{name:"mature",csvPerc:"G0percentile",csvScore:"G0yourscore"},{name:"youth",csvPerc:"G2percentile",csvScore:"G2yourscore"},{name:"shield",csvPerc:"Spercentile",csvScore:"Syourscore"},{name:"lifestyle",csvPerc:"Bpercentile",csvScore:"Byourscore"},{name:"median",csvPerc:"G1percentile",csvScore:"G1yourscore"}],u,$,T,f=0,p=0,i={},v="",y=0,x;const g=R.find(s=>s.name===t);function h(){if(t=="shield"||t=="youth"||t=="median")return X(f);if(t=="mature"||t=="lifestyle")return _(f)}function D(){x&&(i=echarts.init(x,null,{devicePixelRatio:4,renderer:"svg"}));const s=x.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"34px",left:"37px",right:"44px",bottom:"28px"},dataset:[{source:$.data.map(o=>[o.x,o.y])},{source:T.data.map(o=>[o.x,o.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:E(r,"AGE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(o){return o===0||o===100?"":o}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:E(r,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:8},axisLine:{show:!0,lineStyle:{color:"#09341F",opacity:.1},symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!0,color:"#09341F",fontSize:8,opacity:.8,formatter(o){return o===0||o===.6?"":o}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Rezultat",type:"scatter",data:[{x:y,y:p}],itemStyle:{color:h()}},{name:"Prosje\u010Dna populacija",type:"line",smooth:!0,datasetIndex:1,symbol:"line",lineStyle:{name:"line",type:"line",color:"#09341F",opacity:.5,symbol:"none",width:5},showSymbol:!1}],graphic:[],legend:{show:!0,right:"50%",top:"1%",left:"67%",itemGap:.2,itemWidth:10,itemHeight:6,textStyle:{color:"#09341F",opacity:.8,fontSize:8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};i.setOption(d),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",y),y1:i.convertToPixel("yAxis",0),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:h(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({type:"line",shape:{x1:i.convertToPixel("xAxis",0),y1:i.convertToPixel("yAxis",p),x2:i.convertToPixel("xAxis",y),y2:i.convertToPixel("yAxis",p)},style:{stroke:h(),lineDash:[8,8],lineWidth:1.7},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:4},style:{fill:h(),stroke:"#FFFFFF",lineWidth:1},z:15});const z=i.convertToPixel("xAxis",y),C=i.convertToPixel("yAxis",p),n=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");n.setAttribute("width","52"),n.setAttribute("height","18"),n.setAttribute("viewBox","0 0 71 32"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg");const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.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"),w.setAttribute("fill",h());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",h()),n.appendChild(w),n.appendChild(S),n.style.position="absolute",n.style.left=`${s.left+z-95}px`,n.style.top=`${s.top+C-10}px`,n.style.zIndex="8",l.innerText=`${Number.parseFloat(p).toFixed(3)}`,l.style.position="absolute",l.style.left=`${s.left+z-79}px`,l.style.top=`${s.top+C-7}px`,l.style.font="bold 10px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(n),i.setOption(d)}V(async()=>{u=await c.getReport(),v=u.sex,$=await c.getScatterData(t,v),T=await c.getLineData(t,v),y=Number(u.chronologicalage),g&&(f=Number(u[g.csvPerc]),p=Number(u[g.csvScore])),D()});function O(s){Z[s?"unshift":"push"](()=>{x=s,a(0,x)})}return m.$$set=s=>{"type"in s&&a(1,t=s.type),"lang"in s&&a(2,r=s.lang),"service"in s&&a(3,c=s.service)},[x,t,r,c,O]}class N extends B{constructor(e){super(),I(this,e,Q,K,M,{type:1,lang:2,service:3})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),b()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),b()}get service(){return this.$$.ctx[3]}set service(e){this.$$set({service:e}),b()}}customElements.define("ga-scatter-plot-custom",W(N,{type:{},lang:{},service:{}},[],[],!1));export{N 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.209.0",
4
+ "version": "1.211.0",
5
5
  "type": "module",
6
6
  "main": "dist/lib/@glycanage/web-components.js",
7
7
  "scripts": {