")}else e._prevDateHead=s,u+="
"+s;t.text=u}(e,o,n,u):"log"===c?function(e,t,n,r,i){var o=e.dtick,s=t.x,u=e.tickformat,c="string"===typeof o&&o.charAt(0);if("never"===i&&(i=""),r&&"L"!==c&&(o="L3",c="L"),u||"L"===c)t.text=be(Math.pow(10,s),e,i,r);else if(a(o)||"D"===c&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),h=e.exponentformat;"power"===h||ye(h)&&xe(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":D)+f+"",t.fontSize*=1.25):("e"===h||"E"===h)&&f>2?t.text="1"+h+(d>0?"+":D)+f:(t.text=be(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var p=String(t.text).charAt(0);"0"!==p&&"1"!==p||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,u,m):"category"===c?function(e,t){var n=e._categories[Math.round(t.x)];void 0===n&&(n=""),t.text=String(n)}(e,o):"multicategory"===c?function(e,t,n){var r=Math.round(t.x),a=e._categories[r]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);n?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,n):Ne(e)?function(e,t,n,r,a){if("radians"!==e.thetaunit||n)t.text=be(t.x,e,a,r);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}function n(e,r){return t(r,0)?e:n(r,e%r)}function r(e){for(var n=1;!t(Math.round(e*n)/n,e);)n*=10;return n}var a=r(e),i=e*a,o=Math.abs(n(i,a));return[Math.round(i/o),Math.round(a/o)]}(i);if(o[1]>=100)t.text=be(l.deg2rad(t.x),e,a,r);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=D+t.text)}}}}(e,o,n,u,m):function(e,t,n,r,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide"),t.text=be(t.x,e,a,r)}(e,o,0,u,m),r||(e.tickprefix&&!v(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!v(e.showticksuffix)&&(o.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(o.text)){var g=e.labelalias[o.text];"string"===typeof g&&(o.text=g)}return("boundaries"===e.tickson||e.showdividers)&&(o.xbnd=[f(o.x-.5),f(o.x+e.dtick-.5)]),o},V.hoverLabelText=function(e,t,n){n&&(e=l.extendFlat({},e,{hoverformat:n}));var r=l.isArrayOrTypedArray(t)?t[0]:t,a=l.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==a&&a!==r)return V.hoverLabelText(e,r,n)+" - "+V.hoverLabelText(e,a,n);var i="log"===e.type&&r<=0,o=V.tickText(e,e.c2l(i?-r:r),"hover").text;return i?0===r?"0":D+o:o};var ge=["f","p","n","\u03bc","m","","k","M","G","T"];function ye(e){return"SI"===e||"B"===e}function xe(e){return e>14||e<-15}function be(e,t,n,r){var i=e<0,o=t._tickround,s=n||t.exponentformat||"B",u=t._tickexponent,c=V.getTickFormat(t),d=t.separatethousands;if(r){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};ve(f),o=(Number(f._tickround)||0)+4,u=f._tickexponent,t.hoverformat&&(c=t.hoverformat)}if(c)return t._numFormat(c)(e).replace(/-/g,D);var h,p=Math.pow(10,-o)/2;if("none"===s&&(u=0),(e=Math.abs(e))"+h+"":"B"===s&&9===u?e+="B":ye(s)&&(e+=ge[u/3+5])),i?D+e:e}function _e(e,t){if(e){var n=Object.keys(z).reduce((function(e,n){return-1!==t.indexOf(n)&&z[n].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){n[t]||(1===t.length?e[t]=0:delete e[t])}))}}function Ae(e,t){for(var n=[],r={},a=0;a1&&n=a.min&&e=r(e))}function l(e,t){var n=null===t[0],r=null===t[1],a=i(e,t[0])>=0,o=i(e,t[1])<=0;return(n||a)&&(r||o)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=0&&a.unshift(a.splice(r,1).shift())}}));var o={false:{left:0,right:0}};return l.syncOrAsync(a.map((function(t){return function(){if(t){var r=V.getFromId(e,t);n||(n={}),n.axShifts=o,n.overlayingShiftedAx=i;var a=V.drawOne(e,r,n);return r._shiftPusher&&ze(r,r._fullDepth||0,o,!0),r._r=r.range.slice(),r._rl=l.simpleMap(r._r,r.r2l),a}}})))},V.drawOne=function(e,t,n){var r,a,s,u=(n=n||{}).axShifts||{},h=n.overlayingShiftedAx||[];t.setScale();var p=e._fullLayout,v=t._id,m=v.charAt(0),g=V.counterLetter(v),y=p._plots[t._mainSubplot];if(y){if(t._shiftPusher=t.autoshift||-1!==h.indexOf(t._id)||-1!==h.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var x=t.linewidth/2||0;"inside"===t.ticks&&(x+=t.ticklen),ze(t,x,u,!0),ze(t,t.shift||0,u,!1)}!0===n.skipTitle&&void 0!==t._shift||(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,u));var b=y[m+"axislayer"],_=t._mainLinePosition,A=_+=t._shift,w=t._mainMirrorPosition,T=t._vals=V.calcTicks(t),k=[t.mirror,A,w].join("_");for(r=0;r0?n.bottom-c:0,d))));var f=0,h=0;if(t._shiftPusher&&(f=Math.max(d,n.height>0?"l"===s?c-n.left:n.right-c:0),t.title.text!==p._dfltTitle[m]&&(h=(t._titleStandoff||0)+(t._titleScoot||0),"l"===s&&(h+=ke(t))),t._fullDepth=Math.max(f,h)),t.automargin){r={x:0,y:0,r:0,l:0,t:0,b:0};var v=[0,1],y="number"===typeof t._shift?t._shift:0;if("x"===m){if("b"===s?r[s]=t._depth:(r[s]=t._depth=Math.max(n.width>0?c-n.top:0,d),v.reverse()),n.width>0){var x=n.right-(t._offset+t._length);x>0&&(r.xr=1,r.r=x);var b=t._offset-n.left;b>0&&(r.xl=0,r.l=b)}}else if("l"===s?(t._depth=Math.max(n.height>0?c-n.left:0,d),r[s]=t._depth-y):(t._depth=Math.max(n.height>0?n.right-c:0,d),r[s]=t._depth+y,v.reverse()),n.height>0){var _=n.bottom-(t._offset+t._length);_>0&&(r.yb=0,r.b=_);var A=t._offset-n.top;A>0&&(r.yt=1,r.t=A)}r[g]="free"===t.anchor?t.position:t._anchorAxis.domain[v[0]],t.title.text!==p._dfltTitle[m]&&(r[s]+=ke(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[v[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][v[1]]))}se&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"===typeof t.automargin&&(_e(r,t.automargin),_e(a,t.automargin)),i.autoMargin(e,Ce(t),r),i.autoMargin(e,Le(t),a),i.autoMargin(e,Ee(t),l)})),l.syncOrAsync(oe)}}function ue(e){var n=v+(e||"tick");return M[n]||(M[n]=function(e,t,n){var r,a,i,o;if(e._selections[t].size())r=1/0,a=-1/0,i=1/0,o=-1/0,e._selections[t].each((function(){var e=Se(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),a=Math.max(a,t.bottom),i=Math.min(i,t.left),o=Math.max(o,t.right)}));else{var l=V.makeLabelFns(e,n);r=a=l.yFn({dx:0,dy:0,fontSize:0}),i=o=l.xFn({dx:0,dy:0,fontSize:0})}return{top:r,bottom:a,left:i,right:o,height:a-r,width:o-i}}(t,n,A)),M[n]}},V.getTickSigns=function(e,t){var n=e._id.charAt(0),r={x:"top",y:"right"}[n],a=e.side===r?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)===("x"===n)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},V.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},V.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",n=function(e){return-1!==t.indexOf(e)},r=n("top"),a=n("left"),i=n("right"),o=n("bottom"),l=n("inside"),s=o||a||r||i;if(!s&&!l)return[0,0];var u=e.side,c=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;return(o||r)&&(c+=f*U,d+=(e.linewidth||0)/2),(a||i)&&(c+=(e.linewidth||0)/2,d+=3),l&&"top"===u&&(d-=f*(1-U)),(a||r)&&(c=-c),"bottom"!==u&&"right"!==u||(d=-d),[s?c:0,l?d:0]}(e),n=t[0],r=t[1];return"x"===e._id.charAt(0)?function(t){return s(n+e._offset+e.l2p(we(t)),r)}:function(t){return s(r,n+e._offset+e.l2p(we(t)))}},V.makeTickPath=function(e,t,n,r){r||(r={});var a=r.minor;if(a&&!e.minor)return"";var i=void 0!==r.len?r.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*n)+"v"+i*n:"M"+(t+l*n)+",0h"+i*n},V.makeLabelFns=function(e,t,n){var r=e.ticklabelposition||"",i=function(e){return-1!==r.indexOf(e)},o=i("top"),s=i("left"),u=i("right"),c=i("bottom")||s||o||u,d=i("inside"),f="inside"===r&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,h=0,p=0,v=f?e.ticklen:0;if(d?v*=-1:c&&(v=0),f&&(h+=v,n)){var m=l.deg2rad(n);h=v*Math.cos(m)+1,p=v*Math.sin(m)}e.showticklabels&&(f||e.showline)&&(h+=.2*e.tickfont.size);var g,y,x,b,_,A={labelStandoff:h+=(e.linewidth||1)/2*(d?-1:1),labelShift:p},w=0,T=e.side,k=e._id.charAt(0),M=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===T||d&&"top"===T)?1:-1,d&&(b*=-1),g=p*b,y=t+h*b,x=_?1:-.2,90===Math.abs(M)&&(d?x+=B:x=-90===M&&"bottom"===T?U:90===M&&"top"===T?B:.5,w=B/2*(M/90)),A.xFn=function(e){return e.dx+g+w*e.fontSize},A.yFn=function(e){return e.dy+y+e.fontSize*x},A.anchorFn=function(e,t){if(c){if(s)return"end";if(u)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},A.heightFn=function(t,n,r){return n<-60||n>60?-.5*r:"top"===e.side!==d?-r:0};else if("y"===k){if(b=(_=!d&&"left"===T||d&&"right"===T)?1:-1,d&&(b*=-1),g=h,y=p*b,x=0,d||90!==Math.abs(M)||(x=-90===M&&"left"===T||90===M&&"right"===T?U:.5),d){var S=a(M)?+M:0;if(0!==S){var C=l.deg2rad(S);w=Math.abs(Math.sin(C))*U*b,x=0}}A.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+w*e.fontSize},A.yFn=function(e){return e.dy+y+e.fontSize*B},A.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},A.heightFn=function(t,n,r){return"right"===e.side&&(n*=-1),n<-30?-r:n<30?-.5*r:0}}return A},V.drawTicks=function(e,t,n){n=n||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?n.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?n.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=n.layer.selectAll("path."+a).data(i,Te);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(e){return d.stroke(r.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(n){return f.crispRound(e,n.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ie(t,[j]),o.attr("transform",n.transFn)},V.drawGrid=function(e,t,n){if(n=n||{},"sync"!==t.tickmode){var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?n.vals.filter((function(e){return e.minor})):[],l=t.showgrid?n.vals.filter((function(e){return!e.minor})):[],s=n.counterAxis;if(s&&V.shouldShowZeroLine(e,t,s))for(var u="array"===t.tickmode,c=0;c=0;g--){var y=g?v:m;if(y){var x=y.selectAll("path."+a).data(g?l:o,Te);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(e){return d.stroke(r.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return f.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?p:t._gw)+"px"})).style("display",null),"function"===typeof n.path&&x.attr("d",n.path)}}Ie(t,[N,R])}},V.drawZeroLine=function(e,t,n){n=n||n;var r=t._id+"zl",a=V.shouldShowZeroLine(e,t,n.counterAxis),i=n.layer.selectAll("path."+r).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(r,1).classed("zl",1).classed("crisp",!1!==n.crisp).each((function(){n.layer.selectAll("path").sort((function(e,t){return q(e.id,t.id)}))})),i.attr("transform",n.transFn).attr("d",n.path).call(d.stroke,t.zerolinecolor||d.defaultLine).style("stroke-width",f.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ie(t,[P])},V.drawLabels=function(e,t,n){n=n||{};var i=e._fullLayout,o=t._id,c=n.cls||o+"tick",d=n.vals.filter((function(e){return e.text})),h=n.labelFns,p=n.secondary?0:t.tickangle,v=(t._prevTickAngles||{})[c],m=n.layer.selectAll("g."+c).data(t.showticklabels?d:[],Te),g=[];function y(e,i){e.each((function(e){var o=r.select(this),l=o.select(".text-math-group"),c=h.anchorFn(e,i),d=n.transFn.call(o.node(),e)+(a(i)&&0!==+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=u.lineCount(o),v=H*e.fontSize,m=h.heightFn(e,a(i)?+i:0,(p-1)*v);if(m&&(d+=s(0,m)),l.empty()){var g=o.select("text");g.attr({transform:d,"text-anchor":c}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=f.bBox(l.node()).width*{end:-.5,start:.5}[c];l.attr("transform",d+s(y,0))}}))}m.enter().append("g").classed(c,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),a=e._promises.length;n.call(u.positionText,h.xFn(t),h.yFn(t)).call(f.font,t.font,t.fontSize,t.fontColor).text(t.text).call(u.convertToTspans,e),e._promises[a]?g.push(e._promises.pop().then((function(){y(n,p)}))):y(n,p)})),Ie(t,[I]),m.exit().remove(),n.repositionOnUpdate&&m.each((function(e){r.select(this).select("text").call(u.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var n=t.ticklabeloverflow;if(n&&"allow"!==n){var a=-1!==n.indexOf("hide"),o="x"===t._id.charAt(0),s=0,u=o?e._fullLayout.width:e._fullLayout.height;if(-1!==n.indexOf("domain")){var c=l.simpleMap(t.range,t.r2l);s=t.l2p(c[0])+t._offset,u=t.l2p(c[1])+t._offset}var d=Math.min(s,u),h=Math.max(s,u),p=t.side,v=1/0,g=-1/0;for(var y in m.each((function(e){var n=r.select(this);if(n.select(".text-math-group").empty()){var i=f.bBox(n.node()),l=0;o?(i.right>h||i.lefth||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+n._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},y(m,v+1?v:p);var x=null;t._selections&&(t._selections[c]=m);var b=[function(){return g.length&&Promise.all(g)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=v,b.push((function(){y(m,v)}))):b.push((function(){if(y(m,p),d.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=t.autotickangles[0];var e,r=0,a=[],i=1;if(m.each((function(e){r=Math.max(r,e.fontSize);var n=t.l2p(e.x),o=Se(this),l=f.bBox(o.node());i=Math.max(i,u.lineCount(o)),a.push({top:0,bottom:10,height:10,left:n-l.width/2,right:n+l.width/2+2,width:l.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||n.secondary){var o=d.length,s=Math.abs((d[o-1].x-d[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",h=function(e){return-1!==c.indexOf(e)},v=h("top"),g=h("left"),b=h("right"),_=h("bottom")||g||v||b?(t.tickwidth||0)+6:0,A=s,w=1.25*r*i,T=A/Math.sqrt(Math.pow(A,2)+Math.pow(w,2)),k=t.autotickangles.map((function(e){return e*Math.PI/180})),M=k.find((function(e){return Math.abs(Math.cos(e))<=T}));void 0===M&&(M=k.reduce((function(e,t){return Math.abs(Math.cos(e))B*F&&(D=F,C[S]=L[S]=O[S])}var U=Math.abs(D-E);U-T>0?T*=1+T/(U-=T):T=0,"y"!==t._id.charAt(0)&&(T=-T),C[M]=A.p2r(A.r2p(L[M])+k*T),"min"===A.autorange||"max reversed"===A.autorange?(C[0]=null,A._rangeInitial0=void 0,A._rangeInitial1=void 0):"max"!==A.autorange&&"min reversed"!==A.autorange||(C[1]=null,A._rangeInitial0=void 0,A._rangeInitial1=void 0),i._insideTickLabelsUpdaterange[A._name+".range"]=C}var Y=l.syncOrAsync(b);return Y&&Y.then&&e._promises.push(Y),Y},V.getPxPosition=function(e,t){var n,r=e._fullLayout._size,a=t._id.charAt(0),i=t.side;return"free"!==t.anchor?n=t._anchorAxis:"x"===a?n={_offset:r.t+(1-(t.position||0))*r.h,_length:0}:"y"===a&&(n={_offset:r.l+(t.position||0)*r.w+t._shift,_length:0}),"top"===i||"left"===i?n._offset:"bottom"===i||"right"===i?n._offset+n._length:void 0},V.shouldShowZeroLine=function(e,t,n){var r=l.simpleMap(t.range,t.r2l);return r[0]*r[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===O)&&(Me(t,0)||!function(e,t,n,r){var a=n._mainAxis;if(a){var i=e._fullLayout,o=t._id.charAt(0),l=V.counterLetter(t._id),s=t._offset+(Math.abs(r[0])1)for(r=1;r2*o}(a,t))return"date";var m="strict"!==n.autotypenumbers;return function(e,t){for(var n=e.length,r=d(n),a=0,o=0,l={},c=0;c2*a}(a,m)?"category":function(e,t){for(var n=e.length,r=0;r=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=_(o[l])){c=g;break}var d=a("pattern",c);if(d===g)for(l=0;l<2;l++)(u=_(o[l]))&&(t.bounds[l]=o[l]=u-1);if(d)for(l=0;l<2;l++)switch(u=o[l],d){case g:if(!r(u))return void(t.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=u;break;case y:if(!r(u))return void(t.enabled=!1);if((u=+u)<0||u>24)return void(t.enabled=!1);t.bounds[l]=o[l]=u}if(!1===n.autorange){var f=n.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]r?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},t.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},t.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},4796:function(e,t,n){"use strict";var r=n(8116).isTypedArraySpec;e.exports=function(e,t,n,a){if("category"===t.type){var i,o=e.categoryarray,l=Array.isArray(o)&&o.length>0||r(o);l&&(i="array");var s,u=n("categoryorder",i);"array"===u&&(s=n("categoryarray")),l||"array"!==u||(u=t.categoryorder="trace"),"trace"===u?t._initialCategories=[]:"array"===u?t._initialCategories=s.slice():(s=function(e,t){var n,r,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)n=t.axData;else for(n=[],r=0;rr?a.substr(r):i.substr(n))+o:a+i+e*t:o}function m(e,t){for(var n=t._size,r=n.h/n.w,a={},i=Object.keys(e),o=0;ou*x)||w)for(n=0;nP&&ID&&(D=I);f/=(D-E)/(2*O),E=s.l2r(E),D=s.l2r(D),s.range=s._input.range=S=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function F(e,t,n,r,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(n,r)).attr("d",a+"Z")}function B(e,t,n){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(t,n)).attr("d","M0,0Z")}function U(e,t,n,r,a,i){e.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),H(e,t,a,i)}function H(e,t,n,r){n||(e.transition().style("fill",r>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function Y(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function G(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,D)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function W(e,t,n,r,i){for(var o,l,s,u,c=!1,d={},f={},h=(i||{}).xaHash,p=(i||{}).yaHash,v=0;v=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==e||ge||Ve(),me)o.indexOf("select")>-1&&S(n,a,J,Q,t.id,De),o.indexOf("event")>-1&&h.click(a,n,t.id);else if(1===e&&ge){var l=v?P:O,u="s"===v||"w"===g?0:1,d=l._name+".range["+u+"]",f=function(e,t){var n,r=e.range[t],a=Math.abs(r-e.range[1-t]);return"date"===e.type?r:"log"===e.type?(n=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+n+"g")(Math.pow(10,r))):(n=Math.floor(Math.log(Math.abs(r))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(n)+"g")(r))}(l,u),p="left",m="middle";if(l.fixedrange)return;v?(m="n"===v?"top":"bottom","right"===l.side&&(p="right")):"e"===g&&(p="right"),a._context.showAxisRangeEntryBoxes&&r.select(be).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:m}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Ne(t,n){if(e._transitioningWithDuration)return!1;var r=Math.max(0,Math.min(ee,he*t+_e)),a=Math.max(0,Math.min(te,pe*n+Ae)),i=Math.abs(r-_e),o=Math.abs(a-Ae);function l(){Se="",we.r=we.l,we.t=we.b,Le.attr("d","M0,0Z")}if(we.l=Math.min(_e,r),we.r=Math.max(_e,r),we.t=Math.min(Ae,a),we.b=Math.max(Ae,a),ne.isSubplotConstrained)i>D||o>D?(Se="xy",i/ee>o/te?(o=i*te/ee,Ae>a?we.t=Ae-o:we.b=Ae+o):(i=o*ee/te,_e>r?we.l=_e-i:we.r=_e+i),Le.attr("d",G(we))):l();else if(re.isSubplotConstrained)if(i>D||o>D){Se="xy";var s=Math.min(we.l/ee,(te-we.b)/te),u=Math.max(we.r/ee,(te-we.t)/te);we.l=s*ee,we.r=u*ee,we.b=(1-s)*te,we.t=(1-u)*te,Le.attr("d",G(we))}else l();else!ie||o0){var c;if(re.isSubplotConstrained||!ae&&1===ie.length){for(c=0;c1&&(void 0!==i.maxallowed&&le===(i.range[0]1&&(void 0!==o.maxallowed&&se===(o.range[0]b[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l),"sync"===t.tickmode&&(t.tickmode="auto")}return n("layer"),t}},2568:function(e,t,n){"use strict";var r=n(5024);e.exports=function(e,t,n,a,i){i||(i={});var o=i.tickSuffixDflt,l=r(e);n("tickprefix")&&n("showtickprefix",l),n("ticksuffix",o)&&n("showticksuffix",l)}},6312:function(e,t,n){"use strict";var r=n(6808);e.exports=function(e,t,n,a){var i=t._template||{},o=t.type||i.type||"-";n("minallowed"),n("maxallowed");var l,s=n("range");s||a.noInsiderange||"log"===o||(!(l=n("insiderange"))||null!==l[0]&&null!==l[1]||(t.insiderange=!1,l=void 0),l&&(s=n("range",l)));var u,c=t.getAutorangeDflt(s,a),d=n("autorange",c);!s||(null!==s[0]||null!==s[1])&&(null!==s[0]&&null!==s[1]||"reversed"!==d&&!0!==d)&&(null===s[0]||"min"!==d&&"max reversed"!==d)&&(null===s[1]||"max"!==d&&"min reversed"!==d)||(s=void 0,delete t.range,t.autorange=!0,u=!0),u||(d=n("autorange",c=t.getAutorangeDflt(s,a))),d&&(r(n,d,s),"linear"!==o&&"-"!==o||n("rangemode")),t.cleanRange()}},1160:function(e,t,n){"use strict";var r=n(4284).FROM_BL;e.exports=function(e,t,n){void 0===n&&(n=r[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*n;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},8344:function(e,t,n){"use strict";var r=n(3428),a=n(4336).E9,i=n(3400),o=i.numberFormat,l=n(8248),s=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,h=n(9032),p=h.FP_SAFE,v=h.BADNUM,m=h.LOG_CLIP,g=h.ONEWEEK,y=h.ONEDAY,x=h.ONEHOUR,b=h.ONEMIN,_=h.ONESEC,A=n(9811),w=n(3816),T=w.HOUR_PATTERN,k=w.WEEKDAY_PATTERN;function M(e){return Math.pow(10,e)}function S(e){return null!==e&&void 0!==e}e.exports=function(e,t){t=t||{};var n=e._id||"x",h=n.charAt(0);function C(t,n){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&n&&e.range&&2===e.range.length){var r=e.range[0],a=e.range[1];return.5*(r+a-2*m*Math.abs(r-a))}return v}function L(t,n,r,a){if((a||{}).msUTC&&l(t))return+t;var o=c(t,r||e.calendar);if(o===v){if(!l(t))return v;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-s/10);o=c(new Date(u))+s/10}return o}function E(t,n,r){return u(t,n,r||e.calendar)}function D(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"===typeof t?String(t):t);var n=e._categories.length-1;return e._categoriesMap[t]=n,n}return v}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function N(e){var t=P(e);return void 0!==t?t:l(e)?+e:void 0}function R(e){return l(e)?+e:P(e)}function j(e,t,n){return r.round(n+t*e,2)}function I(e,t,n){return(e-n)/t}var z=function(t){return l(t)?j(t,e._m,e._b):v},F=function(t){return I(t,e._m,e._b)};if(e.rangebreaks){var B="y"===h;z=function(t){if(!l(t))return v;var n=e._rangebreaks.length;if(!n)return j(t,e._m,e._b);var r=B;e.range[0]>e.range[1]&&(r=!r);for(var a=r?-1:1,i=a*t,o=0,s=0;sc)){o=i<(u+c)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?j(t,e._m2,d):0},F=function(t){var n=e._rangebreaks.length;if(!n)return I(t,e._m,e._b);for(var r=0,a=0;ae._rangebreaks[a].pmax&&(r=a+1);return I(t,e._m2,e._B[r])}}e.c2l="log"===e.type?C:d,e.l2c="log"===e.type?M:d,e.l2p=z,e.p2l=F,e.c2p="log"===e.type?function(e,t){return z(C(e,t))}:z,e.p2c="log"===e.type?function(e){return M(F(e))}:F,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=F,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return C(s(e),t)},e.r2d=e.r2c=function(e){return M(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=C,e.l2d=M,e.d2p=function(t,n){return e.l2p(e.d2r(t,n))},e.p2d=function(e){return M(F(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=F,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=L,e.c2d=e.c2r=e.l2d=e.l2r=E,e.d2p=e.r2p=function(t,n,r){return e.l2p(L(t,0,r))},e.p2d=e.p2r=function(e,t,n){return E(F(e),t,n)},e.cleanPos=function(t){return i.cleanDate(t,v,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var n=R(t);return void 0!==n?n:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(F(e))},e.r2p=e.d2p,e.p2r=F,e.cleanPos=function(e){return"string"===typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var n=N(t);return void 0!==n?n:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=d,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(F(e))},e.r2p=e.d2p,e.p2r=F,e.cleanPos=function(e){return Array.isArray(e)||"string"===typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(r){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var u in s)if(u!==n){var c=t[A.id2name(u)];l=l.concat(c._traceIndices)}var d=[[0,{}],[0,{}]],p=[];for(a=0;as[1]&&(a[l?0:1]=r),a[0]===a[1]){var u=e.l2r(n),c=e.l2r(r);if(void 0!==n){var d=u+1;void 0!==r&&(d=Math.min(d,c)),a[l?1:0]=d}if(void 0!==r){var f=c+1;void 0!==n&&(f=Math.max(f,u)),a[l?0:1]=f}}}},e.cleanRange=function(t,n){e._cleanRange(t,n),e.limitRange(t)},e._cleanRange=function(t,n){n||(n={}),t||(t="range");var r,a,o=i.nestedProperty(e,t).get();if(a=(a="date"===e.type?i.dfltRange(e.calendar):"y"===h?w.DFLTRANGEY:"realaxis"===e._name?[0,1]:n.dfltRange||w.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(a[0]=0),o&&2===o.length){var s=null===o[0],u=null===o[1];for("date"!==e.type||e.autorange||(o[0]=i.cleanDate(o[0],v,e.calendar),o[1]=i.cleanDate(o[1],v,e.calendar)),r=0;r<2;r++)if("date"===e.type){if(!i.isDateTime(o[r],e.calendar)){e[t]=a;break}if(e.r2l(o[0])===e.r2l(o[1])){var c=i.constrain(e.r2l(o[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);o[0]=e.l2r(c-1e3),o[1]=e.l2r(c+1e3);break}}else{if(!l(o[r])){if(s||u||!l(o[1-r])){e[t]=a;break}o[r]=o[1-r]*(r?10:.1)}if(o[r]<-p?o[r]=-p:o[r]>p&&(o[r]=p),o[0]===o[1]){var d=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=d,o[1]+=d}}}else i.nestedProperty(e,t).set(a)},e.setScale=function(n){var r=t._size;if(e.overlaying){var a=A.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=n&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,u=e.r2l(e[i][0],o),c=e.r2l(e[i][1],o),d="y"===h;if(d?(e._offset=r.t+(1-e.domain[1])*r.h,e._length=r.h*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c):(e._offset=r.l+e.domain[0]*r.w,e._length=r.w*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(u,c),Math.max(u,c)),e._rangebreaks.length)){for(l=0;lc&&(f=!f),f&&e._rangebreaks.reverse();var p=f?-1:1;for(e._m2=p*e._length/(Math.abs(c-u)-e._lBreaks),e._B.push(-e._m2*(d?c:u)),l=0;la&&(a+=7,oa&&(a+=24,o=r&&o=r&&t=l.min&&(el.max&&(l.max=r),a=!1)}a&&u.push({min:e,max:r})}};for(r=0;rn.duration?(function(){for(var n={},r=0;r rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,n._offset).call(o.setScale,1,1);var r=e.plot.selectAll(".scatterlayer .trace");r.selectAll(".point").call(o.setPointGroupScale,1,1),r.selectAll(".textpoint").call(o.setTextPointsScale,1,1),r.call(o.hideOutsideRangePoints,e)}function m(t,n){var r=t.plotinfo,a=r.xaxis,s=r.yaxis,u=a._length,c=s._length,d=!!t.xr1,f=!!t.yr1,h=[];if(d){var p=i.simpleMap(t.xr0,a.r2l),v=i.simpleMap(t.xr1,a.r2l),m=p[1]-p[0],g=v[1]-v[0];h[0]=(p[0]*(1-n)+n*v[0]-p[0])/(p[1]-p[0])*u,h[2]=u*(1-n+n*g/m),a.range[0]=a.l2r(p[0]*(1-n)+n*v[0]),a.range[1]=a.l2r(p[1]*(1-n)+n*v[1])}else h[0]=0,h[2]=u;if(f){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];h[1]=(y[1]*(1-n)+n*x[1]-y[1])/(y[0]-y[1])*c,h[3]=c*(1-n+n*_/b),s.range[0]=a.l2r(y[0]*(1-n)+n*x[0]),s.range[1]=s.l2r(y[1]*(1-n)+n*x[1])}else h[1]=0,h[3]=c;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var A=d?u/h[2]:1,w=f?c/h[3]:1,T=d?h[0]:0,k=f?h[1]:0,M=d?h[0]/h[2]*u:0,S=f?h[1]/h[3]*c:0,C=a._offset-M,L=s._offset-S;r.clipRect.call(o.setTranslate,T,k).call(o.setScale,1/A,1/w),r.plot.call(o.setTranslate,C,L).call(o.setScale,A,w),o.setPointGroupScale(r.zoomScalePts,1/A,1/w),o.setTextPointsScale(r.zoomScaleTxt,1/A,1/w)}l.redrawComponents(e)}},4944:function(e,t,n){"use strict";var r=n(4040).traceIs,a=n(2976);function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var n=i(e),a=r(e,"box-violin"),o=r(e._fullInput||{},"candlestick");return a&&!o&&t===n&&void 0===e[n]&&void 0===e[n+"0"]}e.exports=function(e,t,n,l){n("autotypenumbers",l.autotypenumbersDflt),"-"===n("type",(l.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var n,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var u=function(e,t,n){for(var r=0;r0&&(a["_"+n+"axes"]||{})[t])return a;if((a[n+"axis"]||n)===t){if(o(a,n))return a;if((a[n]||[]).length||a[n+"0"])return a}}}(t,l,s);if(u)if("histogram"!==u.type||s!=={v:"y",h:"x"}[u.orientation||"v"]){var c=s+"calendar",d=u[c],f={noMultiCategory:!r(u,"cartesian")||r(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&s==={h:"x",v:"y"}[u.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=e.autotypenumbers,o(u,s)){var h=i(u),p=[];for(n=0;n0?".":"")+i;a.isPlainObject(o)?s(o,t,l,r+1):t(l,i,o)}}))}t.manageCommandObserver=function(e,n,r,o){var l={},s=!0;n&&n._commandObserver&&(l=n._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var u=t.hasSimpleAPICommandBindings(e,r,l.lookupTable);if(n&&n._commandObserver){if(u)return l;if(n._commandObserver.remove)return n._commandObserver.remove(),n._commandObserver=null,l}if(u){i(e,u,l.cache),l.check=function(){if(s){var t=i(e,u,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:u.type,prop:u.prop,traces:u.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),n.attr(i);var o=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),s=n.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var n=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)n.on("click",(function(){A.sendDataToCloud(e)}));else{var r=window.location.pathname.split("/"),a=window.location.search;n.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+r[2].split(".")[0]+"/"+r[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},A.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var n=r.select(e).append("div").attr("id","hiddenform").style("display","none"),a=n.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=A.graphJson(e,!1,"keepdata"),a.node().submit(),n.remove(),e.emit("plotly_afterexport"),!1}};var k=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function S(e,t){var n=e._context.locale;n||(n="en-US");var r=!1,a={};function i(e){for(var n=!0,i=0;i1&&N.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&N.length>15&&0===l.shapes.length&&0===l.images.length,A.linkSubplots(f,l,c,r),A.cleanPlot(f,l,c,r);var F=!(!r._has||!r._has("gl2d")),B=!(!l._has||!l._has("gl2d")),U=!(!r._has||!r._has("cartesian"))||F,H=!(!l._has||!l._has("cartesian"))||B;U&&!H?r._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),r._zoomlayer&&!e._dragging&&v({_fullLayout:r}),function(e,t){var n,r=[];t.meta&&(n=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var c=1-2*l;r=Math.round(c*r),a=Math.round(c*a)}}var f=A.layoutAttributes.width.min,h=A.layoutAttributes.height.min;r1,v=!t.height&&Math.abs(n.height-a)>1;(v||p)&&(p&&(n.width=r),v&&(n.height=a)),e._initialAutoSize||(e._initialAutoSize={width:r,height:a}),A.sanitizeMargins(n)},A.supplyLayoutModuleDefaults=function(e,t,n,r){var a,i,o,l=s.componentsRegistry,u=t._basePlotModules,c=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in u.length||u.push(c),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),c.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(d.subplotSort);for(i=0;i1&&(n.l/=g,n.r/=g)}if(h){var y=(n.t+n.b)/h;y>1&&(n.t/=y,n.b/=y)}var x=void 0!==n.xl?n.xl:n.x,b=void 0!==n.xr?n.xr:n.x,_=void 0!==n.yt?n.yt:n.y,w=void 0!==n.yb?n.yb:n.y;p[t]={l:{val:x,size:n.l+m},r:{val:b,size:n.r+m},b:{val:w,size:n.b+m},t:{val:_,size:n.t+m}},v[t]=1}else delete p[t],delete v[t];if(!r._replotting)return A.doAutoMargin(e)}},A.doAutoMargin=function(e){var t=e._fullLayout,n=t.width,r=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,l={t:0,b:0,l:0,r:0},u=d.extendFlat({},a),c=i.l,f=i.r,h=i.t,v=i.b,m=t._pushmargin,g=t._pushmarginIds,y=t.minreducedwidth,x=t.minreducedheight;if(!1!==i.autoexpand){for(var b in m)g[b]||delete m[b];var _=e._fullLayout._reservedMargin;for(var w in _)for(var T in _[w]){var k=_[w][T];l[T]=Math.max(l[T],k)}for(var M in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:v}},l){var S=0;for(var C in m)"base"!==C&&o(m[C][M].size)&&(S=m[C][M].size>S?m[C][M].size:S);var L=Math.max(0,i[M]-S);l[M]=Math.max(0,l[M]-L)}for(var E in m){var D=m[E].l||{},P=m[E].b||{},N=D.val,R=D.size,j=P.val,I=P.size,z=n-l.r-l.l,F=r-l.t-l.b;for(var B in m){if(o(R)&&m[B].r){var U=m[B].r.val,H=m[B].r.size;if(U>N){var Y=(R*U+(H-z)*N)/(U-N),V=(H*(1-N)+(R-z)*(1-U))/(U-N);Y+V>c+f&&(c=Y,f=V)}}if(o(I)&&m[B].t){var G=m[B].t.val,W=m[B].t.size;if(G>j){var q=(I*G+(W-F)*j)/(G-j),Z=(W*(1-j)+(I-F)*(1-G))/(G-j);q+Z>v+h&&(v=q,h=Z)}}}}}var X=d.constrain(n-i.l-i.r,2,y),J=d.constrain(r-i.t-i.b,2,x),Q=Math.max(0,n-X),K=Math.max(0,r-J);if(Q){var $=(c+f)/Q;$>1&&(c/=$,f/=$)}if(K){var ee=(v+h)/K;ee>1&&(v/=ee,h/=ee)}if(a.l=Math.round(c)+l.l,a.r=Math.round(f)+l.r,a.t=Math.round(h)+l.t,a.b=Math.round(v)+l.b,a.p=Math.round(i.pad),a.w=Math.round(n)-a.l-a.r,a.h=Math.round(r)-a.t-a.b,!t._replotting&&(A.didMarginChange(u,a)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=p.list(e,"",!0);for(var n in t)if(t[n].autoshift||t[n].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){r=!0})),n.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){var t;o++,r||o!==i||(t=a,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(n.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}n.runFn(l),setTimeout(l())}))}],i=d.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}A.didMarginChange=function(e,t){for(var n=0;n1)return!0}return!1},A.graphJson=function(e,t,n,r,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&A.supplyDefaults(e);var o=a?e._fullData:e.data,s=a?e._fullLayout:e.layout,u=(e._transitionData||{})._frames;function c(e,t){if("function"===typeof e)return t?"_function_":null;if(d.isPlainObject(e)){var r,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!==typeof e[i]){if("keepdata"===n){if("src"===i.substr(i.length-3))return}else if("keepstream"===n){if("string"===typeof(r=e[i+"src"])&&r.indexOf(":")>0&&!d.isPlainObject(e.stream))return}else if("keepall"!==n&&"string"===typeof(r=e[i+"src"])&&r.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}var i=Array.isArray(e),o=d.isTypedArray(e);if((i||o)&&e.dtype&&e.shape){var s=e.bdata;return c({dtype:e.dtype,shape:e.shape,bdata:d.isArrayBuffer(s)?l.encode(s):s},t)}return i?e.map((function(e){return c(e,t)})):o?d.simpleMap(e,d.identity):d.isJSDate(e)?d.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var n=c(e);return t&&delete n.fit,n}))};if(!t&&(f.layout=c(s),a)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return u&&(f.frames=c(u)),i&&(f.config=c(e._context,!0)),"object"===r?f:JSON.stringify(f)},A.modifyFrames=function(e,t){var n,r,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(n=0;n=0;i--)if(s[i].enabled){n._indexToPoints=s[i]._indexToPoints;break}r&&r.calc&&(o=r.calc(e,n))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=n,f[t]=o}}for(j(o,l,c),a=0;a0){for(var r=[],a=0;a-1&&(d[h[n]].title={text:""});for(n=0;n")?"":t.html(e).text()}));return t.remove(),n}(A)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},4664:function(e,t,n){"use strict";var r=n(3400);e.exports=function(e,t){for(var n=0;nd+u||!r(c))}for(var h=0;h=0)return e}else if("string"===typeof e&&"%"===(e=e.trim()).slice(-1)&&r(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function p(e,t,n,r,i,o){var l=!(!1===(o=o||{}).moduleHasSelected),s=!(!1===o.moduleHasUnselected),u=!(!1===o.moduleHasConstrain),c=!(!1===o.moduleHasCliponaxis),d=!(!1===o.moduleHasTextangle),h=!(!1===o.moduleHasInsideanchor),p=!!o.hasPathbar,v=Array.isArray(i)||"auto"===i,m=v||"inside"===i,g=v||"outside"===i;if(m||g){var y=f(r,"textfont",n.font),x=a.extendFlat({},y),b=!(e.textfont&&e.textfont.color);if(b&&delete x.color,f(r,"insidetextfont",x),p){var _=a.extendFlat({},y);b&&delete _.color,f(r,"pathbar.textfont",_)}g&&f(r,"outsidetextfont",y),l&&r("selected.textfont.color"),s&&r("unselected.textfont.color"),u&&r("constraintext"),c&&r("cliponaxis"),d&&r("textangle"),r("texttemplate")}m&&h&&r("insidetextanchor")}e.exports={supplyDefaults:function(e,t,n,r){function c(n,r){return a.coerce(e,t,d,n,r)}if(l(e,t,r,c)){s(e,t,r,c),c("xhoverformat"),c("yhoverformat"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var f=c("textposition");p(e,0,r,c,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u(e,t,c,n,r);var h=(t.marker.line||{}).color,v=o.getComponentMethod("errorbars","supplyDefaults");v(e,t,h||i.defaultLine,{axis:"y"}),v(e,t,h||i.defaultLine,{axis:"x",inherit:"y"}),a.coerceSelectionMarkerOpacity(t,c)}else t.visible=!1},crossTraceDefaults:function(e,t){var n,r;function i(e,t){return a.coerce(r._input,r,d,e,t)}for(var o=0;oi))return t}return void 0!==n?n:e.dflt},t.coerceColor=function(e,t,n){return a(t).isValid()?t:void 0!==n?n:e.dflt},t.coerceEnumerated=function(e,t,n){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==n?n:e.dflt},t.getValue=function(e,t){var n;return i(e)?t0?t+=n:c<0&&(t-=n)}return t}function N(e){var t=c,n=e.b,a=P(e);return r.inbox(n-t,a-t,_+(a-t)/(a-n)-1)}var R=e[d+"a"],j=e[f+"a"];v=Math.abs(R.r2c(R.range[1])-R.r2c(R.range[0]));var I=r.getDistanceFunction(a,h,p,(function(e){return(h(e)+p(e))/2}));if(r.getClosest(m,I,e),!1!==e.index&&m[e.index].p!==u){T||(L=function(e){return Math.min(k(e),e.p-y.bargroupwidth/2)},E=function(e){return Math.max(M(e),e.p+y.bargroupwidth/2)});var z=m[e.index],F=g.base?z.b+z.s:z.s;e[f+"0"]=e[f+"1"]=j.c2p(z[f],!0),e[f+"LabelVal"]=F;var B=y.extents[y.extents.round(z.p)];e[d+"0"]=R.c2p(x?L(z):B[0],!0),e[d+"1"]=R.c2p(x?E(z):B[1],!0);var U=void 0!==z.orig_p;return e[d+"LabelVal"]=U?z.orig_p:z.p,e.labelLabel=s(R,e[d+"LabelVal"],g[d+"hoverformat"]),e.valueLabel=s(j,e[f+"LabelVal"],g[f+"hoverformat"]),e.baseLabel=s(j,z.b,g[f+"hoverformat"]),e.spikeDistance=(function(e){var t=c,n=e.b,a=P(e);return r.inbox(n-t,a-t,A+(a-t)/(a-n)-1)}(z)+function(e){return D(k(e),M(e),A)}(z))/2,e[d+"Spike"]=R.c2p(z.p,!0),o(z,g,e),e.hovertemplate=g.hovertemplate,e}}function d(e,t){var n=t.mcc||e.marker.color,r=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(n)?n:i.opacity(r)&&a?r:void 0}e.exports={hoverPoints:function(e,t,n,r,i){var o=c(e,t,n,r,i);if(o){var l=o.cd,s=l[0].trace,u=l[o.index];return o.color=d(s,u),a.getComponentMethod("errorbars","hoverInfo")(u,s,o),[o]}},hoverOnBars:c,getTraceColor:d}},1132:function(e,t,n){"use strict";e.exports={attributes:n(832),layoutAttributes:n(9324),supplyDefaults:n(1508).supplyDefaults,crossTraceDefaults:n(1508).crossTraceDefaults,supplyLayoutDefaults:n(7156),calc:n(9439),crossTraceCalc:n(6376).crossTraceCalc,colorbar:n(5528),arraysToCalcdata:n(4664),plot:n(8184).plot,style:n(100).style,styleOnSelect:n(100).styleOnSelect,hoverPoints:n(1020).hoverPoints,eventData:n(2160),selectPoints:n(5784),moduleType:"trace",name:"bar",basePlotModule:n(7952),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},9324:function(e){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}},7156:function(e,t,n){"use strict";var r=n(4040),a=n(4460),i=n(3400),o=n(9324),l=n(1508).validateCornerradius;e.exports=function(e,t,n){function s(n,r){return i.coerce(e,t,o,n,r)}for(var u=!1,c=!1,d=!1,f={},h=s("barmode"),p=0;p0)-(e<0)}function k(e,t){return e0}function C(e,t,n,r,a){return!(e<0||t<0)&&(n<=e&&r<=t||n<=t&&r<=e||(a?e>=n*(t/r):t>=r*(e/n)))}function L(e){return"auto"===e?0:e}function E(e,t){var n=Math.PI/180*t,r=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));return{x:e.width*a+e.height*r,y:e.width*r+e.height*a}}function D(e,t,n,r,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,u=i.anchor,c="end"===u,d="start"===u,f=((i.leftToRight||0)+1)/2,h=1-f,p=i.hasB,v=i.r,m=i.overhead,g=a.width,y=a.height,x=Math.abs(t-e),b=Math.abs(r-n),A=x>2*_&&b>2*_?_:0;x-=2*A,b-=2*A;var w=L(s);"auto"!==s||g<=x&&y<=b||!(g>x||y>b)||(g>b||y>x)&&g_){var C=function(e,t,n,r,a,i,o,l,s){var u,c,d,f,h,p=Math.max(0,Math.abs(t-e)-2*_),v=Math.max(0,Math.abs(r-n)-2*_),m=i-_,g=o?m-Math.sqrt(m*m-(m-o)*(m-o)):m,y=s?2*m:l?m-o:2*g,x=s?2*m:l?2*g:m-o;return a.y/a.x>=v/(p-y)?f=v/a.y:a.y/a.x<=(v-x)/p?f=p/a.x:!s&&l?(u=a.x*a.x+a.y*a.y/4,d=(p-m)*(p-m)+(v/2-m)*(v/2-m)-m*m,f=(-(c=-2*a.x*(p-m)-a.y*(v/2-m))+Math.sqrt(c*c-4*u*d))/(2*u)):s?(u=(a.x*a.x+a.y*a.y)/4,d=(p/2-m)*(p/2-m)+(v/2-m)*(v/2-m)-m*m,f=(-(c=-a.x*(p/2-m)-a.y*(v/2-m))+Math.sqrt(c*c-4*u*d))/(2*u)):(u=a.x*a.x/4+a.y*a.y,d=(p/2-m)*(p/2-m)+(v-m)*(v-m)-m*m,f=(-(c=-a.x*(p/2-m)-2*a.y*(v-m))+Math.sqrt(c*c-4*u*d))/(2*u)),f=Math.min(1,f),h=l?Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(v-a.y*f)/2)*(m-(v-a.y*f)/2)))-o):Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(p-a.x*f)/2)*(m-(p-a.x*f)/2)))-o),{scale:f,pad:h}}(e,t,n,r,S,v,m,o,p);T=C.scale,M=C.pad}else T=1,l&&(T=Math.min(1,x/S.x,b/S.y)),M=0;var D=a.left*h+a.right*f,O=(a.top+a.bottom)/2,P=(e+_)*h+(t-_)*f,N=(n+r)/2,R=0,j=0;if(d||c){var I=(o?S.x:S.y)/2;v&&(c||p)&&(A+=M);var z=o?k(e,t):k(n,r);o?d?(P=e+z*A,R=-z*I):(P=t-z*A,R=z*I):d?(N=n+z*A,j=-z*I):(N=r-z*A,j=z*I)}return{textX:D,textY:O,targetX:P,targetY:N,anchorX:R,anchorY:j,scale:T,rotate:w}}e.exports={plot:function(e,t,n,d,m,g){var A=t.xaxis,O=t.yaxis,P=e._fullLayout,N=e._context.staticPlot;m||(m={mode:P.barmode,norm:P.barmode,gap:P.bargap,groupgap:P.bargroupgap},h("bar",P));var R=i.makeTraceGroups(d,n,"trace bars").each((function(n){var u=r.select(this),d=n[0].trace,h=n[0].t,R="waterfall"===d.type,j="funnel"===d.type,I="histogram"===d.type,z="bar"===d.type,F=z||j,B=0;R&&d.connector.visible&&"between"===d.connector.mode&&(B=d.connector.line.width/2);var U="h"===d.orientation,H=S(m),Y=i.ensureSingle(u,"g","points"),V=w(d),G=Y.selectAll("g.point").data(i.identity,V);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var S,R,j=r.select(this),Y=function(e,t,n,r){var a=[],i=[],o=r?t:n,l=r?n:t;return a[0]=o.c2p(e.s0,!0),i[0]=l.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=l.c2p(e.p1,!0),r?[a,i]:[i,a]}(u,A,O,U),V=Y[0][0],G=Y[0][1],W=Y[1][0],q=Y[1][1],Z=0===(U?G-V:q-W);if(Z&&F&&v.getLineWidth(d,u)&&(Z=!1),Z||(Z=!a(V)||!a(G)||!a(W)||!a(q)),u.isBlank=Z,Z&&(U?G=V:q=W),B&&!Z&&(U?(V-=k(V,G)*B,G+=k(V,G)*B):(W-=k(W,q)*B,q+=k(W,q)*B)),"waterfall"===d.type){if(!Z){var X=d[u.dir].marker;S=X.line.width,R=X.color}}else S=v.getLineWidth(d,u),R=u.mc||d.marker.color;function J(e){var t=r.round(S/2%1,2);return 0===m.gap&&0===m.groupgap?r.round(Math.round(e)-t,2):e}var Q=l.opacity(R)<1||S>.01?J:function(e,t,n){return n&&e===t?e:Math.abs(e-t)>=2?J(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(V=Q(V,G,U),G=Q(G,V,U),W=Q(W,q,!U),q=Q(q,W,!U));var K,$=U?A.c2p:O.c2p;K=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var ee,te,ne=z||I?function(e,t){if(!e)return 0;var n,r=U?Math.abs(q-W):Math.abs(G-V),a=U?Math.abs(G-V):Math.abs(q-W),i=Q(Math.abs($(K,!0)-$(0,!0))),o=u.hasB?Math.min(r/2,a/2):Math.min(r/2,i);return n="%"===t?r*(Math.min(50,e)/100):e,Q(Math.max(Math.min(n,o),0))}(h.cornerradiusvalue,h.cornerradiusform):0,re="M"+V+","+W+"V"+q+"H"+G+"V"+W+"Z",ae=0;if(ne&&u.s){var ie=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((ae=Q(u.hasB?0:Math.abs($(K,!0)-$(ie,!0))))0?Math.sqrt(ae*(2*ne-ae)):0,de=oe>0?Math.max:Math.min;ee="M"+V+","+W+"V"+(q-ue*le)+"H"+de(G-(ne-ae)*oe,V)+"A "+ne+","+ne+" 0 0 "+se+" "+G+","+(q-ne*le-ce)+"V"+(W+ne*le+ce)+"A "+ne+","+ne+" 0 0 "+se+" "+de(G-(ne-ae)*oe,V)+","+(W+ue*le)+"Z"}else if(u.hasB)ee="M"+(V+ne*oe)+","+W+"A "+ne+","+ne+" 0 0 "+se+" "+V+","+(W+ne*le)+"V"+(q-ne*le)+"A "+ne+","+ne+" 0 0 "+se+" "+(V+ne*oe)+","+q+"H"+(G-ne*oe)+"A "+ne+","+ne+" 0 0 "+se+" "+G+","+(q-ne*le)+"V"+(W+ne*le)+"A "+ne+","+ne+" 0 0 "+se+" "+(G-ne*oe)+","+W+"Z";else{var fe=(te=Math.abs(q-W)+ae)0?Math.sqrt(ae*(2*ne-ae)):0,pe=le>0?Math.max:Math.min;ee="M"+(V+fe*oe)+","+W+"V"+pe(q-(ne-ae)*le,W)+"A "+ne+","+ne+" 0 0 "+se+" "+(V+ne*oe-he)+","+q+"H"+(G-ne*oe+he)+"A "+ne+","+ne+" 0 0 "+se+" "+(G-fe*oe)+","+pe(q-(ne-ae)*le,W)+"V"+W+"Z"}}else ee=re}else ee=re;var ve=M(i.ensureSingle(j,"path"),P,m,g);if(ve.style("vector-effect",N?"none":"non-scaling-stroke").attr("d",isNaN((G-V)*(q-W))||Z&&e._context.staticPlot?"M0,0Z":ee).call(s.setClipUrl,t.layerClipId,e),!P.uniformtext.mode&&H){var me=s.makePointStyleFns(d);s.singlePointStyle(u,ve,d,me,e)}!function(e,t,n,r,a,l,u,d,h,m,g,A,w){var T,S=t.xaxis,O=t.yaxis,P=e._fullLayout;function N(t,n,r){return i.ensureSingle(t,"text").text(n).attr({class:"bartext bartext-"+T,"text-anchor":"middle","data-notex":1}).call(s.font,r).call(o.convertToTspans,e)}var R=r[0].trace,j="h"===R.orientation,I=function(e,t,n,r,a){var o,l=t[0].trace,s=l.texttemplate;return o=s?function(e,t,n,r,a){var o=t[0].trace,l=i.castOption(o,n,"texttemplate");if(!l)return"";var s,u,d,f,h="histogram"===o.type,p="waterfall"===o.type,v="funnel"===o.type,m="h"===o.orientation;function g(e){return c(u,u.c2l(e),!0).text}function y(e){return c(f,f.c2l(e),!0).text}m?(s="y",u=a,d="x",f=r):(s="x",u=r,d="y",f=a);var x=t[n],_={};_.label=x.p,_.labelLabel=_[s+"Label"]=g(x.p);var A=i.castOption(o,x.i,"text");(0===A||A)&&(_.text=A),_.value=x.s,_.valueLabel=_[d+"Label"]=y(x.s);var w={};b(w,o,x.i),(h||void 0===w.x)&&(w.x=m?_.value:_.label),(h||void 0===w.y)&&(w.y=m?_.label:_.value),(h||void 0===w.xLabel)&&(w.xLabel=m?_.valueLabel:_.labelLabel),(h||void 0===w.yLabel)&&(w.yLabel=m?_.labelLabel:_.valueLabel),p&&(_.delta=+x.rawS||x.s,_.deltaLabel=y(_.delta),_.final=x.v,_.finalLabel=y(_.final),_.initial=_.final-_.delta,_.initialLabel=y(_.initial)),v&&(_.value=x.s,_.valueLabel=y(_.value),_.percentInitial=x.begR,_.percentInitialLabel=i.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=i.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=i.formatPercent(x.sumR));var T=i.castOption(o,x.i,"customdata");return T&&(_.customdata=T),i.texttemplateString(l,_,e._d3locale,w,_,o._meta||{})}(e,t,n,r,a):l.textinfo?function(e,t,n,r){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function u(e){return c(o?r:n,e,!0).text}function d(e){return c(o?n:r,+e,!0).text}var f,h=a.textinfo,p=e[t],v=h.split("+"),m=[],g=function(e){return-1!==v.indexOf(e)};if(g("label")&&m.push(u(e[t].p)),g("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&m.push(f),l){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(d(b)),g("delta")&&m.push(d(y)),g("final")&&m.push(d(x))}if(s){g("value")&&m.push(d(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var A=_>1;g("percent initial")&&(f=i.formatPercent(p.begR),A&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=i.formatPercent(p.difR),A&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=i.formatPercent(p.sumR),A&&(f+=" of total"),m.push(f))}return m.join("
")}(t,n,r,a):v.getValue(l.text,n),v.coerceString(y,o)}(P,r,a,S,O);T=function(e,t){var n=v.getValue(e.textposition,t);return v.coerceEnumerated(x,n)}(R,a);var z="stack"===A.mode||"relative"===A.mode,F=r[a],B=!z||F._outmost,U=F.hasB,H=m&&m-g>_;if(I&&"none"!==T&&(!F.isBlank&&l!==u&&d!==h||"auto"!==T&&"inside"!==T)){var Y=P.font,V=p.getBarColor(r[a],R),G=p.getInsideTextFont(R,a,Y,V),W=p.getOutsideTextFont(R,a,Y),q=R.insidetextanchor||"end",Z=n.datum();j?"log"===S.type&&Z.s0<=0&&(l=S.range[0]0&&K>0;ae=H?U?C(ne-2*m,re,Q,K,j)||C(ne,re-2*m,Q,K,j):j?C(ne-(m-g),re,Q,K,j)||C(ne,re-2*(m-g),Q,K,j):C(ne,re-(m-g),Q,K,j)||C(ne-2*(m-g),re,Q,K,j):C(ne,re,Q,K,j),ie&&ae?T="inside":(T="outside",X.remove(),X=null)}else T="inside";if(!X){var oe=(X=N(n,I,$=i.ensureUniformFontSize(e,"outside"===T?W:G))).attr("transform");if(X.attr("transform",""),Q=(J=s.bBox(X.node())).width,K=J.height,X.attr("transform",oe),Q<=0||K<=0)return void X.remove()}var le,se=R.textangle;le="outside"===T?function(e,t,n,r,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,u=i.angle||0,c=a.width,d=a.height,f=Math.abs(t-e),h=Math.abs(r-n);o=l?h>2*_?_:0:f>2*_?_:0;var p=1;s&&(p=l?Math.min(1,h/d):Math.min(1,f/c));var v=L(u),m=E(a,v),g=(l?m.x:m.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,A=(n+r)/2,w=0,T=0,M=l?k(t,e):k(n,r);return l?(b=t-M*o,w=M*g):(A=r+M*o,T=-M*g),{textX:y,textY:x,targetX:b,targetY:A,anchorX:w,anchorY:T,scale:p,rotate:v}}(l,u,d,h,J,{isHorizontal:j,constrained:"both"===R.constraintext||"outside"===R.constraintext,angle:se}):D(l,u,d,h,J,{isHorizontal:j,constrained:"both"===R.constraintext||"inside"===R.constraintext,angle:se,anchor:q,hasB:U,r:m,overhead:g}),le.fontSize=$.size,f("histogram"===R.type?"bar":R.type,le,P),F.transform=le;var ue=M(X,P,A,w);i.setTransormAndDisplay(ue,le)}else n.select("text").remove()}(e,t,j,n,w,V,G,W,q,ne,ae,m,g),t.layerClipId&&s.hideOutsideRangePoint(u,j.select("text"),A,O,d.xcalendar,d.ycalendar)}));var W=!1===d.cliponaxis;s.setClipUrl(u,W?null:t.layerClipId,e)}));u.getComponentMethod("errorbars","plot")(e,R,t,m)},toMoveInsideBar:D}},5784:function(e){"use strict";function t(e,t,n,r,a){var i=t.c2p(r?e.s0:e.p0,!0),o=t.c2p(r?e.s1:e.p1,!0),l=n.c2p(r?e.p0:e.s0,!0),s=n.c2p(r?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:r?[o,(l+s)/2]:[(i+o)/2,s]}e.exports=function(e,n){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,u="h"===l.orientation,c=[];if(!1===n)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){p(r.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:v,styleOnSelect:function(e,t,n){var a=t[0].trace;a.selectedpoints?function(e,t,n){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,n){e.each((function(e){var a,l=r.select(this);if(e.selected){a=o.ensureUniformFontSize(n,m(l,e,t,n));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,n)}(n,a,e):(p(n,a,e),l.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},5592:function(e,t,n){"use strict";var r=n(6308),a=n(4288).hasColorscale,i=n(7260),o=n(3400).coercePattern;e.exports=function(e,t,n,l,s){var u=n("marker.color",l),c=a(e,"marker");c&&i(e,t,s,n,{prefix:"marker.",cLetter:"c"}),n("marker.line.color",r.defaultLine),a(e,"marker.line")&&i(e,t,s,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width"),n("marker.opacity"),o(n,"marker.pattern",u,c),n("selected.marker.color"),n("unselected.marker.color")}},2744:function(e,t,n){"use strict";var r=n(3428),a=n(3400);function i(e){return"_"+e+"Text_minsize"}e.exports={recordMinTextSize:function(e,t,n){if(n.uniformtext.mode){var r=i(e),a=n.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o g.point"}t.selectAll(l).each((function(e){var t=e.transform;if(t){t.scale=s&&t.hide?0:o/t.fontSize;var n=r.select(this).select("text");a.setTransormAndDisplay(n,t)}}))}}}},4996:function(e,t,n){"use strict";var r=n(5464),a=n(6968).u,i=n(5376),o=n(2548),l=n(1776).Ks,s=n(1776).Gw,u=n(2880).extendFlat,c=n(8192).c,d=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:l({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},d,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},d,{}),outsidetextfont:u({},d,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},d,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},d,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},36:function(e,t,n){"use strict";var r=n(7316);t.name="pie",t.plot=function(e,n,a,i){r.plotBasePlot(t.name,e,n,a,i)},t.clean=function(e,n,a,i){r.cleanBasePlot(t.name,e,n,a,i)}},5768:function(e,t,n){"use strict";var r=n(8248),a=n(9760),i=n(6308),o={};function l(e){return function(t,n){return!!t&&!!(t=a(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[n]||(e[n]=t),t)}}function s(e,t){var n,r=JSON.stringify(e),i=t[r];if(!i){for(i=e.slice(),n=0;n=0})),("funnelarea"===t.type?g:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=m),i},crossTraceCalc:function(e,t){var n=(t||{}).type;n||(n="pie");var r=e._fullLayout,a=e.calcdata,i=r[n+"colorway"],l=r["_"+n+"colormap"];r["extend"+n+"colors"]&&(i=s(i,o));for(var u=0,c=0;c0){l=!0;break}}l||(o=0)}return{hasLabels:n,hasValues:i,len:o}}function c(e,t,n,r,a){r("marker.line.width")&&r("marker.line.color",a?void 0:n.paper_bgcolor);var i=r("marker.colors");s(r,"marker.pattern",i),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=n.paper_bgcolor)}e.exports={handleLabelsAndValues:u,handleMarkerDefaults:c,supplyDefaults:function(e,t,n,r){function s(n,r){return a.coerce(e,t,i,n,r)}var d=u(s("labels"),s("values")),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(s("label0"),s("dlabel")),f){t._length=f,c(e,t,r,s,!0),s("scalegroup");var h,p=s("text"),v=s("texttemplate");if(v||(h=s("textinfo",a.isArrayOrTypedArray(p)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),v||h&&"none"!==h){var m=s("textposition");l(e,t,r,s,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&s("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&s("insidetextorientation")}else"none"===h&&s("textposition","none");o(t,r,s);var g=s("hole");if(s("title.text")){var y=s("title.position",g?"middle center":"top center");g||"middle center"!==y||(t.title.position="top center"),a.coerceFont(s,"title.font",r.font)}s("sort"),s("direction"),s("rotation"),s("pull")}else t.visible=!1}}},3644:function(e,t,n){"use strict";var r=n(624).appendArrayMultiPointValues;e.exports=function(e,t){var n={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(n.pointNumber=n.i=e.pts[0]),r(n,t,e.pts),"funnelarea"===t.type&&(delete n.v,delete n.i),n}},1552:function(e,t,n){"use strict";var r=n(3616),a=n(6308);e.exports=function(e,t,n,i){var o=n.marker.pattern;o&&o.shape?r.pointStyle(e,n,i,t):a.fill(e,t.color)}},9656:function(e,t,n){"use strict";var r=n(3400);function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}t.formatPiePercent=function(e,t){var n=a((100*e).toPrecision(3));return r.numSeparate(n,t)+"%"},t.formatPieValue=function(e,t){var n=a(e.toPrecision(10));return r.numSeparate(n,t)},t.getFirstFilled=function(e,t){if(r.isArrayOrTypedArray(e))for(var n=0;n"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(A.family,e.pts),fontSize:m.castOption(A.size,e.pts),fontColor:m.castOption(A.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,d)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,inOut_bbox:w}),e.bbox=w[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,d)],event:r.event})}})),e.on("mouseout",(function(e){var n=t._fullLayout,a=t._fullData[u.index],o=r.select(this).datum();u._hasHoverEvent&&(e.originalEvent=r.event,t.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),u._hasHoverLabel=!1)})),e.on("click",(function(e){var n=t._fullLayout,a=t._fullData[u.index];t._dragging||!1===n.hovermode||(t._hoverdata=[g(e,a)],i.click(t,r.event))}))}function b(e,t,n){var r=m.castOption(e.insidetextfont.color,t.pts);!r&&e._input.textfont&&(r=m.castOption(e._input.textfont.color,t.pts));var a=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||n.family,i=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||n.size;return{color:r||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var n,r,a=0;at&&t>r||n=-4;m-=2)g(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)g(Math.PI*(m+1),"tan")}if(d||h){for(m=4;m>=-4;m-=2)g(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)g(Math.PI*(m+.5),"rad")}}if(l||p||d){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*r*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;v.push(i)}(p||h)&&((i=w(e,r,o,s,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i)),(p||f)&&((i=T(e,r,o,s,u)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i));for(var x=0,b=0,_=0;_=1)break}return v[x]}function w(e,t,n,r,a){t=Math.max(0,t-2*v);var i=e.width/e.height,o=S(i,r,t,n);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:M(a)}}function T(e,t,n,r,a){t=Math.max(0,t-2*v);var i=e.height/e.width,o=S(i,r,t,n);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:M(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function M(e){return(180/Math.PI*e+720)%180-90}function S(e,t,n,r){var a=e+1/(2*Math.tan(t));return n*Math.min(1/(Math.sqrt(a*a+.5)+a),r/(Math.sqrt(e*e+r/2)+e))}function C(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function L(e,t){var n=t.pxmid[0],r=t.pxmid[1],a=e.width/2,i=e.height/2;return n<0&&(a*=-1),r<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+n*n/(r*r)),outside:!0}}function E(e,t){var n,r,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=O(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,u,c=(s=e.r,u=e.trace.aspectratio,s/(void 0===u?1:u)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=c,o.x-=(1+a)*c,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=c,o.x+=(1+a)*c,l.tx-=e.titleBox.width/2),n=d/e.titleBox.width,r=D(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(n,r),tx:l.tx,ty:l.ty}}function D(e,t){var n=e.trace,r=t.h*(n.domain.y[1]-n.domain.y[0]);return Math.min(e.titleBox.height,r/2)}function O(e){var t,n=e.pull;if(!n)return 0;if(s.isArrayOrTypedArray(n))for(n=0,t=0;tn&&(n=e.pull[t]);return n}function P(e,t){for(var n=[],r=0;r1?c=(u=n.r)/a.aspectratio:u=(c=n.r)*a.aspectratio,s=(u*=(1+a.baseratio)/2)*c}o=Math.min(o,s/n.vTotal)}for(r=0;r")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:m.formatPieValue(e.v,r.separators),percent:e.v/n.vTotal,percentLabel:m.formatPiePercent(e.v/n.vTotal,r.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=m.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function j(e,t){var n=e.rotate*Math.PI/180,r=Math.cos(n),a=Math.sin(n),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*r-o*a,e.textY=i*a+o*r,e.noCenter=!0}e.exports={plot:function(e,t){var n=e._context.staticPlot,i=e._fullLayout,f=i._size;p("pie",i),_(t,e),P(t,f);var v=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var p=r.select(this),v=t[0],g=v.trace;!function(e){var t,n,r,a=e[0],i=a.r,o=a.trace,l=m.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;ta.vTotal/2?1:0,n.halfangle=Math.PI*Math.min(n.v/a.vTotal,.5),n.ring=1-o.hole,n.rInscribed=C(n,a))}(t),p.attr("stroke-linejoin","round"),p.each((function(){var y=r.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],w=!1;y.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var u=v.cx,c=v.cy,f=r.select(this),p=f.selectAll("path.surface").data([a]);if(p.enter().append("path").classed("surface",!0).style({"pointer-events":n?"none":"all"}),f.call(x,e,t),g.pull){var y=+m.castOption(g.pull,a.pts)||0;y>0&&(u+=y*a.pxmid[0],c+=y*a.pxmid[1])}a.cxFinal=u,a.cyFinal=c;var T=g.hole;if(a.v===v.vTotal){var k="M"+(u+a.px0[0])+","+(c+a.px0[1])+D(a.px0,a.pxmid,!0,1)+D(a.pxmid,a.px0,!0,1)+"Z";T?p.attr("d","M"+(u+T*a.px0[0])+","+(c+T*a.px0[1])+D(a.px0,a.pxmid,!1,T)+D(a.pxmid,a.px0,!1,T)+"Z"+k):p.attr("d",k)}else{var M=D(a.px0,a.px1,!0,1);if(T){var S=1-T;p.attr("d","M"+(u+T*a.px1[0])+","+(c+T*a.px1[1])+D(a.px1,a.px0,!1,T)+"l"+S*a.px0[0]+","+S*a.px0[1]+M+"Z")}else p.attr("d","M"+u+","+c+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}R(e,a,v);var C=m.castOption(g.textposition,a.pts),E=f.selectAll("g.slicetext").data(a.text&&"none"!==C?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each((function(){var n=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===C?function(e,t,n){var r=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||n.color,a=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||n.family,i=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||n.size;return{color:r,family:a,size:i}}(g,a,i.font):b(g,a,i.font));n.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var p,y=l.bBox(n.node());if("outside"===C)p=L(y,a);else if(p=A(y,a,v),"auto"===C&&p.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);n.call(l.font,x),p=L(y=l.bBox(n.node()),a)}var _=p.textPosAngle,T=void 0===_?a.pxmid:N(v.r,_);if(p.targetX=u+T[0]*p.rCenter+(p.x||0),p.targetY=c+T[1]*p.rCenter+(p.y||0),j(p,y),p.outside){var k=p.targetY;a.yLabelMin=k-y.height/2,a.yLabelMid=k,a.yLabelMax=k+y.height/2,a.labelExtraX=0,a.labelExtraY=0,w=!0}p.fontSize=f.size,h(g.type,p,i),t[o].transform=p,s.setTransormAndDisplay(n,p)}))}function D(e,t,n,r){var i=r*(t[0]-e[0]),o=r*(t[1]-e[1]);return"a"+r*v.r+","+r*v.r+" 0 "+a.largeArc+(n?" 1 ":" 0 ")+i+","+o}}));var T=r.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,n=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=g.title.text;g._meta&&(a=s.templateString(a,g._meta)),n.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,g.title.font).call(d.convertToTspans,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(v):E(v,f),n.attr("transform",c(t.x,t.y)+u(Math.min(1,t.scale))+c(t.tx,t.ty))})),w&&function(e,t){var n,r,a,i,o,l,u,c,d,f,h,p,v;function g(e,t){return e.pxmid[1]-t.pxmid[1]}function y(e,t){return t.pxmid[1]-e.pxmid[1]}function x(e,n){n||(n={});var a,c,d,h,p=n.labelExtraY+(r?n.yLabelMax:n.yLabelMin),v=r?e.yLabelMin:e.yLabelMax,g=r?e.yLabelMax:e.yLabelMin,y=e.cyFinal+o(e.px0[1],e.px1[1]),x=p-v;if(x*u>0&&(e.labelExtraY=x),s.isArrayOrTypedArray(t.pull))for(c=0;c=(m.castOption(t.pull,d.pts)||0)||((e.pxmid[1]-d.pxmid[1])*u>0?(x=d.cyFinal+o(d.px0[1],d.px1[1])-v-e.labelExtraY)*u>0&&(e.labelExtraY+=x):(g+e.labelExtraY-y)*u>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(h=d.cxFinal+i(d.px0[0],d.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=h)))}for(r=0;r<2;r++)for(a=r?g:y,o=r?Math.max:Math.min,u=r?1:-1,n=0;n<2;n++){for(i=n?Math.max:Math.min,l=n?1:-1,(c=e[r][n]).sort(a),d=e[1-r][n],f=d.concat(c),p=[],h=0;hMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+u):l+="l"+e.labelExtraX+","+c+"v"+(d-c)+"h"+u}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+u;s.ensureSingle(n,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(y,g),w&&g.automargin){var k=l.bBox(p.node()),M=g.domain,S=f.w*(M.x[1]-M.x[0]),C=f.h*(M.y[1]-M.y[0]),D=(.5*S-v.r)/f.w,O=(.5*C-v.r)/f.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:M.x[0]-D,xr:M.x[1]+D,yb:M.y[0]-O,yt:M.y[1]+O,l:Math.max(v.cx-v.r-k.left,0),r:Math.max(k.right-(v.cx+v.r),0),b:Math.max(k.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-k.top,0),pad:5})}}))}));setTimeout((function(){v.selectAll("tspan").each((function(){var e=r.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:R,transformInsideText:A,determineInsideTextFont:b,positionTitleOutside:E,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:j}},2152:function(e,t,n){"use strict";var r=n(3428),a=n(528),i=n(2744).resizeText;e.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(t){var n=t[0].trace,i=r.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each((function(t){r.select(this).call(a,t,n,e)}))}))}},528:function(e,t,n){"use strict";var r=n(6308),a=n(9656).castOption,i=n(1552);e.exports=function(e,t,n,o){var l=n.marker.line,s=a(l.color,t.pts)||r.defaultLine,u=a(l.width,t.pts)||0;e.call(i,t,n,o).style("stroke-width",u).call(r.stroke,s)}},148:function(e,t,n){"use strict";var r=n(3400);e.exports=function(e,t){for(var n=0;ns&&E[g].gap;)g--;for(x=E[g].s,v=E.length-1;v>g;v--)E[v].s=x;for(;sS[d]&&d=0;d--){var f=e[d];if("scatter"===f.type&&f.xaxis===u.xaxis&&f.yaxis===u.yaxis){f.opacity=void 0;break}}}}}},8800:function(e,t,n){"use strict";var r=n(3400),a=n(4040),i=n(2904),o=n(8200),l=n(3028),s=n(3980),u=n(1147),c=n(3912),d=n(4428),f=n(6828),h=n(1731),p=n(124),v=n(840),m=n(3400).coercePattern;e.exports=function(e,t,n,g){function y(n,a){return r.coerce(e,t,i,n,a)}var x=s(e,t,g,y);if(x||(t.visible=!1),t.visible){u(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=c(e,t,g,y);"group"===g.scattermode&&void 0===t.orientation&&y("orientation","v");var _=!b&&x=Math.min(t,n)&&p<=Math.max(t,n)?0:1/0}var r=Math.max(3,e.mrc||0),a=1-1/r,i=Math.abs(f.c2p(e.x)-p);return i=Math.min(t,n)&&v<=Math.max(t,n)?0:1/0}var r=Math.max(3,e.mrc||0),a=1-1/r,i=Math.abs(h.c2p(e.y)-v);return in!==(u=a[r][1])>=n&&(o=a[r-1][0],l=a[r][0],u-s&&(i=o+(l-o)*(n-s)/(u-s),d=Math.min(d,i),p=Math.max(p,i)));return{x0:d=Math.max(d,0),x1:p=Math.min(p,f._length),y0:n,y1:n}}(d._polygons);null===O&&(O={x0:m[0],x1:m[0],y0:m[1],y1:m[1]});var P=l.defaultLine;return l.opacity(d.fillcolor)?P=d.fillcolor:l.opacity((d.line||{}).color)&&(P=d.line.color),r.extendFlat(e,{distance:e.maxHoverDistance,x0:O.x0,x1:O.x1,y0:O.y0,y1:O.y1,color:P,hovertemplate:!1}),delete e.index,d.text&&!r.isArrayOrTypedArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}},5875:function(e,t,n){"use strict";var r=n(3028);e.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:n(2904),layoutAttributes:n(5308),supplyDefaults:n(8800),crossTraceDefaults:n(5036),supplyLayoutDefaults:n(9748),calc:n(6356).calc,crossTraceCalc:n(6664),arraysToCalcdata:n(148),plot:n(6504),colorbar:n(5528),formatLabels:n(6688),style:n(6844).style,styleOnSelect:n(6844).styleOnSelect,hoverPoints:n(8723),selectPoints:n(1560),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:n(7952),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},5308:function(e){"use strict";e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},9748:function(e,t,n){"use strict";var r=n(3400),a=n(5308);e.exports=function(e,t){var n,i,o="group"===t.barmode;"group"===t.scattermode&&(n="scattergap",i=o?t.bargap:.2,r.coerce(e,t,a,n,i))}},6828:function(e,t,n){"use strict";var r=n(3400).isArrayOrTypedArray,a=n(4288).hasColorscale,i=n(7260);e.exports=function(e,t,n,o,l,s){s||(s={});var u=(e.marker||{}).color;u&&u._inputArray&&(u=u._inputArray),l("line.color",n),a(e,"line")?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!r(u)&&u||n),l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},2340:function(e,t,n){"use strict";var r=n(3616),a=n(9032),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,u=n(3400),c=u.segmentsIntersect,d=u.constrain,f=n(8200);e.exports=function(e,t){var n,a,o,h,p,v,m,g,y,x,b,_,A,w,T,k,M,S,C=t.trace||{},L=t.xaxis,E=t.yaxis,D="log"===L.type,O="log"===E.type,P=L._length,N=E._length,R=t.backoff,j=C.marker,I=t.connectGaps,z=t.baseTolerance,F=t.shape,B="linear"===F,U=C.fill&&"none"!==C.fill,H=[],Y=f.minTolerance,V=e.length,G=new Array(V),W=0;function q(n){var r=e[n];if(!r)return!1;var a=t.linearized?L.l2p(r.x):L.c2p(r.x),o=t.linearized?E.l2p(r.y):E.c2p(r.y);if(a===i){if(D&&(a=L.c2p(r.x,!0)),a===i)return!1;O&&o===i&&(a*=Math.abs(L._m*N*(L._m>0?l:s)/(E._m*P*(E._m>0?l:s)))),a*=1e3}if(o===i){if(O&&(o=E.c2p(r.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function Z(e,t,n,r){var a=n-e,i=r-t,o=.5-e,l=.5-t,s=a*a+i*i,u=a*o+i*l;if(u>0&&u