@glycanage/web-components 1.208.0 → 1.210.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.
- package/dist/biological-age-rank-scatter.wc.js +1 -0
- package/dist/biological-age-rank.wc.js +3 -0
- package/dist/immune-resilience-index-scatter.wc.js +1 -0
- package/dist/immune-resilience-index.wc.js +1 -0
- package/dist/index.js +1 -1
- package/dist/index3.js +87 -0
- package/dist/scatter-plot-custom-clinical.wc.js +1 -1
- package/dist/scatter-plot-custom.wc.js +1 -1
- package/dist/scatter-plot.wc.js +1 -1
- package/package.json +1 -1
|
@@ -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{a as E,f as
|
|
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 +1 @@
|
|
|
1
|
-
import{c as W,S as B,i as I,f as
|
|
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};
|
package/dist/scatter-plot.wc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,S as M,i as B,f as A,s as W,e as G,b as U,n as P,p as N,g as k,q as V,u as F,k as T,o as _,A as H}from"./index2.js";import{g as Z}from"./globals.js";import{a as v,f as
|
|
1
|
+
import{c as I,S as M,i as B,f as A,s as W,e as G,b as U,n as P,p as N,g as k,q as V,u as F,k as T,o as _,A as H}from"./index2.js";import{g as Z}from"./globals.js";import{i as q}from"./index3.js";import{a as v,f as X,h as j}from"./helpers.js";const{document:J}=Z;function K(h){let e,l,t;return{c(){e=G("div"),l=U(),t=G("link"),P(e,"width","100%"),P(e,"height","100%"),P(e,"position","relative"),N(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),N(t,"rel","stylesheet")},m(i,c){k(i,e,c),h[4](e),k(i,l,c),V(J.head,t)},p:F,i:F,o:F,d(i){i&&(T(e),T(l)),h[4](null),T(t)}}}function Q(h,e,l){let{type:t}=e,{lang:i}=e,{service:c=window.GaReportService}=e,z=[{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,$,C,f=0,p=0,o={},g="",y=0,x;const w=z.find(s=>s.name===t);function m(){if(t=="shield"||t=="youth"||t=="median")return X(f);if(t=="mature"||t=="lifestyle")return j(f)}function O(){x&&(o=q(x,null,{devicePixelRatio:4,renderer:"svg"}));const s=x.getBoundingClientRect();var d={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"65px",left:i==="slovenian"?"62px":"50px",right:i==="slovenian"?"50px":"55px",bottom:"40px"},dataset:[{source:$.data.map(r=>[r.x,r.y])},{source:C.data.map(r=>[r.x,r.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:v(i,"AGE"),nameTextStyle:{color:"#09341F",opacity:.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",opacity:.8,formatter(r){return r===0||r===100?"":r}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:v(i,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.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",opacity:.8,formatter(r){return r===0||r===.6?"":r}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:v(i,"MEASURED_RESULT"),type:"scatter",data:[{x:y,y:p}],itemStyle:{color:m()}},{name:v(i,"POPULATION_AVERAGE"),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:"3%",left:i==="slovenian"?"67%":"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};o.setOption(d),d.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",y),y1:o.convertToPixel("yAxis",0),x2:o.convertToPixel("xAxis",y),y2:o.convertToPixel("yAxis",p)},style:{stroke:m(),lineDash:[8,8],lineWidth:3},z:8}),d.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",0),y1:o.convertToPixel("yAxis",p),x2:o.convertToPixel("xAxis",y),y2:o.convertToPixel("yAxis",p)},style:{stroke:m(),lineDash:[8,8],lineWidth:3},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:o.convertToPixel("xAxis",y),cy:o.convertToPixel("yAxis",p),r:6},style:{fill:m(),stroke:"#FFFFFF",lineWidth:1},z:15});const E=o.convertToPixel("xAxis",y),L=o.convertToPixel("yAxis",p),n=document.createElementNS("http://www.w3.org/2000/svg","svg"),a=document.createElement("div");n.setAttribute("width","71"),n.setAttribute("height","32"),n.setAttribute("viewBox","0 0 71 32"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg");const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.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"),b.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(b),n.appendChild(S),n.style.position="absolute",n.style.left=`${s.left+E+10}px`,n.style.top=`${s.top+L-15}px`,n.style.zIndex="8",a.innerText=`${Number.parseFloat(p).toFixed(3)}`,a.style.position="absolute",a.style.left=`${s.left+E+28}px`,a.style.top=`${s.top+L-8}px`,a.style.font="bold 16px sans-serif",a.style.color="white",a.style.zIndex="999",a.style.fontFamily="Sen",document.body.appendChild(a),document.body.appendChild(n),o.setOption(d)}_(async()=>{u=await c.getReport(),g=u.sex,$=await c.getScatterData(t,g),C=await c.getLineData(t,g),y=Number(u.chronologicalage),w&&(f=Number(u[w.csvPerc]),p=Number(u[w.csvScore])),O()});function D(s){H[s?"unshift":"push"](()=>{x=s,l(0,x)})}return h.$$set=s=>{"type"in s&&l(1,t=s.type),"lang"in s&&l(2,i=s.lang),"service"in s&&l(3,c=s.service)},[x,t,i,c,D]}class R extends M{constructor(e){super(),B(this,e,Q,K,W,{type:1,lang:2,service:3})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),A()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),A()}get service(){return this.$$.ctx[3]}set service(e){this.$$set({service:e}),A()}}customElements.define("ga-scatter-plot",I(R,{type:{},lang:{},service:{}},[],[],!1));export{R as default};
|