"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9113],{49113:(e,o,t)=>{t.d(o,{drawLine:()=>c});var l=t(68584),s=t(99546),r=t(75429);const a=.3,n=2;function c(e,o){const{features:t,regions:c,bpPerPx:i,scaleOpts:h,height:f,ticks:{values:u},displayCrossHatches:b,colorCallback:d,config:T,offset:g=0}=o,p=c[0],k=(p.end-p.start)/i,v=f-2*g,w=(0,l.readConfObject)(T,"clipColor"),m=(0,r.getScale)({...h,range:[0,v]}),y=m.domain(),C=y[0],S=y[1],P=e=>(0,s.clamp)(v-(m(e)||0),0,v)+g;let _,I=Number.NEGATIVE_INFINITY;const M=[];for(const o of t.values()){const[t,l]=(0,s.featureSpanPx)(o,p,i);Math.floor(t)!==Math.floor(I)&&(M.push(o),I=t);const r=o.get("score"),c=r<C,f=r>S,u=l-t+a,b=d(o,r);e.beginPath(),e.strokeStyle=b;const T=void 0!==_?_:r;p.reversed?(e.moveTo(l,P(T)),e.lineTo(l,P(r)),e.lineTo(t,P(r))):(e.moveTo(t,P(T)),e.lineTo(t,P(r)),e.lineTo(l,P(r))),e.stroke(),_=r,f?(e.fillStyle=w,e.fillRect(t,g,u,n)):c&&"log"!==h.scaleType&&(e.fillStyle=w,e.fillRect(t,v-n,u,v))}return b&&(e.lineWidth=1,e.strokeStyle="rgba(200,200,200,0.5)",u.forEach((o=>{e.beginPath(),e.moveTo(0,Math.round(P(o))),e.lineTo(k,Math.round(P(o))),e.stroke()}))),{reducedFeatures:M}}}}]);
//# sourceMappingURL=9113.ae5cf363.chunk.js.map