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