"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2367],{22367:(e,t,l)=>{l.d(t,{makeImageData:()=>o});var n=l(75943),s=l(7080);const c=.3;function i(e,t,l,s,i,a){t.fillStyle=(0,n.WX)(e),t.fillRect(l-c,s-c,i+c,a+c)}function a(e,t,l,s,i,a,o,r){t.fillStyle=void 0!==r?(0,n.uL)(e,o,r):(0,n.j0)(e,o),t.fillRect(l-c,s-c,i+c,a+c)}function o({ctx:e,canvasWidth:t,canvasHeight:l,renderArgs:n}){const{renderingMode:o,minorAlleleFrequencyFilter:r,sources:f,features:u}=n,{statusCallback:h=()=>{}}=n;h("Drawing variant matrix");const g=l/f.length,p=(0,s.Cg)(u.values(),r),b=[],d=p.length,m=t/d;for(let n=0;n<d;n++){const s=[],r=p[n];if(r.get("format").includes("PS")){const u=r.get("samples"),h=n/p.length*t,b=f.length;for(let t=0;t<b;t++){const n=t/b*l,{name:r,HP:p}=f[t],d=u[r];if(d){const t=d.GT?.[0];if(t){s.push(t);const l=t.includes("|");if("phased"===o)if(l){const l=d.PS?.[0];a(t.split("|"),e,h,n,m,g,p,l)}else e.fillStyle="black",e.fillRect(h-c,n-c,m+c,g+c);else i(t.split(/[/|]/),e,h,n,m,g)}}}}else{const s=r.get("genotypes"),u=n/p.length*t,h=f.length,b=[];for(let t=0;t<h;t++){const n=t/h*l,{name:r,HP:p}=f[t],d=s[r];if(d){b.push(d);const t=d.includes("|");"phased"===o?t?a(d.split("|"),e,u,n,m,g,p):(e.fillStyle="black",e.fillRect(u-c,n-c,m+c,g+c)):i(d.split(/[/|]/),e,u,n,m,g)}}}b.push(s)}return{mafs:p,arr:b}}},75943:(e,t,l)=>{l.d(t,{WX:()=>i,j0:()=>a,uL:()=>o});var n=l(40898),s=l(87485),c=l(7080);function i(e){const t=e.length;let l=0,n=0,c=0,i=0;for(const t of e)"1"===t?l++:"0"===t?i++:"."===t?n++:c++;if(i===t)return"#ccc";{let e=(0,s.M)(`hsl(200,50%,${80-l/t*50}%)`);return c&&(e=e.mix(`hsla(0,100%,20%,${c/t})`)),n&&(e=e.mix(`hsla(50,50%,50%,${n/t/2})`)),e.toHex()}}function a(e,t){const l=+e[t];return l?n.set1[l-1]||"black":"#ccc"}function o(e,t,l){return+e[t]?(0,c.qH)(+l)||"black":"#ccc"}}}]);
//# sourceMappingURL=2367.5ae514d9.chunk.js.map