UNPKG

auspice

Version:

Web app for visualizing pathogen evolution

1 lines 42 kB
(self.webpackChunkauspice=self.webpackChunkauspice||[]).push([[631],{62631(t,e,s){"use strict";s.r(e),s.d(e,{default:()=>nt});var n=s(15031),o=s.n(n),i=s(78281),r=s(43979),a=s.n(r),l=s(49633),c=s(59773),h=s(69646),d=(s(71595),s(28355)),u=s(26225),f=s(68087),p=s(4124),m=s(97195),v=s(56821),y=s(62865),g=s(91277),b=s(28833),x=s(24790),C=s(51914),w=s.n(C),S=s(32438),_=s(40952),M=s(48617);function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function P(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,n)}return s}function z(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?P(Object(s),!0).forEach(function(e){N(t,e,s[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):P(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))})}return t}function N(t,e,s){return(e=function(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=E(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var s=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=s){var n,o,i,r,a=[],l=!0,c=!1;try{if(i=(s=s.call(t)).next,0===e){if(Object(s)!==s)return;l=!1}else for(;!(l=(n=i.call(s)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=s.return&&(r=s.return(),Object(r)!==r))return}finally{if(c)throw o}}return a}}(t,e)||B(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!s){if(Array.isArray(t)||(s=B(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,a=!1;return{s:function(){s=s.call(t)},n:function(){var t=s.next();return r=t.done,t},e:function(t){a=!0,i=t},f:function(){try{r||null==s.return||s.return()}finally{if(a)throw i}}}}function O(t){return function(t){if(Array.isArray(t))return j(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||B(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t,e){if(t){if("string"==typeof t)return j(t,e);var s={}.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?j(t,e):void 0}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=Array(e);s<e;s++)n[s]=t[s];return n}var Y=function(t,e,s){this.svg=(0,c.A)(t),this.genomeMap=e,this.callbacks=s,this.okToDrawBars=!1};function D(t,e,s){return(e-5)/t.length>s?t:null}Y.prototype.render=function(t){this.props=t,this.selectedCds=t.selectedCds,this.selectedPositions=t.selectedPositions,this.aa="nuc"!==this.selectedCds,this.showCounts=t.showCounts,this.bars=t.bars,this._setSelectedNodes(),this.svg.selectAll("*").remove(),this._calcOffsets(t.width,t.height),this._createGroups(),this._setScales(t.maxYVal),this._setZoomBounds(),this._setZoomCoordinates(t.zoomMin,t.zoomMax),this._drawAxes(),this._setUpZoomBrush(),this._drawNavCds(),this._drawMainCds(),this.okToDrawBars=!0,this._drawBars()},Y.prototype.update=function(t){var e=this,s=t.selectedCds,n=void 0===s?void 0:s,o=t.selectedPositions,i=void 0===o?void 0:o,r=t.newBars,a=void 0===r?void 0:r,l=t.showCounts,c=void 0===l?void 0:l,h=t.zoomMax,d=void 0===h?void 0:h,u=t.zoomMin,f=void 0===u?void 0:u;n&&(this.selectedCds=n,this._setUpZoomBrushWrapping(),this.aa="nuc"!==this.selectedCds,this._setZoomBounds()),void 0!==c&&(this.showCounts=c),a||void 0!==i?(a&&(this.bars=a[0],this._updateOffsets(),this._updateMainScaleAndAxis(a[1]),this._drawNavCds()),void 0!==i&&(this.selectedPositions=i),(n||void 0!==i)&&this._setZoomCoordinates(f,d,!!n),this._groups.navBrush.call(this.brush.move,function(){return e.zoomCoordinates.map(e.scales.xNav)}),void 0!==i&&(this._clearSelectedBars(),this._setSelectedNodes(),this._highlightSelectedBars())):void 0===f&&void 0===d||(this._setZoomCoordinates(f,d,!1),this._groups.navBrush.call(this.brush.move,function(){return e.zoomCoordinates.map(e.scales.xNav)}))},Y.prototype._setZoomBounds=function(){if(this.aa){var t=this.selectedCds.segments.map(function(t){return t.rangeGenome}).flat();this.zoomBounds=[Math.min.apply(Math,O(t)),Math.max.apply(Math,O(t))]}else this.zoomBounds=O(this.genomeMap[0].range)},Y.prototype._setZoomCoordinates=function(t,e,s){if(s&&this.zoomCoordinates&&(this.zoomCoordinates=void 0),this.selectedCds===_.Sc){var n,o=this.scales.xNav.domain();if(null!==(n=this.selectedPositions)&&void 0!==n&&n.length){var i=Math.min.apply(Math,O(this.selectedPositions)),r=Math.max.apply(Math,O(this.selectedPositions));if(this.zoomCoordinates&&(this.zoomCoordinates[0]!==o[0]||this.zoomCoordinates[1]!==o[1])&&i>this.zoomCoordinates[0]&&r<this.zoomCoordinates[1])return;var a=Math.floor(.05*o[1]);a>1e3&&(a=1e3),this.zoomCoordinates=[i-a,r+a]}else this.zoomCoordinates=o;(t||e)&&(t&&(this.zoomCoordinates[0]=t),e&&(this.zoomCoordinates[1]=e),this.zoomCoordinates[0]>=this.zoomCoordinates[1]&&(t&&(this.zoomCoordinates=[t,o[1]]),e&&(this.zoomCoordinates=[o[0],e]))),this.zoomCoordinates[0]<o[0]&&(this.zoomCoordinates[0]=o[0]),this.zoomCoordinates[1]>o[1]&&(this.zoomCoordinates[1]=o[1])}else{var l=this.selectedCds.segments;this.selectedCds.isWrapping?("+"===this.selectedCds.strand?this.zoomCoordinates=[l[l.length-1].rangeGenome[1],l[0].rangeGenome[0]]:this.zoomCoordinates=[l[0].rangeGenome[1],l[l.length-1].rangeGenome[0]],t&&t<this.zoomCoordinates[0]&&(this.zoomCoordinates[0]=t),e&&e>this.zoomCoordinates[0]&&(this.zoomCoordinates[1]=e)):(this.zoomCoordinates=O(this.zoomBounds),t&&t>this.zoomCoordinates[0]&&t<this.zoomCoordinates[1]&&(this.zoomCoordinates[0]=t),e&&e>this.zoomCoordinates[0]&&e<this.zoomCoordinates[1]&&(this.zoomCoordinates[1]=e))}},Y.prototype._setSelectedNodes=function(){if(this.selectedNodes=[],this.selectedPositions.length&&this.bars)if(this.aa){var t,e=A(this.bars);try{for(e.s();!(t=e.n()).done;){var s,n=t.value,o=A(this.selectedPositions);try{for(o.s();!(s=o.n()).done;){var i=s.value;n.codon===i&&this.selectedNodes.push(n)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){e.e(t)}finally{e.f()}}else{var r,a=A(this.bars);try{for(a.s();!(r=a.n()).done;){var l=r.value;-1!==this.selectedPositions.indexOf(l.x)&&this.selectedNodes.push(l)}}catch(t){a.e(t)}finally{a.f()}}},Y.prototype._drawMainCds=function(){var t=this;this._groups.mainCds.selectAll("*").remove();var e=k(this.scales.xMain.domain(),2),s=e[0],n=e[1];if(this.selectedCds!==_.Sc)return this._groups.mainCds.selectAll(".cds").data(this._cdsSegments({selected:!0})).enter().append("rect").attr("class","gene").attr("x",function(e){return t.scales.xMain(Math.max(e.rangeLocal[0]-.5,s))}).attr("y",0).attr("width",function(e){return t.scales.xMain(Math.min(e.rangeLocal[1]+.5,n))-t.scales.xMain(Math.max(e.rangeLocal[0]-.5,s))}).attr("height",this.offsets.mainCdsRectHeight).style("fill",this.selectedCds.color).style("stroke","#fff").style("stroke-width",2).style("opacity",1).on("mouseover",function(e){t.callbacks.onHover({d3event:m.f0,tooltip:t._cdsTooltip(e)})}).on("mouseout",function(e){t.callbacks.onLeave(e)}),void this._groups.mainCds.append("text").attr("x",function(){var e=t.scales.xMain(Math.max(1,s));return e+(t.scales.xMain(Math.min(t.selectedCds.length,n))-e)/2}).attr("y",1).attr("pointer-events","none").attr("text-anchor","middle").attr("dominant-baseline","hanging").style("fill","white").style("font-size","".concat(this.offsets.mainCdsRectHeight-2,"px")).text(function(){return t.selectedCds.name});var o=this._cdsSegments({range:[s,n]}).map(function(e){var o=[t.scales.xMain(Math.max(e.rangeGenome[0]-.5,s)),t.scales.xMain(Math.min(e.rangeGenome[1]+.5,n))],i=(e.cds.stackPosition-1)*t.offsets.mainCdsJitter;return z({rangePx:o,yPx:"+"===e.cds.strand?t.offsets.mainCdsPositiveDelta-i-t.offsets.mainCdsRectHeight:t.offsets.mainCdsNegativeDelta+i},e)});this._groups.mainCds.selectAll(".cds").data(o).enter().append("path").attr("class","gene").attr("d",function(e){return function(t,e){var s=e.mainCdsRectHeight,n=Math.floor(t.rangePx[1]-t.rangePx[0]),o=Math.round(t.rangePx[0]);if(n<20)return"M ".concat(o,",").concat(t.yPx," h ").concat(n," v ").concat(s," h -").concat(n," Z");var i=Math.floor(Math.min(n/4,10));n-=i;var r=s/2;return"+"===t.cds.strand?"M ".concat(o,",").concat(t.yPx," h ").concat(n," l ").concat(i,",").concat(r," l -").concat(i,",").concat(r," h -").concat(n," Z"):(o=Math.round(t.rangePx[1]),"M ".concat(o,",").concat(t.yPx," h -").concat(n," l -").concat(i,",").concat(r," l ").concat(i,",").concat(r," h ").concat(n," Z"))}(e,t.offsets)}).style("fill",function(t){return t.cds.color}).style("opacity",.7).on("mouseover",function(e){t.callbacks.onHover({d3event:m.f0,tooltip:t._cdsTooltip(e)})}).on("mouseout",this.callbacks.onLeave).on("click",this.callbacks.onCdsClick).style("cursor","pointer"),this._groups.mainCds.selectAll(".cdsText").data(o).enter().append("text").attr("x",function(t){return t.rangePx[0]+.5*(t.rangePx[1]-t.rangePx[0])}).attr("y",function(t){return t.yPx+1}).attr("pointer-events","none").attr("text-anchor","middle").attr("dominant-baseline","hanging").style("font-size","".concat(this.offsets.mainCdsRectHeight-2,"px")).style("fill","white").text(function(t){return D(t.cds.name,t.rangePx[1]-t.rangePx[0],10)})},Y.prototype._drawNavCds=function(){var t=this;this._groups.navCds.selectAll("*").remove();var e=this._cdsSegments({}).map(function(e){return z({rangePx:e.rangeGenome.map(t.scales.xNav),yPx:"+"===e.cds.strand?t.offsets.navCdsPositiveStrandSpace-e.cds.stackPosition*t.offsets.navCdsRectHeight:t.offsets.navCdsNegativeY1Delta+(e.cds.stackPosition-1)*t.offsets.navCdsRectHeight},e)});this._groups.navCds.selectAll(".cdsNav").data(e).enter().append("rect").attr("class","gene").attr("x",function(t){return t.rangePx[0]}).attr("y",function(t){return t.yPx}).attr("width",function(t){return t.rangePx[1]-t.rangePx[0]}).attr("height",this.offsets.navCdsRectHeight).style("fill",function(t){return t.cds.color}).style("fill-opacity",function(e){return t.selectedCds===_.Sc||e.cds.name===t.selectedCds.name?1:.3}).style("stroke","#fff").style("stroke-width",1).on("mouseover",function(e){t.callbacks.onHover({d3event:m.f0,tooltip:t._cdsTooltip(e)})}).on("mouseout",function(e){t.callbacks.onLeave(e)}).on("click",this.callbacks.onCdsClick).style("cursor","pointer"),this._groups.navCds.selectAll(".cdsNavText").data(e).enter().append("text").attr("x",function(t){return t.rangePx[0]+.5*(t.rangePx[1]-t.rangePx[0])}).attr("y",function(t){return t.yPx+2}).attr("pointer-events","none").attr("text-anchor","middle").attr("dominant-baseline","hanging").style("font-size","".concat(this.offsets.navCdsRectHeight-2,"px")).style("fill","#fff").text(function(t){return D(t.cds.name,t.rangePx[1]-t.rangePx[0],7.5)})},Y.prototype._cdsSegments=function(t){var e=this,s=t.range,n=void 0===s?void 0:s,o=t.selected,i=void 0!==o&&o,r=[];return this.genomeMap[0].genes.forEach(function(t){t.cds.forEach(function(s){i&&s.name!==e.selectedCds.name||s.segments.forEach(function(e){if(!n||!(e.rangeGenome[1]<n[0]||e.rangeGenome[0]>n[1])){var o=z({},e);o.cds=s,o.gene=t,r.push(o)}})})}),r},Y.prototype._clearSelectedBars=function(){var t,e=A(this.selectedNodes);try{for(e.s();!(t=e.n()).done;){var s=t.value,n=this.aa?"#cds-".concat(this.selectedCds.name,"-").concat(s.codon):"#nt".concat(s.x);(0,c.A)(n).style("fill",p.KD)}}catch(t){e.e(t)}finally{e.f()}this.selectedNodes=[]},Y.prototype._highlightSelectedBars=function(){var t,e=A(this.selectedNodes);try{for(e.s();!(t=e.n()).done;){var s=t.value,n=this.aa?"#cds-".concat(this.selectedCds.name,"-").concat(s.codon):"#nt".concat(s.x);(0,c.A)(n).style("fill","red")}}catch(t){e.e(t)}finally{e.f()}},Y.prototype._drawLoadingState=function(){var t=this;this._groups.mainBars.append("rect").attr("class","loading").attr("x",0).attr("y",0).attr("width",function(){return t.scales.xMain.range()[1]}).attr("height",function(){return t.scales.y.range()[0]}).attr("fill-opacity",.1),this._groups.mainBars.append("text").attr("y",function(){return t.scales.y.range()[0]/2}).attr("x",function(){return t.scales.xMain.range()[1]/2}).attr("pointer-events","none").attr("text-anchor","middle").attr("dominant-baseline","middle").style("fill",p.KD).style("font-size","5rem").style("font-weight",200).text("data loading")},Y.prototype._drawBars=function(){var t=this;if(this.okToDrawBars){if(this._groups.mainBars.selectAll("*").remove(),!this.bars)return this._drawLoadingState();if(0!==this.bars.length){var e=this.scales.xMain.domain()[0],s=this.scales.xMain(e+1)-this.scales.xMain(e);this.aa&&(s*=3),(s*=.9)<1.5&&(s=1.5);var n=this.aa?function(e){return"cds-".concat(t.selectedCds.name,"-").concat(e.codon)}:function(t){return"nt"+t.x},o=s/2;this._groups.mainBars.selectAll(".bar").data(this.bars).enter().append("rect").attr("class","bar").attr("id",n).attr("x",function(e){return t.aa?t.scales.xMain(3*(e.codon-1)+2)-o:t.scales.xMain(e.x)-o}).attr("y",function(e){return t.scales.y(e.y)}).attr("width",s).attr("height",function(e){return t.offsets.heightMainBars-t.scales.y(e.y)}).style("fill",p.KD).on("mouseover",function(e){t.callbacks.onHover({d3event:m.f0,tooltip:t.aa?t._mainTooltipAa(e):t._mainTooltipNuc(e)})}).on("mouseout",function(e){t.callbacks.onLeave(e)}).on("click",function(e){t.callbacks.onClick(e)}).style("cursor","pointer"),this._highlightSelectedBars()}else this._groups.mainBars.append("text").attr("x",function(){return t.scales.xMain.range()[1]/2}).attr("y",function(){return t.scales.y.range()[0]/2}).attr("pointer-events","none").attr("text-anchor","middle").attr("dominant-baseline","middle").style("fill",p.KD).style("font-size","3rem").style("font-weight",300).text(this.aa?"No mutations for ".concat(this.selectedCds.name):"No nucleotide mutations")}},Y.prototype._setScales=function(t){this.scales={};var e=this.genomeMap[0].range,s=this.selectedCds===_.Sc?e[1]:this.selectedCds.length,n=this.selectedCds===_.Sc?e[0]:0;this.scales.xMain=(0,v.A)().domain([n,s]).range([0,this.offsets.widthNarrow]),this.scales.xNav=(0,v.A)().domain(O(e)).range([0,this.offsets.width]),this.scales.y=(0,v.A)().domain([0,t]).range([this.offsets.heightMainBars,0]),this.scales.xMainUpperLimit=s},Y.prototype._drawAxes=function(){var t=this;this.axes={},this.axes.y=(0,y.V4)(this.scales.y).ticks(4),this.axes.xMain=(0,y.l7)(this.scales.xMain).ticks(16).tickFormat(function(e){return t.aa?Math.ceil(e/3):e}),this.axes.xNav=(0,y.l7)(this.scales.xNav).ticks(20,",f"),this.scales.xNav.domain()[1]-this.scales.xNav.domain()[0]>1e6&&this.axes.xNav.tickFormat((0,g.GP)(".1e")),this._groups.mainXAxis.append("text").attr("class","axisLabel").attr("y",7).attr("x",-2).attr("pointer-events","none").attr("text-anchor","end").attr("dominant-baseline","hanging").style("fill",p.KD).style("font-size","12px").text("AA pos").style("visibility",this.aa?"visible":"hidden"),this._groups.mainYAxis.call(this.axes.y),this._groups.mainXAxis.call(this.axes.xMain),this._groups.navXAxis.call(this.axes.xNav)},Y.prototype._updateMainScaleAndAxis=function(t){var e=this.genomeMap[0].range,s=this.selectedCds===_.Sc?e[1]:this.selectedCds.length,n=this.selectedCds===_.Sc?e[0]:0;this.scales.xMain.domain()[1]!==s&&(this._groups.mainBars.attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainY1+")"),this._groups.mainCds.attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainCdsY1+")"),this._groups.mainXAxis.attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainAxisY1+")"),this._groups.mainClip.select("#cliprect").attr("width",this.offsets.widthNarrow).attr("height",this.offsets.heightMainBars),this.scales.xMain.domain([n,s]).range([0,this.offsets.widthNarrow]),this.scales.xMainUpperLimit=s,this._groups.mainXAxis.call(this.axes.xMain)),this._groups.mainXAxis.select(".axisLabel").style("visibility",this.aa?"visible":"hidden"),this.scales.y.domain([0,t]).range([this.offsets.heightMainBars,0]),this._groups.mainYAxis.call(this.axes.y)},Y.prototype._calcOffsets=function(t,e){var s=this.genomeMap[0].metadata,n=s.strandsObserved.has("+")?13*s.posStrandStackHeight:0,o=s.strandsObserved.has("-")?13*s.negStrandStackHeight:0,i=s.strandsObserved.has("+")?16+8*(s.posStrandStackHeight-1):0,r=s.strandsObserved.has("-")?16+8*(s.negStrandStackHeight-1):0;this.offsets={},this.offsets.tinySpace=2,this.offsets.brushHandleHeight=14,this.offsets.navCdsRectHeight=13,this.offsets.navAxisY1=e-0-this.offsets.brushHandleHeight-20-o,this.offsets.navCdsY1=this.offsets.navAxisY1-2-n,this.offsets.navCdsPositiveStrandSpace=n,this.offsets.navCdsNegativeY1Delta=this.offsets.navAxisY1+20-this.offsets.navCdsY1,this.offsets.brushY1=this.offsets.navCdsY1-2,this.offsets.brushHeight=this.offsets.navCdsNegativeY1Delta+o+4,this.offsets.mainAxisY1=this.offsets.brushY1-2-20,this.aa?this.offsets.mainCdsY1=this.offsets.mainAxisY1-2-16:this.offsets.mainCdsY1=this.offsets.mainAxisY1-2-r-2-i,this.offsets.mainCdsNegativeStrandSpace=r,this.offsets.mainCdsPositiveStrandSpace=i,this.offsets.mainCdsPositiveDelta=i,this.offsets.mainCdsNegativeDelta=i+2,this.offsets.mainCdsJitter=8,this.offsets.mainCdsRectHeight=16,this.offsets.mainY1=10,this.offsets.heightMainBars=this.offsets.mainCdsY1-this.offsets.mainY1-2,this.offsets.x1=30,this.offsets.width=t-this.offsets.x1-15,this.offsets.xMainInternalPad=20,this.aa?(this.offsets.x1Narrow=this.offsets.x1+this.offsets.xMainInternalPad,this.offsets.widthNarrow=this.offsets.width-2*this.offsets.xMainInternalPad):(this.offsets.x1Narrow=this.offsets.x1,this.offsets.widthNarrow=this.offsets.width)},Y.prototype._updateOffsets=function(){this.aa?(this.offsets.x1Narrow=this.offsets.x1+this.offsets.xMainInternalPad,this.offsets.widthNarrow=this.offsets.width-2*this.offsets.xMainInternalPad,this.offsets.mainCdsY1=this.offsets.mainAxisY1-this.offsets.tinySpace-this.offsets.mainCdsRectHeight):(this.offsets.x1Narrow=this.offsets.x1,this.offsets.widthNarrow=this.offsets.width,this.offsets.mainCdsY1=this.offsets.mainAxisY1-this.offsets.tinySpace-this.offsets.mainCdsNegativeStrandSpace-this.offsets.tinySpace-this.offsets.mainCdsPositiveStrandSpace),this.offsets.heightMainBars=this.offsets.mainCdsY1-this.offsets.mainY1-this.offsets.tinySpace},Y.prototype._setUpZoomBrush=function(){var t=this;this.brush=(0,x.n5)().extent([[0,0],[this.offsets.width,this.offsets.brushHeight]]).on("brush",function(){t._brushChanged()}).on("end",function(){t._brushChanged(!0),t._dispatchZoomCoordinates()}),this._groups.navBrush.attr("class","brush").attr("stroke-width",0).call(this.brush).call(this.brush.move,function(){return t.zoomCoordinates.map(t.scales.xNav)});var e=this.offsets.brushHandleHeight-4;this.brushHandle=this._groups.navBrush.selectAll(".handle--custom").data([{type:"w"},{type:"e"}]).enter().append("path").attr("class","handle--custom").attr("stroke",p.KD).attr("stroke-width",2).attr("cursor",function(e,s){return t.zoomCoordinates[s]===t.zoomBounds[s]?0===s?"e-resize":"w-resize":"ew-resize"}).attr("d","M0,0 -5,".concat(e," 5,").concat(e," Z")).attr("transform",function(e){return"e"===e.type?"translate(".concat(t.scales.xNav(t.zoomCoordinates[1]),",").concat(t.offsets.brushHeight,")"):"translate(".concat(t.scales.xNav(t.zoomCoordinates[0]),",").concat(t.offsets.brushHeight,")")}),this._setUpZoomBrushWrapping()},Y.prototype._setUpZoomBrushWrapping=function(){var t,e=this;null===(t=this._navBrushWrappingSelection)||void 0===t||t.remove(),this._navBrushWrappingSelection=void 0,this._groups.navBrush.select(".selection").attr("fill-opacity",.3),this.selectedCds!==_.Sc&&!1!==this.selectedCds.isWrapping&&(this._navBrushWrappingSelection=this._groups.navBrushWrapping.selectAll(".selection-wrapping").data(this.zoomCoordinates).enter().append("rect").attr("class","selection-wrapping").attr("x",function(t,s){return 0===s?0:e.scales.xNav(t)}).attr("y",0).attr("width",function(t,s){return 0===s?e.scales.xNav(t):e.offsets.width-e.scales.xNav(t)}).attr("height",this.offsets.brushHeight).attr("fill","#777").attr("fill-opacity",.3),this._groups.navBrush.select(".selection").attr("fill-opacity",0))},Y.prototype._dispatchZoomCoordinates=function(){this.props.dispatch((0,S.yr)(this.zoomCoordinates))},Y.prototype._brushChanged=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=(m.f0.selection||this.scales.xNav.range()).map(this.scales.xNav.invert,this.scales.xNav);if(this.zoomCoordinates=s.map(Math.round),this.selectedCds===_.Sc)this.scales.xMain.domain(this.zoomCoordinates);else{var n=k((0,M.fK)(this.selectedCds,this.zoomCoordinates),2),o=n[0];n[1]?this.scales.xMain.domain(o):(this._setZoomCoordinates(),this._groups.navBrush.call(this.brush.move,function(){return t.zoomCoordinates.map(t.scales.xNav)}))}this.axes.xMain=this.axes.xMain.scale(this.scales.xMain),this._groups.mainXAxis.call(this.axes.xMain),this._drawBars(),this._drawMainCds(),this.brushHandle&&(this.brushHandle.attr("display",null).attr("transform",function(e,s){return"translate(".concat(t.scales.xNav(t.zoomCoordinates[s]),",").concat(t.offsets.brushHeight,")")}),e&&this._groups.navBrush.selectAll(".handle--custom").attr("cursor",function(e,s){return t.zoomCoordinates[s]===t.zoomBounds[s]?0===s?"e-resize":"w-resize":"ew-resize"})),this._navBrushWrappingSelection&&this._navBrushWrappingSelection.attr("x",function(e,s){return 0===s?0:t.scales.xNav(t.zoomCoordinates[1])}).attr("width",function(e,s){return 0===s?t.scales.xNav(t.zoomCoordinates[0]):t.offsets.width-t.scales.xNav(t.zoomCoordinates[1])})},Y.prototype._setUpMousewheelZooming=function(){var t=this,e=[[this.offsets.x1Narrow,this.offsets.mainY1],[this.offsets.widthNarrow,this.offsets.heightMainBars+this.offsets.mainY1]],s=(0,b.s_)().translateExtent(e).extent(e).on("zoom",function(){var e=m.f0.transform,s=t.zoomCoordinates[1]-t.zoomCoordinates[0],n=(s-s/e.k)/2,o=[Math.max(t.zoomCoordinates[0]+n,t.scales.xNav(0)),Math.min(t.zoomCoordinates[1]-n,t.scales.xNav.domain()[1])];o[1]-o[0]<500&&e.k>1||(t.zoomCoordinates=o,e.rescaleX(t.scales.xMain),t._groups.navBrush.call(t.brush.move,function(){return t.zoomCoordinates.map(t.scales.xNav)}))}),n=["option","shift"];w().bind(n,function(){t._groups.keyPressOverlay=t.svg.append("rect").attr("class","overlay").attr("text","zoom").attr("transform","translate("+t.offsets.x1Narrow+","+t.offsets.mainY1+")").attr("width",t.offsets.widthNarrow).attr("height",t.offsets.navCdsY1-t.offsets.mainY1).call(s).on("wheel",function(){m.f0.preventDefault()})},"keydown"),w().bind(n,function(){t._groups.keyPressOverlay&&t._groups.keyPressOverlay.remove()},"keyup")},Y.prototype._createGroups=function(){this._groups={},this._groups.mainBars=this.svg.append("g").attr("id","mainBars").attr("clip-path","url(#clip)").attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainY1+")"),this._groups.navBrush=this.svg.append("g").attr("id","navBrush").attr("transform","translate("+this.offsets.x1+","+this.offsets.brushY1+")"),this._groups.navBrushWrapping=this.svg.append("g").attr("id","navBrushWrapping").attr("transform","translate("+this.offsets.x1+","+this.offsets.brushY1+")"),this._groups.navCds=this.svg.append("g").attr("id","navCds").attr("transform","translate("+this.offsets.x1+","+this.offsets.navCdsY1+")"),this._groups.mainCds=this.svg.append("g").attr("id","mainCds").attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainCdsY1+")"),this._groups.mainYAxis=this.svg.append("g").attr("id","entropyYAxis").attr("transform","translate("+this.offsets.x1+","+this.offsets.mainY1+")"),this._groups.mainXAxis=this.svg.append("g").attr("id","mainXAxis").attr("transform","translate("+this.offsets.x1Narrow+","+this.offsets.mainAxisY1+")"),this._groups.navXAxis=this.svg.append("g").attr("id","navXAxis").attr("transform","translate("+this.offsets.x1+","+this.offsets.navAxisY1+")"),this._groups.mainClip=this.svg.append("g").attr("id","mainClip"),this._groups.mainClip.append("clipPath").attr("class","clipPath").attr("id","clip").append("rect").attr("id","cliprect").attr("x",0).attr("y",0).attr("width",this.offsets.widthNarrow).attr("height",this.offsets.heightMainBars)},Y.prototype._mainTooltipAa=function(t){return function(e){var s=(0,M.ln)(this.genomeMap,this.selectedCds.name);if(!s)return console.error("CDS ".concat(this.selectedCds.name," not found in genomeMap (i.e. JSON annotations)")),null;var n=(0,M.WF)(s,t.codon),o=n.frame,r=n.nucCoordinates;return i.createElement("div",{className:"tooltip",style:p.vS.tooltip},i.createElement("div",null,e("Codon {{codon}} in protein {{protein}}",{codon:t.codon,protein:this.selectedCds.name})),i.createElement("p",null),i.createElement("div",null,e("Nuc positions {{positions}}",{positions:r.join(", ")})),i.createElement("p",null),i.createElement("div",null,"-"===s.strand?"Negative strand":"Positive strand".concat("+"!==s.strand?" (assumed)":""),", ".concat(o)),i.createElement("p",null),i.createElement("div",null,this.showCounts?"".concat(e("Num changes observed"),": ").concat(t.y):"".concat(e("Normalised Shannon entropy"),": ").concat(t.y)),i.createElement("div",{style:p.vS.comment},e("Click to color tree & map by this genotype"),i.createElement("br",null),e("Shift+click to add/remove positions")))}.bind(this)},Y.prototype._mainTooltipNuc=function(t){return function(e){var s,n=t.x,o=(0,M.BR)(this.genomeMap,n);return s=o?i.createElement("div",null,"Overlaps with ".concat(o.length," CDS segment").concat(o.length>1?"s":"",":"),i.createElement("p",null),i.createElement("table",{className:"entropy-table"},i.createElement("tbody",null,i.createElement("tr",{key:"header"},i.createElement("td",{style:{minWidth:"60px"}},"CDS"),i.createElement("td",null,"Nt Pos (in CDS)"),i.createElement("td",null,"AA Pos")),o.map(function(t){return i.createElement("tr",{key:t.cds.name+t.nucLocal},i.createElement("td",null,t.cds.name),i.createElement("td",null,t.nucLocal),i.createElement("td",null,t.aaLocal))})))):i.createElement("div",null,e("No overlapping CDSs")),i.createElement("div",{className:"tooltip",style:p.vS.tooltip},i.createElement("div",null,e("Nucleotide {{nuc}}",{nuc:n})),i.createElement("p",null),s,i.createElement("p",null),i.createElement("div",null,this.showCounts?"".concat(e("Num changes observed"),": ").concat(t.y):"".concat(e("Normalised Shannon entropy"),": ").concat(t.y)),i.createElement("div",{style:p.vS.comment},e("Click to color tree & map by this genotype"),i.createElement("br",null),e("Shift+click to add/remove positions")))}.bind(this)},Y.prototype._cdsTooltip=function(t){return function(e){var s,n,o,r,a,l=t.cds.segments.length>1;return i.createElement("div",{className:"tooltip entropy",style:p.vS.tooltip},i.createElement("table",{className:"entropy-table"},i.createElement("tbody",null,t.cds.displayName&&i.createElement("tr",null,i.createElement("td",null,"Name"),i.createElement("td",null,t.cds.displayName)),i.createElement("tr",null,i.createElement("td",null,"CDS name"),i.createElement("td",null,t.cds.name)),t.cds.description&&i.createElement("tr",null,i.createElement("td",null,"Description"),i.createElement("td",null,t.cds.description)),t.cds.name!==t.gene.name&&i.createElement("tr",null,i.createElement("td",null,"Gene name"),i.createElement("td",null,t.gene.name)),i.createElement("tr",null,i.createElement("td",null,"CDS length"),i.createElement("td",null,"".concat(t.cds.length/3," amino acids"))),l?i.createElement(i.Fragment,null,i.createElement("tr",null,i.createElement("td",null,"CDS segment"),i.createElement("td",null,"".concat(t.segmentNumber,"/").concat(t.cds.segments.length))),i.createElement("tr",null,i.createElement("td",null,"Segment length"),i.createElement("td",null,(n=t.rangeLocal,o=n[1]-n[0]+1,r=o%3,a=String(Math.floor(o/3)),r&&(a+=1===r?" ⅓":" ⅔"),a+" amino acids"))),i.createElement("tr",null,i.createElement("td",null,"Segment coords"),i.createElement("td",null,t.rangeGenome.join(" - ")+" (genome coordinates)"))):i.createElement("tr",null,i.createElement("td",null,"CDS coords"),i.createElement("td",null,t.rangeGenome.join(" - ")+" (genome coordinates)")),i.createElement("tr",null,i.createElement("td",null,"Strand"),i.createElement("td",null,"+"===t.cds.strand?"Positive":"Negative")),i.createElement("tr",null,i.createElement("td",null,"Frame"),i.createElement("td",null,"".concat(t.frame," (").concat("+"===t.cds.strand?"F":"R").concat(t.frame,")"))),i.createElement("tr",null,i.createElement("td",{style:{minWidth:"100px"}},"Phase"),i.createElement("td",null,t.phase)))),(null===(s=this.selectedCds)||void 0===s?void 0:s.name)!==t.cds.name&&i.createElement("div",{style:p.vS.comment},e("Click to view this CDS in isolation")))}.bind(this)};const H=Y,T=function(t){var e=t.d3event,s=t.width,n=t.height,o=t.children;if(!e)return null;var r={container:{position:"absolute",maxWidth:500,padding:"10px",borderRadius:10,zIndex:1e3,pointerEvents:"none",fontFamily:p.vS.panel.fontFamily,fontSize:14,lineHeight:1,fontWeight:p.vS.panel.fontWeight,color:p.vS.panel.color,backgroundColor:p.vS.panel.backgroundColor,wordWrap:"break-word",wordBreak:"break-word"}},a={x:e.layerX,y:e.layerY};return a.x<.7*s?r.container.left=a.x:r.container.right=s-a.x,a.y<.5*n?r.container.top=a.y:r.container.bottom=n-a.y,i.createElement("div",{style:r.container},o)};var L,R,W=s(99438),I=(s(66565),s(21143)),Z=s(22137);function G(t){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(t)}function U(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,n)}return s}function X(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?U(Object(s),!0).forEach(function(e){tt(t,e,s[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):U(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))})}return t}function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var s=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=s){var n,o,i,r,a=[],l=!0,c=!1;try{if(i=(s=s.call(t)).next,0===e){if(Object(s)!==s)return;l=!1}else for(;!(l=(n=i.call(s)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=s.return&&(r=s.return(),Object(r)!==r))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return K(t,e);var s={}.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?K(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=Array(e);s<e;s++)n[s]=t[s];return n}function V(t,e){for(var s=0;s<e.length;s++){var n=e[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,et(n.key),n)}}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q(t,e)}function J(t){var e=$();return function(){var s,n=Q(t);if(e){var o=Q(this).constructor;s=Reflect.construct(n,arguments,o)}else s=n.apply(this,arguments);return function(t,e){if(e&&("object"==G(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,s)}}function $(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($=function(){return!!t})()}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}function tt(t,e,s){return(e=et(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function et(t){var e=function(t){if("object"!=G(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=G(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==G(e)?e:e+""}s(19596);var st=(0,l.Ng)(function(t){return{selectedCds:t.entropy.selectedCds,selectedPositions:t.entropy.selectedPositions,bars:t.entropy.bars,genomeMap:t.entropy.genomeMap,maxYVal:t.entropy.maxYVal,showCounts:t.entropy.showCounts,loaded:t.entropy.loaded,onScreen:t.entropy.onScreen,colorBy:t.controls.colorBy,zoomMin:t.controls.zoomMin,zoomMax:t.controls.zoomMax,defaultColorBy:t.controls.defaults.colorBy,panelLayout:t.controls.panelLayout,narrativeMode:t.narrative.display,showOnlyPanels:t.controls.showOnlyPanels}})((R=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&q(t,e)}(r,t);var e,s,n=J(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=n.call(this,t)).state={hovered:!1,chart:!1},e}return e=r,s=[{key:"onHover",value:function(t){this.setState({hovered:t})}},{key:"onLeave",value:function(){this.setState({hovered:!1})}},{key:"onClick",value:function(t){if(!this.props.narrativeMode){var e=!!window.event.shiftKey,s=F(void 0===t.codon?[_.Sc,t.x]:[this.props.selectedCds.name,t.codon],2),n=s[0],o=s[1],i=e?(0,I.dN)({currentColorBy:this.props.colorBy,gene:n,position:o}):(0,I.KC)({gene:n,positions:[o]});this.props.dispatch((0,f.p)(i)),this.setState({hovered:!1})}}},{key:"onCdsClick",value:function(t){this.props.dispatch((0,S.Eb)((0,M.ln)(this.props.genomeMap,t.cds.name))),this.setState({hovered:!1})}},{key:"resetLayout",value:function(t){var e=this;if(this.props.narrativeMode||!this.state.chart)return null;var s=this.props.selectedCds===_.Sc,n=this.props.genomeMap[0].proteinOnly&&1===this.props.genomeMap[0].genes.length;return i.createElement("div",{style:X(X({},p.pL),t.resetLayout)},i.createElement("button",{key:1,style:p.fB,onClick:function(){s||n?e.state.chart.update({zoomMin:e.state.chart.zoomBounds[0],zoomMax:e.state.chart.zoomBounds[1]}):e.props.dispatch((0,S.Eb)(_.Sc))}},i.createElement("span",{style:t.switchTitle}," ",this.props.t("Reset Layout")," ")))}},{key:"entropyCountSwitch",value:function(t){var e=this,s=this.props.t;return this.props.narrativeMode?null:i.createElement("div",{style:X(X({},p.pL),t.entropyCountSwitch)},i.createElement("button",{key:1,style:this.props.showCounts?p.fB:p.oH,onClick:function(){return e.props.dispatch((0,S.Ae)(!1))}},i.createElement("span",{style:t.switchTitle}," ",s("entropy")," ")),i.createElement("button",{key:2,style:this.props.showCounts?p.oH:p.fB,onClick:function(){return e.props.dispatch((0,S.Ae)(!0))}},i.createElement("span",{style:t.switchTitle}," ",s("events")," ")))}},{key:"setUp",value:function(t){var e=new H(this.d3entropy,t.genomeMap,{onHover:this.onHover.bind(this),onLeave:this.onLeave.bind(this),onClick:this.onClick.bind(this),onCdsClick:this.onCdsClick.bind(this)});e.render(t),t.narrativeMode&&(0,c.A)(this.d3entropy).selectAll(".handle--custom").style("visibility","hidden"),this.setState({chart:e})}},{key:"visibilityOnScreenChange",value:function(t){if(1!==t.length)return console.error("Unexpected IntersectionObserver callback entries of length",t.length);var e=t[0].isIntersecting;return e!==this.props.onScreen?!e||this.props.bars?this.props.dispatch({type:W.Nv,onScreen:e}):void this.props.dispatch(function(t,s){var n=s(),o=n.entropy,i=n.tree,r=F((0,M.j_)(i.nodes,i.visibility,o.selectedCds,o.showCounts),2),a=r[0],l=r[1];t({type:W.Nv,onScreen:e,entropyData:a,entropyMaxYVal:l})}):void 0}},{key:"componentDidMount",value:function(){this.props.loaded&&(this.setUp(this.props),new IntersectionObserver(this.visibilityOnScreenChange.bind(this),{threshold:0}).observe(this.d3entropy))}},{key:"UNSAFE_componentWillReceiveProps",value:function(t){if(t.loaded||this.setState({chart:!1}),this.state.chart){if(this.props.width!==t.width||this.props.height!==t.height)this.state.chart.render(t);else{var e={};this.props.zoomMax===t.zoomMax&&this.props.zoomMin===t.zoomMin||(e.zoomMax=t.zoomMax,e.zoomMin=t.zoomMin),this.props.bars!==t.bars&&(e.newBars=[t.bars,t.maxYVal]),this.props.selectedCds!==t.selectedCds&&(e.selectedCds=t.selectedCds),this.props.showCounts!==t.showCounts&&(e.showCounts=t.showCounts),o()(this.props.selectedPositions,t.selectedPositions)||(e.selectedPositions=t.selectedPositions),Object.keys(e).length&&this.state.chart.update(e)}this.props.narrativeMode!==t.narrativeMode&&(t.narrativeMode?(0,c.A)(this.d3entropy).selectAll(".handle--custom").style("visibility","hidden"):(0,c.A)(this.d3entropy).selectAll(".handle--custom").style("visibility","visible"))}else t.loaded&&this.setUp(t)}},{key:"title",value:function(){return this.props.width<500?"Diversity":this.props.selectedCds===_.Sc?"Nucleotide diversity of genome":"Amino acid diversity of CDS ".concat(this.props.selectedCds.name)}},{key:"render",value:function(){var t,e=this,s={switchContainer:{position:"absolute",marginTop:-5,paddingLeft:(t=this.props.width)-100},switchContainerWide:{position:"absolute",marginTop:-25,paddingLeft:t-185},switchTitle:{margin:5,position:"relative",top:-1},resetLayout:{position:"absolute",right:190,top:0,zIndex:100},entropyCountSwitch:{position:"absolute",right:50,top:0,zIndex:100},helpIcon:{position:"absolute",right:25,top:3,fontSize:"16px",cursor:"help",color:"#888"}};return i.createElement(u.A,{infocard:this.props.showOnlyPanels,title:this.title()},i.createElement(T,{d3event:this.state.hovered.d3event,width:this.props.width,height:this.props.height},this.state.hovered?this.state.hovered.tooltip(this.props.t):null),i.createElement("svg",{id:"d3entropyParent",style:{pointerEvents:"auto"},width:this.props.width,height:this.props.height},i.createElement("g",null,i.createElement("g",null,i.createElement("g",null,i.createElement("g",null,i.createElement("g",{ref:function(t){e.d3entropy=t},id:"d3entropy"})))))),this.resetLayout(s),this.entropyCountSwitch(s),i.createElement("span",{style:s.helpIcon,"data-tip":!0,"data-for":"entropyHelp"},i.createElement(d.__w,null)),i.createElement(Z.FS,{place:"left",type:"dark",effect:"solid",id:"entropyHelp",style:{maxWidth:"50vh"}},i.createElement("div",null,"This panel displays the observed diversity across the current genome or a selected CDS"," (currently you are viewing ".concat(this.props.selectedCds===_.Sc?"the genome":"CDS ".concat(this.props.selectedCds.name),"). "),i.createElement("p",null),"The lower axis shows the genome with +ve strand CDSs above and -ve strand CDSs below and the grey overlay allows zooming in to a region. The upper axis shows either the zoomed in region of the genome or a selected CDS; in the latter case the coordinates represent amino acids.",i.createElement("p",null),"Clicking on a CDS will select it and show it on the upper axis.",' Clicking "Reset Layout" will always return you to viewing the entire genome.')))}},{key:"componentWillUnmount",value:function(){}}],s&&V(e.prototype,s),Object.defineProperty(e,"prototype",{writable:!1}),r}(i.Component),tt(R,"propTypes",{dispatch:a().func.isRequired,loaded:a().bool.isRequired,colorBy:a().string.isRequired,defaultColorBy:a().string.isRequired,selectedCds:a().any.isRequired,selectedPositions:a().array.isRequired}),L=R))||L;const nt=(0,h.C)()(st)},64436(t,e,s){(e=s(93527)(!1)).push([t.id,'\n/* Variables - keep in sync with globalStyles.js*/\n:root {\n --darkGrey: #333;\n --medGrey: #888;\n}\n\n/* Normally elements with .overlay are children of the .brush, however\nthe overlay added on key-presses is is not a child of .brush */\n#d3entropy .overlay {\n fill: none;\n pointer-events: all;\n}\n\n#d3entropy .niceText {\n font-family: "Lato", "Helvetica Neue", "Helvetica", "sans-serif";\n font-size: 14px;\n font-style: italic;\n color: var(--medGrey);\n}\n\n.brush .selection {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n#d3entropy .cdsText {\n pointer-events: none;\n}\n#d3entropy .cds {\n cursor: pointer;\n}\n\ntable.entropy-table {\n font-weight: 300;\n}\n\ntable.entropy-table td {\n padding-bottom: 3px;\n padding-right: 5px;\n}',""]),t.exports=e},19596(t,e,s){var n=s(64436);"string"==typeof n&&(n=[[t.id,n,""]]),s(81023)(n,{}),n.locals&&(t.exports=n.locals)}}]);