"),void 0!==t.yLabel&&(d+="y: "+t.yLabel+"
"),d+=(d?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?d=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(d=t.yLabel):d=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(d+=(d?"
":"")+t.text),void 0!==t.extraText&&(d+=(d?"
":"")+t.extraText),""!==d||t.hovertemplate||(""===c&&e.remove(),d=c);var b=t.hovertemplate||!1,_=t.hovertemplateLabels||t,A=t.eventData[0]||{};b&&(d=(d=o.hovertemplateString(b,_,A)).replace(T,function(t,e){return c=e,""}));var L=e.select("text.nums").call(u.font,t.fontFamily||h,t.fontSize||g,t.fontColor||x).text(d).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),D=e.select("text.name"),P=0,E=0;if(c&&c!==d){D.call(u.font,t.fontFamily||h,t.fontSize||g,m).text(c).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var R=D.node().getBoundingClientRect();P=R.width+2*k,E=R.height+2*k}else D.remove(),e.select("rect").remove();e.select("path").style({fill:v,stroke:x});var I,F,N=L.node().getBoundingClientRect(),B=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,H=Math.abs(t.x1-t.x0),q=Math.abs(t.y1-t.y0),V=N.width+w+k+P;t.ty0=S-N.top,t.bx=N.width+2*k,t.by=Math.max(N.height+2*k,E),t.anchor="start",t.txwidth=N.width,t.tx2width=P,t.offset=0,i?(t.pos=B,I=j+q/2+V<=O,F=j-q/2-V>=0,"top"!==t.idealAlign&&I||!F?I?(j+=q/2,t.anchor="start"):t.anchor="middle":(j-=q/2,t.anchor="end")):(t.pos=j,I=B+H/2+V<=C,F=B-H/2-V>=0,"left"!==t.idealAlign&&I||!F?I?(B+=H/2,t.anchor="start"):t.anchor="middle":(B-=H/2,t.anchor="end")),L.attr("text-anchor",t.anchor),P&&D.attr("text-anchor",t.anchor),e.attr("transform","translate("+B+","+j+")"+(i?"rotate("+y+")":""))}),F}function A(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var a="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],l=o*(w+k),c=l+o*(t.txwidth+k),f=0,d=t.offset;"middle"===t.anchor&&(l-=t.tx2width/2,c+=t.txwidth/2+k),e&&(d*=-_,f=t.offset*b),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(d-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(a*w+f)+","+(w+d)+"v"+(t.by/2-w)+"h"+a*t.bx+"v-"+t.by+"H"+(a*w+f)+"V"+(d-w)+"Z"),i.call(s.positionText,l+f,d+t.ty0-t.by/2+k),t.tx2width&&(r.select("text.name").call(s.positionText,c+o*k+f,d+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,c+(o-1)*t.tx2width/2+f,d-t.by/2-1,t.tx2width,t.by+2))}})}function L(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],i=t.cd[r]||{},l=Array.isArray(r)?function(t,e){return o.castOption(a,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(i,n,t,e)};function s(e,r,n){var a=l(r,n);a&&(t[e]=a)}if(s("hoverinfo","hi","hoverinfo"),s("bgcolor","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function S(t,e){var r,n,a=e.container,o=e.fullLayout,l=e.event,s=!!t.hLinePoint,c=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),c||s){var d=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(s){var p,h,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(p=l.pointerX,h=l.pointerY):(p=r._offset+g.x,h=n._offset+g.y);var v,y,m=i.readability(g.color,d)<1.5?f.contrast(d):g.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||m,w=n._boundingBox,k=(w.left+w.right)/20){for(var n=[],a=0;a-1?o="closest":(e._isHoriz=function(t){for(var e=!0,r=0;r1){d||p||h||"independent"===T("pattern")&&(d=!0),v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),v._domains={x:u("x",T,w,x,m),y:u("y",T,k,b,y,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=t.grid||{},p=e._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,y="independent"===r.pattern,m=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n1);if(!1!==x||p.uirevision){var b=i.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==x){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),a.coerceFont(w,"font",e.font),w("orientation"),"h"===b.orientation){var _=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(_)?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}w("traceorder",v),s.isGrouped(e.legend)&&w("tracegroupgap"),w("x",c),w("xanchor",f),w("y",u),w("yanchor",d),w("valign"),a.noneOrAll(p,b,["x","y"])}}function w(t,e){return a.coerce(p,b,o,t,e)}}},{"../../lib":168,"../../plot_api/plot_template":202,"../../plots/layout_attributes":243,"../../registry":257,"./attributes":100,"./helpers":106}],103:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib/events"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/interactions"),g=t("../../constants/alignment"),v=g.LINE_SPACING,y=g.FROM_TL,m=g.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=h.DBLCLICKDELAY;function k(t,e,r,n,a){var i=r.data()[0][0].trace,o={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(o.group=i._group),"pie"===i.type&&(o.label=r.datum()[0].label),!1!==l.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){d(r,t,n)},w);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==l.triggerHandler(t,"plotly_legenddoubleclick",o)&&d(r,t,n)}}function T(t,e,r){var n=t.data()[0][0],i=e._fullLayout,l=n.trace,s=o.traceIs(l,"pie"),u=l.index,d=s?n.label:l.name,h=e._context.edits.legendText&&!s,g=a.ensureSingle(t,"text","legendtext");function y(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend.font.size*v;if(o){var s=c.bBox(o);n=s.height,a=s.width,c.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),d=f.lineCount(u),h=u.node();n=l*d,a=h?c.bBox(h).width:0;var g=l*(.3+(1-d)/2);f.positionText(u,p.textOffsetX,g)}r.lineHeight=l,r.height=Math.max(n,16)+3,r.width=a}(t,e)})}g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,i.legend.font).text(h?M(d,r):d),f.positionText(g,p.textOffsetX,0),h?g.call(f.makeEditable,{gd:e,text:d}).call(y).on("edit",function(t){this.text(M(t,r)).call(y);var i=n.trace._fullInput||{},l={};if(o.hasTransform(i,"groupby")){var s=o.getTransformIndices(i,"groupby"),c=s[s.length-1],f=a.keyedContainer(i,"transforms["+c+"].styles","target","value.name");f.set(n.trace._group,t),l=f.constructUpdate()}else l.name=t;return o.call("_guiRestyle",e,l,u)}):y(g)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,i=1,o=a.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimew&&(i=Math.max(i-1,1)),k(e,r,t,i,n.event)}})}function L(t,e,r){var a=t._fullLayout,i=a.legend,o=i.borderwidth,l=_.isGrouped(i),s=0;if(i._width=0,i._height=0,_.isVertical(i))l&&e.each(function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;c.setTranslate(this,o,5+o+i._height+r/2),i._height+=r,i._width=Math.max(i._width,n)}),i._width+=45+2*o,i._height+=10+2*o,l&&(i._height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(l){for(var u=[i._width],f=e.data(),d=0,p=f.length;do+b-w;r.each(function(t){var e=t[0],r=k?40+t[0].width:m;o+x+w+r>a._size.w&&(x=0,v+=y,i._height+=y,y=0),c.setTranslate(this,o+x,5+o+e.height/2+v),i._width+=w+r,x+=w+r,y=Math.max(e.height,y)}),k?i._height=y:i._height+=y,i._width+=2*o,i._height+=10+2*o}i._width=Math.ceil(i._width),i._height=Math.ceil(i._height);var T=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");c.setRect(r,0,-e.height/2,(T?0:i._width)+s,e.height)})}function S(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center");var n="top";a.isBottomAnchor(e)?n="bottom":a.isMiddleAnchor(e)&&(n="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*m[r],b:e._height*m[n],t:e._height*y[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var l=e.legend,f=e.showlegend&&x(t.calcdata,l),d=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void i.autoMargin(t,"legend");for(var h=0,g=0;gf?function(t){var e=t._fullLayout.legend,r="left";a.isRightAnchor(e)?r="right":a.isCenterAnchor(e)&&(r="center");i.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*y[r],r:e._width*m[r],b:0,t:0})}(t):S(t);var d=e._size,h=d.l+d.w*l.x,g=d.t+d.h*(1-l.y);a.isRightAnchor(l)?h-=l._width:a.isCenterAnchor(l)&&(h-=l._width/2),a.isBottomAnchor(l)?g-=l._height:a.isMiddleAnchor(l)&&(g-=l._height/2);var v=l._width,x=d.w;v>x?(h=d.l,v=x):(h+v>u&&(h=u-v),h<0&&(h=0),v=Math.min(u-h,l._width));var b,_,w,T,M=l._height,A=d.h;if(M>A?(g=d.t,M=A):(g+M>f&&(g=f-M),g<0&&(g=0),M=Math.min(f-g,l._height)),c.setTranslate(O,h,g),E.on(".drag",null),O.on("wheel",null),l._height<=M||t._context.staticPlot)D.attr({width:v-l.borderwidth,height:M-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),c.setTranslate(P,0,0),z.select("rect").attr({width:v-2*l.borderwidth,height:M-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth}),c.setClipUrl(P,r,t),c.setRect(E,0,0,0,0),delete l._scrollY;else{var F,N,B=Math.max(p.scrollBarMinHeight,M*M/l._height),j=M-B-2*p.scrollBarMargin,H=l._height-M,q=j/H,V=Math.min(l._scrollY||0,H);D.attr({width:v-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:M-l.borderwidth,x:l.borderwidth/2,y:l.borderwidth/2}),z.select("rect").attr({width:v-2*l.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:M-2*l.borderwidth,x:l.borderwidth,y:l.borderwidth+V}),c.setClipUrl(P,r,t),G(V,B,q),O.on("wheel",function(){G(V=a.constrain(l._scrollY+n.event.deltaY/j*H,0,H),B,q),0!==V&&V!==H&&n.event.preventDefault()});var U=n.behavior.drag().on("dragstart",function(){F=n.event.sourceEvent.clientY,N=V}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||G(V=a.constrain((t.clientY-F)/q+N,0,H),B,q)});E.call(U)}function G(e,r,n){l._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(P,0,-e),c.setRect(E,v,p.scrollBarMargin+e*n,p.scrollBarWidth,r),z.select("rect").attr({y:l.borderwidth+e})}t._context.edits.legendPosition&&(O.classed("cursor-move",!0),s.init({element:O.node(),gd:t,prepFn:function(){var t=c.getTranslate(O);w=t.x,T=t.y},moveFn:function(t,e){var r=w+t,n=T+e;c.setTranslate(O,r,n),b=s.align(r,0,d.l,d.l+d.w,l.xanchor),_=s.align(n,0,d.t+d.h,d.t,l.yanchor)},doneFn:function(){void 0!==b&&void 0!==_&&o.call("_guiRelayout",t,{"legend.x":b,"legend.y":_})},clickFn:function(r,n){var a=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});a.size()>0&&k(t,O,a,r,n)}}))}],t)}}},{"../../constants/alignment":146,"../../constants/interactions":148,"../../lib":168,"../../lib/events":161,"../../lib/svg_text_utils":189,"../../plots/plots":245,"../../registry":257,"../color":51,"../dragelement":69,"../drawing":72,"./constants":101,"./get_legend_data":104,"./handle_click":105,"./helpers":106,"./style":108,d3:16}],104:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},l=[],s=!1,c={},u=0;function f(t,r){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;rr[1])return r[1]}return a}function h(t){return t[0]}if(u||f||d){var g={},v={};if(u){g.mc=p("marker.color",h),g.mx=p("marker.symbol",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16]);g.ms=y,v.marker.size=y}d&&(v.line={width:p("line.width",h,[0,10])}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(l,g)],(a=i.minExtend(c,v)).selectedpoints=null}var m=n.select(this).select("g.legendpoints"),x=m.selectAll("path.scatterpts").data(u?r:[]);x.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),x.exit().remove(),x.call(o.pointStyle,a,e),u&&(r[0].mrc=3);var b=m.selectAll("g.pointtext").data(f?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,a,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,o=n.select(this);o.style("stroke-width",i+"px").call(l.fill,a.fillcolor),i&&l.stroke(o,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var a=e[r?"increasing":"decreasing"],i=a.line.width,s=n.select(this);s.style("fill","none").call(o.dashLine,a.line.dash,i),i&&l.stroke(s,a.line.color)})})}},{"../../lib":168,"../../registry":257,"../../traces/pie/style_one":365,"../../traces/scatter/subtypes":391,"../color":51,"../drawing":72,d3:16}],109:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),l=t("../../../build/ploticon"),s=o._,c=e.exports={};function u(t,e){var r,a,o=e.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=i.list(t,null,!0),d="on";if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(k=["toggleHover"],T=["resetViews"]):d?(w=["zoomInGeo","zoomOutGeo"],k=["hoverClosestGeo"],T=["resetGeo"]):f?(k=["hoverClosest3d"],T=["resetCameraDefault3d","resetCameraLastSave3d"]):v?(k=["toggleHover"],T=["resetViewMapbox"]):k=h?["hoverClosestGl2d"]:p?["hoverClosestPie"]:["toggleHover"];u&&(k=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!u&&!h||m||(w=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==T[0]&&(T=["resetScale2d"]));f?M=["zoom3d","pan3d","orbitRotation","tableRotation"]:(u||h)&&!m||g?M=["zoom2d","pan2d"]:v||d?M=["pan2d"]:y&&(M=["zoom2d"]);(function(t){for(var e=!1,r=0;r0)){var g=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,i=0;i0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(t,e,r,n,a){var l="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[l(e),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===t.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:R?V(r.xanchor)+r.x0:V(r.x0),cy:I?U(r.yanchor)-r.y0:U(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:R?V(r.xanchor)+r.x1:V(r.x1),cy:I?U(r.yanchor)-r.y1:U(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,Y={element:X.node(),gd:t,prepFn:function(n){R&&(_=V(r.xanchor));I&&(w=U(r.yanchor));"path"===r.type?z=r.path:(y=R?r.x0:V(r.x0),m=I?r.y0:U(r.y0),x=R?r.x1:V(r.x1),b=I?r.y1:U(r.y1));yb?(k=m,L="y0",T=b,S="y1"):(k=b,L="y1",T=m,S="y0");W(n),Q(p,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n);"paper"===a||s.autorange||(c+=a);l.setClipUrl(t,c?"clip"+r._fullLayout._uid+c:null,r)}(e,r,t),Y.moveFn="move"===D?J:$},doneFn:function(){u(e),K(p),h(e,t,r),n.call("_guiRelayout",t,B.getUpdateObj())},clickFn:function(){K(p)}};function W(t){if(F)D="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=Y.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=t.clientX-r.left,o=t.clientY-r.top,l=!N&&n>P&&a>E&&!t.shiftKey?c.getCursor(i/n,1-o/a):"move";u(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;R?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(V(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?j("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),j("path",r.path=v(z,o,l))}else R?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(y+n)),j("x1",r.x1=G(x+n))),I?j("yanchor",r.yanchor=Z(w+a)):(j("y0",r.y0=Z(m+a)),j("y1",r.y1=Z(b+a)));e.attr("d",g(t,r)),Q(p,r)}function $(n,a){if(N){var i=function(t){return t},o=i,l=i;R?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(V(t)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?j("yanchor",r.yanchor=Z(w+a)):(l=function(t){return Z(U(t)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),j("path",r.path=v(z,o,l))}else if(F){if("resize-over-start-point"===D){var s=y+n,c=I?m-a:m+a;j("x0",r.x0=R?s:G(s)),j("y0",r.y0=I?c:Z(c))}else if("resize-over-end-point"===D){var u=x+n,f=I?b-a:b+a;j("x1",r.x1=R?u:G(u)),j("y1",r.y1=I?f:Z(f))}}else{var h=~D.indexOf("n")?k+a:k,B=~D.indexOf("s")?T+a:T,X=~D.indexOf("w")?M+n:M,Y=~D.indexOf("e")?A+n:A;~D.indexOf("n")&&I&&(h=k-a),~D.indexOf("s")&&I&&(B=T-a),(!I&&B-h>E||I&&h-B>E)&&(j(L,r[L]=I?h:Z(h)),j(S,r[S]=I?B:Z(B))),Y-X>P&&(j(C,r[C]=R?X:G(X)),j(O,r[O]=R?Y:G(Y)))}e.attr("d",g(t,r)),Q(p,r)}function Q(t,e){(R||I)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?e.xanchor:a.midRange(r?[e.x0,e.x1]:d.extractPathCoords(e.path,f.paramIsX))),o=U(I?e.yanchor:a.midRange(r?[e.y0,e.y1]:d.extractPathCoords(e.path,f.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.roundPositionForSharpStrokeRendering(o,1),R&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(t){t.selectAll(".visual-cue").remove()}c.init(Y),X.node().onmousemove=W}(t,x,r,e,p)}}function h(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");l.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function g(t,e){var r,n,o,l,s,c,u,p,h=e.type,g=i.getFromId(t,e.xref),v=i.getFromId(t,e.yref),y=t._fullLayout._size;if(g?(r=d.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return y.l+y.w*t},v?(o=d.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(o(t,!0))}):l=function(t){return y.t+y.h*(1-t)},"path"===h)return g&&"date"===g.type&&(n=d.decodeDate(n)),v&&"date"===v.type&&(l=d.decodeDate(l)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,l=t.xanchor,s=t.yanchor;return n.replace(f.segmentRE,function(t){var n=0,c=t.charAt(0),u=f.paramIsX[c],d=f.paramIsY[c],p=f.numParams[c],h=t.substr(1).replace(f.paramRE,function(t){return u[n]?t="pixel"===i?e(l)+Number(t):e(t):d[n]&&(t="pixel"===o?r(s)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+h})}(e,n,l);if("pixel"===e.xsizemode){var m=n(e.xanchor);s=m+e.x0,c=m+e.x1}else s=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=l(e.yanchor);u=x-e.y0,p=x-e.y1}else u=l(e.y0),p=l(e.y1);if("line"===h)return"M"+s+","+u+"L"+c+","+p;if("rect"===h)return"M"+s+","+u+"H"+c+"V"+p+"H"+s+"Z";var b=(s+c)/2,_=(u+p)/2,w=Math.abs(b-s),k=Math.abs(_-u),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function v(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,a=t.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],l=f.numParams[a];return a+t.substr(1).replace(f.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function L(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function S(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,a=l.ensureSingle(t,"rect",u.railTouchRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(t,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[u.name],n=[],a=0;a0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,g(e))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each(function(){n.select(this).selectAll("g."+u.groupClassName).each(l)}).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[m.side];e.attr("transform","translate("+g+")")}}}P.call(E),z&&(A?P.on(".opacity",null):(k=0,T=!0,P.text(v).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.call("_guiRestyle",t,g,e,y):o.call("_guiRelayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(E)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)}));return P.classed("js-placeholder",T),_}};var d=/ [XY][0-9]* /},{"../../constants/interactions":148,"../../lib":168,"../../lib/svg_text_utils":189,"../../plots/plots":245,"../../registry":257,"../color":51,"../drawing":72,d3:16,"fast-isnumeric":18}],140:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s=t("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":195,"../../plot_api/plot_template":202,"../../plots/font_attributes":239,"../../plots/pad_attributes":244,"../color/attributes":50}],141:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],142:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,l=i.buttons;function s(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,a){return n.coerce(t,e,l,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:s})}},{"../../lib":168,"../../plots/array_container_defaults":208,"./attributes":140,"./constants":141}],143:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function p(t){return t._index}function h(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,l){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),l||y(t,n,a,i,e))}function v(t,e,r,n,a){var i=l.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(m,a,u,t).call(A,a,d,p),l.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",function(){r.call(L,String(h(r,a)?-1:a._index)),y(t,e,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(e,s.lx,s.ly)}function y(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,y=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=y.headerHeight+f.gapButtonHeader:h=y.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-y.openWidth);var b={x:y.lx+h+o.pad.l,y:y.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(l,s){var c=n.select(this);c.call(m,o,l,t).call(A,o,b),c.on("click",function(){n.event.defaultPrevented||(g(t,o,0,e,r,i,s),l.execute&&a.executeAPICommand(t,l.method,l.args),t.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(k,o),u.call(_,o)})}),u.call(_,o),x?(T.w=Math.max(y.openWidth,y.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(y.openHeight,y.headerHeight)),T.direction=o.direction,i&&(u.size()?function(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)}).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),u=0;uw,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+y;S+A>c&&(S=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=y>k,z=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,P=h+g,E=v;P+z>s&&(P=s-z);var R=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=R.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:E,width:z,height:D}),this._vbarYMin=E+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+z+.5:f+.5,B=d-.5,j=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||O){var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,l=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/n;this.vbar.call(i.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":168,"../color":51,"../drawing":72,d3:16}],146:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],147:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],148:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],149:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],150:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],151:[function(t,e,r){"use strict";r.version="1.44.3",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),l=0;l1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],154:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(t){return Math.abs(t[1]-t[0])>l-1e-15}function c(t,e){return i(e-t,l)}function u(t,e){if(s(e))return!0;var r,n;e[0](n=a(n,l))&&(n+=l);var i=a(t,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(u=0,f=o,d=l):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":175}],155:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function l(t){return n(t)||o(t)}function s(t,e,r){if(l(t)){if(l(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return a(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||c(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),y=t.charAt(0);!c||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),k=t.match(w?x:m);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var z=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=z.newDate(T,z.toMonthIndex(T,M,D),A)}else O=z.newDate(T,Number(M),A)}catch(t){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var P=new Date(Date.UTC(2e3,M,A,L,S));return P.setUTCFullYear(T),P.getUTCMonth()!==M?u:P.getUTCDate()!==A?u:P.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var k=90*f,T=3*d,M=5*p;function A(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return u;e||(e=0);var i,o,l,c,m,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){i=y("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),r=new Date(Math.round(t-e/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===u)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;function S(t,e,r,n){t=t.replace(L,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=s(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var O=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=s(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){l.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(t,e,r,n,a,i,o,c){if(l(t,e,r,n,a,i,o,c))return 0;var u=r-t,f=n-e,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,i-e),s(u,f,h,o-t,c-e),s(d,p,g,t-a,e-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,l){if(t===a&&l===i||(n={},a=t,i=l),n[r])return n[r];var s=t.getPointAtLength(o(r-l/2,e)),c=t.getPointAtLength(o(r+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,l=(n=n||{}).pathLength||t.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":175}],166:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],167:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],168:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private");var c=t("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=t("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=t("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=t("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=t("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=t("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=t("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=t("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var y=t("./anchor_utils");s.isLeftAnchor=y.isLeftAnchor,s.isCenterAnchor=y.isCenterAnchor,s.isRightAnchor=y.isRightAnchor,s.isTopAnchor=y.isTopAnchor,s.isMiddleAnchor=y.isMiddleAnchor,s.isBottomAnchor=y.isBottomAnchor;var m=t("./geometry2d");s.segmentsIntersect=m.segmentsIntersect,s.segmentDistance=m.segmentDistance,s.getTextLocation=m.getTextLocation,s.clearLocationCache=m.clearLocationCache,s.getVisibleSegment=m.getVisibleSegment,s.findPointOnPath=m.findPointOnPath;var x=t("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=t("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=t("./regex");s.counterRegex=_.counter;var w=t("./throttle");function k(t){var e={};for(var r in t)for(var n=t[r],a=0;ao?l:a(t)?Number(t):l:l},s.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},s.noop=t("./noop"),s.identity=t("./identity"),s.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):t(e,r,n,(a||0)+1):c},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){var n;function a(){return s.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s};var A=/%{([^\s%{}:]*)(:[^}]*)?}/g,L=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(A,function(t,n){return L.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})};var S=/^:/,C=0;s.hovertemplateString=function(t,e){var r=arguments,a={};return t.replace(A,function(t,i,o){var l,c,u;for(u=2;u=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var O=2e9;s.seedPseudoRandom=function(){O=2e9},s.pseudoRandom=function(){var t=O;return O=(69069*O+1)%4294967296,Math.abs(O-t)<429496729?s.pseudoRandom():O/4294967296}},{"../constants/numerical":149,"./anchor_utils":153,"./angles":154,"./array":155,"./clean_number":156,"./clear_responsive":158,"./coerce":159,"./dates":160,"./extend":162,"./filter_unique":163,"./filter_visible":164,"./geometry2d":165,"./get_graph_div":166,"./identity":167,"./is_plain_object":169,"./keyed_container":170,"./localize":171,"./loggers":172,"./make_trace_groups":173,"./matrix":174,"./mod":175,"./nested_property":176,"./noop":177,"./notifier":178,"./push_unique":181,"./regex":183,"./relative_attr":184,"./relink_private":185,"./search":186,"./stats":188,"./throttle":190,"./to_log_range":191,d3:16,"fast-isnumeric":18}],169:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],170:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};e&&e.length?(s=n(t,e),l=s.get()):l=t,e=e||"";var u={};if(l)for(o=0;o2)return c[e]=2|c[e],d.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;ee/2?t-Math.round(t/e)*e:t}}},{}],176:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),o=0;oi||c===a||cl||e&&s(t))}:function(t,e){var s=t[0],c=t[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],y=r[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(n(o,d))>a)return!0;return!1};i.filter=function(t,e){var r=[t[0]],n=0,a=0;function i(i){t.push(i);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&i(t.pop());return{addPt:i,raw:t,filtered:r}}},{"../constants/numerical":149,"./matrix":174}],181:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,t+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],l=0;le[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(s=new Array(o),l=0;lt.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":155,"fast-isnumeric":18}],189:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,A){var L=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(s),O=n.select(t.node().parentNode);if(!O.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),i={fontSize:r};!function(t,e,r){var i,o,l,s;MathJax.Hub.Queue(function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+a.randstr({},64);return s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),e,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)},function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})}(C[2],i,function(n,a,i){O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return D(),void e();var s=O.append("g").classed(z+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:z,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black";o.select("g").attr({fill:c,stroke:c});var u=l(o,"width"),f=l(o,"height"),d=+t.attr("x")-u*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||l(t,"height"))/4;"y"===z[0]?(s.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-u/2,p-f/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?o.attr({x:t.attr("x"),y:p-f/2}):"a"===z[0]&&0!==z.indexOf("atitle")?o.attr({x:0,y:p}):o.attr({x:d,y:+t.attr("y")+p-f/2}),A&&A.call(t,s),e(s)})})):D(),t}function D(){O.empty()||(z=t.attr("class")+"-math",O.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,l=!1,s=[],c=-1;function u(){c++;var e=document.createElementNS(i.svg,"tspan");n.select(e).attr({class:"line",dy:c*o+"em"}),t.appendChild(e),r=e;var a=s;if(s=[{node:e}],a.length>1)for(var l=1;l doesnt match end tag <"+t+">. Pretending it did match.",e),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag "+t+">.",e)}x.test(e)?u():(r=t,s=[{node:t}]);for(var O=e.split(y),z=0;z|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h="\u200b",g=["http:","https:","mailto:","",void 0,":"],v=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,m=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/
/i,b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(y),o=[],l="",s=0,c=0;ca?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(L,function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t})}function C(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})})},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(t,a,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),t.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function s(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?l():o.on("click",l),n.rebind(t,i,"on")}},{"../constants/alignment":146,"../constants/xmlns_namespaces":150,"../lib":168,d3:16}],190:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var l in n)n[l].tsi.ts+e?s():i.timer=setTimeout(function(){s(),i.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":18}],192:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],193:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],194:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,u=(l.subplotsRegistry.ternary||{}).attrRegex,h=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(c(m))e.set(null);else{if(!Array.isArray(m))return i.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],O=u(y,f).get(),z=[],D=-1,P=C.length;for(x=0;xC.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?z.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b=0;x--)C.splice(z[x],1),O&&O.splice(z[x],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==a){var E;if(-1===D)E=L;else{for(P=Math.max(C.length,P),E=[],x=0;x=D);x++)E.push(_);for(x=D;x=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in P(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,t.data.length-1),e)for(var g=0;g-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=W(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(U(t,i,a)||d.supplyDefaults(t),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),l.push(S)),l.push(d.rehover),c.add(t,V,[t,a.undoit],V,[t,a.redoit]);var s=o.syncOrAsync(l,t);return s&&s.then||(s=Promise.resolve(t)),s.then(function(){return t.emit("plotly_relayout",a.eventData),t})}function U(t,e,r){var n;if(!e.axrange)return!1;for(n in e)if("axrange"!==n&&e[n])return!1;for(n in r.rangesAltered){var a=h.id2name(n),i=t.layout[a],o=t._fullLayout[a];o.autorange=i.autorange,o.range=i.range.slice(),o.cleanRange()}return!0}function G(t,e){var r=e?function(t){var r={skipTitle:!0};for(var n in e)if(h.getFromId(t,n).automargin){r={};break}return h.draw(t,Object.keys(e),r)}:function(t){return h.draw(t,"redraw")};t.push(T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}r.plot=function(t,e,a,i){var l;if(t=o.getGraphDiv(t),s.init(t),o.isPlainObject(e)){var c=e;e=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),z(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(k.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=k.cleanLayout(a)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,d.supplyDefaults(t);var v=t._fullLayout,x=v._has("cartesian");if(!v._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e);r&&(t.layout=r);p.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=p.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var l=t.framework.svg(),s=1,c=t._fullLayout.title?t._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(b.convertToTspans,t)},f=l.select(".title-group text").call(u);if(t._context.edits.titleText){var h=o._(t,"Click to enter Plot title");c&&c!==h||(s=.2,f.attr({"data-unformatted":h}).text(h).style({opacity:s}).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)}));var g=function(){this.call(b.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(u),this.call(g)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);v._replotting=!0,f&<(t),t.framework!==lt&&(t.framework=lt,lt(t)),g.initGradients(t),f&&h.saveShowSpikeInitial(t);var _=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;_&&d.doCalcdata(t);for(var w=0;w=0&&r=0&&r0&&"string"!=typeof P.parts[R];)R--;var I=P.parts[R],F=P.parts[R-1]+"."+I,j=P.parts.slice(0,R).join("."),H=l(t.layout,j).get(),V=l(s,j).get(),U=P.get();if(void 0!==E){T[D]=E,L[D]="reverse"===I?E:N(U);var G=f.getLayoutValObject(s,P.parts);if(G&&G.impliedEdits&&null!==E)for(var W in G.impliedEdits)S(o.relativeAttr(D,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(D))if(E){S("autosize",null);var $="height"===D?"width":"height";S($,s[$])}else s[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",E?null:s.width),S("height",E?null:s.height);else if(F.match(Z))z(F),l(s,j+"._inputRange").set(null);else if(F.match(X)){z(F),l(s,j+"._inputRange").set(null);var Q=l(s,j).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(Y)&&l(s,j+"._inputDomain").set(null);if("type"===I){var K=H,tt="linear"===V.type&&"log"===E,et="log"===V.type&&"linear"===E;if(tt||et){if(K&&K.range)if(V.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&S(j+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),S(j+".range[0]",Math.log(rt)/Math.LN10),S(j+".range[1]",Math.log(nt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,rt)),S(j+".range[1]",Math.pow(10,nt)))}else S(j+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete s[P.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,E,S),u.getComponentMethod("images","convertCoords")(t,V,E,S)}else S(j+".autorange",!0),S(j+".range",null);l(s,j+"._inputRange").set(null)}else if(I.match(A)){var at=l(s,D).get(),it=(E||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,at,it,S),u.getComponentMethod("images","convertCoords")(t,at,it,S)}var ot=w.containerArrayMatch(D);if(ot){r=ot.array,n=ot.index;var lt=ot.property,st=G||{editType:"calc"};""!==n&&""===lt&&(w.isAddVal(E)?L[D]=null:w.isRemoveVal(E)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(_,st),y[r]||(y[r]={});var ct=y[r][n];ct||(ct=y[r][n]={}),ct[lt]=E,delete e[D]}else"reverse"===I?(H.range?H.range.reverse():(S(j+".autorange",!0),H.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===E||"select"===E)&&"lasso"!==U&&"select"!==U?_.plot=!0:G?M.update(_,G):_.calc=!0,P.set(E))}}for(r in y){w.applyContainerArrayChanges(t,d(i,r),y[r],_,d)||(_.plot=!0)}var ut=s._axisConstraintGroups||[];for(C in O)for(n=0;n1;)if(n.pop(),void 0!==(r=l(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var h,g,v=0;function y(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var m=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))m.push({type:"object",data:y(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&TT)&&M.push(g);m=M}}m.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||h[g]||{}).name,y=e[n].name,m=u[v]||h[v];v&&y&&"number"==typeof y&&m&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,l],p=[t,i];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,i)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":51,"../components/colorbar/connect":53,"../components/drawing":72,"../constants/xmlns_namespaces":150,"../lib":168,"../lib/events":161,"../lib/queue":182,"../lib/svg_text_utils":189,"../plots/cartesian/axes":212,"../plots/cartesian/constants":218,"../plots/cartesian/graph_interact":222,"../plots/plots":245,"../plots/polar/legacy":248,"../registry":257,"./edit_types":195,"./helpers":196,"./manage_arrays":198,"./plot_config":200,"./plot_schema":201,"./subroutines":203,d3:16,"fast-isnumeric":18,"has-hover":20}],200:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"boolean",dflt:1},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},a={};!function t(e,r){for(var n in e){var a=e[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),t(a,r[n]))}}(n,a),e.exports={configAttributes:n,dfltConfig:a}},{}],201:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("./plot_config").configAttributes,u=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v="_isSubplotObj",y="_isLinkedToArray",m=[v,y,"_arrayAttrRegexps","_deprecated"];function x(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(b(e[r]))r++;else if(r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function b(t){return t===Math.round(t)&&t>=0}function _(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):g(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[y];if(!n)return;delete t[y],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(g(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[e[2]],l=3}else if("area"===t.type)a=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return x(a,e,l)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,a,i,l,s=t._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;l&&(o=a);var s,c=e+"["+o+"]";function u(){s={},l&&(s[c]={},s[c][i]=l)}function f(t,e){l?n.nestedProperty(s[c],t).set(e):s[c+"."+t]=e}function d(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:f,getUpdateObj:d,applyUpdate:function(e,r){e&&f(e,r);var a=d();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":168,"../plots/attributes":209}],203:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),l=t("../lib/clear_gl_canvases"),s=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),p=t("../constants/alignment"),h=t("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,y=t("../plots/cartesian/autorange").doAutoRange,m="start",x="middle",b="end";function _(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function w(t){var e,a,i,l,u,h,g=t._fullLayout,v=g._size,y=v.p,m=d.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return t._promises.length&&Promise.all(t._promises);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-y-n:e._offset+e._length+y+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:v.l+v.w*(t.position||0)+n%1}for(e=0;ek?u.push({code:"unused",traceType:m,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:m,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=p(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&h(i)&&t(i,o)}}({data:v,layout:d},""),u.length)return u.map(g)}},{"../lib":168,"../plots/attributes":209,"../plots/plots":245,"./plot_config":200,"./plot_schema":201,"./plot_template":202}],205:[function(t,e,r){"use strict";var n=t("./plot_api"),a=t("../lib"),i=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),s={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,u,f;function d(t){return!(t in e)||a.validate(e[t],s[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],u=t.layout||{},f=t.config||{}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),u=a.extendDeep({},t.layout),f=t._context),!d("width")||!d("height"))throw new Error("Height and width should be pixel values.");if(!d("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var p={};function h(t,r){return a.coerce(e,p,s,t,r)}var g=h("format"),v=h("width"),y=h("height"),m=h("scale"),x=h("setBackground"),b=h("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=a.extendFlat({},u);v&&(w.width=v),y&&(w.height=y);var k=a.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:x}),T=i.getRedrawFunc(_);function M(){return new Promise(function(t){setTimeout(t,i.getDelay(_._fullLayout))})}function A(){return new Promise(function(t,e){var r=o(_,g,m),i=_._fullLayout.width,s=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===g)return t(b?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=a.randstr(),l({format:g,width:i,height:s,scale:m,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,k).then(T).then(M).then(A).then(function(e){t(function(t){return b?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":168,"../snapshot/helpers":261,"../snapshot/svgtoimg":263,"../snapshot/tosvg":265,"./plot_api":199}],206:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;dx.length&&a.push(p("unused",i,y.concat(x.length)));var T,M,A,L,S,C=x.length,O=Array.isArray(k);if(O&&(C=Math.min(C,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&a.push(p("unused",i,y.concat(M,x[M].length)));var z=x[M].length;for(T=0;T<(O?Math.min(z,k[M].length):z);T++)A=O?k[M][T]:k,L=m[M][T],S=x[M][T],n.validate(L,A)?S!==L&&S!==+L&&a.push(p("dynamic",i,y.concat(M,T),L,S)):a.push(p("value",i,y.concat(M,T),L))}else a.push(p("array",i,y.concat(M),m[M]));else for(M=0;M1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,y=0;y0&&((b=M-o(v)-o(y))>A?_/b>L&&(m=v,x=y,L=_/b):_/M>L&&(m={val:v.val,pad:0},x={val:y.val,pad:0},L=_/M));if(d===p){var S=d-1,C=d+1;if(k)if(0===d)i=[0,1];else{var O=(d>0?f:u).reduce(function(t,e){return Math.max(t,o(e))},0),z=d/(1-Math.min(.5,O/M));i=d>0?[0,z]:[z,0]}else i=T?[Math.max(0,S),Math.max(1,C)]:[S,C]}else k?(m.val>=0&&(m={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(m.val-L*o(m)<0&&(m={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),L=(x.val-m.val)/(M-o(m)-o(x)),i=[m.val-L*o(m),x.val+L*o(x)];return h&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function s(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function c(t,e){var r,n,a,i=e._id,o=t._fullData,l=t._fullLayout,s=[],c=[];function d(t,e){for(r=0;r=r&&(c.extrapad||!o)){l=!1;break}a(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(s,1),s--)}if(l){var u=i&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function p(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(t,e){if(e.autorange){e.range=l(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var i=e._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[e._name];s&&"auto"===s.rangemode&&(s.range=l(t,e)),i._input.rangeslider[e._name]=a.extendFlat({},s)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,l,s,c,d,h,g,v,y=[],m=[],x=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1;function T(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),A=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),S=T(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a0&&(g=o),o>v&&o-i&&(g=o),o>v&&o=z;a--)O(a);return{min:y,max:m,opts:r}},concatExtremes:c}},{"../../constants/numerical":149,"../../lib":168,"../../registry":257,"fast-isnumeric":18}],212:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),l=t("../../lib"),s=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),f=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),h=t("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,y=h.ONEDAY,m=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=t("../../constants/alignment").MID_SHIFT,T=t("../../constants/alignment").LINE_SPACING,M=e.exports={};M.setConvert=t("./set_convert");var A=t("./axis_autotype"),L=t("./axis_ids");M.id2name=L.id2name,M.name2id=L.name2id,M.cleanId=L.cleanId,M.list=L.list,M.listIds=L.listIds,M.getFromId=L.getFromId,M.getFromTrace=L.getFromTrace;var S=t("./autorange");M.getAutoRange=S.getAutoRange,M.findExtremes=S.findExtremes,M.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(t,e,u,c)},M.coercePosition=function(t,e,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=M.getFromId(e,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}t[a]=o(s)},M.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?l.ensureNumber:M.getFromId(e,r).cleanPos)(t)},M.redrawComponents=function(t,e){e=e||M.listIds(t);var r=t._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},M.saveRangeInitial=function(t,e){for(var r=M.list(t,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=M.tickIncrement(t,"M6","reverse")+1.5*y:i.exactMonths>.8?t=M.tickIncrement(t,"M1","reverse")+15.5*y:t-=y/2;var s=M.tickIncrement(t,r);if(s<=n)return s}return t}(x,t,m,c,i)),v=x,0;v<=u;)v=M.tickIncrement(v,m,!1,i),0;return{start:e.c2r(x,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:u-c}},M.prepTicks=function(t){var e=l.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),M.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),j(t)},M.calcTicks=function(t){M.prepTicks(t);var e=l.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=l.simpleMap(t.range,t.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],s=Math.min(i,o),c=Math.max(i,o),u=0;Array.isArray(r)||(r=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var d=0;ds&&p=n:c<=n)&&!(i.length>s||c===o);c=M.tickIncrement(c,t.dtick,a,t.calendar))o=c,i.push(c);et(t)&&360===Math.abs(e[1]-e[0])&&i.pop(),t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=y&&i<=10||e>=15*y)t._tickround="d";else if(e>=x&&i<=16||e>=m)t._tickround="M";else if(e>=b&&i<=19||e>=x)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(V(t.exponentformat)&&!U(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function H(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}M.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar);var i=2*e;i>g?(e/=g,r=n(10),t.dtick="M"+12*B(e,r,D)):i>v?(e/=v,t.dtick="M"+B(e,1,P)):i>y?(t.dtick=B(e,y,R),t.tick0=l.dateTick0(t.calendar,!0)):i>m?t.dtick=B(e,m,P):i>x?t.dtick=B(e,x,E):i>b?t.dtick=B(e,b,E):(r=n(10),t.dtick=B(e,r,D))}else if("log"===t.type){t.tick0=0;var o=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),t.dtick="L"+B(e,r,D)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):et(t)?(t.tick0=0,r=1,t.dtick=B(e,r,N)):(t.tick0=0,r=n(10),t.dtick=B(e,r,D));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},M.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return t+o*e;var s=e.charAt(0),c=o*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,i);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?F:I,f=t+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},M.tickFirst=function(t){var e=t.r2l||Number,r=l.simpleMap(t.range,e),i=r[1]"+s,t._prevDateHead=s));e.text=c}(t,i,r,s):"log"===c?function(t,e,r,n,i){var o=t.dtick,s=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=G(Math.pow(10,s),t,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=t.exponentformat;"power"===p||V(p)&&U(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+d+"",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(f>0?"+":_)+d:(e.text=G(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,i,0,s,h):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,i):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,i,r):et(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=G(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=G(l.deg2rad(e.x),t,a,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=_+e.text)}}}}(t,i,r,s,h):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=G(e.x,t,a,n)}(t,i,0,s,h),t.tickprefix&&!p(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!p(t.showticksuffix)&&(i.text+=t.ticksuffix),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};i.xbnd=[g(i.x-.5),g(i.x+t.dtick-.5)]}return i},M.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return M.hoverLabelText(t,e)+" - "+M.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=M.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+a:a};var q=["f","p","n","\u03bc","m","","k","M","G","T"];function V(t){return"SI"===t||"B"===t}function U(t){return t>14||t<-15}function G(t,e,r,n){var i=t<0,o=e._tickround,s=r||e.exponentformat||"B",c=e._tickexponent,u=M.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};j(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(t=Math.abs(t))"+p+"":"B"===s&&9===c?t+="B":V(s)&&(t+=q[c/3+5]));return i?_+t:t}function Z(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,a=l.deg2rad(n),i=Math.sin(a),o=Math.cos(a),s=0,c=0;return t._selections[e].each(function(){var t=W(this),e=f.bBox(t.node()),r=e.width,n=e.height;s=Math.max(s,o*r,i*n),c=Math.max(c,i*r,o*n)}),{x:c,y:s}[r]}function X(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Y(t,e){var r=t.l2p(e);return r>1&&r=0,i=u(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e