@glycanage/web-components 1.115.0 → 1.117.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 le,S as ne,i as oe,f as V,s as re,a as ce,d as ae,g as X,u as Y,k as ee,o as ve,e as r,m as b,b as v,v as te,p as i,n as a,q as e,r as y}from"./index2.js";import{a as z}from"./helpers.js";function de(n){ce(n,"svelte-1qc23nv",`@font-face{font-family:"mercury";src:url("https://dev.back-office.ga-internals-91.com/assets/reports/b2b/clp/1.0/fonts/MercuryDisplay.otf") format("truetype");font-weight:500;font-display:swap}.main.svelte-1qc23nv{height:100%;width:100%;display:flex;flex-direction:column}.graph-container.svelte-1qc23nv{width:100%;height:30%;display:flex;align-items:center;justify-content:space-between;position:relative}.colorBox.svelte-1qc23nv{height:7px;width:14.3%;border-radius:24px}.colorBoxShort.svelte-1qc23nv{height:7px;width:5%;border-radius:24px}.slider.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -50%);width:24%;max-height:70px}.slider-glycanage.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -150%);width:24%;color:white;font-weight:500}.fixed-chrono.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, 155%);width:24%;color:#09341F80;font-weight:500;z-index:99}.text-left.svelte-1qc23nv{position:absolute;height:15%;width:34.7%;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-1qc23nv{position:absolute;height:15%;width:29.5%;top:68%;left:35.3%;display:flex;align-items:center;justify-content:center;color:#09341F80}.text-right.svelte-1qc23nv{position:absolute;height:15%;width:34.7%;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}.glycanage.svelte-1qc23nv{display:flex;font-size:192px;justify-content:center;align-items:end;height:50%;margin-bottom:1rem;margin-top:1.4rem;font-family:'mercury', serif}`)}function se(n){let l,s,c,d,t,h,f,o,B,x,m,F,G,k,H,$,L,E,_,A,I,C,u,D,J,w,N,K,q,O,P,S,M=z(n[0],"BETTER")+"",W,Q,R,U,j,T=z(n[0],"WORSE")+"",Z;return{c(){l=r("div"),s=r("div"),c=b(n[2]),d=v(),t=r("div"),h=r("div"),f=v(),o=r("div"),B=v(),x=r("div"),m=v(),F=r("div"),G=v(),k=r("div"),H=v(),$=r("div"),L=v(),E=r("div"),_=v(),A=r("div"),I=v(),C=r("div"),u=te("svg"),D=te("path"),J=v(),w=r("div"),N=b(n[2]),K=v(),q=r("div"),O=b(n[1]),P=v(),S=r("div"),W=b(M),Q=v(),R=r("div"),R.innerHTML='<svg width="44" height="52" viewBox="0 0 44 52" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.0002 0.133165C22.6224 0.133165 23.2446 0.244272 23.8668 0.466494C24.4891 0.688719 25.0446 1.02205 25.5335 1.46649C28.4224 4.13316 30.9779 6.73316 33.2002 9.2665C35.4224 11.7998 37.2779 14.2554 38.7668 16.6332C40.2557 19.0109 41.3891 21.2998 42.1668 23.4998C42.9446 25.6998 43.3335 27.7998 43.3335 29.7998C43.3335 36.4665 41.1891 41.7776 36.9002 45.7332C32.6113 49.6887 27.6446 51.6665 22.0002 51.6665C16.3557 51.6665 11.3891 49.6887 7.10016 45.7332C2.81128 41.7776 0.666833 36.4665 0.666834 29.7998C0.666834 27.7998 1.05572 25.6998 1.8335 23.4998C2.61128 21.2998 3.74461 19.0109 5.2335 16.6332C6.72239 14.2554 8.57795 11.7998 10.8002 9.2665C13.0224 6.73316 15.5779 4.13316 18.4668 1.46649C18.9557 1.02205 19.5113 0.688719 20.1335 0.466493C20.7557 0.244272 21.3779 0.133165 22.0002 0.133165Z" fill="#D7E4DE"></path></svg>',U=v(),j=r("div"),Z=b(T),i(s,"class","glycanage svelte-1qc23nv"),a(s,"color",n[4]()),i(h,"class","colorBoxShort svelte-1qc23nv"),a(h,"background-color","#015566"),i(o,"class","colorBox svelte-1qc23nv"),a(o,"background-color","#015566"),i(x,"class","colorBox svelte-1qc23nv"),a(x,"background-color","#13A195"),i(F,"class","colorBox svelte-1qc23nv"),a(F,"background-color","#66CCAA"),i(k,"class","colorBox svelte-1qc23nv"),a(k,"background-color","#66CCAA"),i($,"class","colorBox svelte-1qc23nv"),a($,"background-color","#F2800D"),i(E,"class","colorBox svelte-1qc23nv"),a(E,"background-color","#DF2120"),i(A,"class","colorBoxShort svelte-1qc23nv"),a(A,"background-color","#DF2120"),i(D,"d","M20.0001 35.5418C19.6112 35.5418 19.2223 35.4724 18.8334 35.3335C18.4445 35.1946 18.0973 34.9863 17.7917 34.7085C15.9862 33.0418 14.389 31.4168 13.0001 29.8335C11.6112 28.2502 10.4515 26.7154 9.52091 25.2293C8.59036 23.7432 7.88203 22.3127 7.39591 20.9377C6.9098 19.5627 6.66675 18.2502 6.66675 17.0002C6.66675 12.8335 8.00703 9.51405 10.6876 7.04183C13.3681 4.56961 16.4723 3.3335 20.0001 3.3335C23.5279 3.3335 26.632 4.56961 29.3126 7.04183C31.9931 9.51405 33.3334 12.8335 33.3334 17.0002C33.3334 18.2502 33.0904 19.5627 32.6042 20.9377C32.1181 22.3127 31.4098 23.7432 30.4792 25.2293C29.5487 26.7154 28.389 28.2502 27.0001 29.8335C25.6112 31.4168 24.014 33.0418 22.2084 34.7085C21.9029 34.9863 21.5556 35.1946 21.1667 35.3335C20.7779 35.4724 20.389 35.5418 20.0001 35.5418Z"),i(D,"fill",n[4]()),a(u,"position","relative"),i(u,"width","62"),i(u,"height","62"),i(u,"viewBox","0 0 40 40"),i(u,"fill","none"),i(u,"xmlns","http://www.w3.org/2000/svg"),i(C,"class","slider svelte-1qc23nv"),a(C,"left",n[2]+"%"),i(w,"class","slider-glycanage svelte-1qc23nv"),a(w,"left",n[2]+"%"),i(q,"class","fixed-chrono svelte-1qc23nv"),a(q,"left","50%"),i(S,"class","text-left svelte-1qc23nv"),i(R,"class","text-middle svelte-1qc23nv"),i(j,"class","text-right svelte-1qc23nv"),i(t,"class","graph-container svelte-1qc23nv"),i(l,"class","main svelte-1qc23nv")},m(g,p){X(g,l,p),e(l,s),e(s,c),e(l,d),e(l,t),e(t,h),e(t,f),e(t,o),e(t,B),e(t,x),e(t,m),e(t,F),e(t,G),e(t,k),e(t,H),e(t,$),e(t,L),e(t,E),e(t,_),e(t,A),e(t,I),e(t,C),e(C,u),e(u,D),e(t,J),e(t,w),e(w,N),e(t,K),e(t,q),e(q,O),e(t,P),e(t,S),e(S,W),e(t,Q),e(t,R),e(t,U),e(t,j),e(j,Z)},p(g,p){p&4&&y(c,g[2]),p&4&&a(C,"left",g[2]+"%"),p&4&&y(N,g[2]),p&4&&a(w,"left",g[2]+"%"),p&2&&y(O,g[1]),p&1&&M!==(M=z(g[0],"BETTER")+"")&&y(W,M),p&1&&T!==(T=z(g[0],"WORSE")+"")&&y(Z,T)},d(g){g&&ee(l)}}}function fe(n){let l,s=n[3]&&se(n);return{c(){s&&s.c(),l=ae()},m(c,d){s&&s.m(c,d),X(c,l,d)},p(c,[d]){c[3]?s?s.p(c,d):(s=se(c),s.c(),s.m(l.parentNode,l)):s&&(s.d(1),s=null)},i:Y,o:Y,d(c){c&&ee(l),s&&s.d(c)}}}function ge(n,l,s){let{lang:c}=l,{service:d=window.GaReportService}=l,t,h=0,f=0,o=0;function B(){if(o>=35&&o<=65)return"#66CCAA";if(o>19&&o<=34)return"#13A195";if(o<=19)return"#015566";if(o>=66&&o<=80)return"#F2800D";if(o>80)return"#DF2120"}let x=!1;return ve(async()=>{t=await d.getReport(),h=Number(t.glycanage),s(1,f=Number(t.chronologicalage)),h>f?s(2,o=Math.round(50+(h-f)/(80-f)*50)):h<f?s(2,o=Math.round(50-(f-h)/(f-20)*50)):s(2,o=50),s(3,x=!0)}),n.$$set=m=>{"lang"in m&&s(0,c=m.lang),"service"in m&&s(5,d=m.service)},[c,f,o,x,B,d]}class ie extends ne{constructor(l){super(),oe(this,l,ge,fe,re,{lang:0,service:5},de)}get lang(){return this.$$.ctx[0]}set lang(l){this.$$set({lang:l}),V()}get service(){return this.$$.ctx[5]}set service(l){this.$$set({service:l}),V()}}customElements.define("ga-main-result-clp",le(ie,{lang:{},service:{}},[],[],!0));export{ie as default};
1
+ import{c as ie,S as oe,i as le,f as V,s as ne,a as re,d as ce,g as X,u as Y,k as _,o as ae,e as n,m as j,b as v,v as ee,p as i,n as a,q as e,r as T}from"./index2.js";import{a as z}from"./helpers.js";function ve(r){re(r,"svelte-1qc23nv",`@font-face{font-family:"mercury";src:url("https://dev.back-office.ga-internals-91.com/assets/reports/b2b/clp/1.0/fonts/MercuryDisplay.otf") format("truetype");font-weight:500;font-display:swap}.main.svelte-1qc23nv{height:100%;width:100%;display:flex;flex-direction:column}.graph-container.svelte-1qc23nv{width:100%;height:30%;display:flex;align-items:center;justify-content:space-between;position:relative}.colorBox.svelte-1qc23nv{height:7px;width:14.3%;border-radius:24px}.colorBoxShort.svelte-1qc23nv{height:7px;width:5%;border-radius:24px}.slider.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -50%);width:24%;max-height:70px}.slider-glycanage.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, -150%);width:24%;color:white;font-weight:500}.fixed-chrono.svelte-1qc23nv{display:flex;flex-direction:column;align-items:center;position:absolute;transform:translate(-50%, 155%);width:24%;color:#09341F80;font-weight:500;z-index:99}.text-left.svelte-1qc23nv{position:absolute;height:15%;width:34.7%;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-1qc23nv{position:absolute;height:15%;width:29.5%;top:68%;left:35.3%;display:flex;align-items:center;justify-content:center;color:#09341F80}.text-right.svelte-1qc23nv{position:absolute;height:15%;width:34.7%;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}.glycanage.svelte-1qc23nv{display:flex;font-size:192px;justify-content:center;align-items:end;height:50%;margin-bottom:1rem;margin-top:1.4rem;font-family:'mercury', serif}`)}function te(r){let o,s,c,d,t,f,g,l,b,x,m,y,Z,B,G,F,H,k,L,$,I,C,u,E,J,q,N,K,w,P,A,D=z(r[0],"BETTER")+"",O,Q,S,U,M,R=z(r[0],"WORSE")+"",W;return{c(){o=n("div"),s=n("div"),c=j(r[1]),d=v(),t=n("div"),f=n("div"),g=v(),l=n("div"),b=v(),x=n("div"),m=v(),y=n("div"),Z=v(),B=n("div"),G=v(),F=n("div"),H=v(),k=n("div"),L=v(),$=n("div"),I=v(),C=n("div"),u=ee("svg"),E=ee("path"),J=v(),q=n("div"),N=j(r[1]),K=v(),w=n("div"),w.textContent="50",P=v(),A=n("div"),O=j(D),Q=v(),S=n("div"),S.innerHTML='<svg width="44" height="52" viewBox="0 0 44 52" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.0002 0.133165C22.6224 0.133165 23.2446 0.244272 23.8668 0.466494C24.4891 0.688719 25.0446 1.02205 25.5335 1.46649C28.4224 4.13316 30.9779 6.73316 33.2002 9.2665C35.4224 11.7998 37.2779 14.2554 38.7668 16.6332C40.2557 19.0109 41.3891 21.2998 42.1668 23.4998C42.9446 25.6998 43.3335 27.7998 43.3335 29.7998C43.3335 36.4665 41.1891 41.7776 36.9002 45.7332C32.6113 49.6887 27.6446 51.6665 22.0002 51.6665C16.3557 51.6665 11.3891 49.6887 7.10016 45.7332C2.81128 41.7776 0.666833 36.4665 0.666834 29.7998C0.666834 27.7998 1.05572 25.6998 1.8335 23.4998C2.61128 21.2998 3.74461 19.0109 5.2335 16.6332C6.72239 14.2554 8.57795 11.7998 10.8002 9.2665C13.0224 6.73316 15.5779 4.13316 18.4668 1.46649C18.9557 1.02205 19.5113 0.688719 20.1335 0.466493C20.7557 0.244272 21.3779 0.133165 22.0002 0.133165Z" fill="#D7E4DE"></path></svg>',U=v(),M=n("div"),W=j(R),i(s,"class","glycanage svelte-1qc23nv"),a(s,"color",r[3]()),i(f,"class","colorBoxShort svelte-1qc23nv"),a(f,"background-color","#015566"),i(l,"class","colorBox svelte-1qc23nv"),a(l,"background-color","#015566"),i(x,"class","colorBox svelte-1qc23nv"),a(x,"background-color","#13A195"),i(y,"class","colorBox svelte-1qc23nv"),a(y,"background-color","#66CCAA"),i(B,"class","colorBox svelte-1qc23nv"),a(B,"background-color","#66CCAA"),i(F,"class","colorBox svelte-1qc23nv"),a(F,"background-color","#F2800D"),i(k,"class","colorBox svelte-1qc23nv"),a(k,"background-color","#DF2120"),i($,"class","colorBoxShort svelte-1qc23nv"),a($,"background-color","#DF2120"),i(E,"d","M20.0001 35.5418C19.6112 35.5418 19.2223 35.4724 18.8334 35.3335C18.4445 35.1946 18.0973 34.9863 17.7917 34.7085C15.9862 33.0418 14.389 31.4168 13.0001 29.8335C11.6112 28.2502 10.4515 26.7154 9.52091 25.2293C8.59036 23.7432 7.88203 22.3127 7.39591 20.9377C6.9098 19.5627 6.66675 18.2502 6.66675 17.0002C6.66675 12.8335 8.00703 9.51405 10.6876 7.04183C13.3681 4.56961 16.4723 3.3335 20.0001 3.3335C23.5279 3.3335 26.632 4.56961 29.3126 7.04183C31.9931 9.51405 33.3334 12.8335 33.3334 17.0002C33.3334 18.2502 33.0904 19.5627 32.6042 20.9377C32.1181 22.3127 31.4098 23.7432 30.4792 25.2293C29.5487 26.7154 28.389 28.2502 27.0001 29.8335C25.6112 31.4168 24.014 33.0418 22.2084 34.7085C21.9029 34.9863 21.5556 35.1946 21.1667 35.3335C20.7779 35.4724 20.389 35.5418 20.0001 35.5418Z"),i(E,"fill",r[3]()),a(u,"position","relative"),i(u,"width","62"),i(u,"height","62"),i(u,"viewBox","0 0 40 40"),i(u,"fill","none"),i(u,"xmlns","http://www.w3.org/2000/svg"),i(C,"class","slider svelte-1qc23nv"),a(C,"left",r[1]+"%"),i(q,"class","slider-glycanage svelte-1qc23nv"),a(q,"left",r[1]+"%"),i(w,"class","fixed-chrono svelte-1qc23nv"),a(w,"left","50%"),i(A,"class","text-left svelte-1qc23nv"),i(S,"class","text-middle svelte-1qc23nv"),i(M,"class","text-right svelte-1qc23nv"),i(t,"class","graph-container svelte-1qc23nv"),i(o,"class","main svelte-1qc23nv")},m(h,p){X(h,o,p),e(o,s),e(s,c),e(o,d),e(o,t),e(t,f),e(t,g),e(t,l),e(t,b),e(t,x),e(t,m),e(t,y),e(t,Z),e(t,B),e(t,G),e(t,F),e(t,H),e(t,k),e(t,L),e(t,$),e(t,I),e(t,C),e(C,u),e(u,E),e(t,J),e(t,q),e(q,N),e(t,K),e(t,w),e(t,P),e(t,A),e(A,O),e(t,Q),e(t,S),e(t,U),e(t,M),e(M,W)},p(h,p){p&2&&T(c,h[1]),p&2&&a(C,"left",h[1]+"%"),p&2&&T(N,h[1]),p&2&&a(q,"left",h[1]+"%"),p&1&&D!==(D=z(h[0],"BETTER")+"")&&T(O,D),p&1&&R!==(R=z(h[0],"WORSE")+"")&&T(W,R)},d(h){h&&_(o)}}}function de(r){let o,s=r[2]&&te(r);return{c(){s&&s.c(),o=ce()},m(c,d){s&&s.m(c,d),X(c,o,d)},p(c,[d]){c[2]?s?s.p(c,d):(s=te(c),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null)},i:Y,o:Y,d(c){c&&_(o),s&&s.d(c)}}}function fe(r,o,s){let{lang:c}=o,{service:d=window.GaReportService}=o,t,f=0,g=0,l=0;function b(){if(l>=35&&l<=65)return"#66CCAA";if(l>19&&l<=34)return"#13A195";if(l<=19)return"#015566";if(l>=66&&l<=80)return"#F2800D";if(l>80)return"#DF2120"}let x=!1;return ae(async()=>{t=await d.getReport(),f=Number(t.glycanage),g=Number(t.chronologicalage),f>g?s(1,l=Math.round(50+(f-g)/(80-g)*50)):f<g?s(1,l=Math.round(50-(g-f)/(g-20)*50)):s(1,l=50),s(2,x=!0)}),r.$$set=m=>{"lang"in m&&s(0,c=m.lang),"service"in m&&s(4,d=m.service)},[c,l,x,b,d]}class se extends oe{constructor(o){super(),le(this,o,fe,de,ne,{lang:0,service:4},ve)}get lang(){return this.$$.ctx[0]}set lang(o){this.$$set({lang:o}),V()}get service(){return this.$$.ctx[4]}set service(o){this.$$set({service:o}),V()}}customElements.define("ga-main-result-clp",ie(se,{lang:{},service:{}},[],[],!0));export{se as default};
@@ -1 +1 @@
1
- import{c as M,S as W,i as B,f as L,s as I,e as z,b as O,n as A,p as k,g as G,q as R,u as P,k as F,o as H,z as V}from"./index2.js";import{g as Z}from"./globals.js";import{i as q,f as j,h as J}from"./helpers.js";const{document:K}=Z;function Q(m){let e,c,t;return{c(){e=z("div"),c=O(),t=z("link"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),k(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),k(t,"rel","stylesheet")},m(n,d){G(n,e,d),m[3](e),G(n,c,d),R(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(c)),m[3](null),F(t)}}}function _(m,e,c){let{type:t}=e,{service:n=window.GaReportService}=e,d=[{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,v,f=0,a=0,o={},g="",p=0,y;const w=d.find(i=>i.name===t);function x(){if(t=="median")return q(f);if(t=="shield"||t=="youth")return j(f);if(t=="mature"||t=="lifestyle")return J(f)}function D(){y&&(o=echarts.init(y,null,{devicePixelRatio:4}));const i=y.getBoundingClientRect();var h={textStyle:{fontFamily:"Sen",fontStyle:"normal",fontSize:12,fontWeight:400,lineHeight:19.2,letterSpacing:.06},animation:!1,backgroundColor:"transparent",grid:{top:"65px",left:"50px",right:"55px",bottom:"40px"},dataset:[{source:T.data.map(s=>[s.x,s.y])},{source:v.data.map(s=>[s.x,s.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:"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(s){return s===0||s===100?"":s}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:"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(s){return s===0||s===.6?"":s}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Measured result",type:"scatter",data:[{x:p,y:a}],itemStyle:{color:x()}},{name:"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:"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};o.setOption(h),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",p),y1:o.convertToPixel("yAxis",0),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",0),y1:o.convertToPixel("yAxis",a),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({name:"Measured result",type:"circle",shape:{cx:o.convertToPixel("xAxis",p),cy:o.convertToPixel("yAxis",a),r:6},style:{fill:x(),stroke:"#FFFFFF",lineWidth:1},z:15});const $=o.convertToPixel("xAxis",p),C=o.convertToPixel("yAxis",a),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");r.setAttribute("width","71"),r.setAttribute("height","32"),r.setAttribute("viewBox","0 0 71 32"),r.setAttribute("fill","none"),r.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",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(b),r.appendChild(S),r.style.position="absolute",r.style.left=`${i.left+$+10}px`,r.style.top=`${i.top+C-15}px`,r.style.zIndex="8",l.innerText=`${Number.parseFloat(a).toFixed(3)}`,l.style.position="absolute",l.style.left=`${i.left+$+28}px`,l.style.top=`${i.top+C-8}px`,l.style.font="bold 16px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(r),o.setOption(h)}H(async()=>{u=await n.getReport(),g=u.sex,T=await n.getScatterData(t,g),v=await n.getLineData(t,g),p=Number(u.chronologicalage),console.log("lineData:",v),w&&(f=Number(u[w.csvPerc]),a=Number(u[w.csvScore])),D()});function E(i){V[i?"unshift":"push"](()=>{y=i,c(0,y)})}return m.$$set=i=>{"type"in i&&c(1,t=i.type),"service"in i&&c(2,n=i.service)},[y,t,n,E]}class N extends W{constructor(e){super(),B(this,e,_,Q,I,{type:1,service:2})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),L()}get service(){return this.$$.ctx[2]}set service(e){this.$$set({service:e}),L()}}customElements.define("ga-scatter-plot-clp",M(N,{type:{},service:{}},[],[],!1));export{N as default};
1
+ import{c as M,S as B,i as I,f as L,s as O,e as k,b as R,n as A,p as z,g as G,q as W,u as P,k as F,o as H,z as V}from"./index2.js";import{g as Z}from"./globals.js";import{i as q,f as j,h as J}from"./helpers.js";const{document:K}=Z;function Q(m){let e,c,t;return{c(){e=k("div"),c=R(),t=k("link"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),z(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),z(t,"rel","stylesheet")},m(n,d){G(n,e,d),m[3](e),G(n,c,d),W(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(c)),m[3](null),F(t)}}}function _(m,e,c){let{type:t}=e,{service:n=window.GaReportService}=e,d=[{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,v=0,a=0,o={},w="",p=0,y;const g=d.find(s=>s.name===t);function x(){if(t=="median")return q(v);if(t=="shield"||t=="youth")return j(v);if(t=="mature"||t=="lifestyle")return J(v)}function D(){y&&(o=echarts.init(y,null,{devicePixelRatio:4}));const s=y.getBoundingClientRect();var h={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"65px",left:"50px",right:"55px",bottom:"40px"},dataset:[{source:T.data.map(i=>[i.x,i.y])},{source:f.data.map(i=>[i.x,i.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:"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(i){return i===0||i===100?"":i}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:"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(i){return i===0||i===.6?"":i}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Measured result",type:"scatter",data:[{x:p,y:a}],itemStyle:{color:x()}},{name:"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:"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};o.setOption(h),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",p),y1:o.convertToPixel("yAxis",0),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",0),y1:o.convertToPixel("yAxis",a),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({name:"Measured result",type:"circle",shape:{cx:o.convertToPixel("xAxis",p),cy:o.convertToPixel("yAxis",a),r:6},style:{fill:x(),stroke:"#FFFFFF",lineWidth:1},z:15});const $=o.convertToPixel("xAxis",p),C=o.convertToPixel("yAxis",a),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");r.setAttribute("width","71"),r.setAttribute("height","32"),r.setAttribute("viewBox","0 0 71 32"),r.setAttribute("fill","none"),r.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",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(b),r.appendChild(S),r.style.position="absolute",r.style.left=`${s.left+$+10}px`,r.style.top=`${s.top+C-15}px`,r.style.zIndex="8",l.innerText=`${Number.parseFloat(a).toFixed(3)}`,l.style.position="absolute",l.style.left=`${s.left+$+28}px`,l.style.top=`${s.top+C-8}px`,l.style.font="bold 16px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(r),o.setOption(h)}H(async()=>{u=await n.getReport(),w=u.sex,T=await n.getScatterData(t,w),f=await n.getLineData(t,w),p=Number(u.chronologicalage),console.log("lineData:",f),g&&(v=Number(u[g.csvPerc]),a=Number(u[g.csvScore])),D()});function E(s){V[s?"unshift":"push"](()=>{y=s,c(0,y)})}return m.$$set=s=>{"type"in s&&c(1,t=s.type),"service"in s&&c(2,n=s.service)},[y,t,n,E]}class N extends B{constructor(e){super(),I(this,e,_,Q,O,{type:1,service:2})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),L()}get service(){return this.$$.ctx[2]}set service(e){this.$$set({service:e}),L()}}customElements.define("ga-scatter-plot-clp",M(N,{type:{},service:{}},[],[],!1));export{N as default};
@@ -1 +1 @@
1
- import{c as W,S as B,i as D,f as z,s as I,e as k,b as O,p as S,n as A,g as G,q as R,u as P,k as F,o as H,z as V}from"./index2.js";import{g as Z}from"./globals.js";import{i as q,f as j,h as J}from"./helpers.js";const{document:K}=Z;function Q(m){let e,c,t;return{c(){e=k("div"),c=O(),t=k("link"),S(e,"class","targeting-class"),A(e,"width","100%"),A(e,"height","100%"),A(e,"position","relative"),S(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),S(t,"rel","stylesheet")},m(n,d){G(n,e,d),m[3](e),G(n,c,d),R(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(c)),m[3](null),F(t)}}}function _(m,e,c){let{type:t}=e,{service:n=window.GaReportService}=e,d=[{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,a=0,o={},v="",p=0,y;const g=d.find(s=>s.name===t);function x(){if(t=="median")return q(f);if(t=="shield"||t=="youth")return j(f);if(t=="mature"||t=="lifestyle")return J(f)}function E(){y&&(o=echarts.init(y,null,{devicePixelRatio:4}));const s=y.getBoundingClientRect();var h={textStyle:{fontFamily:"Sen",fontStyle:"normal",fontSize:12,fontWeight:400,lineHeight:19.2,letterSpacing:.06},animation:!1,backgroundColor:"transparent",grid:{top:"65px",left:"50px",right:"55px",bottom:"40px"},dataset:[{source:T.data.map(i=>[i.x,i.y])},{source:$.data.map(i=>[i.x,i.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:"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(i){return i===0||i===100?"":i}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:"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(i){return i===0||i===.6?"":i}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Measured result",type:"scatter",data:[{x:p,y:a}],itemStyle:{color:x()}},{name:"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:"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};o.setOption(h),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",p),y1:o.convertToPixel("yAxis",0),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({type:"line",shape:{x1:o.convertToPixel("xAxis",0),y1:o.convertToPixel("yAxis",a),x2:o.convertToPixel("xAxis",p),y2:o.convertToPixel("yAxis",a)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({name:"Measured result",type:"circle",shape:{cx:o.convertToPixel("xAxis",p),cy:o.convertToPixel("yAxis",a),r:6},style:{fill:x(),stroke:"#FFFFFF",lineWidth:1},z:15});const C=o.convertToPixel("xAxis",p),L=o.convertToPixel("yAxis",a),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElement("div");r.setAttribute("width","71"),r.setAttribute("height","32"),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 b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),b.setAttribute("fill",x()),r.appendChild(w),r.appendChild(b),r.style.position="absolute",r.style.left=`${s.left+C+10}px`,r.style.top=`${s.top+L-15}px`,r.style.zIndex="8",l.innerText=`${Number.parseFloat(a).toFixed(3)}`,l.style.position="absolute",l.style.left=`${s.left+C+28}px`,l.style.top=`${s.top+L-8}px`,l.style.font="bold 16px sans-serif",l.style.color="white",l.style.zIndex="999",l.style.fontFamily="Sen",document.body.appendChild(l),document.body.appendChild(r),o.setOption(h)}H(async()=>{u=await n.getReport(),v=u.sex,T=await n.getScatterData(t,v),$=await n.getLineData(t,v),p=Number(u.chronologicalage),g&&(f=Number(u[g.csvPerc]),a=Number(u[g.csvScore])),E()});function M(s){V[s?"unshift":"push"](()=>{y=s,c(0,y)})}return m.$$set=s=>{"type"in s&&c(1,t=s.type),"service"in s&&c(2,n=s.service)},[y,t,n,M]}class N extends B{constructor(e){super(),D(this,e,_,Q,I,{type:1,service:2})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),z()}get service(){return this.$$.ctx[2]}set service(e){this.$$set({service:e}),z()}}customElements.define("ga-scatter-plot",W(N,{type:{},service:{}},[],[],!1));export{N as default};
1
+ import{c as B,S as D,i as I,f as L,s as O,e as k,b as R,n as S,p as z,g as G,q as W,u as A,k as P,o as H,z as V}from"./index2.js";import{g as Z}from"./globals.js";import{i as q,f as j,h as J}from"./helpers.js";const{document:K}=Z;function Q(m){let e,c,t;return{c(){e=k("div"),c=R(),t=k("link"),S(e,"width","100%"),S(e,"height","100%"),S(e,"position","relative"),z(t,"href","https://fonts.googleapis.com/css2?family=Sen:wght@400..800&display=swap"),z(t,"rel","stylesheet")},m(n,d){G(n,e,d),m[3](e),G(n,c,d),W(K.head,t)},p:A,i:A,o:A,d(n){n&&(P(e),P(c)),m[3](null),P(t)}}}function _(m,e,c){let{type:t}=e,{service:n=window.GaReportService}=e,d=[{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,F,T,v=0,l=0,s={},f="",p=0,y;const w=d.find(o=>o.name===t);function x(){if(t=="median")return q(v);if(t=="shield"||t=="youth")return j(v);if(t=="mature"||t=="lifestyle")return J(v)}function E(){y&&(s=echarts.init(y,null,{devicePixelRatio:4}));const o=y.getBoundingClientRect();var h={textStyle:{fontFamily:"Sen, sans serif"},animation:!1,backgroundColor:"transparent",grid:{top:"65px",left:"50px",right:"55px",bottom:"40px"},dataset:[{source:F.data.map(i=>[i.x,i.y])},{source:T.data.map(i=>[i.x,i.y])}],tooltip:{show:!1},xAxis:{min:0,max:100,interval:20,name:"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(i){return i===0||i===100?"":i}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:"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(i){return i===0||i===.6?"":i}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.1,borderWidth:1}},{name:"Measured result",type:"scatter",data:[{x:p,y:l}],itemStyle:{color:x()}},{name:"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:"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};s.setOption(h),h.graphic.push({type:"line",shape:{x1:s.convertToPixel("xAxis",p),y1:s.convertToPixel("yAxis",0),x2:s.convertToPixel("xAxis",p),y2:s.convertToPixel("yAxis",l)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({type:"line",shape:{x1:s.convertToPixel("xAxis",0),y1:s.convertToPixel("yAxis",l),x2:s.convertToPixel("xAxis",p),y2:s.convertToPixel("yAxis",l)},style:{stroke:x(),lineDash:[8,8],lineWidth:3},z:8}),h.graphic.push({name:"Measured result",type:"circle",shape:{cx:s.convertToPixel("xAxis",p),cy:s.convertToPixel("yAxis",l),r:6},style:{fill:x(),stroke:"#FFFFFF",lineWidth:1},z:15});const $=s.convertToPixel("xAxis",p),C=s.convertToPixel("yAxis",l),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),a=document.createElement("div");r.setAttribute("width","71"),r.setAttribute("height","32"),r.setAttribute("viewBox","0 0 71 32"),r.setAttribute("fill","none"),r.setAttribute("xmlns","http://www.w3.org/2000/svg");const g=document.createElementNS("http://www.w3.org/2000/svg","path");g.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"),g.setAttribute("fill",x());const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),b.setAttribute("fill",x()),r.appendChild(g),r.appendChild(b),r.style.position="absolute",r.style.left=`${o.left+$+10}px`,r.style.top=`${o.top+C-15}px`,r.style.zIndex="8",a.innerText=`${Number.parseFloat(l).toFixed(3)}`,a.style.position="absolute",a.style.left=`${o.left+$+28}px`,a.style.top=`${o.top+C-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(r),s.setOption(h)}H(async()=>{u=await n.getReport(),f=u.sex,F=await n.getScatterData(t,f),T=await n.getLineData(t,f),p=Number(u.chronologicalage),w&&(v=Number(u[w.csvPerc]),l=Number(u[w.csvScore])),E()});function M(o){V[o?"unshift":"push"](()=>{y=o,c(0,y)})}return m.$$set=o=>{"type"in o&&c(1,t=o.type),"service"in o&&c(2,n=o.service)},[y,t,n,M]}class N extends D{constructor(e){super(),I(this,e,_,Q,O,{type:1,service:2})}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),L()}get service(){return this.$$.ctx[2]}set service(e){this.$$set({service:e}),L()}}customElements.define("ga-scatter-plot",B(N,{type:{},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.115.0",
4
+ "version": "1.117.0",
5
5
  "type": "module",
6
6
  "main": "dist/lib/@glycanage/web-components.js",
7
7
  "scripts": {