@glycanage/web-components 1.113.0 → 1.115.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/globals.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;export{o as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
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};
|
package/dist/scatter-plot.wc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
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};
|