"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[6838,754],{80754:function(e,t,n){n.r(t),n.d(t,{StatBars:function(){return v},YScaleBar:function(){return u.Z}});var r=n(68079),o=n(33028),a=n(96902),i=n(27664),s=n(99836),l=n(50209),c=n(4782),u=n(64335),h=n(29938);function d(e){var t=e.prefersOffset,n=(0,i.getContainingView)(e).trackLabels,r=(0,i.getContainingTrack)(e),o=(0,s.getConf)(r,"name");return"overlapping"!==n||t?10:(0,i.measureText)(o,12.8)+100}var x=(0,c.observer)((function(e){var t=e.children,n=e.model;if(e.exportSVG)return(0,h.jsx)(h.Fragment,{children:t});var r=n.height;return(0,h.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,i.getContainingView)(n).width},children:t})})),g=function(e){var t=e.color,n=void 0===t?"rgb(255,255,255,0.8)":t;return(0,h.jsx)("rect",(0,o.Z)((0,o.Z)({},e),{},{fill:n}))},m=(0,c.observer)((function(e){var t=e.model,n=t.ticks,r=t.scaleType,o=(0,i.getContainingView)(t).width,a="[".concat(null===n||void 0===n?void 0:n.values[0],"-").concat(null===n||void 0===n?void 0:n.values[1],"]")+("log"===r?" (log scale)":""),s=(0,i.measureText)(a,14),l=o-s-25;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g,{y:0,x:l,width:s+6,height:16}),(0,h.jsx)("text",{y:13,x:l,children:a})]})})),f=(0,c.observer)((function(e){var t=e.model,n=e.rowHeight,r=e.labelWidth,o=e.exportSVG,i=t.needsCustomLegend,s=t.needsScalebar,l=t.needsFullHeightScalebar,c=t.rowHeightTooSmallForScalebar,u=t.renderColorBoxes,d=t.sources,x=Math.min(n,12),m=n>11,f=u?15:0,v=r+f+5,j=(o?10:0)||(s&&!c?50:0);return d?(0,h.jsxs)(h.Fragment,{children:[l?(0,h.jsx)(g,{y:0,x:j,width:v,height:(d.length+.25)*n}):null,d.map((function(e,t){var r=Math.min(20,n);return(0,h.jsxs)(a.Fragment,{children:[l?null:(0,h.jsx)(g,{y:t*n+1,x:j,width:v,height:r}),e.color?(0,h.jsx)(g,{y:t*n+1,x:j,width:f,height:i?n:r,color:e.color}):null,m?(0,h.jsx)("text",{y:t*n+13,x:j+f+2,fontSize:x,children:e.name}):null]},"".concat(e.name,"-").concat(t))}))]}):null})),v=(0,c.observer)((function(e){var t=e.model,n=e.orientation,a=e.exportSVG,s=t.stats,l=t.needsCustomLegend,c=t.needsFullHeightScalebar,g=t.rowHeightTooSmallForScalebar,v=t.rowHeight,j=t.sources,p=t.ticks,w=Math.min(v,12),b=v>11,S=(0,i.getContainingView)(t).width;if(!(s&&j))return null;var C=Math.max.apply(Math,(0,r.Z)(j.map((function(e){return(0,i.measureText)(e.name,w)})).map((function(e){return b?e:20}))||[0]));return(0,h.jsx)(x,(0,o.Z)((0,o.Z)({},e),{},{children:c?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("g",{transform:"translate(".concat(a?0:d(t),",0)"),children:(0,h.jsx)(u.Z,{model:t,orientation:n})}),(0,h.jsx)("g",{transform:"translate(".concat(S-C-100,",0)"),children:(0,h.jsx)(f,{exportSVG:a,model:t,rowHeight:12,labelWidth:C})})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(f,{exportSVG:a,model:t,rowHeight:t.rowHeight,labelWidth:C}),g||l?(0,h.jsx)(m,(0,o.Z)({},e)):j.map((function(e,r){return(0,h.jsx)("g",{transform:"translate(0 ".concat(v*r,")"),children:(0,h.jsx)(u.Z,{model:t,orientation:n})},"".concat(JSON.stringify(p),"-").concat(r))}))]})}))}));t.default=(0,c.observer)((function(e){var t=e.model;return(0,h.jsxs)("div",{children:[(0,h.jsx)(l.qb,(0,o.Z)({},e)),(0,h.jsx)(v,{model:t})]})}))},76838:function(e,t,n){n.r(t),n.d(t,{renderSvg:function(){return c}});var r=n(32723),o=n(34795),a=(n(96902),n(27664)),i=n(75717),s=n(80754),l=n(29938);function c(e,t,n){return u.apply(this,arguments)}function u(){return(u=(0,o.Z)((0,r.Z)().mark((function e(t,n,o){var c,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.when)((function(){return!!t.stats&&!!t.regionCannotBeRenderedText}));case 2:return c=(0,a.getContainingView)(t),u=c.offsetPx,e.t0=l.jsxs,e.t1=l.Fragment,e.t2=l.jsx,e.next=8,o(n);case 8:return e.t3=e.sent,e.t4={id:"snpcov",children:e.t3},e.t5=(0,e.t2)("g",e.t4),e.t6=(0,l.jsx)("g",{transform:"translate(".concat(Math.max(-u,0),")"),children:(0,l.jsx)(s.StatBars,{model:t,orientation:"left",exportSVG:!0})}),e.t7=[e.t5,e.t6],e.t8={children:e.t7},e.abrupt("return",(0,e.t0)(e.t1,e.t8));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}}]);
//# sourceMappingURL=6838.019f6bce.chunk.js.map