"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[6861],{46861:(e,o,t)=>{t.r(o),t.d(o,{default:()=>M});var r=t(7552),n=t(68584),u=t(99546),a=t(68446),s=t(80208);function c({feature:e,config:o,layoutRecord:{y:t,data:{anchorX:u,radiusPx:a,score:c}}}){const i=(0,n.readConfObject)(o,"innerColor",{feature:e}),l=String(c),d=2*a/l.length*1.1;return d<12?null:r.createElement("text",{style:{fontSize:d,fill:(0,s.contrastingTextColor)(i)},x:u,y:t+a-d/2.4,textAnchor:"middle",dominantBaseline:"hanging"},l)}const i=(0,a.observer)((function(e){const{feature:o,config:t,layoutRecord:u,selectedFeatureId:a}=e,{anchorLocation:s,y:i,data:{radiusPx:l}}=u,d=o=>{const{onFeatureMouseDown:t,feature:r}=e;return t?.(o,r.id())},f=o=>{const{onFeatureMouseEnter:t,feature:r}=e;return t?.(o,r.id())},M=o=>{const{onFeatureMouseOut:t,feature:r}=e;return t?.(o,r.id())},g=o=>{const{onFeatureMouseOver:t,feature:r}=e;return t?.(o,r.id())},b=o=>{const{onFeatureMouseUp:t,feature:r}=e;return t?.(o,r.id())},y=o=>{const{onFeatureMouseLeave:t,feature:r}=e;return t?.(o,r.id())},p=o=>{const{onFeatureMouseMove:t,feature:r}=e;return t?.(o,r.id())},v=o=>{const{onFeatureClick:t,feature:r}=e;return o.stopPropagation(),t?.(o,r.id())},h={fill:(0,n.readConfObject)(t,"strokeColor",{feature:o})};String(a)===String(o.id())&&(h.fill="red");const O={fill:(0,n.readConfObject)(t,"innerColor",{feature:o})},C=(0,n.readConfObject)(t,"strokeWidth",{feature:o});return r.createElement("g",{"data-testid":o.id()},r.createElement("title",null,(0,n.readConfObject)(t,"caption",{feature:o})),r.createElement("circle",{cx:s,cy:i+l,r:l,style:h,onMouseDown:d,onMouseEnter:f,onMouseOut:M,onMouseOver:g,onMouseUp:b,onMouseLeave:y,onMouseMove:p,onClick:v,onFocus:g,onBlur:M}),l-C<=2?null:r.createElement("circle",{cx:s,cy:i+l,r:l-C,style:O,onMouseDown:d,onMouseEnter:f,onMouseOut:M,onMouseOver:g,onMouseUp:b,onMouseLeave:y,onMouseMove:p,onClick:v,onFocus:g,onBlur:M}),r.createElement(c,{feature:o,config:t,layoutRecord:u}))})),l=(0,a.observer)((function({feature:e,config:o,layoutRecord:{anchorLocation:t,y:u,data:{radiusPx:a}}}){return r.createElement("line",{x1:t,y1:0,x2:t,y2:u+2*a,stroke:(0,n.readConfObject)(o,"stickColor",{feature:e}),strokeWidth:(0,n.readConfObject)(o,"stickWidth",{feature:e})})}));function d(){return d=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},d.apply(null,arguments)}function f(e){const{feature:o,bpPerPx:t,config:r,region:a,layout:s}=e,c=Math.abs(o.get("end")+o.get("start"))/2,i=(0,u.bpToPx)(c,a,t),l=(0,n.readConfObject)(r,"radius",{feature:o});l||console.error(new Error(`lollipop radius ${l} configured for feature ${o.id()}`)),s.add(o.id(),i,2*l,2*l,{featureId:o.id(),anchorX:i,radiusPx:l,score:(0,n.readConfObject)(e.config,"score",{feature:o})})}const M=(0,a.observer)((function(e){const o=o=>{const{onMouseEnter:t}=e;return t?.(o)},t=o=>{const{onMouseLeave:t}=e;return t?.(o)},{regions:n,bpPerPx:u,layout:a,config:s,features:c=new Map,displayModel:M={}}=e,{selectedFeatureId:g}=M,b=n[0];for(const e of c.values())f({feature:e,bpPerPx:u,region:b,config:s,layout:a});const y=(b.end-b.start)/u,p=[...a.getLayout(s).values()],v=a.getTotalHeight();return r.createElement("svg",{width:y,height:v,style:{position:"relative"},onMouseDown:o=>{const{onMouseDown:t}=e;return t?.(o)},onMouseUp:o=>{const{onMouseUp:t}=e;return t?.(o)},onMouseEnter:o,onMouseLeave:t,onMouseOver:o=>{const{onMouseOver:t}=e;return t?.(o)},onMouseOut:o=>{const{onMouseOut:t}=e;return t?.(o)},onFocus:o,onBlur:t,onClick:o=>{const{onClick:t}=e;return t?.(o)}},p.map((o=>{const t=c.get(o.data.featureId);return r.createElement(r.Fragment,{key:t.id()},r.createElement(l,d({key:`stick-${t.id()}`},e,{config:s,layoutRecord:o,feature:t})),r.createElement(i,d({key:`body-${t.id()}`},e,{layoutRecord:o,feature:t,selectedFeatureId:g})))})))}))}}]);
//# sourceMappingURL=6861.66a2e4c0.chunk.js.map