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