@glycanage/web-components 1.107.0 → 1.108.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/index2.js +1 -1
- package/dist/scatter-plot.wc.js +1 -1
- package/package.json +1 -1
package/dist/index2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var G=Object.defineProperty,K=(t,n,e)=>n in t?G(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,a=(t,n,e)=>(K(t,typeof n!="symbol"?n+"":n,e),e);function y(){}function
|
|
1
|
+
var G=Object.defineProperty,K=(t,n,e)=>n in t?G(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,a=(t,n,e)=>(K(t,typeof n!="symbol"?n+"":n,e),e);function y(){}function B(t){return t()}function M(){return Object.create(null)}function m(t){t.forEach(B)}function R(t){return typeof t=="function"}function Q(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}function U(t){return Object.keys(t).length===0}function T(t,n){t.appendChild(n)}function V(t,n,e){const o=W(t);if(!o.getElementById(n)){const s=x("style");s.id=n,s.textContent=e,X(o,s)}}function W(t){if(!t)return document;const n=t.getRootNode?t.getRootNode():t.ownerDocument;return n&&n.host?n:t.ownerDocument}function X(t,n){return T(t.head||t,n),n.sheet}function q(t,n,e){t.insertBefore(n,e||null)}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function Y(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function E(t){return document.createTextNode(t)}function Z(){return E(" ")}function tt(){return E("")}function z(t,n,e){e==null?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function nt(t){return Array.from(t.childNodes)}function et(t,n){n=""+n,t.data!==n&&(t.data=n)}function ot(t,n,e,o){e==null?t.style.removeProperty(n):t.style.setProperty(n,e,o?"important":"")}function st(t){const n={};return t.childNodes.forEach(e=>{n[e.slot||"default"]=!0}),n}let b;function g(t){b=t}function rt(){if(!b)throw new Error("Function called outside component initialization");return b}function it(t){rt().$$.on_mount.push(t)}const f=[],k=[];let d=[];const D=[],ct=Promise.resolve();let O=!1;function $t(){O||(O=!0,ct.then(P))}function j(t){d.push(t)}const N=new Set;let p=0;function P(){if(p!==0)return;const t=b;do{try{for(;p<f.length;){const n=f[p];p++,g(n),ut(n.$$)}}catch(n){throw f.length=0,p=0,n}for(g(null),f.length=0,p=0;k.length;)k.pop()();for(let n=0;n<d.length;n+=1){const e=d[n];N.has(e)||(N.add(e),e())}d.length=0}while(f.length);for(;D.length;)D.pop()();O=!1,N.clear(),g(t)}function ut(t){if(t.fragment!==null){t.update(),m(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(j)}}function at(t){const n=[],e=[];d.forEach(o=>t.indexOf(o)===-1?n.push(o):e.push(o)),e.forEach(o=>o()),d=n}const _=new Set;let h;function lt(){h={r:0,c:[],p:h}}function ht(){h.r||m(h.c),h=h.p}function H(t,n){t&&t.i&&(_.delete(t),t.i(n))}function ft(t,n,e,o){if(t&&t.o){if(_.has(t))return;_.add(t),h.c.push(()=>{_.delete(t),o&&(e&&t.d(1),o())}),t.o(n)}else o&&o()}function dt(t){t&&t.c()}function J(t,n,e){const{fragment:o,after_update:s}=t.$$;o&&o.m(n,e),j(()=>{const r=t.$$.on_mount.map(B).filter(R);t.$$.on_destroy?t.$$.on_destroy.push(...r):m(r),t.$$.on_mount=[]}),s.forEach(j)}function F(t,n){const e=t.$$;e.fragment!==null&&(at(e.after_update),m(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function pt(t,n){t.$$.dirty[0]===-1&&(f.push(t),$t(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function mt(t,n,e,o,s,r,$,c=[-1]){const u=b;g(t);const i=t.$$={fragment:null,ctx:[],props:r,update:y,not_equal:s,bound:M(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:M(),dirty:c,skip_bound:!1,root:n.target||u.$$.root};$&&$(i.root);let A=!1;if(i.ctx=e?e(t,n.props||{},(l,C,...L)=>{const S=L.length?L[0]:C;return i.ctx&&s(i.ctx[l],i.ctx[l]=S)&&(!i.skip_bound&&i.bound[l]&&i.bound[l](S),A&&pt(t,l)),C}):[],i.update(),A=!0,m(i.before_update),i.fragment=o?o(i.ctx):!1,n.target){if(n.hydrate){const l=nt(n.target);i.fragment&&i.fragment.l(l),l.forEach(w)}else i.fragment&&i.fragment.c();n.intro&&H(t.$$.fragment),J(t,n.target,n.anchor),P()}g(u)}let I;typeof HTMLElement=="function"&&(I=class extends HTMLElement{constructor(t,n,e){super(),a(this,"$$ctor"),a(this,"$$s"),a(this,"$$c"),a(this,"$$cn",!1),a(this,"$$d",{}),a(this,"$$r",!1),a(this,"$$p_d",{}),a(this,"$$l",{}),a(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=n,e&&this.attachShadow({mode:"open"})}addEventListener(t,n,e){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,e)}removeEventListener(t,n,e){if(super.removeEventListener(t,n,e),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(s){return()=>{let r;return{c:function(){r=x("slot"),s!=="default"&&z(r,"name",s)},m:function($,c){q($,r,c)},d:function($){$&&w(r)}}}};if(await Promise.resolve(),!this.$$cn)return;const n={},e=st(this);for(const s of this.$$s)s in e&&(n[s]=[t(s)]);for(const s of this.attributes){const r=this.$$g_p(s.name);r in this.$$d||(this.$$d[r]=v(r,s.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const s in this.$$p_d)if(this.$$d[s]=this.$$c.$$.ctx[this.$$c.$$.props[s]],this.$$p_d[s].reflect){const r=v(s,this.$$d[s],this.$$p_d,"toAttribute");r==null?this.removeAttribute(s):this.setAttribute(this.$$p_d[s].attribute||s,r)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const s in this.$$l)for(const r of this.$$l[s]){const $=this.$$c.$on(s,r);this.$$l_u.set(r,$)}this.$$l={}}}attributeChangedCallback(t,n,e){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=v(t,e,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function v(t,n,e,o){var s;const r=(s=e[t])==null?void 0:s.type;if(n=r==="Boolean"&&typeof n!="boolean"?n!=null:n,!o||!e[t])return n;if(o==="toAttribute")switch(r){case"Object":case"Array":return n==null?null:JSON.stringify(n);case"Boolean":return n?"":null;case"Number":return n??null;default:return n}else switch(r){case"Object":case"Array":return n&&JSON.parse(n);case"Boolean":return n;case"Number":return n!=null?+n:n;default:return n}}function bt(t,n,e,o,s,r){let $=class extends I{constructor(){super(t,e,s),this.$$p_d=n}static get observedAttributes(){return Object.keys(n).map(c=>(n[c].attribute||c).toLowerCase())}};return Object.keys(n).forEach(c=>{Object.defineProperty($.prototype,c,{get(){return this.$$c&&c in this.$$c?this.$$c[c]:this.$$d[c]},set(u){var i;u=v(c,u,n),this.$$d[c]=u,(i=this.$$c)==null||i.$set({[c]:u})}})}),o.forEach(c=>{Object.defineProperty($.prototype,c,{get(){var u;return(u=this.$$c)==null?void 0:u[c]}})}),r&&($=r($)),t.element=$,$}class gt{constructor(){a(this,"$$"),a(this,"$$set")}$destroy(){F(this,1),this.$destroy=y}$on(n,e){if(!R(e))return y;const o=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return o.push(e),()=>{const s=o.indexOf(e);s!==-1&&o.splice(s,1)}}$set(n){this.$$set&&!U(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}const yt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yt);export{gt as S,V as a,Z as b,bt as c,tt as d,x as e,P as f,q as g,ht as h,mt as i,H as j,w as k,lt as l,E as m,ot as n,it as o,z as p,T as q,et as r,Q as s,ft as t,y as u,Y as v,dt as w,J as x,F as y,k as z};
|
package/dist/scatter-plot.wc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as k,S as B,i as G,f as $,s as N,a as E,e as I,n as d,g as M,u as S,k as R,o as D,z as O}from"./index2.js";import{i as W,f as H,h as V}from"./helpers.js";function Z(l){E(l,"svelte-4pqnog",'@font-face{font-family:"Sen";src:url("https://dev.back-office.ga-internals-91.com/assets/fonts/Sen-Regular.ttf") format("truetype");font-weight:normal;font-display:swap}@font-face{font-family:"Sen";src:url("https://dev.back-office.ga-internals-91.com/assets/fonts/Sen-Bold.ttf") format("truetype");font-weight:bold;font-display:swap}')}function q(l){let e;return{c(){e=I("div"),d(e,"width","100%"),d(e,"height","32rem"),d(e,"position","relative"),d(e,"padding-top","0.5rem")},m(c,i){M(c,e,i),l[3](e)},p:S,i:S,o:S,d(c){c&&R(e),l[3](null)}}}function _(l,e,c){let{type:i}=e,{service:f=window.GaReportService}=e,F=[{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,b,h=0,n=0,t={},A="",p=0,y;const v=F.find(o=>o.name===i);function m(){if(i=="median")return W(h);if(i=="shield"||i=="youth")return H(h);if(i=="mature"||i=="lifestyle")return V(h)}function z(){y&&(t=echarts.init(y,null,{devicePixelRatio:4}));const o=y.getBoundingClientRect();echarts.registerTransform(ecStat.transform.regression);var x={textStyle:{fontFamily:"Sen",fontStyle:"normal",fontSize:12,fontWeight:400,lineHeight:19.2,letterSpacing:.06},animation:!1,backgroundColor:"transparent",dataset:[{source:b.data.map(r=>[r.x,r.y])},{transform:{type:"ecStat:regression",config:{method:"polynomial",order:3}}}],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(r){return r===0||r===100?"":r}},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(r){return r===0||r===.6?"":r}},splitLine:{show:!0}},series:[{type:"scatter",tooltip:{},itemStyle:{color:"#09341F",opacity:.2,borderWidth:1},showInLegend:!1},{name:"Measured result",type:"scatter",data:[{x:p,y:n}],symbolSize:10,itemStyle:{color:m()},showSymbol:!0},{name:"Population average",type:"line",smooth:!0,datasetIndex:1,symbol:"line",lineStyle:{name:"line",type:"line",color:"#B5C2BD",symbol:"none",width:5},showSymbol:!1}],graphic:[],legend:{show:!0,right:"50%",top:"1%",left:"70%",textStyle:{color:"#09341F",opacity:.8},selected:{"Measured result":!0,"Population average":!0},inactiveColor:"#fff"}};t.setOption(x),x.graphic.push({type:"line",shape:{x1:t.convertToPixel("xAxis",p),y1:t.convertToPixel("yAxis",0),x2:t.convertToPixel("xAxis",p),y2:t.convertToPixel("yAxis",n)},style:{stroke:m(),lineDash:[8,8],lineWidth:3},z:8}),x.graphic.push({type:"line",shape:{x1:t.convertToPixel("xAxis",0),y1:t.convertToPixel("yAxis",n),x2:t.convertToPixel("xAxis",p),y2:t.convertToPixel("yAxis",n)},style:{stroke:m(),lineDash:[8,8],lineWidth:3},z:8}),x.graphic.push({name:"Measured result",type:"circle",shape:{cx:t.convertToPixel("xAxis",p),cy:t.convertToPixel("yAxis",n),r:7},style:{fill:m()},z:15});const P=t.convertToPixel("xAxis",p),T=t.convertToPixel("yAxis",n),s=document.createElementNS("http://www.w3.org/2000/svg","svg"),a=document.createElement("div");s.setAttribute("width","71"),s.setAttribute("height","32"),s.setAttribute("viewBox","0 0 71 32"),s.setAttribute("fill","none"),s.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",m());const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d","M1.13333 17.6C0.0666666 16.8 0.0666666 15.2 1.13333 14.4L7 10L7 22L1.13333 17.6Z"),w.setAttribute("fill",m()),s.appendChild(g),s.appendChild(w),s.style.position="absolute",s.style.left=`${o.left+P+10}px`,s.style.top=`${o.top+T-8}px`,s.style.zIndex="8",a.innerText=`${Number.parseFloat(n).toFixed(3)}`,a.style.position="absolute",a.style.left=`${o.left+P+28}px`,a.style.top=`${o.top+T-1}px`,a.style.font="bold 16px sans-serif",a.style.color="white",a.style.zIndex="999",document.body.appendChild(a),document.body.appendChild(s),t.setOption(x)}D(async()=>{u=await f.getReport(),A=u.sex,b=await f.getScatterData(i,A),p=Number(u.glycanage),v&&(h=Number(u[v.csvPerc]),n=Number(u[v.csvScore])),z()});function L(o){O[o?"unshift":"push"](()=>{y=o,c(0,y)})}return l.$$set=o=>{"type"in o&&c(1,i=o.type),"service"in o&&c(2,f=o.service)},[y,i,f,L]}class C extends B{constructor(e){super(),G(this,e,_,q,N,{type:1,service:2},Z)}get type(){return this.$$.ctx[1]}set type(e){this.$$set({type:e}),$()}get service(){return this.$$.ctx[2]}set service(e){this.$$set({service:e}),$()}}customElements.define("ga-scatter-plot",k(C,{type:{},service:{}},[],[],!1));export{C as default};
|