@glycanage/web-components 1.169.0 → 1.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as W,S as B,i as I,f as S,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,z as Z}from"./index2.js";import{g as q}from"./globals.js";import{a as E,i as X,f as _,h as J}from"./helpers.js";const{document:K}=q;function Q(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(n,c){k(n,e,c),m[4](e),k(n,a,c),j(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(a)),m[4](null),F(t)}}}function U(m,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"}],u,$,T,
|
|
1
|
+
import{c as W,S as B,i as I,f as S,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,z as Z}from"./index2.js";import{g as q}from"./globals.js";import{a as E,i as X,f as _,h as J}from"./helpers.js";const{document:K}=q;function Q(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(n,c){k(n,e,c),m[4](e),k(n,a,c),j(K.head,t)},p:P,i:P,o:P,d(n){n&&(F(e),F(a)),m[4](null),F(t)}}}function U(m,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"}],u,$,T,f=0,p=0,s={},v="",y=0,x;const g=R.find(i=>i.name===t);function h(){if(t=="median")return X(f);if(t=="shield"||t=="youth")return _(f);if(t=="mature"||t=="lifestyle")return J(f)}function D(){x&&(s=echarts.init(x,null,{devicePixelRatio:4,renderer:"svg"}));const i=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(n,"AGE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:10},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(o){return o===0||o===100?"":o}},splitLine:{show:!0}},yAxis:{min:0,max:.6,name:E(n,"INDEX_SCORE"),nameTextStyle:{color:"#09341F",opacity:.8,fontSize:10},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(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"}};s.setOption(d),d.graphic.push({type:"line",shape:{x1:s.convertToPixel("xAxis",y),y1:s.convertToPixel("yAxis",0),x2:s.convertToPixel("xAxis",y),y2:s.convertToPixel("yAxis",p)},style:{stroke:h(),lineDash:[8,8],lineWidth:3},z:8}),d.graphic.push({type:"line",shape:{x1:s.convertToPixel("xAxis",0),y1:s.convertToPixel("yAxis",p),x2:s.convertToPixel("xAxis",y),y2:s.convertToPixel("yAxis",p)},style:{stroke:h(),lineDash:[8,8],lineWidth:3},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:s.convertToPixel("xAxis",y),cy:s.convertToPixel("yAxis",p),r:6},style:{fill:h(),stroke:"#FFFFFF",lineWidth:1},z:15});const C=s.convertToPixel("xAxis",y),z=s.convertToPixel("yAxis",p),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",h());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",h()),r.appendChild(w),r.appendChild(b),r.style.position="absolute",r.style.left=`${i.left+C-70}px`,r.style.top=`${i.top+z-15}px`,r.style.zIndex="8",l.innerText=`${Number.parseFloat(p).toFixed(3)}`,l.style.position="absolute",l.style.left=`${i.left+C-52}px`,l.style.top=`${i.top+z-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),s.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(i){Z[i?"unshift":"push"](()=>{x=i,a(0,x)})}return m.$$set=i=>{"type"in i&&a(1,t=i.type),"lang"in i&&a(2,n=i.lang),"service"in i&&a(3,c=i.service)},[x,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}),S()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),S()}get service(){return this.$$.ctx[3]}set service(e){this.$$set({service:e}),S()}}customElements.define("ga-scatter-plot-custom",W(N,{type:{},lang:{},service:{}},[],[],!1));export{N as default};
|