@glycanage/web-components 1.123.0 → 1.124.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 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 _,z as H}from"./index2.js";import{g as Z}from"./globals.js";import{a as f,i as q,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(o,c){k(o,e,c),h[4](e),k(o,l,c),V(J.head,t)},p:F,i:F,o:F,d(o){o&&(T(e),T(l)),h[4](null),T(t)}}}function Q(h,e,l){let{type:t}=e,{lang:o}=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,$,C,v=0,p=0,i={},g="",y=0,x;const w=R.find(s=>s.name===t);function m(){if(t=="median")return q(v);if(t=="shield"||t=="youth")return X(v);if(t=="mature"||t=="lifestyle")return j(v)}function O(){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:"65px",left:o==="slovenian"?"55px":"50px",right:"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:f(o,"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:f(o,"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:f(o,"MEASURED_RESULT"),type:"scatter",data:[{x:y,y:p}],itemStyle:{color:m()}},{name:f(o,"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:o==="slovenian"?"66%":"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.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:3},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:3},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:6},style:{fill:m(),stroke:"#FFFFFF",lineWidth:1},z:15});const E=i.convertToPixel("xAxis",y),L=i.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),i.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&&(v=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,o=s.lang),"service"in s&&l(3,c=s.service)},[x,t,o,c,D]}class z 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(z,{type:{},lang:{},service:{}},[],[],!1));export{z as default};
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 _,z as H}from"./index2.js";import{g as Z}from"./globals.js";import{a as f,i as q,f as X,h as j}from"./helpers.js";const{document:J}=Z;function K(h){let e,a,t;return{c(){e=G("div"),a=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(o,c){k(o,e,c),h[4](e),k(o,a,c),V(J.head,t)},p:F,i:F,o:F,d(o){o&&(T(e),T(a)),h[4](null),T(t)}}}function Q(h,e,a){let{type:t}=e,{lang:o}=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,$,C,v=0,p=0,i={},g="",y=0,x;const w=R.find(s=>s.name===t);function m(){if(t=="median")return q(v);if(t=="shield"||t=="youth")return X(v);if(t=="mature"||t=="lifestyle")return j(v)}function O(){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:"65px",left:o==="slovenian"?"62px":"50px",right:o==="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:f(o,"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:f(o,"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:f(o,"MEASURED_RESULT"),type:"scatter",data:[{x:y,y:p}],itemStyle:{color:m()}},{name:f(o,"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:o==="slovenian"?"67%":"70%",itemGap:.2,textStyle:{color:"#09341F",opacity:.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:3},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:3},z:8}),d.graphic.push({name:"Measured result",type:"circle",shape:{cx:i.convertToPixel("xAxis",y),cy:i.convertToPixel("yAxis",p),r:6},style:{fill:m(),stroke:"#FFFFFF",lineWidth:1},z:15});const E=i.convertToPixel("xAxis",y),L=i.convertToPixel("yAxis",p),n=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=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",l.innerText=`${Number.parseFloat(p).toFixed(3)}`,l.style.position="absolute",l.style.left=`${s.left+E+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(n),i.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&&(v=Number(u[w.csvPerc]),p=Number(u[w.csvScore])),O()});function D(s){H[s?"unshift":"push"](()=>{x=s,a(0,x)})}return h.$$set=s=>{"type"in s&&a(1,t=s.type),"lang"in s&&a(2,o=s.lang),"service"in s&&a(3,c=s.service)},[x,t,o,c,D]}class z 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(z,{type:{},lang:{},service:{}},[],[],!1));export{z 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.123.0",
4
+ "version": "1.124.0",
5
5
  "type": "module",
6
6
  "main": "dist/lib/@glycanage/web-components.js",
7
7
  "scripts": {