"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[5847],{65847:(e,o,r)=>{r.d(o,{drawDensity:()=>f});var t=r(68584),n=r(99546),c=r(37347),a=r(75429);const l=.3,s=2;function f(e,o){const{stopToken:r,features:f,regions:i,bpPerPx:b,scaleOpts:p,height:u,config:g}=o,d=i[0],C=(0,t.readConfObject)(g,"bicolorPivot"),w=(0,t.readConfObject)(g,"bicolorPivotValue"),h=(0,t.readConfObject)(g,"negColor"),j=(0,t.readConfObject)(g,"posColor"),v=(0,t.readConfObject)(g,"color"),O=(0,t.readConfObject)(g,"clipColor"),S="none"!==C&&"log"!==p.scaleType,m=(0,a.getScale)({...p,pivotValue:S?w:void 0,range:S?[h,"#eee",j]:["#eee",j]}),T="#f0f"===v?(e,o)=>m(o):(e,o)=>(0,t.readConfObject)(g,"color",{feature:e,score:o}),P=(0,a.getScale)({...p,range:[0,u]}).domain(),k=P[0],y=P[1];let _=Number.NEGATIVE_INFINITY,x=!1;const I=[];let N=performance.now();for(const o of f.values()){performance.now()-N>400&&((0,c.SW)(r),N=performance.now());const[t,a]=(0,n.featureSpanPx)(o,d,b);Math.floor(t)!==Math.floor(_)&&(I.push(o),_=t);const s=o.get("score");x=x||s>y||s<k;const f=a-t+l;e.fillStyle=T(o,s),e.fillRect(t,0,f,u)}if(e.save(),x){e.fillStyle=O;for(const o of f.values()){performance.now()-N>400&&((0,c.SW)(r),N=performance.now());const[t,f]=(0,n.featureSpanPx)(o,d,b),i=f-t+l,u=o.get("score");(u>y||u<k&&"log"!==p.scaleType)&&(0,a.fillRectCtx)(t,0,i,s,e)}}return e.restore(),{reducedFeatures:I}}}}]);
//# sourceMappingURL=5847.965237a1.chunk.js.map