@glycanage/web-components 1.117.0 → 1.118.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 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
|
+
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,renderer:"svg"}));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};
|
package/dist/scatter-plot.wc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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};
|
|
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,renderer:"svg"}));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};
|