@glycanage/web-components 1.151.0 → 1.152.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 H,S as j,i as B,f as S,s as X,a as U,e as E,m as O,b as z,n as C,p as I,g as R,q as g,r as Y,u as G,k as M,o as V,z as Z}from"./index2.js";import{g as q}from"./globals.js";import{a as L}from"./helpers.js";const{document:J}=q;function K(c){U(c,"svelte-13ksezj",".main.svelte-13ksezj{height:100%;width:100%;display:flex;align-items:end}.label.svelte-13ksezj{width:40%;display:flex;align-items:center;font-size:0.8rem;height:100%}.label-container.svelte-13ksezj{display:flex;flex-direction:column}")}function Q(c){let o,y,m,n,v=L(c[0],c[1])+"",k,D,w,f=L(c[0],c[2])+"",r,b,l,$,A;return{c(){o=E("div"),y=E("div"),m=E("div"),n=E("b"),k=O(v),D=z(),w=E("div"),r=O(f),b=z(),l=E("div"),l.innerHTML="",$=z(),A=E("link"),C(n,"font-size",(c[0]==="slovenian"?.7:.8)+"rem"),C(w,"font-size","0.7rem"),I(m,"class","label-container svelte-13ksezj"),I(y,"class","label svelte-13ksezj"),C(l,"display","flex"),C(l,"align-items","center"),C(l,"margin-bottom","1rem"),C(l,"height","55%"),C(l,"width","100%"),C(l,"position","relative"),I(o,"class","main svelte-13ksezj"),I(A,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),I(A,"rel","stylesheet")},m(p,e){R(p,o,e),g(o,y),g(y,m),g(m,n),g(n,k),g(m,D),g(m,w),g(w,r),g(o,b),g(o,l),c[6](l),R(p,$,e),g(J.head,A)},p(p,[e]){e&3&&v!==(v=L(p[0],p[1])+"")&&Y(k,v),e&1&&C(n,"font-size",(p[0]==="slovenian"?.7:.8)+"rem"),e&5&&f!==(f=L(p[0],p[2])+"")&&Y(r,f)},i:G,o:G,d(p){p&&(M(o),M($)),c[6](null),M(A)}}}function W(c,o,y){let{service:m=window.GaReportService}=o,{type:n}=o,{lang:v}=o,k="",D="",w=[{name:"shield",label:"GLYCAN_SHIELD",description:"ANTI_INFLAMMATORY_INDEX",value:"Spercentile"},{name:"youth",label:"GLYCAN_YOUTH",description:"ANTI_INFLAMMATORY_INDEX",value:"G2percentile"},{name:"mature",label:"GLYCAN_MATURE",description:"PRO_INFLAMMATORY_INDEX",value:"G0percentile"},{name:"median",label:"GLYCAN_MEDIAN",description:"SUPPORTIVE_INDEX",value:"G1percentile"},{name:"lifestyle",label:"GLYCAN_LIFESTYLE_B",description:"SUPPORTIVE_INDEX",value:"Bpercentile"}];const f=w.find(e=>e.name===n);let r={},b,l;function $(e){if(n==="shield"||n==="youth")return e<=17?"#DD2222":e>17&&e<=33?"#EE6600":e>33&&e<=66?"#66CCAA":e>66&&e<=82?"#119999":"#005566";if(n==="mature"||n==="lifestyle")return e<=17?"#005566":e>17&&e<=33?"#119999":e>33&&e<=66?"#66CCAA":e>66&&e<=82?"#EE6600":"#DD2222";if(n==="median")return e===1||e===100||e===0||e===99?"#DD2222":e>=2&&e<=17||e>=83&&e<=98?"#EE6600":e>=18&&e<=33||e>=67&&e<=82?"#119999":"#005566"}function A(){b&&(r=echarts.init(b,null,{devicePixelRatio:4,renderer:"svg"}));const e=b.getBoundingClientRect(),u=w.find(s=>s.name===n).value;console.log("cur:",u);var T=l.data.map((s,a)=>[a,s[u]]),_={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"2px",left:"2px",right:"2px",bottom:"2px"},dataset:[{source:T}],tooltip:{show:!1},xAxis:{min:l.data.map((s,a)=>[a,s[u]])[0][0],max:l.data.map((s,a)=>[a,s[u]])[l.data.length-1][0],name:"",interval:1,axisLine:{show:!1,symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{min:Math.min(...l.data.map(s=>Math.min(s[u])))-5,max:Math.max(...l.data.map(s=>Math.max(s[u])))+5,name:"",axisLine:{show:!1,symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},series:[{name:"Chrono Age",type:"line",smooth:!0,datasetIndex:0,symbol:"line",lineStyle:{color:"#416D57",width:5},showSymbol:!1,z:10}],graphic:[]};r.setOption(_);for(let s=0;s<l.data.length;s++){const a=document.createElementNS("http://www.w3.org/2000/svg","svg"),h=document.createElement("div"),x=document.createElement("div"),d=document.createElement("div");x.style.position="absolute",x.style.left=`${e.left+r.convertToPixel("xAxis",s)}px`,x.style.top=`${e.top}px`,x.style.height=`${e.height}px`,x.style.width="2px",x.style.display="flex",x.style.flexDirection="column",x.style.zIndex="0";for(let t=0;t<8;t++){const i=document.createElement("div");i.style.width="2px",i.style.height="8px",i.style.borderRadius="99px",i.style.marginBottom="2px",i.style.opacity=l.data[s].result?"1":"0.5",(n==="mature"||n==="lifestyle")&&(t<2&&(i.style.backgroundColor="#DD2222"),t===2&&(i.style.backgroundColor="#EE6600"),(t===3||t===4)&&(i.style.backgroundColor="#66CCAA"),t===5&&(i.style.backgroundColor="#119999"),t>5&&(i.style.backgroundColor="#005566")),(n==="shield"||n==="youth")&&(t<2&&(i.style.backgroundColor="#005566"),t===2&&(i.style.backgroundColor="#119999"),(t===3||t===4)&&(i.style.backgroundColor="#66CCAA"),t===5&&(i.style.backgroundColor="#EE6600"),t>5&&(i.style.backgroundColor="#DD2222")),n==="median"&&((t===0||t===7)&&(i.style.backgroundColor="#DD2222"),(t===1||t===6)&&(i.style.backgroundColor="#EE6600"),(t===2||t===5)&&(i.style.backgroundColor="#119999"),(t===3||t===4)&&(i.style.backgroundColor="#005566")),x.appendChild(i)}a.setAttribute("width","28"),a.setAttribute("height","33"),a.setAttribute("viewBox","0 0 28 33"),a.setAttribute("fill","none"),a.setAttribute("xmlns","http://www.w3.org/2000/svg");const N=document.createElementNS("http://www.w3.org/2000/svg","path");if(N.setAttribute("d","M14.0003 32.5418C13.6114 32.5418 13.2225 32.4724 12.8337 32.3335C12.4448 32.1946 12.0975 31.9863 11.792 31.7085C9.98644 30.0418 8.38921 28.4168 7.00033 26.8335C5.61144 25.2502 4.45171 23.7154 3.52116 22.2293C2.5906 20.7432 1.88227 19.3127 1.39616 17.9377C0.910048 16.5627 0.666992 15.2502 0.666992 14.0002C0.666992 9.8335 2.00727 6.51405 4.68783 4.04183C7.36838 1.56961 10.4725 0.333496 14.0003 0.333496C17.5281 0.333496 20.6323 1.56961 23.3128 4.04183C25.9934 6.51405 27.3337 9.8335 27.3337 14.0002C27.3337 15.2502 27.0906 16.5627 26.6045 17.9377C26.1184 19.3127 25.41 20.7432 24.4795 22.2293C23.5489 23.7154 22.3892 25.2502 21.0003 26.8335C19.6114 28.4168 18.0142 30.0418 16.2087 31.7085C15.9031 31.9863 15.5559 32.1946 15.167 32.3335C14.7781 32.4724 14.3892 32.5418 14.0003 32.5418Z"),N.setAttribute("fill",$(l.data[s][u])),a.appendChild(N),a.style.position="absolute",a.style.left=`${e.left+r.convertToPixel("xAxis",s)-14}px`,a.style.top=`${e.top+r.convertToPixel("yAxis",T[s][1])-37}px`,a.style.zIndex="8",a.style.opacity=l.data[s].result?"1":"0.4",h.innerText=`${l.data[s][u]}`,h.style.position="absolute",h.style.left=`${e.left+r.convertToPixel("xAxis",s)-(l.data[s][u]<10?4:l.data[s][u]===100?10:7)}px`,h.style.top=`${e.top+r.convertToPixel("yAxis",T[s][1])+-30}px`,h.style.font="bold 12px sans-serif",h.style.color="white",h.style.zIndex="19",h.style.fontFamily="Sen",h.style.opacity=l.data[s].result?"1":"0.8",n==="lifestyle"&&l.data[s].result){d.style.position="absolute",d.style.left=`${e.left+r.convertToPixel("xAxis",s)-60}px`,d.style.top=`${e.top+r.convertToPixel("yAxis",T[s][1])+70}px`,d.style.font="bold 12px sans-serif",d.style.color="black",d.style.zIndex="19",d.style.fontFamily="Sen",d.style.display="flex",d.style.flexDirection="column",d.style.alignItems="center";const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","16"),t.setAttribute("height","18"),t.setAttribute("viewBox","0 0 16 18"),t.setAttribute("fill","none"),t.setAttribute("xmlns","http://www.w3.org/2000/svg");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M7 17C7 17.5523 7.44772 18 8 18C8.55228 18 9 17.5523 9 17H7ZM8.70711 0.292893C8.31658 -0.0976311 7.68342 -0.0976311 7.29289 0.292893L0.928932 6.65685C0.538408 7.04738 0.538408 7.68054 0.928932 8.07107C1.31946 8.46159 1.95262 8.46159 2.34315 8.07107L8 2.41421L13.6569 8.07107C14.0474 8.46159 14.6805 8.46159 15.0711 8.07107C15.4616 7.68054 15.4616 7.04738 15.0711 6.65685L8.70711 0.292893ZM8 17H9V1H8H7V17H8Z"),i.setAttribute("fill","#09341F"),t.appendChild(i);const P=document.createElement("div");P.innerText="Results from this test",d.appendChild(t),d.appendChild(P),document.body.appendChild(d)}document.body.appendChild(h),document.body.appendChild(a),document.body.appendChild(x)}r.setOption(_)}V(async()=>{l=await m.getOverTimeDataIndexes(),l.data.findIndex(e=>e.result===!0),A(),f&&(y(1,k=f.label),y(2,D=f.description))});function p(e){Z[e?"unshift":"push"](()=>{b=e,y(3,b)})}return c.$$set=e=>{"service"in e&&y(4,m=e.service),"type"in e&&y(5,n=e.type),"lang"in e&&y(0,v=e.lang)},[v,k,D,b,m,n,p]}class F extends j{constructor(o){super(),B(this,o,W,Q,X,{service:4,type:5,lang:0},K)}get service(){return this.$$.ctx[4]}set service(o){this.$$set({service:o}),S()}get type(){return this.$$.ctx[5]}set type(o){this.$$set({type:o}),S()}get lang(){return this.$$.ctx[0]}set lang(o){this.$$set({lang:o}),S()}}customElements.define("ga-over-time-indexes",H(F,{service:{},type:{},lang:{}},[],[],!1));export{F as default};
1
+ import{c as H,S as j,i as B,f as S,s as X,a as U,e as E,m as O,b as z,n as b,p as I,g as R,q as x,r as Y,u as G,k as _,o as V,z as Z}from"./index2.js";import{g as q}from"./globals.js";import{a as L}from"./helpers.js";const{document:J}=q;function K(c){U(c,"svelte-13ksezj",".main.svelte-13ksezj{height:100%;width:100%;display:flex;align-items:end}.label.svelte-13ksezj{width:40%;display:flex;align-items:center;font-size:0.8rem;height:100%}.label-container.svelte-13ksezj{display:flex;flex-direction:column}")}function Q(c){let n,y,m,o,v=L(c[0],c[1])+"",k,D,w,C=L(c[0],c[2])+"",r,g,s,$,A;return{c(){n=E("div"),y=E("div"),m=E("div"),o=E("b"),k=O(v),D=z(),w=E("div"),r=O(C),g=z(),s=E("div"),s.innerHTML="",$=z(),A=E("link"),b(o,"font-size",(c[0]==="slovenian"?.7:.8)+"rem"),b(w,"font-size","0.7rem"),I(m,"class","label-container svelte-13ksezj"),I(y,"class","label svelte-13ksezj"),b(s,"display","flex"),b(s,"align-items","center"),b(s,"margin-bottom","1rem"),b(s,"height","55%"),b(s,"width","100%"),b(s,"position","relative"),I(n,"class","main svelte-13ksezj"),I(A,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),I(A,"rel","stylesheet")},m(p,e){R(p,n,e),x(n,y),x(y,m),x(m,o),x(o,k),x(m,D),x(m,w),x(w,r),x(n,g),x(n,s),c[6](s),R(p,$,e),x(J.head,A)},p(p,[e]){e&3&&v!==(v=L(p[0],p[1])+"")&&Y(k,v),e&1&&b(o,"font-size",(p[0]==="slovenian"?.7:.8)+"rem"),e&5&&C!==(C=L(p[0],p[2])+"")&&Y(r,C)},i:G,o:G,d(p){p&&(_(n),_($)),c[6](null),_(A)}}}function W(c,n,y){let{service:m=window.GaReportService}=n,{type:o}=n,{lang:v}=n,k="",D="",w=[{name:"shield",label:"GLYCAN_SHIELD",description:"ANTI_INFLAMMATORY_INDEX",value:"Spercentile"},{name:"youth",label:"GLYCAN_YOUTH",description:"ANTI_INFLAMMATORY_INDEX",value:"G2percentile"},{name:"mature",label:"GLYCAN_MATURE",description:"PRO_INFLAMMATORY_INDEX",value:"G0percentile"},{name:"median",label:"GLYCAN_MEDIAN",description:"SUPPORTIVE_INDEX",value:"G1percentile"},{name:"lifestyle",label:"GLYCAN_LIFESTYLE_B",description:"SUPPORTIVE_INDEX",value:"Bpercentile"}];const C=w.find(e=>e.name===o);let r={},g,s;function $(e){if(o==="shield"||o==="youth")return e<=17?"#DD2222":e>17&&e<=33?"#EE6600":e>33&&e<=66?"#66CCAA":e>66&&e<=82?"#119999":"#005566";if(o==="mature"||o==="lifestyle")return e<=17?"#005566":e>17&&e<=33?"#119999":e>33&&e<=66?"#66CCAA":e>66&&e<=82?"#EE6600":"#DD2222";if(o==="median")return e===1||e===100||e===0||e===99?"#DD2222":e>=2&&e<=17||e>=83&&e<=98?"#EE6600":e>=18&&e<=33||e>=67&&e<=82?"#119999":"#005566"}function A(){g&&(r=echarts.init(g,null,{devicePixelRatio:4,renderer:"svg"}));const e=g.getBoundingClientRect(),f=w.find(l=>l.name===o).value;console.log("cur:",f);var T=s.data.map((l,a)=>[a,l[f]]),M={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"2px",left:"2px",right:"2px",bottom:"2px"},dataset:[{source:T}],tooltip:{show:!1},xAxis:{min:s.data.map((l,a)=>[a,l[f]])[0][0],max:s.data.map((l,a)=>[a,l[f]])[s.data.length-1][0],name:"",interval:1,axisLine:{show:!1,symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[8]},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{min:0,max:100,name:"",axisLine:{show:!1,symbol:["none","arrow"],symbolSize:[5,10],symbolOffset:[5]},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},series:[{name:"Chrono Age",type:"line",smooth:!0,datasetIndex:0,symbol:"line",lineStyle:{color:"#416D57",width:5},showSymbol:!1,z:10}],graphic:[]};r.setOption(M);for(let l=0;l<s.data.length;l++){const a=document.createElementNS("http://www.w3.org/2000/svg","svg"),u=document.createElement("div"),h=document.createElement("div"),d=document.createElement("div");h.style.position="absolute",h.style.left=`${e.left+r.convertToPixel("xAxis",l)}px`,h.style.top=`${e.top}px`,h.style.height=`${e.height}px`,h.style.width="2px",h.style.display="flex",h.style.flexDirection="column",h.style.zIndex="0";for(let t=0;t<8;t++){const i=document.createElement("div");i.style.width="2px",i.style.height="8px",i.style.borderRadius="99px",i.style.marginBottom="2px",i.style.opacity=s.data[l].result?"1":"0.5",(o==="mature"||o==="lifestyle")&&(t<2&&(i.style.backgroundColor="#DD2222"),t===2&&(i.style.backgroundColor="#EE6600"),(t===3||t===4)&&(i.style.backgroundColor="#66CCAA"),t===5&&(i.style.backgroundColor="#119999"),t>5&&(i.style.backgroundColor="#005566")),(o==="shield"||o==="youth")&&(t<2&&(i.style.backgroundColor="#005566"),t===2&&(i.style.backgroundColor="#119999"),(t===3||t===4)&&(i.style.backgroundColor="#66CCAA"),t===5&&(i.style.backgroundColor="#EE6600"),t>5&&(i.style.backgroundColor="#DD2222")),o==="median"&&((t===0||t===7)&&(i.style.backgroundColor="#DD2222"),(t===1||t===6)&&(i.style.backgroundColor="#EE6600"),(t===2||t===5)&&(i.style.backgroundColor="#119999"),(t===3||t===4)&&(i.style.backgroundColor="#005566")),h.appendChild(i)}a.setAttribute("width","28"),a.setAttribute("height","33"),a.setAttribute("viewBox","0 0 28 33"),a.setAttribute("fill","none"),a.setAttribute("xmlns","http://www.w3.org/2000/svg");const N=document.createElementNS("http://www.w3.org/2000/svg","path");if(N.setAttribute("d","M14.0003 32.5418C13.6114 32.5418 13.2225 32.4724 12.8337 32.3335C12.4448 32.1946 12.0975 31.9863 11.792 31.7085C9.98644 30.0418 8.38921 28.4168 7.00033 26.8335C5.61144 25.2502 4.45171 23.7154 3.52116 22.2293C2.5906 20.7432 1.88227 19.3127 1.39616 17.9377C0.910048 16.5627 0.666992 15.2502 0.666992 14.0002C0.666992 9.8335 2.00727 6.51405 4.68783 4.04183C7.36838 1.56961 10.4725 0.333496 14.0003 0.333496C17.5281 0.333496 20.6323 1.56961 23.3128 4.04183C25.9934 6.51405 27.3337 9.8335 27.3337 14.0002C27.3337 15.2502 27.0906 16.5627 26.6045 17.9377C26.1184 19.3127 25.41 20.7432 24.4795 22.2293C23.5489 23.7154 22.3892 25.2502 21.0003 26.8335C19.6114 28.4168 18.0142 30.0418 16.2087 31.7085C15.9031 31.9863 15.5559 32.1946 15.167 32.3335C14.7781 32.4724 14.3892 32.5418 14.0003 32.5418Z"),N.setAttribute("fill",$(s.data[l][f])),a.appendChild(N),a.style.position="absolute",a.style.left=`${e.left+r.convertToPixel("xAxis",l)-14}px`,a.style.top=`${e.top+r.convertToPixel("yAxis",T[l][1])-37}px`,a.style.zIndex="8",a.style.opacity=s.data[l].result?"1":"0.4",u.innerText=`${s.data[l][f]}`,u.style.position="absolute",u.style.left=`${e.left+r.convertToPixel("xAxis",l)-(s.data[l][f]<10?4:s.data[l][f]===100?10:7)}px`,u.style.top=`${e.top+r.convertToPixel("yAxis",T[l][1])+-30}px`,u.style.font="bold 12px sans-serif",u.style.color="white",u.style.zIndex="19",u.style.fontFamily="Sen",u.style.opacity=s.data[l].result?"1":"0.8",o==="lifestyle"&&s.data[l].result){d.style.position="absolute",d.style.left=`${e.left+r.convertToPixel("xAxis",l)-60}px`,d.style.top=`${e.top+r.convertToPixel("yAxis",T[l][1])+70}px`,d.style.font="bold 12px sans-serif",d.style.color="black",d.style.zIndex="19",d.style.fontFamily="Sen",d.style.display="flex",d.style.flexDirection="column",d.style.alignItems="center";const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","16"),t.setAttribute("height","18"),t.setAttribute("viewBox","0 0 16 18"),t.setAttribute("fill","none"),t.setAttribute("xmlns","http://www.w3.org/2000/svg");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M7 17C7 17.5523 7.44772 18 8 18C8.55228 18 9 17.5523 9 17H7ZM8.70711 0.292893C8.31658 -0.0976311 7.68342 -0.0976311 7.29289 0.292893L0.928932 6.65685C0.538408 7.04738 0.538408 7.68054 0.928932 8.07107C1.31946 8.46159 1.95262 8.46159 2.34315 8.07107L8 2.41421L13.6569 8.07107C14.0474 8.46159 14.6805 8.46159 15.0711 8.07107C15.4616 7.68054 15.4616 7.04738 15.0711 6.65685L8.70711 0.292893ZM8 17H9V1H8H7V17H8Z"),i.setAttribute("fill","#09341F"),t.appendChild(i);const P=document.createElement("div");P.innerText="Results from this test",d.appendChild(t),d.appendChild(P),document.body.appendChild(d)}document.body.appendChild(u),document.body.appendChild(a),document.body.appendChild(h)}r.setOption(M)}V(async()=>{s=await m.getOverTimeDataIndexes(),s.data.findIndex(e=>e.result===!0),A(),C&&(y(1,k=C.label),y(2,D=C.description))});function p(e){Z[e?"unshift":"push"](()=>{g=e,y(3,g)})}return c.$$set=e=>{"service"in e&&y(4,m=e.service),"type"in e&&y(5,o=e.type),"lang"in e&&y(0,v=e.lang)},[v,k,D,g,m,o,p]}class F extends j{constructor(n){super(),B(this,n,W,Q,X,{service:4,type:5,lang:0},K)}get service(){return this.$$.ctx[4]}set service(n){this.$$set({service:n}),S()}get type(){return this.$$.ctx[5]}set type(n){this.$$set({type:n}),S()}get lang(){return this.$$.ctx[0]}set lang(n){this.$$set({lang:n}),S()}}customElements.define("ga-over-time-indexes",H(F,{service:{},type:{},lang:{}},[],[],!1));export{F 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.151.0",
4
+ "version": "1.152.0",
5
5
  "type": "module",
6
6
  "main": "dist/lib/@glycanage/web-components.js",
7
7
  "scripts": {