diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bdd929c231..6b0cfca8713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master where X.Y.Z is the semver of most recent plotly.js release. +## [1.16.3-d16] -- 2016-09-12 + +### Changed +- Merged Peter developments for treemaps + + ## [1.16.3-d16] -- 2016-09-08 ### Changed diff --git a/dist/README.md b/dist/README.md index a5297724fc4..e8b83c46280 100644 --- a/dist/README.md +++ b/dist/README.md @@ -36,11 +36,11 @@ The main plotly.js bundle includes all the official (non-beta) trace modules. It be can imported as minified javascript - using dist file `dist/plotly.min.js` -- using CDN URL https://cdn.plot.ly/plotly-plotly-latest.min.js OR https://cdn.plot.ly/plotly-plotly-1.16.3-d16.min.js +- using CDN URL https://cdn.plot.ly/plotly-plotly-latest.min.js OR https://cdn.plot.ly/plotly-plotly-1.16.3-d17.min.js or as raw javascript: - using dist file `dist/plotly.js` -- using CDN URL https://cdn.plot.ly/plotly-plotly-latest.js OR https://cdn.plot.ly/plotly-plotly-1.16.3-d16.js +- using CDN URL https://cdn.plot.ly/plotly-plotly-latest.js OR https://cdn.plot.ly/plotly-plotly-1.16.3-d17.js - using CommonJS with `require('plotly.js')` If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plot.ly/javascript/reference/)), use dist file `dist/plotly-with-meta.js` @@ -49,7 +49,7 @@ The main plotly.js bundle weights in at: | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js | |-----------|---------------|----------------------|---------------------| -| 3.9 MB | 1.6 MB | 499.9 kB | 4 MB | +| 3.9 MB | 1.6 MB | 499.1 kB | 4 MB | ## Partial bundles @@ -67,13 +67,13 @@ The `cartesian` partial bundle contains the `scatter`, `bar`, `box`, `heatmap`, | dist bundle (minified) | `dist/plotly-cartesian.min.js` | | CDN URL (latest) | https://cdn.plot.ly/plotly-cartesian-latest.js | | CDN URL (latest minified) | https://cdn.plot.ly/plotly-cartesian-latest.min.js | -| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.16.3-d16.js | -| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.16.3-d16.min.js | +| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.16.3-d17.js | +| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.16.3-d17.min.js | | CommonJS | `require('plotly.js/lib/index-cartesian')` | | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 1.6 MB | 620.3 kB | 202 kB | +| 1.6 MB | 618.3 kB | 201.3 kB | ---------------- diff --git a/dist/plotly-cartesian.min.js b/dist/plotly-cartesian.min.js index 39f995f8f01..04f94c34420 100644 --- a/dist/plotly-cartesian.min.js +++ b/dist/plotly-cartesian.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (cartesian - minified) v1.16.3-d16 +* plotly.js (cartesian - minified) v1.16.3-d17 * Copyright 2012-2016, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -13,14 +13,14 @@ E[0]=f[P],E[1]=d[N]}else ui.event.altKey&&(x=E.slice());M.style("pointer-events" valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":101,"../../plots/cartesian/constants":129,"../../plots/font_attributes":142,"./arrow_paths":21}],23:[function(t,e,n){"use strict";function r(t,e){function n(e,n){return c.coerce(t,r,m.layoutAttributes,e,n)}var r={};n("opacity"),n("align"),n("bgcolor");var a=n("bordercolor"),o=f.opacity(a);n("borderpad");var i=n("borderwidth"),l=n("showarrow");l&&(n("arrowcolor",o?r.bordercolor:f.defaultLine),n("arrowhead"),n("arrowsize"),n("arrowwidth",2*(o&&i||1)),n("ax"),n("ay"),n("axref"),n("ayref"),c.noneOrAll(t,r,["ax","ay"])),n("text",l?" ":"new text"),n("textangle"),c.coerceFont(n,"font",e.font);for(var s=["x","y"],d=0;2>d;d++){var h=s[d],p={_fullLayout:e},g=u.coerceRef(t,r,p,h),v=u.coerceARef(t,r,p,h),y=.5;if("paper"!==g){var x=u.getFromId(p,g);if(y=x.range[0]+y*(x.range[1]-x.range[0]),-1!==["date","category"].indexOf(x.type)&&"string"==typeof t[h]){var b;if("date"===x.type){if(b=c.dateTime2ms(t[h]),b!==!1&&(t[h]=b),v===g){var _=c.dateTime2ms(t["a"+h]);_!==!1&&(t["a"+h]=_)}}else(x._categories||[]).length&&(b=x._categories.indexOf(t[h]),-1!==b&&(t[h]=b))}}n(h,y),l||n(h+"anchor")}return c.noneOrAll(t,r,["x","y"]),r}function a(t){var e=t._fullLayout;e.annotations.forEach(function(e){var n=u.getFromId(t,e.xref),r=u.getFromId(t,e.yref);if(n||r){var a=(e._xsize||0)/2,o=e._xshift||0,i=(e._ysize||0)/2,l=e._yshift||0,s=a-o,c=a+o,f=i-l,d=i+l;if(e.showarrow){var h=3*e.arrowsize*e.arrowwidth;s=Math.max(s,h),c=Math.max(c,h),f=Math.max(f,h),d=Math.max(d,h)}n&&n.autorange&&u.expand(n,[n.l2c(e.x)],{ppadplus:c,ppadminus:s}),r&&r.autorange&&u.expand(r,[r.l2c(e.y)],{ppadplus:d,ppadminus:f})}})}function o(t,e,n,r,a,o,i,l){var s=n-t,c=a-t,u=i-a,f=r-e,d=o-e,h=l-o,p=s*h-u*f;if(0===p)return null;var g=(c*h-u*d)/p,m=(c*f-s*d)/p;return 0>m||m>1||0>g||g>1?null:{x:t+s*g,y:e+f*g}}var i=t("d3"),l=t("fast-isnumeric"),s=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),h=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),g=t("../dragelement"),m=e.exports={};m.ARROWPATHS=t("./arrow_paths"),m.layoutAttributes=t("./attributes"),m.supplyLayoutDefaults=function(t,e){for(var n=t.annotations||[],a=e.annotations=[],o=0;ot?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}tt.selectAll("tspan.line").attr({y:0,x:0});var r=G.select(".annotation-math-group"),a=!r.empty(),l=d.bBox((a?r:tt).node()),h=l.width,v=l.height,y=Math.round(h+2*W),x=Math.round(v+2*W);B._w=h,B._h=v;var b=!1;if(["x","y"].forEach(function(e){var r,a=B[e+"ref"]||e,o=u.getFromId(t,a),i=(U+("x"===e?0:90))*Math.PI/180,l=y*Math.abs(Math.cos(i))+x*Math.abs(Math.sin(i)),s=B[e+"anchor"];if(o){if(!o.autorange&&(B[e]-o.range[0])*(B[e]-o.range[1])>0&&(B["a"+e+"ref"]===a?(B["a"+e]-o.range[0])*(B["a"+e]-o.range[1])>0&&(b=!0):b=!0,b))return;Z[e]=o._offset+o.l2p(B[e]),r=.5}else r=B[e],"y"===e&&(r=1-r),Z[e]="x"===e?S.l+S.w*r:S.t+S.h*r;var c=0;B["a"+e+"ref"]===a?Z["aa"+e]=o._offset+o.l2p(B["a"+e]):(c=B.showarrow?B["a"+e]:l*n(r,s),Z[e]+=c),B["_"+e+"type"]=o&&o.type,B["_"+e+"size"]=l,B["_"+e+"shift"]=c}),b)return void G.remove();var w,k;B.showarrow&&(w=B.axref===B.xref?Z.x:c.constrain(Z.x-B.ax,1,_.width-1),k=B.ayref===B.yref?Z.y:c.constrain(Z.y-B.ay,1,_.height-1)),Z.x=c.constrain(Z.x,1,_.width-1),Z.y=c.constrain(Z.y,1,_.height-1);var M=W-l.top,A=W-l.left;a?r.select("svg").attr({x:W-1,y:W}):(tt.attr({x:A,y:M}),tt.selectAll("tspan.line").attr({y:M,x:A})),J.call(d.setRect,$/2,$/2,y-$,x-$);var T=0,L=0;T=B.axref===B.xref?Math.round(Z.aax-y/2):Math.round(Z.x-y/2),L=B.ayref===B.yref?Math.round(Z.aay-x/2):Math.round(Z.y-x/2),G.call(c.setTranslate,T,L);var z="annotations["+e+"]",C=function(n,r){i.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var a,l;a=B.axref===B.xref?Z.aax+n:Z.x+n,l=B.ayref===B.yref?Z.aay+r:Z.y+r;var u=c.rotationXYMatrix(U,a,l),d=c.apply2DTransform(u),h=c.apply2DTransform2(u),p=J.attr("width")/2,v=J.attr("height")/2,y=[[a-p,l-v,a-p,l+v],[a-p,l+v,a+p,l+v],[a+p,l+v,a+p,l-v],[a+p,l-v,a-p,l-v]].map(h);if(!y.reduce(function(t,e){return t^!!o(w,k,w+1e6,k+1e6,e[0],e[1],e[2],e[3])},!1)){y.forEach(function(t){var e=o(a,l,w,k,t[0],t[1],t[2],t[3]);e&&(a=e.x,l=e.y)});var x=B.arrowwidth,b=B.arrowcolor,_=Y.append("g").style({opacity:f.opacity(b)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),M=_.append("path").attr("d","M"+a+","+l+"L"+w+","+k).style("stroke-width",x+"px").call(f.stroke,f.rgb(b));m.arrowhead(M,B.arrowhead,"end",B.arrowsize);var A=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(a-w)+","+(l-k),transform:"translate("+w+","+k+")"}).style("stroke-width",x+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");if(t._context.editable){var T,L,C;g.init({element:A.node(),prepFn:function(){var t=c.getTranslate(G);L=t.x,C=t.y,T={},H&&H.autorange&&(T[H._name+".autorange"]=!0),V&&V.autorange&&(T[V._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var n=d(L,C),r=n[0]+t,a=n[1]+e;G.call(c.setTranslate,r,a),T[z+".x"]=H?B.x+t/H._m:(w+t-S.l)/S.w,T[z+".y"]=V?B.y+e/V._m:1-(k+e-S.t)/S.h,B.axref===B.xref&&(T[z+".ax"]=H?B.ax+t/H._m:(w+t-S.l)/S.w),B.ayref===B.yref&&(T[z+".ay"]=V?B.ay+e/V._m:1-(k+e-S.t)/S.h),X.attr({transform:"rotate("+U+","+r+","+a+")"})},doneFn:function(e){if(e){s.relayout(t,T);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}};B.showarrow&&C(0,0);var E=c.rotationXYMatrix(U,Z.x,Z.y),O=c.apply2DTransform(E);if(t._context.editable){var P,N,D;g.init({element:G.node(),prepFn:function(){var t=c.getTranslate(G);P=t.x,N=t.y,D={}},moveFn:function(t,e){G.call(c.setTranslate,P+t,N+e);var n="pointer";if(B.showarrow)B.axref===B.xref?D[z+".ax"]=H.p2l(H.l2p(B.ax)+t):D[z+".ax"]=B.ax+t,B.ayref===B.yref?D[z+".ay"]=V.p2l(V.l2p(B.ay)+e):D[z+".ay"]=B.ay+e,C(t,e);else{if(H)D[z+".x"]=B.x+t/H._m;else{var r=B._xsize/S.w,a=B.x+B._xshift/S.w-r/2;D[z+".x"]=g.align(a+t/S.w,r,0,1,B.xanchor)}if(V)D[z+".y"]=B.y+e/V._m;else{var o=B._ysize/S.h,i=B.y-B._yshift/S.h-o/2;D[z+".y"]=g.align(i-e/S.h,o,0,1,B.yanchor)}H&&V||(n=g.getCursor(H?.5:D[z+".x"],V?.5:D[z+".y"],B.xanchor,B.yanchor))}var l=O(P,N),s=l[0]+t,u=l[1]+e;G.call(c.setTranslate,P+t,N+e),X.attr({transform:"rotate("+U+","+s+","+u+")"}),p(G,n)},doneFn:function(e){if(p(G),e){s.relayout(t,D);var n=document.querySelector(".js-notes-box-panel");n&&n.redraw(n.selectedObj)}}})}}var x,b=t.layout,_=t._fullLayout;if(!l(e)||-1===e){if(!e&&Array.isArray(a))return b.annotations=a,m.supplyLayoutDefaults(b,_),void m.drawAll(t);if("remove"===a)return delete b.annotations,_.annotations=[],void m.drawAll(t);if(n&&"add"!==a){for(x=0;x<_.annotations.length;x++)m.draw(t,x,n,a);return}e=_.annotations.length,_.annotations.push({})}if(!n&&a){if("remove"===a){for(_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),_.annotations.splice(e,1),b.annotations.splice(e,1),x=e;x<_.annotations.length;x++)_._infolayer.selectAll('.annotation[data-index="'+(x+1)+'"]').attr("data-index",String(x)),m.draw(t,x);return}if("add"===a||c.isPlainObject(a)){_.annotations.splice(e,0,{});var w=c.isPlainObject(a)?c.extendFlat({},a):{text:"New text"};for(b.annotations?b.annotations.splice(e,0,w):b.annotations=[w],x=_.annotations.length-1;x>e;x--)_._infolayer.selectAll('.annotation[data-index="'+(x-1)+'"]').attr("data-index",String(x)),m.draw(t,x)}}_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var k=b.annotations[e],M=_.annotations[e];if(k){var A={xref:k.xref,yref:k.yref},T={};"string"==typeof n&&n?T[n]=a:c.isPlainObject(n)&&(T=n);var L=Object.keys(T);for(x=0;xx;x++){var E=C[x];if(void 0===T[E]&&void 0!==k[E]){var O=u.getFromId(t,u.coerceRef(A,{},t,E)),P=u.getFromId(t,u.coerceRef(k,{},t,E)),N=k[E],D=M["_"+E+"type"];if(void 0!==T[E+"ref"]){var I="auto"===k[E+"anchor"],R="x"===E?S.w:S.h,j=(M["_"+E+"size"]||0)/(2*R);if(O&&P)N=(N-O.range[0])/(O.range[1]-O.range[0]),N=P.range[0]+N*(P.range[1]-P.range[0]);else if(O){if(N=(N-O.range[0])/(O.range[1]-O.range[0]),N=O.domain[0]+N*(O.domain[1]-O.domain[0]),I){var F=N+j,q=N-j;2/3>N+q?N=q:N+F>4/3&&(N=F)}}else P&&(I&&(1/3>N?N+=j:N>2/3&&(N-=j)),N=(N-P.domain[0])/(P.domain[1]-P.domain[0]),N=P.range[0]+N*(P.range[1]-P.range[0]))}P&&P===O&&D&&("log"===D&&"log"!==P.type?N=Math.pow(10,N):"log"!==D&&"log"===P.type&&(N=N>0?Math.log(N)/Math.LN10:void 0)),k[E]=N}}var B=r(k,_);_.annotations[e]=B;var H=u.getFromId(t,B.xref),V=u.getFromId(t,B.yref),Z={x:0,y:0},U=+B.textangle||0,Y=_._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",B.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:k,fullAnnotation:B})}),X=Y.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),G=X.append("g"),$=B.borderwidth,Q=B.borderpad,W=$+Q,J=G.append("rect").attr("class","bg").style("stroke-width",$+"px").call(f.stroke,B.bordercolor).call(f.fill,B.bgcolor),K=B.font,tt=G.append("text").classed("annotation",!0).attr("data-unformatted",B.text).text(B.text);t._context.editable?tt.call(h.makeEditable,G).call(v).on("edit",function(n){B.text=n,this.attr({"data-unformatted":B.text}),this.call(v);var r={};r["annotations["+e+"].text"]=B.text,H&&H.autorange&&(r[H._name+".autorange"]=!0),V&&V.autorange&&(r[V._name+".autorange"]=!0),s.relayout(t,r)}):tt.call(v),X.attr({transform:"rotate("+U+","+Z.x+","+Z.y+")"}).call(d.setPosition,Z.x,Z.y)}},m.arrowhead=function(t,e,n,r){l(r)||(r=1);var a=t.node(),o=m.ARROWPATHS[e||0];if(o){"string"==typeof n&&n||(n="end");var s,c,u,h,p=(d.getPx(t,"stroke-width")||1)*r,g=t.style("stroke")||f.defaultLine,v=t.style("stroke-opacity")||1,y=n.indexOf("start")>=0,x=n.indexOf("end")>=0,b=o.backoff*p;if("line"===a.nodeName){if(s={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")},u=Math.atan2(s.y-c.y,s.x-c.x),h=u+Math.PI,b){var _=b*Math.cos(u),w=b*Math.sin(u);y&&(s.x-=_,s.y-=w,t.attr({x1:s.x,y1:s.y})),x&&(c.x+=_,c.y+=w,t.attr({x2:c.x,y2:c.y}))}}else if("path"===a.nodeName){var k=a.getTotalLength(),M="";if(y){var A=a.getPointAtLength(0),T=a.getPointAtLength(.1);u=Math.atan2(A.y-T.y,A.x-T.x),s=a.getPointAtLength(Math.min(b,k)),b&&(M="0px,"+b+"px,")}if(x){var L=a.getPointAtLength(k),z=a.getPointAtLength(k-.1);if(h=Math.atan2(L.y-z.y,L.x-z.x),c=a.getPointAtLength(Math.max(0,k-b)),b){var S=M?2*b:b;M+=k-S+"px,"+k+"px"}}else M&&(M+=k+"px");M&&t.style("stroke-dasharray",M)}var C=function(n,r){e>5&&(r=0),i.select(a.parentElement).append("path").attr({"class":t.attr("class"),d:o.path,transform:"translate("+n.x+","+n.y+")rotate("+180*r/Math.PI+")scale("+p+")"}).style({fill:g,opacity:v,"stroke-width":0})};y&&C(s,u),x&&C(c,h)}},m.calcAutorange=function(t){var e=t._fullLayout,n=e.annotations;if(n.length&&t._fullData.length){var r={};n.forEach(function(t){r[t.xref]=!0,r[t.yref]=!0});var o=u.list(t).filter(function(t){return t.autorange&&r[t._id]});if(o.length)return c.syncOrAsync([m.drawAll,a],t)}}},{"../../lib":103,"../../lib/setcursor":112,"../../lib/svg_text_utils":114,"../../plotly":121,"../../plots/cartesian/axes":124,"../color":25,"../dragelement":46,"../drawing":48,"./arrow_paths":21,"./attributes":22,d3:14,"fast-isnumeric":17}],24:[function(t,e,n){"use strict";n.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],n.defaultLine="#444",n.lightLine="#eee",n.background="#fff",n.borderLine="#BEC8D9",n.lightFraction=1e3/11},{}],25:[function(t,e,n){"use strict";function r(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var n=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!n)return t;var r=n[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===r.length;if(!a&&3!==r.length)return t;for(var i=0;i=0))return t;if(3===i)r[i]>1&&(r[i]=1);else if(r[i]>=1)return t}var l=Math.round(255*r[0])+", "+Math.round(255*r[1])+", "+Math.round(255*r[2]);return a?"rgba("+l+", "+r[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),o=t("fast-isnumeric"),i=e.exports={},l=t("./attributes");i.defaults=l.defaults,i.defaultLine=l.defaultLine,i.lightLine=l.lightLine,i.background=l.background,i.overrideDefaults=function(t){i.defaults=t},i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(a(t))},i.opacity=function(t){return t?a(t).getAlpha():0},i.addOpacity=function(t,e){var n=a(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},i.combine=function(t,e){var n=a(t).toRgb();if(1===n.a)return a(t).toRgbString();var r=a(e||i.background).toRgb(),o=1===r.a?r:{r:255*(1-r.a)+r.r*r.a,g:255*(1-r.a)+r.g*r.a,b:255*(1-r.a)+r.b*r.a},l={r:o.r*(1-n.a)+n.r*n.a,g:o.g*(1-n.a)+n.g*n.a,b:o.b*(1-n.a)+n.b*n.a};return a(l).toRgbString()},i.contrast=function(t,e,n){var r=a(t),o=r.isLight()?r.darken(n):r.lighten(e);return o.toString()},i.stroke=function(t,e){var n=a(e);t.style({stroke:i.tinyRGB(n),"stroke-opacity":n.getAlpha()})},i.fill=function(t,e){var n=a(e);t.style({fill:i.tinyRGB(n),"fill-opacity":n.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,n,a,o,l=Object.keys(t);for(e=0;es&&(o[1]-=(it-s)/2)):n.node()&&!n.classed("js-placeholder")&&(it=d.bBox(e.node()).height),it){if(it+=5,"top"===b.titleside)J.domain[1]-=it/A.h,o[1]*=-1;else{J.domain[0]+=it/A.h;var u=Math.max(1,n.selectAll("tspan.line").size());o[1]+=(1-u)*s}e.attr("transform","translate("+o+")"),J.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(A.h*(1-J.domain[1]))+")");var f=at.select(".cbfills").selectAll("rect.cbfill").data(S);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var n=[0===e?L[0]:(S[e]+S[e-1])/2,e===S.length-1?L[1]:(S[e]+S[e+1])/2].map(J.c2p).map(Math.round);e!==S.length-1&&(n[1]+=n[1]>n[0]?1:-1);var o=E(t).replace("e-",""),i=a(o).toHexString();r.select(this).attr({x:Y,width:Math.max(F,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:i})});var h=at.select(".cblines").selectAll("path.cbline").data(b.line.color&&b.line.width?z:[]);return h.enter().append("path").classed("cbline",!0),h.exit().remove(),h.each(function(t){r.select(this).attr("d","M"+Y+","+(Math.round(J.c2p(t))+b.line.width/2%1)+"h"+F).call(d.lineGroupStyle,b.line.width,C(t),b.line.dash)}),J._axislayer.selectAll("g."+J._id+"tick,path").remove(),J._pos=Y+F+(b.outlinewidth||0)/2-("outside"===b.ticks?1:0),J.side="right",c.syncOrAsync([function(){return l.doTicks(t,J,!0)},function(){if(-1===["top","bottom"].indexOf(b.titleside)){var e=J.titlefont.size,n=J._offset+J._length/2,a=A.l+(J.position||0)*A.w+("right"===J.side?10+e*(J.showticklabels?1:.5):-10-e*(J.showticklabels?.5:0));w("h"+J._id+"title",{avoid:{selection:r.select(t).selectAll("g."+J._id+"tick"),side:b.titleside,offsetLeft:A.l,offsetTop:A.t,maxShift:M.width},attributes:{x:a,y:n,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function w(e,n){var r,a=x();r=i.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:J,propName:r,traceIndex:a.index,dfltName:"colorscale",containerGroup:at.select(".cbtitle")},l="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+l+",."+l+"-math-group").remove(),p.draw(t,e,u(o,n||{}))}function k(){var n=F+b.outlinewidth/2+d.bBox(J._axislayer.node()).width;if(I=ot.select("text"),I.node()&&!I.classed("js-placeholder")){var r,a=ot.select(".h"+J._id+"title-math-group").node();r=a&&-1!==["top","bottom"].indexOf(b.titleside)?d.bBox(a).width:d.bBox(ot.node()).right-Y-A.l,n=Math.max(n,r)}var o=2*b.xpad+n+b.borderwidth+b.outlinewidth/2,l=$-Q;at.select(".cbbg").attr({x:Y-b.xpad-(b.borderwidth+b.outlinewidth)/2,y:Q-Z,width:Math.max(o,2),height:Math.max(l+2*Z,2)}).call(h.fill,b.bgcolor).call(h.stroke,b.bordercolor).style({"stroke-width":b.borderwidth}),at.selectAll(".cboutline").attr({x:Y,y:Q+b.ypad+("top"===b.titleside?it:0),width:Math.max(F,2),height:Math.max(l-2*b.ypad-it,2)}).call(h.stroke,b.outlinecolor).style({fill:"None","stroke-width":b.outlinewidth});var s=({center:.5,right:1}[b.xanchor]||0)*o;at.attr("transform","translate("+(A.l-s)+","+A.t+")"),i.autoMargin(t,e,{x:b.x,y:b.y,l:o*({right:1,center:.5}[b.xanchor]||0),r:o*({left:1,center:.5}[b.xanchor]||0),t:l*({bottom:1,middle:.5}[b.yanchor]||0),b:l*({top:1,middle:.5}[b.yanchor]||0)})}var M=t._fullLayout,A=M._size;if("function"!=typeof b.fillcolor&&"function"!=typeof b.line.color)return void M._infolayer.selectAll("g."+e).remove();var T,L=r.extent(("function"==typeof b.fillcolor?b.fillcolor:b.line.color).domain()),z=[],S=[],C="function"==typeof b.line.color?b.line.color:function(){return b.line.color},E="function"==typeof b.fillcolor?b.fillcolor:function(){return b.fillcolor},O=b.levels.end+b.levels.size/100,P=b.levels.size,N=1.001*L[0]-.001*L[1],D=1.001*L[1]-.001*L[0];for(T=b.levels.start;0>(T-O)*P;T+=P)T>N&&D>T&&z.push(T);if("function"==typeof b.fillcolor)if(b.filllevels)for(O=b.filllevels.end+b.filllevels.size/100,P=b.filllevels.size,T=b.filllevels.start;0>(T-O)*P;T+=P)T>L[0]&&T1){var rt=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));tt*=rt*c.roundUp(nt/rt,[2,5,10]),(Math.abs(b.levels.start)/b.levels.size+1e-6)%1<2e-6&&(J.tick0=0)}J.dtick=tt}J.domain=[G+U,G+H-U],J.setScale();var at=M._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).each(function(){var t=r.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(A.l)+","+Math.round(A.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(A.l)+",-"+Math.round(A.t)+")");J._axislayer=at.select(".cbaxis");var it=0;if(-1!==["top","bottom"].indexOf(b.titleside)){var lt,st=A.l+(b.x+V)*A.w,ct=J.titlefont.size;lt="top"===b.titleside?(1-(G+H-U))*A.h+A.t+3+.75*ct:(1-(G+U))*A.h+A.t-3-.25*ct,w(J._id+"title",{attributes:{x:st,y:lt,"text-anchor":"start"}})}var ut=c.syncOrAsync([i.previousPromises,_,i.previousPromises,k],t);if(ut&&ut.then&&(t._promises||[]).push(ut),t._context.editable){var ft,dt,ht;s.init({element:at.node(),prepFn:function(){ft=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",ft+" translate("+t+","+e+")"),dt=s.align(X+t/A.w,q,0,1,b.xanchor),ht=s.align(G-e/A.h,H,0,1,b.yanchor);var n=s.getCursor(dt,ht,b.xanchor,b.yanchor);f(at,n)},doneFn:function(e){f(at),e&&void 0!==dt&&void 0!==ht&&o.restyle(t,{"colorbar.x":dt,"colorbar.y":ht},x().index)}})}return ut}function x(){var n,r,a=e.substr(2);for(n=0;nu*f?a.RdBu:u>=0?a.Reds:a.Blues,s.colorscale=d,l.reversescale&&(d=o(d)),l.colorscale=d)}},{"../../lib":103,"./flip_scale":36,"./scales":43}],33:[function(t,e,n){"use strict";var r=t("./attributes"),a=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:a({},r.colorscale,{}),cauto:a({},r.zauto,{}),cmax:a({},r.zmax,{}),cmin:a({},r.zmin,{}),autocolorscale:a({},r.autocolorscale,{}),reversescale:a({},r.reversescale,{})}}},{"../../lib/extend":101,"./attributes":31,"./scales.js":43}],34:[function(t,e,n){"use strict";var r=t("./scales");e.exports=r.RdBu},{"./scales":43}],35:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../colorbar/has_colorbar"),i=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,n,c,u){var f=u.prefix,d=u.cLetter,h=f.slice(0,f.length-1),p=f?a.nestedProperty(t,h).get()||{}:t,g=f?a.nestedProperty(e,h).get()||{}:e,m=p[d+"min"],v=p[d+"max"],y=p.colorscale,x=r(m)&&r(v)&&v>m;c(f+d+"auto",!x),c(f+d+"min"),c(f+d+"max");var b;void 0!==y&&(b=!l(y)),c(f+"autocolorscale",b);var _=c(f+"colorscale"),w=c(f+"reversescale");if(w&&(g.colorscale=s(_)),"marker.line."!==f){var k;f&&(k=o(p));var M=c(f+"showscale",k);M&&i(p,g,n)}}},{"../../lib":103,"../colorbar/defaults":27,"../colorbar/has_colorbar":29,"./flip_scale":36,"./is_valid_scale":40,"fast-isnumeric":17}],36:[function(t,e,n){"use strict";e.exports=function(t){for(var e,n=t.length,r=new Array(n),a=n-1,o=0;a>=0;a--,o++)e=t[a],r[o]=[1-e[0],e[1]];return r}},{}],37:[function(t,e,n){"use strict";var r=t("./scales"),a=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return e||(e=a),t?("string"==typeof t&&(n(),"string"==typeof t&&n()),o(t)?t:e):e}},{"./default_scale":34,"./is_valid_scale_array":41,"./scales":43}],38:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var n=e?a.nestedProperty(t,e).get()||{}:t,i=n.color,l=!1;if(Array.isArray(i))for(var s=0;sd;d++)s=t[d],u[d]=e+s[0]*(n-e),f[d]=a(s[1]).toRgb();var h=r.scale.linear().domain(u).interpolate(r.interpolateObject).range(f);return function(t){if(o(t)){var r=i.constrain(t,e,n),s=h(r);return a(s).toRgbString()}return a(t).isValid()?t:l.defaultLine}}},{"../../lib":103,"../color":25,d3:14,"fast-isnumeric":17,tinycolor2:20}],43:[function(t,e,n){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]], Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],44:[function(t,e,n){"use strict";e.exports=function(t,e,n,r,a){var o=(t-n)/(r-n),i=o+e/(r-n),l=(o+i)/2;return"left"===a||"bottom"===a?o:"center"===a||"middle"===a?l:"right"===a||"top"===a?i:2/3-l>o?o:i>4/3-l?i:l}},{}],45:[function(t,e,n){"use strict";var r=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,n,o){return t="left"===n?0:"center"===n?1:"right"===n?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:r.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":103}],46:[function(t,e,n){"use strict";function r(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function a(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),i=t("../../lib"),l=t("../../plots/cartesian/constants"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(t){function e(e){return t.element.onmousemove=p,g._dragged=!1,g._dragging=!0,c=e.clientX,u=e.clientY,h=e.target,f=(new Date).getTime(),f-g._mouseDownTimev&&(m=Math.max(m-1,1)),t.doneFn&&t.doneFn(g._dragged,m),!g._dragged){var n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),h.dispatchEvent(n)}return a(g),g._dragged=!1,i.pauseEvent(e)}var c,u,f,d,h,p,g=i.getPlotDiv(t.element)||{},m=1,v=l.DBLCLICKDELAY;g._mouseDownTime||(g._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"}},{"../../lib":103,"../../plotly":121,"../../plots/cartesian/constants":129,"./align":44,"./cursor":45,"./unhover":47}],47:[function(t,e,n){"use strict";var r=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,n){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,n)},a.raw=function(t,e){var n=t._fullLayout;e||(e={}),e.target&&r.triggerHandler(t,"plotly_beforehover",e)===!1||(n._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":100}],48:[function(t,e,n){"use strict";function r(t,e,n,r){var o=t[0]-e[0],i=t[1]-e[1],l=n[0]-e[0],s=n[1]-e[1],c=Math.pow(o*o+i*i,b/2),u=Math.pow(l*l+s*s,b/2),f=(u*u*o-c*c*l)*r,d=(u*u*i-c*c*s)*r,h=3*u*(c+u),p=3*c*(c+u);return[[a.round(e[0]+(h&&f/h),2),a.round(e[1]+(h&&d/h),2)],[a.round(e[0]-(p&&f/p),2),a.round(e[1]-(p&&d/p),2)]]}var a=t("d3"),o=t("fast-isnumeric"),i=t("../../plots/plots"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../traces/scatter/subtypes"),h=t("../../traces/scatter/make_bubble_size_func"),p=e.exports={};p.font=function(t,e,n,r){e&&e.family&&(r=e.color,n=e.size,e=e.family),e&&t.style("font-family",e),n+1&&t.style("font-size",n+"px"),r&&t.call(l.fill,r)},p.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},p.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},p.setRect=function(t,e,n,r,a){t.call(p.setPosition,e,n).call(p.setSize,r,a)},p.translatePoints=function(t,e,n){t.each(function(t){var r=t.xp||e.c2p(t.x),i=t.yp||n.c2p(t.y),l=a.select(this);o(r)&&o(i)?"text"===this.nodeName?l.attr("x",r).attr("y",i):l.attr("transform","translate("+r+","+i+")"):l.remove()})},p.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},p.crispRound=function(t,e,n){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):n||0},p.lineGroupStyle=function(t,e,n,r){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},i=e||o.width||0,s=r||o.dash||"";a.select(this).call(l.stroke,n||o.color).call(p.dashLine,s,i)})},p.dashLine=function(t,e,n){var r=Math.max(n,3);"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},p.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=a.select(this);try{n.call(l.fill,e[0].trace.fillcolor)}catch(r){c.error(r,t),n.remove()}})};var g=t("./symbol_defs");p.symbolNames=[],p.symbolFuncs=[],p.symbolNeedLines={},p.symbolNoDot={},p.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];p.symbolList=p.symbolList.concat([e.n,t,e.n+100,t+"-open"]),p.symbolNames[e.n]=t,p.symbolFuncs[e.n]=e.f,e.needLine&&(p.symbolNeedLines[e.n]=!0),e.noDot?p.symbolNoDot[e.n]=!0:p.symbolList=p.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var m=p.symbolNames.length,v="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";p.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=p.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=m||t>=400?0:Math.floor(Math.max(t,0))},p.pointStyle=function(t,e){if(t.size()){var n=e.marker,r=n.line;if(i.traceIs(e,"symbols")){var o=h(e);t.attr("d",function(t){var r;r="various"===t.ms||"various"===n.size?3:d.isBubble(e)?o(t.ms):(n.size||6)/2,t.mrc=r;var a=p.symbolNumber(t.mx||n.symbol)||0,i=a%100;return t.om=a%200>=100,p.symbolFuncs[i](r)+(a>=200?v:"")}).style("opacity",function(t){return(t.mo+1||n.opacity+1)-1})}var s=(e._input||{}).marker||{},c=p.tryColorscale(n,s,""),u=p.tryColorscale(n,s,"line.");t.each(function(t){var e,o,i;t.so?(i=r.outlierwidth,o=r.outliercolor,e=n.outliercolor):(i=(t.mlw+1||r.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(r.color)?l.defaultLine:r.color,e="mc"in t?t.mcc=c(t.mc):Array.isArray(n.color)?l.defaultLine:n.color||"rgba(0,0,0,0)");var s=a.select(this);t.om?s.call(l.stroke,e).style({"stroke-width":(i||1)+"px",fill:"none"}):(s.style("stroke-width",i+"px").call(l.fill,e),i&&s.call(l.stroke,o))})}},p.tryColorscale=function(t,e,n){var r=c.nestedProperty(t,n+"color").get(),a=c.nestedProperty(t,n+"colorscale").get(),i=c.nestedProperty(t,n+"cauto").get(),l=c.nestedProperty(t,n+"cmin"),u=c.nestedProperty(t,n+"cmax"),f=l.get(),d=u.get();return a&&Array.isArray(r)?(!i&&o(f)&&o(d)||(f=1/0,d=-(1/0),r.forEach(function(t){o(t)&&(f>t&&(f=+t),t>d&&(d=+t))}),f>d&&(f=0,d=1),l.set(f),u.set(d),c.nestedProperty(e,n+"cmin").set(f),c.nestedProperty(e,n+"cmax").set(d)),s.makeScaleFunction(a,f,d)):c.identity};var y={start:1,end:-1,middle:0,bottom:1,top:-1},x=1.3;p.textPointStyle=function(t,e){t.each(function(t){var n=a.select(this),r=t.tx||e.text;if(!r||Array.isArray(r))return void n.remove();var i=t.tp||e.textposition,l=-1!==i.indexOf("top")?"top":-1!==i.indexOf("bottom")?"bottom":"middle",s=-1!==i.indexOf("left")?"end":-1!==i.indexOf("right")?"start":"middle",c=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;c=o(c)&&c>0?c:0,n.call(p.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",s).text(r).call(u.convertToTspans);var d=a.select(this.parentNode),h=n.selectAll("tspan.line"),g=((h[0].length||1)-1)*x+1,m=y[s]*f,v=.75*c+y[l]*f+(y[l]-1)*g*c/2;d.attr("transform","translate("+m+","+v+")"),g>1&&h.attr({x:n.attr("x"),y:n.attr("y")})})};var b=.5;p.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,a="M"+t[0],o=[];for(n=1;nn;n++)i.push(r(t[n-1],t[n],t[n+1],e));for(i.push(r(t[o-1],t[o],t[0],e)),n=1;o>=n;n++)a+="C"+i[n-1][1]+" "+i[n][0]+" "+t[n];return a+="C"+i[o][1]+" "+i[0][0]+" "+t[0]+"Z"};var _={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},w=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};p.steps=function(t){var e=_[t]||w;return function(t){for(var n="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),r=1;r=M&&(a.selectAll("[data-bb]").attr("data-bb",null),k=[]),t.setAttribute("data-bb",k.length),k.push(s),c.extendFlat({},s)},p.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var n="#"+e,r=a.select("base");r.size()&&r.attr("href")&&(n=window.location.href+n),t.attr("clip-path","url("+n+")")}},{"../../constants/xmlns_namespaces":95,"../../lib":103,"../../lib/svg_text_utils":114,"../../plots/plots":144,"../../traces/scatter/make_bubble_size_func":251,"../../traces/scatter/subtypes":256,"../color":25,"../colorscale":39,"./symbol_defs":49,d3:14,"fast-isnumeric":17}],49:[function(t,e,n){"use strict";var r=t("d3");e.exports={circle:{n:0,f:function(t){var e=r.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=r.round(.4*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H"+e+"V"+n+"H-"+e+"V"+e+"H-"+n+"V-"+e+"H-"+e+"V-"+n+"H"+e+"V-"+e+"H"+n+"Z"}},x:{n:4,f:function(t){var e=r.round(.8*t/Math.sqrt(2),2),n="l"+e+","+e,a="l"+e+",-"+e,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+n+a+o+a+o+i+o+i+n+i+n+"Z"}},"triangle-up":{n:5,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),a=r.round(t,2);return"M-"+e+","+n+"H"+e+"L0,-"+a+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),a=r.round(t,2);return"M-"+e+",-"+n+"H"+e+"L0,"+a+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),a=r.round(t,2);return"M"+n+",-"+e+"V"+e+"L-"+a+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2),n=r.round(t/2,2),a=r.round(t,2);return"M-"+n+",-"+e+"V"+e+"L"+a+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+n+",-"+e+"H"+e+"V"+n+"Z"}},"triangle-se":{n:10,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+e+",-"+n+"V"+e+"H-"+n+"Z"}},"triangle-sw":{n:11,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M"+n+","+e+"H-"+e+"V-"+n+"Z"}},"triangle-nw":{n:12,f:function(t){var e=r.round(.6*t,2),n=r.round(1.2*t,2);return"M-"+e+","+n+"V-"+e+"H"+n+"Z"}},pentagon:{n:13,f:function(t){var e=r.round(.951*t,2),n=r.round(.588*t,2),a=r.round(-t,2),o=r.round(t*-.309,2),i=r.round(.809*t,2);return"M"+e+","+o+"L"+n+","+i+"H-"+n+"L-"+e+","+o+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),a=r.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+n+"V"+n+"L0,"+e+"L-"+a+","+n+"V-"+n+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=r.round(t,2),n=r.round(t/2,2),a=r.round(t*Math.sqrt(3)/2,2);return"M-"+n+","+a+"H"+n+"L"+e+",0L"+n+",-"+a+"H-"+n+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=r.round(.924*t,2),n=r.round(.383*t,2);return"M-"+n+",-"+e+"H"+n+"L"+e+",-"+n+"V"+n+"L"+n+","+e+"H-"+n+"L-"+e+","+n+"V-"+n+"Z"}},star:{n:17,f:function(t){var e=1.4*t,n=r.round(.225*e,2),a=r.round(.951*e,2),o=r.round(.363*e,2),i=r.round(.588*e,2),l=r.round(-e,2),s=r.round(e*-.309,2),c=r.round(.118*e,2),u=r.round(.809*e,2),f=r.round(.382*e,2);return"M"+n+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+f+"L-"+i+","+u+"L-"+o+","+c+"L-"+a+","+s+"H-"+n+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=r.round(.66*t,2),n=r.round(.38*t,2),a=r.round(.76*t,2);return"M-"+a+",0l-"+n+",-"+e+"h"+a+"l"+n+",-"+e+"l"+n+","+e+"h"+a+"l-"+n+","+e+"l"+n+","+e+"h-"+a+"l-"+n+","+e+"l-"+n+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),a=r.round(1.6*t,2),o=r.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+n+i+e+","+n+i+"0,-"+a+i+"-"+e+","+n+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=r.round(t*Math.sqrt(3)*.8,2),n=r.round(.8*t,2),a=r.round(1.6*t,2),o=r.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+n+i+"-"+e+",-"+n+i+"0,"+a+i+e+",-"+n+"Z"}},"star-square":{n:21,f:function(t){var e=r.round(1.1*t,2),n=r.round(2*t,2),a="A "+n+","+n+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=r.round(1.4*t,2),n=r.round(1.9*t,2),a="A "+n+","+n+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=r.round(.7*t,2),n=r.round(1.4*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=r.round(1.4*t,2),n=r.round(.7*t,2);return"M0,"+n+"L"+e+",0L0,-"+n+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=r.round(t,2),n=r.round(t/Math.sqrt(2),2);return"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=r.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=r.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=r.round(1.3*t,2),n=r.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+n+",-"+n+"L"+n+","+n+"M-"+n+","+n+"L"+n+",-"+n},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=r.round(1.2*t,2),n=r.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=r.round(t/2,2),n=r.round(t,2);return"M"+e+","+n+"V-"+n+"m-"+n+",0V"+n+"M"+n+","+e+"H-"+n+"m0,-"+n+"H"+n},needLine:!0},"y-up":{n:37,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+n+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+n+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+n+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=r.round(1.2*t,2),n=r.round(1.6*t,2),a=r.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+n+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=r.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=r.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=r.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=r.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:14}],50:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],51:[function(t,e,n){"use strict";function r(t,e,n,r){var o=e["error_"+r]||{},s=o.visible&&-1!==["linear","log"].indexOf(n.type),c=[];if(s){for(var u=l(o),f=0;fl;l++)i[l]={x:n[l],y:a[l]};return i[0].trace=t,r.calc({calcdata:[i],_fullLayout:e}),i},r.plot=t("./plot"),r.style=t("./style"),r.hoverInfo=function(t,e,n){(e.error_y||{}).visible&&(n.yerr=t.yh-t.y,e.error_y.symmetric||(n.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(n.xerr=t.xh-t.x,e.error_x.symmetric||(n.xerrneg=t.x-t.xs))}},{"./attributes":50,"./calc":51,"./defaults":53,"./plot":55,"./style":56}],55:[function(t,e,n){"use strict";function r(t,e,n){var r={x:e.c2p(t.x),y:n.c2p(t.y)};return void 0!==t.yh&&(r.yh=n.c2p(t.yh),r.ys=n.c2p(t.ys),o(r.ys)||(r.noYS=!0,r.ys=n.c2p(t.ys,!0))),void 0!==t.xh&&(r.xh=e.c2p(t.xh),r.xs=e.c2p(t.xs),o(r.xs)||(r.noXS=!0,r.xs=e.c2p(t.xs,!0))),r}var a=t("d3"),o=t("fast-isnumeric"),i=t("../../lib"),l=t("../../traces/scatter/subtypes");e.exports=function(t,e){var n=e.x(),s=e.y();t.each(function(t){var e=t[0].trace,c=e.error_x||{},u=e.error_y||{},f=l.hasMarkers(e)&&e.marker.maxdisplayed>0;if(u.visible||c.visible){var d=a.select(this).selectAll("g.errorbar").data(i.identity);d.enter().append("g").classed("errorbar",!0),d.each(function(t){var e=a.select(this),i=r(t,n,s);if(!f||t.vis){var l;if(u.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var d=u.width;l="M"+(i.x-d)+","+i.yh+"h"+2*d+"m-"+d+",0V"+i.ys,i.noYS||(l+="m-"+d+",0h"+2*d),e.append("path").classed("yerror",!0).attr("d",l)}if(c.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var h=(c.copy_ystyle?u:c).width;l="M"+i.xh+","+(i.y-h)+"v"+2*h+"m0,-"+h+"H"+i.xs,i.noXS||(l+="m0,-"+h+"v"+2*h),e.append("path").classed("xerror",!0).attr("d",l)}}})}})}},{"../../lib":103,"../../traces/scatter/subtypes":256,d3:14,"fast-isnumeric":17}],56:[function(t,e,n){"use strict";var r=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,n=e.error_y||{},o=e.error_x||{},i=r.select(this);i.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(a.stroke,n.color),o.copy_ystyle&&(o=n),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":25,d3:14}],57:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:!0,source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"number",dflt:0},y:{valType:"number",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":129}],58:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,i,n,r)}e=e||{},r("source"),r("layer"),r("x"),r("y"),r("xanchor"),r("yanchor"),r("sizex"),r("sizey"),r("sizing"),r("opacity");for(var l=0;2>l;l++){var s={_fullLayout:n},c=["x","y"][l];a.coerceRef(t,e,s,c,"paper")}return e}var a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./attributes");e.exports=function(t,e){if(t.images&&Array.isArray(t.images))for(var n=t.images,a=e.images=[],o=0;o=2/3},n.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},n.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},n.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],62:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},r,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":101,"../../plots/font_attributes":142,"../color/attributes":24}],63:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],64:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/plots"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,n){function l(t,e){return r.coerce(d,h,o,t,e)}for(var s,c,u,f,d=t.legend||{},h=e.legend={},p=0,g="normal",m=0;m1);if(y!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),r.coerceFont(l,"font",e.font),l("orientation"),"h"===h.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(s=0,u="left",c=1.1,f="bottom"):(s=0,u="left",c=-.1,f="top")}l("traceorder",g),i.isGrouped(e.legend)&&l("tracegroupgap"),l("x",s),l("xanchor",u),l("y",c),l("yanchor",f),r.noneOrAll(d,h,["x","y"])}}},{"../../lib":103,"../../plots/plots":144,"./attributes":62,"./helpers":67}],65:[function(t,e,n){"use strict";function r(t,e){function n(n){u.util.convertToTspans(n,function(){n.selectAll("tspan.line").attr({x:n.attr("x")}),t.call(o,e)})}var r=t.data()[0][0],a=e._fullLayout,i=r.trace,l=d.traceIs(i,"pie"),s=i.index,c=l?r.label:i.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(p.font,a.legend.font).text(c),e._context.editable&&!l?f.call(u.util.makeEditable).call(n).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(n),this.text()||(t=" "),u.restyle(e,"name",t,s)}):f.call(n)}function a(t,e){var n=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],r=t.selectAll("rect").data([0]);r.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),r.on("click",function(){if(!e._dragged){var r,a,o=t.data()[0][0],i=e._fullData,l=o.trace,s=l.legendgroup,c=[]; if(d.traceIs(l,"pie")){var f=o.label,h=n.indexOf(f);-1===h?n.push(f):n.splice(h,1),u.relayout(e,"hiddenlabels",n)}else{if(""===s)c=[l.index];else for(var p=0;ptspan"),h=d[0].length||1;n=s*h,r=u.node()&&p.bBox(u.node()).width;var g=s*(.3+(1-h)/2);u.attr("y",g),d.attr("y",g)}n=Math.max(n,16)+3,o.attr({x:0,y:-n/2,height:n}),a.height=n,a.width=r}function i(t,e,n){var r=t._fullLayout,a=r.legend,o=a.borderwidth,i=x.isGrouped(a);if(x.isVertical(a))i&&e.each(function(t,e){f.setTranslate(this,0,e*a.tracegroupgap)}),a.width=0,a.height=0,n.each(function(t){var e=t[0],n=e.height,r=e.width;f.setTranslate(this,o,5+o+a.height+n/2),a.height+=n,a.width=Math.max(a.width,r)}),a.width+=45+2*o,a.height+=10+2*o,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),n.selectAll(".legendtoggle").attr("width",(t._context.editable?0:a.width)+40),a.width=Math.ceil(a.width),a.height=Math.ceil(a.height);else if(i){a.width=0,a.height=0;for(var l=[a.width],s=e.data(),u=0,d=s.length;d>u;u++){var h=s[u].map(function(t){return t[0].width}),p=40+Math.max.apply(null,h);a.width+=a.tracegroupgap+p,l.push(a.width)}e.each(function(t,e){f.setTranslate(this,l[e],0)}),e.each(function(){var t=c.select(this),e=t.selectAll("g.traces"),n=0;e.each(function(t){var e=t[0],r=e.height;f.setTranslate(this,0,5+o+n+r/2),n+=r}),a.height=Math.max(a.height,n)}),a.height+=10+2*o,a.width+=2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),n.selectAll(".legendtoggle").attr("width",t._context.editable?0:a.width)}else{a.width=0,a.height=0;var g=0,m=0,v=0,y=0;n.each(function(t){v=Math.max(40+t[0].width,v)}),n.each(function(t){var e=t[0],n=v,i=a.tracegroupgap||5;o+y+i+n>r.width-(r.margin.r+r.margin.l)&&(y=0,g+=m,a.height=a.height+m,m=0),f.setTranslate(this,o+y,5+o+e.height/2+g),a.width+=i+n,a.height=Math.max(a.height,e.height),y+=i+n,m=Math.max(e.height,m)}),a.width+=2*o,a.height+=10+2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),n.selectAll(".legendtoggle").attr("width",t._context.editable?0:a.width)}}function l(t){var e=t._fullLayout,n=e.legend,r="left";b.isRightAnchor(n)?r="right":b.isCenterAnchor(n)&&(r="center");var a="top";b.isBottomAnchor(n)?a="bottom":b.isMiddleAnchor(n)&&(a="middle"),d.autoMargin(t,"legend",{x:n.x,y:n.y,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:n.height*({top:1,middle:.5}[a]||0),t:n.height*({bottom:1,middle:.5}[a]||0)})}function s(t){var e=t._fullLayout,n=e.legend,r="left";b.isRightAnchor(n)?r="right":b.isCenterAnchor(n)&&(r="center"),d.autoMargin(t,"legend",{x:n.x,y:.5,l:n.width*({right:1,center:.5}[r]||0),r:n.width*({left:1,center:.5}[r]||0),b:0,t:0})}var c=t("d3"),u=t("../../plotly"),f=t("../../lib"),d=t("../../plots/plots"),h=t("../dragelement"),p=t("../drawing"),g=t("../color"),m=t("./constants"),v=t("./get_legend_data"),y=t("./style"),x=t("./helpers"),b=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(f.setTranslate,0,e),L.call(p.setRect,j,t,m.scrollBarWidth,m.scrollBarHeight),M.select("rect").attr({y:x.borderwidth-e})}var n=t._fullLayout,o="legend"+n._uid;if(n._infolayer&&t.calcdata){var x=n.legend,_=n.showlegend&&v(t.calcdata,x),w=n.hiddenlabels||[];if(!n.showlegend||!_.length)return n._infolayer.selectAll(".legend").remove(),n._topdefs.select("#"+o).remove(),void d.autoMargin(t,"legend");var k=n._infolayer.selectAll("g.legend").data([0]);k.enter().append("g").attr({"class":"legend","pointer-events":"all"});var M=n._topdefs.selectAll("#"+o).data([0]);M.enter().append("clipPath").attr("id",o).append("rect");var A=k.selectAll("rect.bg").data([0]);A.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}),A.call(g.stroke,x.bordercolor),A.call(g.fill,x.bgcolor),A.style("stroke-width",x.borderwidth+"px");var T=k.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var L=k.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var z=T.selectAll("g.groups").data(_);z.enter().append("g").attr("class","groups"),z.exit().remove();var S=z.selectAll("g.traces").data(f.identity);S.enter().append("g").attr("class","traces"),S.exit().remove(),S.call(y).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(r,t).call(a,t)});var C=0!==k.enter().size();C&&(i(t,z,S),l(t));var E=0,O=n.width,P=0,N=n.height;i(t,z,S),x.height>N?s(t):l(t);var D=n._size,I=D.l+D.w*x.x,R=D.t+D.h*(1-x.y);b.isRightAnchor(x)?I-=x.width:b.isCenterAnchor(x)&&(I-=x.width/2),b.isBottomAnchor(x)?R-=x.height:b.isMiddleAnchor(x)&&(R-=x.height/2);var j=x.width;D.w;I+j>O&&(I=O-j),E>I&&(I=E),j=Math.min(O-I,x.width);var F=x.height,q=D.h;F>q?(R=D.t,F=q):(R+F>N&&(R=N-F),P>R&&(R=P),F=Math.min(N-R,x.height)),f.setTranslate(k,I,R);var B,H,V=F-m.scrollBarHeight-2*m.scrollBarMargin,Z=x.height-F;if(x.height<=F||t._context.staticPlot)A.attr({width:j-x.borderwidth,height:F-x.borderwidth,x:x.borderwidth/2,y:x.borderwidth/2}),f.setTranslate(T,0,0),M.select("rect").attr({width:j-2*x.borderwidth,height:F-2*x.borderwidth,x:x.borderwidth,y:x.borderwidth}),T.call(p.setClipUrl,o);else{B=m.scrollBarMargin,H=T.attr("data-scroll")||0,A.attr({width:j-2*x.borderwidth+m.scrollBarWidth+m.scrollBarMargin,height:F-x.borderwidth,x:x.borderwidth/2,y:x.borderwidth/2}),M.select("rect").attr({width:j-2*x.borderwidth+m.scrollBarWidth+m.scrollBarMargin,height:F-2*x.borderwidth,x:x.borderwidth,y:x.borderwidth-H}),T.call(p.setClipUrl,o),C&&e(B,H),k.on("wheel",null),k.on("wheel",function(){H=f.constrain(T.attr("data-scroll")-c.event.deltaY/V*Z,-Z,0),B=m.scrollBarMargin-H/Z*V,e(B,H),c.event.preventDefault()}),L.on(".drag",null),T.on(".drag",null);var U=c.behavior.drag().on("drag",function(){B=f.constrain(c.event.y-m.scrollBarHeight/2,m.scrollBarMargin,m.scrollBarMargin+V),H=-(B-m.scrollBarMargin)/V*Z,e(B,H)});L.call(U),T.call(U)}if(t._context.editable){var Y,X,G,$;k.classed("cursor-move",!0),h.init({element:k.node(),prepFn:function(){var t=f.getTranslate(k);G=t.x,$=t.y},moveFn:function(t,e){var n=G+t,r=$+e;f.setTranslate(k,n,r),Y=h.align(n,0,D.l,D.l+D.w,x.xanchor),X=h.align(r,0,D.t+D.h,D.t,x.yanchor)},doneFn:function(e){e&&void 0!==Y&&void 0!==X&&u.relayout(t,{"legend.x":Y,"legend.y":X})}})}}}},{"../../lib":103,"../../plotly":121,"../../plots/plots":144,"../color":25,"../dragelement":46,"../drawing":48,"./anchor_utils":61,"./constants":63,"./get_legend_data":66,"./helpers":67,"./style":69,d3:14}],66:[function(t,e,n){"use strict";var r=t("../../plots/plots"),a=t("./helpers");e.exports=function(t,e){function n(t,n){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=[[n]]):l[t].push([n]);else{var r="~~i"+f;s.push(r),l[r]=[[n]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;oo;o++)v=l[s[o]],y[o]=a.isReversed(e)?v.reverse():v;else{for(y=[new Array(x)],o=0;x>o;o++)v=l[s[o]][0],y[0][a.isReversed(e)?x-o-1:o]=v;x=1}return e._lgroupsLength=x,y}},{"../../plots/plots":144,"./helpers":67}],67:[function(t,e,n){"use strict";var r=t("../../plots/plots");n.legendGetsTrace=function(t){return t.visible&&r.traceIs(t,"showLegend")},n.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},n.isVertical=function(t){return"h"!==t.orientation},n.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../plots/plots":144}],68:[function(t,e,n){"use strict";var r=e.exports={};r.layoutAttributes=t("./attributes"),r.supplyLayoutDefaults=t("./defaults"),r.draw=t("./draw"),r.style=t("./style")},{"./attributes":62,"./defaults":64,"./draw":65,"./style":69}],69:[function(t,e,n){"use strict";function r(t){var e=t[0].trace,n=e.visible&&e.fill&&"none"!==e.fill,r=h.hasLines(e),a=s.select(this).select(".legendfill").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-fill",!0),a.exit().remove(),a.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var o=s.select(this).select(".legendlines").selectAll("path").data(r?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(f.lineGroupStyle)}function a(t){function e(t,e,n){var r=c.nestedProperty(i,t).get(),a=Array.isArray(r)&&e?e(r):r;if(n){if(an[1])return n[1]}return a}function n(t){return t[0]}var r,a,o=t[0],i=o.trace,l=h.hasMarkers(i),u=h.hasText(i),d=h.hasLines(i);if(l||u||d){var p={},g={};l&&(p.mc=e("marker.color",n),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",n),p.mlw=e("marker.line.width",c.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(g.line={width:e("line.width",n,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",n),p.ts=10,p.tc=e("textfont.color",n),p.tf=e("textfont.family",n)),r=[c.minExtend(o,p)],a=c.minExtend(i,g)}var m=s.select(this).select("g.legendpoints"),v=m.selectAll("path.scatterpts").data(l?r:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(f.pointStyle,a),l&&(r[0].mrc=3);var y=m.selectAll("g.pointtext").data(u?r:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,a)}function o(t){var e=t[0].trace,n=e.marker||{},r=n.line||{},a=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.traceIs(e,"bar")?[t]:[]);a.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),a.exit().remove(),a.each(function(t){var e=(t.mlw+1||r.width+1)-1,a=s.select(this);a.style("stroke-width",e+"px").call(d.fill,t.mc||n.color),e&&a.call(d.stroke,t.mlc||r.color)})}function i(t){var e=t[0].trace,n=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);n.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.each(function(t){var n=(t.lw+1||e.line.width+1)-1,r=s.select(this);r.style("stroke-width",n+"px").call(d.fill,t.fc||e.fillcolor),n&&r.call(d.stroke,t.lc||e.line.color)})}function l(t){var e=t[0].trace,n=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);n.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),n.exit().remove(),n.size()&&n.call(p,t[0],e)}var s=t("d3"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../drawing"),d=t("../color"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=s.select(this),n=e.selectAll("g.legendfill").data([t]);n.enter().append("g").classed("legendfill",!0);var r=e.selectAll("g.legendlines").data([t]);r.enter().append("g").classed("legendlines",!0);var a=e.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.style("opacity",t[0].trace.opacity),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(i).each(l).each(r).each(a)}},{"../../lib":103,"../../plots/plots":144,"../../traces/pie/style_one":235,"../../traces/scatter/subtypes":256,"../color":25,"../drawing":48,d3:14}],70:[function(t,e,n){"use strict";function r(t,e){var n=e.currentTarget,r=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=t._fullLayout,i={};if("zoom"===r){for(var l,s,u="in"===a?.5:2,f=(1+u)/2,d=(1-u)/2,h=c.Axes.list(t,null,!0),p=0;py;y++){var x=l[y];d=v[x]={};for(var b=0;b1)return r(["resetViews","toggleHover"]),i(m,n);u&&(r(["zoom3d","pan3d","orbitRotation","tableRotation"]),r(["resetCameraDefault3d","resetCameraLastSave3d"]),r(["hoverClosest3d"])),d&&(r(["zoomInGeo","zoomOutGeo","resetGeo"]),r(["hoverClosestGeo"]));var v=a(l),y=[];return((c||p)&&!v||g)&&(y=["zoom2d","pan2d"]),(c||g)&&o(s)&&(y.push("select2d"),y.push("lasso2d")),y.length&&r(y),!c&&!p||v||g||r(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?r(["toggleHover"]):p?r(["hoverClosestGl2d"]):c?r(["hoverClosestCartesian","hoverCompareCartesian"]):h&&r(["hoverClosestPie"]),i(m,n)}function a(t){for(var e=s.Axes.list({_fullLayout:t},null,!0),n=!0,r=0;r0);if(p){var g=a(e,n,s);u("x",g[0]),u("y",g[1]),o.noneOrAll(t,e,["x","y"]),u("xanchor"),u("yanchor"),o.coerceFont(u,"font",n.font);var m=u("bgcolor");u("activecolor",i.contrast(m,c.lightAmount,c.darkAmount)),u("bordercolor"),u("borderwidth")}}},{"../../lib":103,"../color":25,"./attributes":73,"./button_attributes":74,"./constants":75}],77:[function(t,e,n){"use strict";function r(t){for(var e=v.list(t,"x",!0),n=[],r=0;re){var n=e;e=t,t=n}l.setAttributes(w,{"data-min":t,"data-max":e}),l.setAttributes(P,{x:t,width:e-t}),l.setAttributes(A,{width:t}),l.setAttributes(T,{x:e,width:p-e}),l.setAttributes(L,{transform:"translate("+(t-m-1)+")"}),l.setAttributes(C,{ -transform:"translate("+e+")"})}var f=t._fullLayout,d=f._infolayer.selectAll("g.range-slider"),h=f.xaxis.rangeslider,p=f._size.w,g=(f.height-f.margin.b-f.margin.t)*h.thickness,m=2,v=Math.floor(h.borderwidth/2),y=f.margin.l,x=f.height-g-f.margin.b,b=0,_=p,w=document.createElementNS(i,"g");l.setAttributes(w,{"class":"range-slider","data-min":b,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+x+")"});var k=document.createElementNS(i,"rect"),M=h.borderwidth%2===0?h.borderwidth:h.borderwidth-1;l.setAttributes(k,{fill:h.bgcolor,stroke:h.bordercolor,"stroke-width":h.borderwidth,height:g+M,width:p+M,transform:"translate(-"+v+", -"+v+")","shape-rendering":"crispEdges"});var A=document.createElementNS(i,"rect");l.setAttributes(A,{x:0,width:b,height:g,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(i,"rect");l.setAttributes(T,{x:_,width:p-_,height:g,fill:"rgba(0,0,0,0.4)"});var L=document.createElementNS(i,"g"),z=document.createElementNS(i,"rect"),S=document.createElementNS(i,"rect");l.setAttributes(L,{transform:"translate("+(b-m-1)+")"}),l.setAttributes(z,{width:10,height:g,x:-6,fill:"transparent",cursor:"col-resize"}),l.setAttributes(S,{width:m,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),l.appendChildren(L,[S,z]);var C=document.createElementNS(i,"g"),E=document.createElementNS(i,"rect"),O=document.createElementNS(i,"rect");l.setAttributes(C,{transform:"translate("+_+")"}),l.setAttributes(E,{width:10,height:g,x:-2,fill:"transparent",cursor:"col-resize"}),l.setAttributes(O,{width:m,height:g/2,y:g/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),l.appendChildren(C,[O,E]);var P=document.createElementNS(i,"rect");l.setAttributes(P,{x:b,width:_-b,height:g,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function n(t){var n,r,f=+t.clientX-o;switch(a){case P:w.style.cursor="ew-resize",n=+l+f,r=+s+f,u(n,r),c(e(n),e(r));break;case z:w.style.cursor="col-resize",n=+l+f,r=+s,u(n,r),c(e(n),e(r));break;case E:w.style.cursor="col-resize",n=+l,r=+s+f,u(n,r),c(e(n),e(r));break;default:w.style.cursor="ew-resize",n=i,r=i+f,u(n,r),c(e(n),e(r))}}function r(){window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r),w.style.cursor="auto"}var a=t.target,o=t.clientX,i=o-w.getBoundingClientRect().left,l=w.getAttribute("data-min"),s=w.getAttribute("data-max");window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)}),h.range||(h.range=a.getAutoRange(f.xaxis));var N=s(t,p,g);l.appendChildren(w,[k,N,A,T,P,L,C]),n(f.xaxis.range[0],f.xaxis.range[1]),d.data([0]).enter().append(function(){return h.setRange=n,w})}},{"../../constants/xmlns_namespaces":95,"../../lib":103,"../../plotly":121,"../../plots/cartesian/axes":124,"./helpers":83,"./range_plot":85}],82:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes");e.exports=function(t,e,n,o){function i(t,e){return r.coerce(l,s,a,t,e)}if(t[n].rangeslider){var l=r.isPlainObject(t[n].rangeslider)?t[n].rangeslider:{},s=e[n].rangeslider={};if(i("bgcolor"),i("bordercolor"),i("borderwidth"),i("thickness"),i("visible"),i("range"),s.range&&!e[n].autorange){var c=s.range,u=e[n].range;c[0]=Math.min(c[0],u[0]),c[1]=Math.max(c[1],u[1])}else e[n]._needsExpand=!0;s.visible&&o.forEach(function(t){var n=e[t]||{};n.fixedrange=!0,e[t]=n})}}},{"../../lib":103,"./attributes":80}],83:[function(t,e,n){"use strict";n.setAttributes=function(t,e){for(var n in e)t.setAttribute(n,e[n])},n.appendChildren=function(t,e){for(var n=0;ns;s++){var c=l[s],u={_fullLayout:e},f=A.coerceRef(t,r,u,c);if("path"!==i){var d=.25,h=.75;if("paper"!==f){var p=A.getFromId(u,f),g=o(p);d=g(p.range[0]+d*(p.range[1]-p.range[0])),h=g(p.range[0]+h*(p.range[1]-p.range[0]))}n(c+"0",d),n(c+"1",h)}}return"path"===i?n("path"):M.noneOrAll(t,r,["x0","x1","y0","y1"]),r}function a(t){return"category"===t.type?t.c2l:t.d2l}function o(t){return"category"===t.type?t.l2c:t.l2d}function i(t,e){t.layout.shapes=e,C.supplyLayoutDefaults(t.layout,t._fullLayout),C.drawAll(t)}function l(t){delete t.layout.shapes,t._fullLayout.shapes=[],C.drawAll(t)}function s(t,e,n){for(var r=0;re;a--)h(t,a).selectAll('[data-index="'+(a-1)+'"]').attr("data-index",a),C.draw(t,a)}function f(t,e,n,i){function l(n){var r={"data-index":e,"fill-rule":"evenodd",d:x(t,C)},a=C.line.width?C.line.color:"rgba(0,0,0,0)",o=n.append("path").attr(r).style("opacity",C.opacity).call(T.stroke,a).call(T.fill,C.fillcolor).call(L.dashLine,C.line.dash,C.line.width);E&&o.call(L.setClipUrl,"clip"+t._fullLayout._uid+E),t._context.editable&&d(t,o,C,e)}var s,c;h(t,e).selectAll('[data-index="'+e+'"]').remove();var u=t.layout.shapes[e];if(u){var f={xref:u.xref,yref:u.yref},g={};"string"==typeof n&&n?g[n]=i:M.isPlainObject(n)&&(g=n);var m=Object.keys(g);for(s=0;ss;s++){var b=y[s];if(void 0===g[b]&&void 0!==u[b]){var _,w=b.charAt(0),k=A.getFromId(t,A.coerceRef(f,{},t,w)),z=A.getFromId(t,A.coerceRef(u,{},t,w)),S=u[b];void 0!==g[w+"ref"]&&(k?(_=a(k)(S),S=(_-k.range[0])/(k.range[1]-k.range[0])):S=(S-z.domain[0])/(z.domain[1]-z.domain[0]),z?(_=z.range[0]+S*(z.range[1]-z.range[0]),S=o(z)(_)):S=k.domain[0]+S*(k.domain[1]-k.domain[0])),u[b]=S}}var C=r(u,t._fullLayout);t._fullLayout.shapes[e]=C;var E;if("below"!==C.layer)E=(C.xref+C.yref).replace(/paper/g,""),l(t._fullLayout._shapeUpperLayer);else if("paper"===C.xref&&"paper"===C.yref)E="",l(t._fullLayout._shapeLowerLayer);else{var O,P=t._fullLayout._plots||{},N=Object.keys(P);for(s=0,c=N.length;c>s;s++)O=P[N[s]],E=N[s],p(t,C,O)&&l(O.shapelayer)}}}function d(t,e,n,r){function a(t){var n=W.right-W.left,r=W.bottom-W.top,a=t.clientX-W.left,o=t.clientY-W.top,i=n>G&&r>$&&!t.shiftKey?z.getCursor(a/n,1-o/r):"move";S(e,i),X=i.split("-")[0]}function o(e){B=A.getFromId(t,n.xref),H=A.getFromId(t,n.yref),V=v(t,B),Z=v(t,H,!0),U=y(t,B),Y=y(t,H,!0);var o="shapes["+r+"]";"path"===n.type?(F=n.path,q=o+".path"):(u=V(n.x0),f=Z(n.y0),d=V(n.x1),h=Z(n.y1),p=o+".x0",g=o+".y0",_=o+".x1",w=o+".y1"),d>u?(L=u,P=o+".x0",R="x0",C=d,N=o+".x1",j="x1"):(L=d,P=o+".x1",R="x1",C=u,N=o+".x0",j="x0"),h>f?(M=f,E=o+".y0",D="y0",T=h,O=o+".y1",I="y1"):(M=h,E=o+".y1",D="y1",T=f,O=o+".y0",I="y0"),c={},a(e),Q.moveFn="move"===X?l:s}function i(n){S(e),n&&k.relayout(t,c)}function l(r,a){if("path"===n.type){var o=function(t){return U(V(t)+r)};B&&"date"===B.type&&(o=m(o));var i=function(t){return Y(Z(t)+a)};H&&"date"===H.type&&(i=m(i)),n.path=b(F,o,i),c[q]=n.path}else c[p]=n.x0=U(u+r),c[g]=n.y0=Y(f+a),c[_]=n.x1=U(d+r),c[w]=n.y1=Y(h+a);e.attr("d",x(t,n))}function s(r,a){if("path"===n.type){var o=function(t){return U(V(t)+r)};B&&"date"===B.type&&(o=m(o));var i=function(t){return Y(Z(t)+a)};H&&"date"===H.type&&(i=m(i)),n.path=b(F,o,i),c[q]=n.path}else{var l=~X.indexOf("n")?M+a:M,s=~X.indexOf("s")?T+a:T,u=~X.indexOf("w")?L+r:L,f=~X.indexOf("e")?C+r:C;s-l>$&&(c[E]=n[D]=Y(l),c[O]=n[I]=Y(s)),f-u>G&&(c[P]=n[R]=U(u),c[N]=n[j]=U(f))}e.attr("d",x(t,n))}var c,u,f,d,h,p,g,_,w,M,T,L,C,E,O,P,N,D,I,R,j,F,q,B,H,V,Z,U,Y,X,G=10,$=10,Q={setCursor:a,element:e.node(),prepFn:o,doneFn:i},W=Q.element.getBoundingClientRect();z.init(Q)}function h(t,e){var n=t._fullLayout.shapes[e],r=t._fullLayout._shapeUpperLayer;return n?"below"===n.layer&&(r="paper"===n.xref&&"paper"===n.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):M.log("getShapeLayer: undefined shape: index",e),r}function p(t,e,n){var r=k.Axes.getFromId(t,n.id,"x")._id,a=k.Axes.getFromId(t,n.id,"y")._id,o="below"===e.layer,i=r===e.xref||a===e.yref,l=!!n.shapelayer;return o&&i&&l}function g(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}}function m(t){return function(e){return t(e).replace(" ","_")}}function v(t,e,n){var r,o=t._fullLayout._size;if(e){var i=a(e);r=function(t){return e._offset+e.l2p(i(t,!0))},"date"===e.type&&(r=g(r))}else r=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return r}function y(t,e,n){var r,a=t._fullLayout._size;if(e){var i=o(e);r=function(t){return i(e.p2l(t-e._offset))}}else r=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return r}function x(t,e){var n,r,o,i,l=e.type,s=A.getFromId(t,e.xref),c=A.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(n=a(s),r=function(t){return s._offset+s.l2p(n(t,!0))}):r=function(t){return u.l+u.w*t},c?(o=a(c),i=function(t){return c._offset+c.l2p(o(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===l)return s&&"date"===s.type&&(r=g(r)),c&&"date"===c.type&&(i=g(i)),C.convertPath(e.path,r,i);var f=r(e.x0),d=r(e.x1),h=i(e.y0),p=i(e.y1);if("line"===l)return"M"+f+","+h+"L"+d+","+p;if("rect"===l)return"M"+f+","+h+"H"+d+"V"+p+"H"+f+"Z";var m=(f+d)/2,v=(h+p)/2,y=Math.abs(m-f),x=Math.abs(v-h),b="A"+y+","+x,_=m+y+","+v,w=m+","+(v-x);return"M"+_+b+" 0 1,1 "+w+b+" 0 0,1 "+_+"Z"}function b(t,e,n){return t.replace(E,function(t){var r=0,a=t.charAt(0),o=P[a],i=N[a],l=D[a],s=t.substr(1).replace(O,function(t){return r>=l?t:(o[r]?t=e(t):i[r]&&(t=n(t)),r++,t)});return a+s})}function _(t,e,n,r,a){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(n)];if(r){var i,l,s,c,u,f=1/0,d=-(1/0),h=r.match(E);for("date"===t.type&&(o=g(o)),i=0;iu&&(f=u),u>d&&(d=u)));return d>=f?[f,d]:void 0}}var w=t("fast-isnumeric"),k=t("../../plotly"),M=t("../../lib"),A=t("../../plots/cartesian/axes"),T=t("../color"),L=t("../drawing"),z=t("../dragelement"),S=t("../../lib/setcursor"),C=e.exports={};C.layoutAttributes=t("./attributes"),C.supplyLayoutDefaults=function(t,e){for(var n=t.shapes||[],a=e.shapes=[],o=0;ol&&(t="X"),t});return r>l&&(s=s.replace(/[\s,]*X.*/,""),M.log("Ignoring extra params in segment "+t)),a+s})},C.calcAutorange=function(t){var e,n,r,a,o,i=t._fullLayout,l=i.shapes;if(l.length&&t._fullData.length)for(e=0;ed?n=d:(u.left-=x.offsetLeft,u.right-=x.offsetLeft,u.top-=x.offsetTop,u.bottom-=x.offsetTop,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(n=Math.max(n,i*(t[x.side]-u[o])+c))}),n=Math.min(d,n)),n>0||0>d){var h={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[x.side];e.attr("transform","translate("+h+")")}}}function p(){L=0,z=!0,S=E,k._infolayer.select("."+e).attr({"data-unformatted":S}).text(S).on("mouseover.opacity",function(){r.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(1e3).style("opacity",0)})}var g=n.propContainer,m=n.propName,v=n.traceIndex,y=n.dfltName,x=n.avoid||{},b=n.attributes,_=n.transform,w=n.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,z=!1,S=g.title.trim();""===S&&(L=0),S.match(/Click to enter .+ title/)&&(L=.2,z=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(S).attr("class",e),C.attr({"data-unformatted":S}).call(f);var E="Click to enter "+y+" title",O=t._context.editable;O&&(g===k?O=t._context.editableMainTitle:g===k.xaxis?O=t._context.editableAxisXTitle:g===k.yaxis?O=t._context.editableAxisYTitle:g===k.yaxis2?O=t._context.editableAxisY2Title:g===k.xaxis2&&(O=t._context.editableAxisX2Title)),O?(S||p(),C.call(u.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,m,e,v):o.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):S&&!S.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",z),g._titleElement=C}},{"../../lib":103,"../../lib/svg_text_utils":114,"../../plotly":121,"../../plots/plots":144,"../color":25,"../drawing":48,d3:14,"fast-isnumeric":17}],89:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i={_isLinkedToArray:!0,method:{valType:"enumerated",values:["restyle","relayout"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:!0,visible:{valType:"boolean"},active:{valType:"integer",min:-1,dflt:0},buttons:i,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:"bottom"},font:o({},r,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":101,"../../plots/font_attributes":142,"../color/attributes":24}],90:[function(t,e,n){"use strict";e.exports={name:"updatemenus",itemName:"updatemenu",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",buttonGroupClassName:"updatemenu-button-group",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],91:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,i,n,r)}var l=a(t,e),s=r("visible",l.length>0);s&&(r("active"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),o.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function a(t,e){function n(t,e){return o.coerce(r,a,c,t,e)}for(var r,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(s.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),s.exit().remove(),s.exit().size()&&v(t),0!==n.length){var c=s.selectAll("g."+T.headerGroupClassName).data(n,a);c.enter().append("g").classed(T.headerGroupClassName,!0);var u=s.selectAll("g."+T.buttonGroupClassName).data([0]);u.enter().append("g").classed(T.buttonGroupClassName,!0).style("pointer-events","all"),c.enter().size()&&u.call(m).attr(T.menuIndexAttrName,"-1"),c.exit().each(function(e){y.select(this).remove(),u.call(m).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var f=0;f",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],95:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],96:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.16.3-d16",n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=r.register,n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=r.Fx,n.Snapshot=r.Snapshot,n.PlotSchema=r.PlotSchema,n.Queue=r.Queue,n.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":118,"./plot_api/to_image":119,"./plot_api/validate":120,"./plotly":121,"./snapshot/download":159,d3:14}],97:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],98:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("./nested_property"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);n.valObjects={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)}},"boolean":{coerceFunction:function(t,e,n){t===!0||t===!1?e.set(t):e.set(n)}},number:{coerceFunction:function(t,e,n,a){!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,a){t%1||!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var a="number"==typeof t;r.strict!==!0&&a?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){a(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(i(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){var r=n.length;return"string"==typeof t&&t.substr(0,r)===n&&l.test(t.substr(r))?void e.set(t):void e.set(n)},validateFunction:function(t,e){var n=e.dflt,r=n.length;return t===n?!0:"string"!=typeof t?!1:!(t.substr(0,r)!==n||!l.test(t.substr(r)))}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),o=0;o2)return!1;var s=i[0].split("-");if(s.length>3||3!==s.length&&i[1])return!1;if(4===s[0].length)n=Number(s[0]);else{if(2!==s[0].length)return!1;var c=(new Date).getFullYear();n=((Number(s[0])-c+70)%100+200)%100+c-70}return l(n)?1===s.length?new Date(n,0,1).getTime():(r=Number(s[1])-1,s[1].length>2||!(r>=0&&11>=r)?!1:2===s.length?new Date(n,r,1).getTime():(a=Number(s[2]),s[2].length>2||!(a>=1&&31>=a)?!1:(a=new Date(n,r,a).getTime(),i[1]?(s=i[1].split(":"),s.length>3?!1:(o=Number(s[0]),s[0].length>2||!(o>=0&&23>=o)?!1:(a+=36e5*o,1===s.length?a:(r=Number(s[1]),s[1].length>2||!(r>=0&&59>=r)?!1:(a+=6e4*r,2===s.length?a:(t=Number(s[2]),t>=0&&60>t?a+1e3*t:!1)))))):a))):!1},n.isDateTime=function(t){return n.dateTime2ms(t)!==!1},n.ms2DateTime=function(t,e){if("undefined"==typeof i)return void s.error("d3 is not defined.");e||(e=0);var n=new Date(t),a=i.time.format("%Y-%m-%d")(n);return 7776e6>e?(a+=" "+r(n.getHours(),2),432e6>e&&(a+=":"+r(n.getMinutes(),2),108e5>e&&(a+=":"+r(n.getSeconds(),2),3e5>e&&(a+="."+r(n.getMilliseconds(),3)))),a.replace(/([:\s]00)*\.?[0]*$/,"")):a};var c={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},f=i.time.format.utc,d={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(f),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(f)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(f)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){d[t].D.push(f(e)),["H","I","D"].forEach(function(n){c[n].forEach(function(r){var a=d[t][n];a.push(f(e+"~"+r)),a.push(f(r+"~"+e))})})})});var h=/[a-z]*/g,p=function(t){return t.substr(0,3)},g=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,m=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},x=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,k=/q([1-4])/,M=["31~mar","30~jun","30~sep","31~dec"],A=function(t,e){return M[e-1]},T=/ ?([+\-]\d\d:?\d\d|Z)$/;n.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(h,p).replace(g,"").replace(m,"~").replace(v,y).replace(k,A).trim().replace(T,"");var e,n,r=null,i=a(t),l=o(t);e=d[i][l],n=e.length;for(var s=0;n>s&&!(r=e[s].parse(t));s++);if(!(r instanceof Date))return!1;var c=r.getTimezoneOffset();return r.setTime(r.getTime()+60*c*1e3),r}},{"../lib":103,d3:14,"fast-isnumeric":17}],100:[function(t,e,n){"use strict";var r=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof r)return t;var e=new r;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(n,r){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,r),e.emit(n,r)},t},triggerHandler:function(t,e,n){var r,a;"undefined"!=typeof jQuery&&(r=jQuery(t).triggerHandler(e,n));var o=t._ev;if(!o)return r;var i=o._events[e];if(!i)return r;"function"==typeof i&&(i=[i]);for(var l=i.pop(),s=0;sv;v++){s=t[v];for(c in s)u=g[c],f=s[c],l&&i(f)?g[c]=f:e&&f&&(o(f)||(d=i(f)))?(d?(d=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},g[c]=a([h,f],e,n,l)):("undefined"!=typeof f||n)&&(g[c]=f)}return g}var o=t("./is_plain_object.js"),i=Array.isArray;n.extendFlat=function(){return a(arguments,!1,!1,!1)},n.extendDeep=function(){return a(arguments,!0,!1,!1)},n.extendDeepAll=function(){return a(arguments,!0,!0,!1)},n.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":104}],102:[function(t,e,n){"use strict";e.exports=function(t){for(var e=[],n=0;nn?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},a.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},a.identity=function(t){return t},a.randstr=function d(t,e,n){if(n||(n=16),void 0===e&&(e=24),0>=e)return"0";var r,a,o,i=Math.log(Math.pow(2,e))/Math.log(n),l="";for(r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var s=i-Math.floor(i);for(r=0;r-1||c!==1/0&&c>=Math.pow(2,e)?d(t,e,n):l},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},a.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var n,r,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(n=0;s>n;n++)c[n]=(1-Math.cos(Math.PI*(n+1)/e))/(2*e);for(n=0;i>n;n++){for(o=0,r=0;s>r;r++)a=n+r+1-e,-i>a?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),0>a?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},a.syncOrAsync=function(t,e,n){function r(){return a.syncOrAsync(t,e,n)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],o=i(e),o&&o.then)return o.then(r).then(void 0,a.promiseError);return n&&n(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,n){if(t){var r,a,o=!1,i=!0;for(r=0;ra;a++)e[a][n]=t[a]},a.minExtend=function(t,e){var n={};"object"!=typeof e&&(e={});var r,o,i,l=3,s=Object.keys(t);for(r=0;r1?r+o[1]:"";if(a&&(o.length>1||i.length>4))for(;n.test(i);)i=i.replace(n,"$1"+a+"$2");return i+l}},{"./coerce":98,"./dates":99,"./extend":101,"./is_plain_object":104,"./loggers":105,"./matrix":106,"./nested_property":107,"./notifier":108,"./search":111,"./stats":113,d3:14}],104:[function(t,e,n){"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}},{}],105:[function(t,e,n){"use strict";var r=t("../plot_api/plot_config"),a=e.exports={};a.log=function(){if(r.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;er;r++)n[r]=new Array(e);return n},n.transposeRagged=function(t){var e,n,r=0,a=t.length;for(e=0;a>e;e++)r=Math.max(r,t[e].length);var o=new Array(r);for(e=0;r>e;e++)for(o[e]=new Array(a),n=0;a>n;n++)o[e][n]=t[n][e];return o},n.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var r,a,o=t.length;if(t[0].length)for(r=new Array(o),a=0;o>a;a++)r[a]=n.dot(t[a],e);else if(e[0].length){var i=n.transposeRagged(e);for(r=new Array(i.length),a=0;aa;a++)r+=t[a]*e[a];return r},n.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},n.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},n.rotationXYMatrix=function(t,e,r){return n.dot(n.dot(n.translationMatrix(e,r),n.rotationMatrix(t)),n.translationMatrix(-e,-r))},n.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var r=1===arguments.length?e[0]:[e[0],e[1]];return n.dot(t,[r[0],r[1],1]).slice(0,2)}},n.apply2DTransform2=function(t){var e=n.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],107:[function(t,e,n){"use strict";function r(t,e){return function(){var n,a,o,i,l,s=t;for(i=0;i=0;e--){if(r=t[e],i=!1,Array.isArray(r))for(n=r.length-1;n>=0;n--)c(r[n])?i?r[n]=void 0:r.pop():i=!0;else if("object"==typeof r&&null!==r)for(o=Object.keys(r),i=!1,n=o.length-1;n>=0;n--)c(r[o[n]])&&!a(r[o[n]],o[n])?delete r[o[n]]:i=!0;if(i)return}}function c(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function u(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var f=t("fast-isnumeric");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,a,i,l=0,s=e.split(".");ln||n>o||i>r||r>l?!1:!e||!c(t)}function n(t,e){var n=t[0],s=t[1];if(a>n||n>o||i>s||s>l)return!1;var c,u,f,d,h,p=r.length,g=r[0][0],m=r[0][1],v=0;for(c=1;p>c;c++)if(u=g,f=m,g=r[c][0],m=r[c][1],d=Math.min(u,g),!(d>n||n>Math.max(u,g)||s>Math.max(f,m)))if(s=s&&n!==d&&v++}return v%2===1}var r=t.slice(),a=r[0][0],o=a,i=r[0][1],l=i;r.push(r[0]);for(var s=1;so;o++)if(i=[t[o][0]-s[0],t[o][1]-s[1]],l=r(i,c),0>l||l>u||Math.abs(r(i,d))>a)return!0;return!1};a.filter=function(t,e){function n(n){t.push(n);var l=r.length,s=a;r.splice(i+1);for(var c=s+1;c1){var l=t.pop();n(l)}return{addPt:n,raw:t,filtered:r}}},{"./matrix":106}],110:[function(t,e,n){"use strict";function r(t,e){for(var n,r=[],o=0;oo.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,n;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;nt}function a(t,e){return e>=t}function o(t,e){return t>e}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("../lib");n.findBin=function(t,e,n){if(l(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?n?r:a:n?i:o;d>f&&h++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return h>90&&s.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,a=e[r]-e[0]||1,o=a/(r||1)/1e4,i=[e[0]],l=0;r>l;l++)e[l+1]>e[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},n.roundUp=function(t,e,n){for(var r,a=0,o=e.length-1,i=0,l=n?0:1,s=n?1:0,c=n?Math.ceil:Math.floor;o>a&&i++<100;)r=c((a+o)/2),e[r]<=t?a=r+l:o=r-s;return e[a]}},{"../lib":103,"fast-isnumeric":17}],112:[function(t,e,n){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],113:[function(t,e,n){"use strict";var r=t("fast-isnumeric");n.aggNums=function(t,e,a,o){var i,l;if(o||(o=a.length),r(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(o),i=0;o>i;i++)l[i]=n.aggNums(t,e,a[i]);a=l}for(i=0;o>i;i++)r(e)?r(a[i])&&(e=t(+e,+a[i])):e=a[i];return e},n.len=function(t){return n.aggNums(function(t){return t+1},0,t)},n.mean=function(t,e){return e||(e=n.len(t)),n.aggNums(function(t,e){return t+e},0,t)/e},n.variance=function(t,e,a){return e||(e=n.len(t)),r(a)||(a=n.mean(t,e)),n.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},n.stdev=function(t,e,r){return Math.sqrt(n.variance(t,e,r))},n.interp=function(t,e){if(!r(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":17}],114:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,n){var r="math-output-"+d.randstr([],64),o=f.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())d.log("There was an error in the tex syntax.",t),n();else{var r=o.select("svg").node().getBoundingClientRect();n(o.select(".MathJax_SVG"),e,r)}o.remove()})}function i(t,e){for(var n=t||"",r=0;r]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),a=g[r];if(void 0!==a){var o=e[1],i=e[3],l=i.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(o)return"";if("href"!==i.substr(0,4).toLowerCase())return"";var c=i.substr(4).replace(/["']/g,"").replace(/=/,""),u=document.createElement("a");return u.href=c,-1===m.indexOf(u.protocol)?"":''}if("br"===r)return"
";if(o)return"sup"===r?'':"sub"===r?'':"";var f=""}return n.xml_entity_encode(t).replace(/");a>0;a=e.indexOf("
",a+1))r.push(a);var o=0;r.forEach(function(t){for(var n=t+o,r=e.slice(0,n),a="",i=r.length-1;i>=0;i--){var l=r[i].match(/<(\/?).*>/i);if(l&&"
"!==r[i]){l[1]||(a=r[i]);break}}a&&(e.splice(n+1,0,a),e.splice(n,0,""),o+=2)});var i=e.join(""),c=i.split(/
/gi);return c.length>1&&(e=c.map(function(t,e){return''+t+""})),e.join("")}function u(t,e,n){var r,a,o,i=n.horizontalAlign,l=n.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-r.height}:"middle"===l?function(){return s.top+(s.height-r.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-r.width}:"center"===i?function(){return s.left+(s.width-r.width)/2}:function(){return s.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),h=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");f.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),n=(new DOMParser).parseFromString(e,"application/xml"),r=n.documentElement.firstChild;r;)this.node().appendChild(this.node().ownerDocument.importNode(r,!0)),r=r.nextSibling;return n.querySelector("parsererror")?(d.log(n.querySelector("parsererror div").textContent),null):f.select(this.node().lastChild)},n.html_entity_decode=function(t){var e=f.select("body").append("div").style({display:"none"}).html(""),n=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),n},n.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},n.convertToTspans=function(t,e){function n(){h.empty()||(p=l.attr("class")+"-math",h.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,h=f.select(l.node().parentNode);if(!h.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var m=d.getPlotDiv(l.node());(m&&m._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return n(),void t();var c=h.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var f=r(s,"width"),d=r(s,"height"),g=+l.attr("x")-f*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],m=parseInt(l.style("font-size"),10)||r(l,"height"),v=-m/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-f/2,v-d/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:v-d/2}):"a"===p[0]?s.attr({x:0,y:v}):s.attr({x:g,y:+l.attr("y")+v-d/2}),e&&e.call(l,c),t(c)})}))}else n();return t}};var g={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},m=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),x=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}});n.plainText=function(t){return(t||"").replace(v," ")},n.makeEditable=function(t,e,n){function r(){o(),i.style({opacity:0});var t,e=c.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function o(){var t=f.select(d.getPlotDiv(i.node())),e=t.select(".svg-container"),r=e.append("div");r.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:n.fill||i.style("fill")||"black",opacity:1,"background-color":n.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(n.text||i.attr("data-unformatted")).call(u(i,e,n)).on("blur",function(){i.text(this.textContent).style({opacity:1});var t,e=f.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(i,n)}).on("focus",function(){var t=this;f.select(document).on("mouseup",function(){return f.event.target===t?!1:void(document.activeElement===r.node()&&r.node().blur())})}).on("keyup",function(){27===f.event.which?(i.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),f.select(this).call(u(i,e,n)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(a)}n||(n={});var i=this,l=f.dispatch("edit","input","cancel"),s=f.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),n.immediate?r():c.on("click",r),f.rebind(this,l,"on")}},{"../constants/string_mappings":94,"../constants/xmlns_namespaces":95,"../lib":103,d3:14}],115:[function(t,e,n){"use strict";function r(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function a(t){Array.isArray(t._promises)&&t._promises.length>0&&N.log("Clearing previous rejected promises from queue."),t._promises=[]}function o(t,e){t._fullLayout._paperdiv.style("background","white"),P.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=N.extendFlat({},P.defaultConfig));var n=t._context;e&&(Object.keys(e).forEach(function(t){t in n&&("setBackground"===t&&"opaque"===e[t]?n[t]=o:n[t]=e[t])}),e.plot3dPixelRatio&&!n.plotGlPixelRatio&&(n.plotGlPixelRatio=n.plot3dPixelRatio)),n.staticPlot&&(n.editable=!1,n.autosizable=!1,n.scrollZoom=!1,n.doubleClick=!1,n.showTips=!1,n.showLink=!1,n.displayModeBar=!1)}function l(t,e,n){var r=C.select(t).selectAll(".plot-container").data([0]);r.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=r.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e),n&&(t.layout=n),P.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(k(t,{}),t._fullLayout.autosize=n.autosize=!0),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=P.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),i=1,l=t._fullLayout.title;""!==l&&l||(i=0);var s="Click to enter title",c=function(){this.call(P.util.convertToTspans)},u=o.select(".title-group text").call(c);if(t._context.editable){u.attr({"data-unformatted":l}),l&&l!==s||(i=.2,u.attr({"data-unformatted":s}).text(s).style({opacity:i}).on("mouseover.opacity",function(){C.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){C.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(P.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(c),this.call(f)}).on("cancel",function(){ -var t=this.attr("data-unformatted");this.text(t).call(c)})};u.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),R.addLinks(t),Promise.resolve()}function s(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);var r=P.Axes.list({_fullLayout:t});for(e=0;ee;e++){var i=t.annotations[e];i.ref&&("paper"===i.ref?(i.xref="paper",i.yref="paper"):"data"===i.ref&&(i.xref="x",i.yref="y"),delete i.ref),c(i,"xref"),c(i,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(N.warn("Shapes must be an array."),delete t.shapes);var l=(t.shapes||[]).length;for(e=0;l>e;e++){var s=t.shapes[e];c(s,"xref"),c(s,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var f=R.getSubplotIds(t,"gl3d");for(e=0;en;++n)x[n]=m[e]+v*y[2+4*n];h.camera={eye:{x:x[0],y:x[1],z:x[2]},center:{x:m[0],y:m[1],z:m[2]},up:{x:y[1],y:y[5],z:y[9]}},delete h.cameraposition}}return F.clean(t),t}function c(t,e){var n=t[e],r=e.charAt(0);n&&"paper"!==n&&(t[e]=P.Axes.cleanId(n,r))}function u(t,e){for(var n=[],r=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),a=0;ao&&(l=N.randstr(r),-1!==n.indexOf(l));o++);i.uid=N.randstr(r),r.push(i.uid)}if(n.push(i.uid),"histogramy"===i.type&&"xbins"in i&&!("ybins"in i)&&(i.ybins=i.xbins,delete i.xbins),i.error_y&&"opacity"in i.error_y){var s=F.defaults,c=i.error_y.color||(R.traceIs(i,"bar")?F.defaultLine:s[a%s.length]);i.error_y.color=F.addOpacity(F.rgb(c),F.opacity(c)*i.error_y.opacity),delete i.error_y.opacity}if("bardir"in i&&("h"!==i.bardir||!R.traceIs(i,"bar")&&"histogram"!==i.type.substr(0,9)||(i.orientation="h",_(i)),delete i.bardir),"histogramy"===i.type&&_(i),"histogramx"!==i.type&&"histogramy"!==i.type||(i.type="histogram"),"scl"in i&&(i.colorscale=i.scl,delete i.scl),"reversescl"in i&&(i.reversescale=i.reversescl,delete i.reversescl),i.xaxis&&(i.xaxis=P.Axes.cleanId(i.xaxis,"x")),i.yaxis&&(i.yaxis=P.Axes.cleanId(i.yaxis,"y")),R.traceIs(i,"gl3d")&&i.scene&&(i.scene=R.subplotsRegistry.gl3d.cleanId(i.scene)),R.traceIs(i,"pie")||(Array.isArray(i.textposition)?i.textposition=i.textposition.map(f):i.textposition&&(i.textposition=f(i.textposition))),R.traceIs(i,"2dMap")&&("YIGnBu"===i.colorscale&&(i.colorscale="YlGnBu"),"YIOrRd"===i.colorscale&&(i.colorscale="YlOrRd")),R.traceIs(i,"markerColorscale")&&i.marker){var u=i.marker;"YIGnBu"===u.colorscale&&(u.colorscale="YlGnBu"),"YIOrRd"===u.colorscale&&(u.colorscale="YlOrRd")}if("surface"===i.type&&N.isPlainObject(i.contours)){var h=["x","y","z"];for(o=0;or?o.push(a+r):o.push(r);return o}function g(t,e,n){var r,a;for(r=0;r=t.data.length||a<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(a,r+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||0>a&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+n+" must be unique.")}}function m(t,e,n){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]),g(t,e,"currentIndices"),"undefined"==typeof n||Array.isArray(n)||(n=[n]),"undefined"!=typeof n&&g(t,n,"newIndices"),"undefined"!=typeof n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,n){var r,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&s0){var l=w(t._boundingBoxMargins),s=l.left+l.right,c=l.bottom+l.top,u=o._container.node().getBoundingClientRect(),f=1-2*i.frameMargins;a=Math.round(f*(u.width-s)),r=Math.round(f*(u.height-c))}else n=window.getComputedStyle(t),r=parseFloat(n.height)||o.height,a=parseFloat(n.width)||o.width;return Math.abs(o.width-a)>1||Math.abs(o.height-r)>1?(o.height=t.layout.height=r,o.width=t.layout.width=a):"initial"!==o.autosize&&(delete e.autosize,o.autosize=t.layout.autosize=!0),R.sanitizeMargins(o),e}function M(t){var e=C.select(t),n=t._fullLayout;if(n._container=e.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===n.autosize&&(k(t,{}),n.autosize=!0,t.layout.autosize=!0),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([0]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._geocontainer=n._paperdiv.selectAll(".geo-container").data([0]),n._geocontainer.enter().append("div").classed("geo-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var r=[];C.selectAll("defs").each(function(){this.id&&r.push(this.id.split("-")[1])}),n._uid=N.randstr(r)}n._paperdiv.selectAll(".main-svg").attr(Q.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._draggers=n._paper.append("g").classed("draglayer",!0);var a=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=a.append("g").classed("imagelayer",!0),n._shapeLowerLayer=a.append("g").classed("shapelayer",!0);var o=P.Axes.getSubplots(t);o.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&A(t,o),n._has("cartesian")&&T(t,o),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0);var i=n._paper.selectAll(".layer-subplot");n._imageSubplotLayer=i.selectAll(".imagelayer"),n._shapeSubplotLayer=i.selectAll(".shapelayer");var l=n._paper.append("g").classed("layer-above",!0);n._imageUpperLayer=l.append("g").classed("imagelayer",!0),n._shapeUpperLayer=l.append("g").classed("shapelayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0),n._geoimages=n._paper.append("g").classed("geoimages",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var s=N.syncOrAsync([L,function(){return P.Axes.doTicks(t,"redraw")},j.init],t);return s&&s.then&&t._promises.push(s),s}function A(t,e){function n(e,n){return function(){return P.Axes.getFromId(t,e,n)}}for(var r,a,o=t._fullLayout._plots={},i=0;i0,_=P.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),k=w===_;b?t.framework===M&&!x&&k||(t.framework=M,M(t)):k?x&&M(t):(t.framework=M,M(t)),x&&P.Axes.saveRangeInitial(t);var A=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&h(t);for(var z=0;zG.range[0]?[1,2]:[2,1]);else{var Q=G.range[0],W=G.range[1];"log"===j?(0>=Q&&0>=W&&o(U+".autorange",!0),0>=Q?Q=W/1e6:0>=W&&(W=Q/1e6),o(U+".range[0]",Math.log(Q)/Math.LN10),o(U+".range[1]",Math.log(W)/Math.LN10)):(o(U+".range[0]",Math.pow(10,Q)),o(U+".range[1]",Math.pow(10,W)))}else o(U+".autorange",!0)}if("reverse"===B)Y.range?Y.range.reverse():(o(U+".autorange",!0),Y.range=[1,0]),X.autorange?w=!0:_=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var J=D.parts[1],K=D.parts[0],tt=g[K]||[],et=P[N.titleCase(K)],nt=tt[J]||{};2===D.parts.length&&("add"===v[E]||N.isPlainObject(v[E])?z[E]="remove":"remove"===v[E]?-1===J?(z[K]=tt,delete z[E]):z[E]=nt:N.log("???",v)),!i(nt,"x")&&!i(nt,"y")||N.containsAny(E,["color","opacity","align","dash"])||(w=!0),et.draw(t,J,D.parts.slice(2).join("."),v[E]),delete v[E]}else if("images"===D.parts[0]){var at=N.objectFromPath(E,j);N.extendDeepAll(t.layout,at),H.supplyLayoutDefaults(t.layout,t._fullLayout),H.draw(t)}else if("mapbox"===D.parts[0]&&"layers"===D.parts[1]){N.extendDeepAll(t.layout,N.objectFromPath(E,j));var ot=(t._fullLayout.mapbox||{}).layers||[];for(O=D.parts[2]+1-ot.length,p=0;O>p;p++)ot.push({});_=!0}else if("updatemenus"===D.parts[0]){N.extendDeepAll(t.layout,N.objectFromPath(E,j));var it=t._fullLayout.updatemenus||[];for(O=D.parts[2]+1-it.length,p=0;O>p;p++)it.push({});_=!0}else 0===D.parts[0].indexOf("scene")?_=!0:0===D.parts[0].indexOf("geo")?_=!0:0===D.parts[0].indexOf("ternary")?_=!0:!m._has("gl2d")||-1===E.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===E?w=!0:-1!==D.parts[0].indexOf("legend")?y=!0:-1!==E.indexOf("title")?x=!0:-1!==D.parts[0].indexOf("bgcolor")?b=!0:D.parts.length>1&&N.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?x=!0:-1!==E.indexOf(".linewidth")&&-1!==E.indexOf("axis")?x=b=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?b=!0:D.parts.length>1&&"mirror"===D.parts[1]?x=b=!0:"margin.pad"===E?x=b=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||E.match(/^(bar|box|font)/)?w=!0:-1!==["hovermode","dragmode"].indexOf(E)?M=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(E)&&(_=!0):_=!0,D.set(j)}I.add(t,rt,[t,z],rt,[t,T]),v.autosize&&(v=k(t,v)),(v.height||v.width||v.autosize)&&(w=!0);var lt=Object.keys(v),st=[R.previousPromises];if(_||w)st.push(function(){return t.layout=void 0,w&&(t.calcdata=void 0),P.plot(t,"",g)});else if(lt.length&&(R.supplyDefaults(t),m=t._fullLayout,y&&st.push(function(){return V.draw(t),R.previousPromises(t)}),b&&st.push(L),x&&st.push(function(){return P.Axes.doTicks(t,"redraw"),S(t),R.previousPromises(t)}),M)){var ct;for($(t),P.Fx.supplyLayoutDefaults(t.layout,m,t._fullData),P.Fx.init(t),ct=R.getSubplotIds(m,"gl3d"),p=0;p1)};c(n.width)&&c(n.height)||l(new Error("Height and width should be pixel values."));var u=r.clone(e,{format:"png",height:n.height,width:n.width}),f=u.td;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=r.getRedrawFunc(f);o.plot(f,u.data,u.layout,u.config).then(d).then(s).then(function(e){t(e)}).catch(function(t){l(t)})});return l}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib");e.exports=r},{"../lib":103,"../plotly":121,"../snapshot":161,"fast-isnumeric":17}],120:[function(t,e,n){"use strict";function r(t,e,n,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,m=n.length,v=0;m>v;v++){var y=n[v],x=["data",v];if(p(y)){var b=u[v],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&s.push(i("invisible",x)),r(y,b,w,s,x);var k=y.transforms,M=b.transforms;if(k){g(k)||s.push(i("array",x,["transforms"])),x.push("transforms");for(var A=0;Ac&&u>e&&(void 0===a[n]?o[f]=T.tickText(t,e):o[f]=l(t,e,String(a[n])),f++);return f=864e5?t._tickround="d":n>=36e5?t._tickround="H":n>=6e4?t._tickround="M":n>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(n/2)/Math.LN10);else{x(n)||(n=Number(n.substr(1))),t._tickround=2-Math.floor(Math.log(n)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var r=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(r)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((r-1)/3):t._tickexponent=r)}else"M"===n.charAt(0)?t._tickround=2===n.length?"m":"y":t._tickround=null}function i(t,e){var n=t.match(B),r=new Date(e);if(n){var a=Math.min(+n[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,a).replace(/0+$/,"")||"0";return y.time.format(t.replace(B,o))(r)}return y.time.format(t)(r)}function l(t,e,n){var r=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function s(t,e,n,r){var a,o=e.x,l=t._tickround,s=new Date(o),c="";n&&t.hoverformat?a=i(t.hoverformat,o):t.tickformat?a=i(t.tickformat,o):(r&&(x(l)?l+=2:l={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[l]),"y"===l?a=D(s):"m"===l?a=I(s):(o!==t._tmin||n||(c="
"+D(s)),"d"===l?a=R(s):"H"===l?a=j(s):(o!==t._tmin||n||(c="
"+R(s)+", "+D(s)),a=F(s),"M"!==l&&(a+=q(s),"S"!==l&&(a+=d(v(o/1e3,1),t,"none",n).substr(1)))))),e.text=a+c}function c(t,e,n,r,a){var o=t.dtick,i=e.x;if(!r||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=d(Math.pow(10,i),t,a,r);else if(x(o)||"D"===o.charAt(0)&&v(i+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var l=Math.round(i);0===l?e.text=1:1===l?e.text="10":l>1?e.text="10"+l+"":e.text="10\u2212"+-l+"",e.fontSize*=1.25}else e.text=d(Math.pow(10,i),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,v(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(0>i?.5:.25)))}}function u(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function f(t,e,n,r,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=d(e.x,t,a,r)}function d(t,e,n,r){var a=0>t,i=e._tickround,l=n||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat;if(r){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};o(u),i=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-i)/2;if("none"===l&&(s=0),t=Math.abs(t),f>t)t="0",a=!1;else{if(t+=f,s&&(t*=Math.pow(10,-s),i+=s),0===i)t=String(Math.floor(t));else if(0>i){t=String(Math.round(t)),t=t.substr(0,t.length+i);for(var d=i;0>d;d++)t+="0"}else{t=String(t);var h=t.indexOf(".")+1;h&&(t=t.substr(0,h+i).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(s&&"hide"!==l){var p;p=0>s?"\u2212"+-s:"power"!==l?"+"+s:String(s),"e"===l||("SI"===l||"B"===l)&&(s>12||-15>s)?t+="e"+p:"E"===l?t+="E"+p:"power"===l?t+="\xd710"+p+"":"B"===l&&9===s?t+="B":"SI"!==l&&"B"!==l||(t+=H[s/3+5])}return a?"\u2212"+t:t}function h(t,e){var n,r,a=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.getAutoRange=function(t){var e,n=[],r=t._min[0].val,a=t._max[0].val;for(e=1;e0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(r===a){var p=r-1,g=r+1;n="tozero"===t.rangemode?0>r?[p,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,p),Math.max(0,g)]:[p,g]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),n=[s.val-d*s.pad,c.val+d*c.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),h&&n.reverse(),n},T.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=T.getAutoRange(t);var n=t._gd.layout[t._name];n||(t._gd.layout[t._name]=n={}),n!==t&&(n.range=t.range.slice(),n.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var n=T.list(t,"",!0),r=!1,a=0;ap&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),r(c)){for(h=!0,i=0;i=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(r(u)){for(h=!0,i=0;i=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,m=e.length,v=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type),b=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),_=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),w=r(n.vpadplus||n.vpad),k=r(n.vpadminus||n.vpad);for(o=0;6>o;o++)a(o);for(o=m-1;o>5;o--)a(o)}},T.autoBin=function(t,e,n,r){function a(t){return(1+100*(t-h)/f.dtick)%100<2}var o=_.aggNums(Math.min,null,t),i=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:i+.5,size:1};var l;if(n)l=(i-o)/n;else{var s=_.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(s.minDiff)/Math.LN10)),u=c*_.roundUp(s.minDiff/c,[.9,1.9,4.9,9.9],!0);l=Math.max(u,2*_.stdev(t)/Math.pow(t.length,r?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[o,i]};T.autoTicks(f,l);var d,h=T.tickIncrement(T.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,m=0,v=0,y=0;yg&&(p>.3*b||a(o)||a(i))){var w=f.dtick/2;h+=o>h+w?w:-w}var k=1+Math.floor((i-h)/f.dtick);d=h+k*f.dtick}else for(d=h;i>=d;)d=T.tickIncrement(d,f.dtick);return{start:h,end:d,size:f.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return r(t);if("auto"===t.tickmode||!t.dtick){var e,n=t.nticks;n||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/e):(e="y"===t._id.charAt(0)?40:80,n=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),o(t),t._tmin=T.tickFirst(t);var a=t.range[1]=l:l>=s)&&(i.push(s),!(i.length>1e3));s=T.tickIncrement(s,t.dtick,a));t._tmax=i[i.length-1];for(var c=new Array(i.length),u=0;u157788e5?(e/=315576e5,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*a(e,n,S)):e>12096e5?(e/=26298e5,t.dtick="M"+a(e,1,C)):e>432e5?(t.dtick=a(e,864e5,O),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=a(e,36e5,C):e>3e4?t.dtick=a(e,6e4,E):e>500?t.dtick=a(e,1e3,E):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,n,S));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var r=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/r,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+a(e,n,S)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,n,S));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},T.tickIncrement=function(t,e,n){var r=n?-1:1;if(x(e))return t+r*e;var a=e.charAt(0),o=r*Number(e.substr(1));if("M"===a){var i=new Date(t);return i.setMonth(i.getMonth()+o)}if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var l="D2"===e?N:P,s=t+.01*r,c=_.roundUp(v(s,1),l,n);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]r:r>c;)c=T.tickIncrement(c,a,e);return c}if("L"===u)return Math.log(n((Math.pow(10,r)-o)/f)*f+o)/Math.LN10;if("D"===u){var d="D2"===a?N:P,h=_.roundUp(v(r,1),d,e);return Math.floor(r)+Math.log(y.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(a)};var D=y.time.format("%Y"),I=y.time.format("%b %Y"),R=y.time.format("%b %-d"),j=y.time.format("%b %-d %Hh"),F=y.time.format("%H:%M"),q=y.time.format(":%S"),B=/%(\d?)f/g;T.tickText=function(t,e,n){function r(r){var a;return void 0===r?!0:n?"none"===r:(a={first:t._tmin,last:t._tmax}[r],"all"!==r&&e!==a)}var a,o,i=l(t,e),d="array"===t.tickmode,h=n||d;if(d&&Array.isArray(t.ticktext)){var p=Math.abs(t.range[1]-t.range[0])/1e4;for(o=0;o1&&en&&(E=90),a(d,E)}c._lastangle=E}return s(),i(e),e+" done"}function s(){var e=.25,n=200,r=("x"===m?t._fullLayout.height:t._fullLayout.width)*e;r=Math.min(r,n),d.each(function(t){var e=y.select(this),n=A.bBox(e.node()),a="x"===m?n.height:n.width;if(a>r){var o=t.text,i=Math.round(r/(a/o.length)),l=Math.floor(i/2),s=i-l-1;o=o.substr(0,l)+"\u2026"+o.substr(-s);var c=e.select("text");c.text(o),e.insert("title","text").text(t.text)}})}function u(){var e,n,r=c._boundingBox,a=0,o=0;if("x"===c._id.charAt(0)?(e="height","2"===c._id.charAt(1)?(o=1,n="t"):n="b"):"y"===c._id.charAt(0)&&(e="width","2"===c._id.charAt(1)?(a=1,n="r"):n="l"),e&&n){var i=r[e];if(c._titleElement){var l=c._titleElement.node().getBoundingClientRect();i+=l[e]+2}var s=.5*t._fullLayout[e];i=Math.min(i,s);var u={x:a,y:o,l:0,r:0,b:0,t:0};u[n]=i,b.Plots.autoMargin(t,c._name,u)}}function f(){c._boundingBox=n.node().getBoundingClientRect()}n.style("pointer-events","all");var d=n.selectAll("g."+C).data(z,S);if(!c.showticklabels||!x(r))return d.remove(),void i(e);var p,v,k,M,T;"x"===m?(T="bottom"===q?1:-1,p=function(t){return t.dx+D*T},M=r+(N+P)*T,v=function(t){return t.dy+M+t.fontSize*("bottom"===q?1:-.5)},k=function(t){return x(t)&&0!==t&&180!==t?0>t*T?"end":"start":"middle"}):(T="right"===q?1:-1,v=function(t){return t.dy+t.fontSize/2-D*T},p=function(t){return t.dx+r+(N+P+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*T},k=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var L=0,E=0,O=[],I=d.enter().append("g").classed(C,1);I.append("text").attr("text-anchor","middle").each(function(e){var n=y.select(this),r=t._promises.length;n.call(A.setPosition,p(e),v(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),r=t._promises[r],r?O.push(t._promises.pop().then(function(){a(n,c.tickangle)})):a(n,c.tickangle)}),d.exit().remove(),d.each(function(t){L=Math.max(L,t.fontSize)}),a(d,c._lastangle||c.tickangle);var R=_.syncOrAsync([o,l,f,u]);return R&&R.then&&t._promises.push(R),R}function i(e){if(!n){var r,a,o,i,l=L.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=1.5,p=l.titlefont.size;if(s.size()){var g=y.select(s.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(c.offsetLeft=+g[1],c.offsetTop=+g[2])}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:L.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-p*(h+(l.showticklabels?1:0)):a._length+10+p*(h+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:L.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+p*(h+(l.showticklabels?1:.5)):-10-p*(h+(l.showticklabels?.5:0))),r={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:r,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:b.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[m]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===m}function s(e,n,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:H,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+n._length,f=o.selectAll("path."+E).data(c.showgrid===!1?[]:s,S);if(f.enter().append("path").classed(E,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)g;g++){var y=c.mirrors[i._id+d[g]];"ticks"!==y&&"labels"!==y||(f[g]=!0)}return void 0!==r[2]&&(f[2]=!0),f.forEach(function(t,e){var n=r[e],a=B[e];t&&x(n)&&(h+=p(n+P*a,a*c.ticklen))}),a(n,h),s(e,i,t),o(n,r[3])}}).filter(function(t){return t&&t.then});return Z.length?Promise.all(Z):0},T.swap=function(t,e){for(var n=h(t,e),r=0;r2*r}function u(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,a=0,o=0;o2*r}var f=t("fast-isnumeric"),d=t("tinycolor2").mix,h=t("../../lib"),p=t("../plots"),g=t("../../components/color/attributes").lightFraction,m=t("./layout_attributes"),v=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),x=t("./tick_label_defaults"),b=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),k=t("./clean_datum"),M=t("./axis_ids");e.exports=function(t,e,n,a){function o(n,r){return h.coerce2(t,e,m,n,r)}var i=a.letter,l=a.font||{},s="Click to enter "+(a.title||i.toUpperCase()+" axis")+" title";a.name&&(e._name=a.name,e._id=M.name2id(a.name));var c=n("type");"-"===c&&(r(e,a.data),"-"===e.type?e.type="linear":c=t.type=e.type),_(e);var u=n("color"),p=u===t.color?u:l.color;n("title",s),h.coerceFont(n,"titlefont",{family:l.family,size:Math.round(1.2*l.size),color:p});var k=2===(t.range||[]).length&&f(t.range[0])&&f(t.range[1]),A=n("autorange",!k);A&&n("rangemode");var T=n("range",[-1,"x"===i?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),h.noneOrAll(t.range,e.range,[0,1]),n("fixedrange"),v(t,e,n,c),x(t,e,n,c,a),y(t,e,n,a),b(t,e,n);var L=o("linecolor",u),z=o("linewidth"),S=n("showline",!!L||!!z);S||(delete e.linecolor,delete e.linewidth),(S||e.ticks)&&n("mirror");var C=o("gridcolor",d(u,a.bgColor,g).toRgbString()),E=o("gridwidth"),O=n("showgrid",a.showGrid||!!C||!!E);O||(delete e.gridcolor,delete e.gridwidth);var P=o("zerolinecolor",u),N=o("zerolinewidth"),D=n("zeroline",a.showGrid||!!P||!!N);return D||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===c?w(i,e.categoryorder,e.categoryarray,a.data):[],e}},{"../../components/color/attributes":24,"../../lib":103,"../plots":144,"./axis_ids":126,"./category_order_defaults":127,"./clean_datum":128,"./layout_attributes":133,"./ordered_categories":135,"./set_convert":138,"./tick_label_defaults":139,"./tick_mark_defaults":140,"./tick_value_defaults":141,"fast-isnumeric":17,tinycolor2:20}],126:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],128:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return a.ms2DateTime(t);if("string"!=typeof t&&!r(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){a.error(e,t)}return t}},{"../../lib":103,"fast-isnumeric":17}],129:[function(t,e,n){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],130:[function(t,e,n){"use strict";function r(t,e){var n,r=t.range[e],a=Math.abs(r-t.range[1-e]);return"date"===t.type?u.ms2DateTime(r,a):"log"===t.type?(n=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,l.format("."+n+"g")(Math.pow(10,r))):(n=Math.floor(Math.log(Math.abs(r))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,l.format("."+String(n)+"g")(r))}function a(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function o(t){l.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function i(t){var e=["lasso","select"];return-1!==e.indexOf(t)}var l=t("d3"),s=t("tinycolor2"),c=t("../../plotly"),u=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/setcursor"),g=t("../../components/dragelement"),m=t("./axes"),v=t("./select"),y=t("./constants"),x=!0;e.exports=function(t,e,n,l,b,_,w,k){function M(t,e){for(var n=0;n.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+pt+", "+gt+")").attr("d",st+"Z"),dt=ht.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+pt+", "+gt+")").attr("d","M0,0Z"),L();for(var o=0;oa?(ut="",it.r=it.l,it.t=it.b,dt.attr("d","M0,0Z")):(it.t=0,it.b=V,ut="x",dt.attr("d","M"+(it.l-.5)+","+(ot-U-.5)+"h-3v"+(2*U+1)+"h3ZM"+(it.r+.5)+","+(ot-U-.5)+"h3v"+(2*U+1)+"h-3Z")):!W||a.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),dt.transition().style("opacity",1).duration(200),ct=!0)}function S(t,e,n){var r,a,o,i=[];for(r=0;rzoom back out","long"),x=!1),l.pre=!1,t.emit("plotly_zoom",l))}function E(e,n){var a=1===(w+k).length;if(e)I();else if(2!==n||a){if(1===n&&a){var o=w?B[0]:q[0],i="s"===w||"w"===k?0:1,l=o._name+".range["+i+"]",s=r(o,i),u="left",d="middle";if(o.fixedrange)return;w?(d="n"===w?"top":"bottom","right"===o.side&&(u="right")):"e"===k&&(u="right"),et.call(f.makeEditable,null,{immediate:!0,background:j.paper_bgcolor,text:String(s),fill:o.tickfont?o.tickfont.color:"#444",horizontalAlign:u,verticalAlign:d}).on("edit",function(e){var n="category"===o.type?o.c2l(e):o.d2l(e);void 0!==n&&c.relayout(t,l,n)})}}else D()}function O(e){function n(t,e,n){if(!t.fixedrange){A(t.range);var r=t.range,a=r[0]+(r[1]-r[0])*e;t.range=[a+(r[0]-a)*n,a+(r[1]-a)*n]}}if(t._context.scrollZoom||j._enablescrollzoom){var r=t.querySelector(".plotly");if(!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(vt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void u.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=xt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=mt[0]+mt[2]*s,f=(l.bottom-e.clientY)/l.height,d=mt[1]+mt[3]*(1-f);if(k){for(o=0;o=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function a(t,e,n){for(var a=1-e,o=0,i=0;i0;r--)n.push(e);return n}function a(t,e){for(var n=[],r=0;rT;T++){var L=o[T],z=h[L];if(z)M[T]=w.getFromId(t,z.xaxis._id),A[T]=w.getFromId(t,z.yaxis._id);else{var S=i[L]._subplot;M[T]=S.xaxis,A[T]=S.yaxis}}var C=e.hovermode||i.hovermode;if(-1===["x","y","closest"].indexOf(C)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var E,O,P,N,D,I,R,j,F,q,B,H,V=[],Z=[];if(Array.isArray(e))for(C="array",P=0;PU||U>X.width||0>Y||Y>X.height)return _.unhoverRaw(t,e)}else U="xpx"in e?e.xpx:M[0]._length/2,Y="ypx"in e?e.ypx:A[0]._length/2;if(E="xval"in e?r(o,e.xval):a(M,U),O="yval"in e?r(o,e.yval):a(A,Y),!g(E[0])||!g(O[0]))return m.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var G=1/0;for(N=0;N1||-1!==I.hoverinfo.indexOf("name")?I.name:void 0,index:!1,distance:Math.min(G,k.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},H=V.length,"array"===j){var $=e[N];"pointNumber"in $?(B.index=$.pointNumber,j="closest"):(j="","xval"in $&&(F=$.xval,j="x"),"yval"in $&&(q=$.yval,j=j?"closest":"y"))}else F=E[R],q=O[R];if(I._module&&I._module.hoverPoints){var Q=I._module.hoverPoints(B,F,q,j);if(Q)for(var W,J=0;JH&&(V.splice(0,H),G=V[0].distance)}if(0===V.length)return _.unhoverRaw(t,e);var K="y"===C&&Z.length>1;V.sort(function(t,e){return t.distance-e.distance});var tt=x.combine(i.plot_bgcolor||x.background,i.paper_bgcolor),et={hovermode:C,rotateLabels:K,bgColor:tt,container:i._hoverlayer,outerContainer:i._paperdiv},nt=c(V,et);u(V,K?"xa":"ya"),f(nt,K);var rt=t._hoverdata,at=[];for(P=0;P128?"#000":x.background;if(t.name&&void 0===t.zLabelVal){var u=document.createElement("p");u.innerHTML=t.name,n=u.textContent||"",n.length>15&&(n=n.substr(0,12)+"...")}void 0!==t.extraText&&(r+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(r+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(r+="y: "+t.yLabel+"
"),r+=(r?"z: ":"")+t.zLabel):A&&t[a+"Label"]===g?r=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(r=t.yLabel):r=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(r+=(r?"
":"")+t.text),""===r&&(""===n&&e.remove(),r=n);var f=e.select("text.nums").style("fill",c).call(b.setPosition,0,0).text(r).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(b.setPosition,0,0);var d=e.select("text.name"),m=0;n&&n!==r?(d.style("fill",s).text(n).call(b.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),d.selectAll("tspan.line").call(b.setPosition,0,0),m=d.node().getBoundingClientRect().width+2*O):(d.remove(),e.select("rect").remove()),e.select("path").style({fill:s,stroke:c});var v,k,L=f.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),N=L.width+E+O+m; -t.ty0=_-L.top,t.bx=L.width+2*O,t.by=L.height+2*O,t.anchor="start",t.txwidth=L.width,t.tx2width=m,t.offset=0,o?(t.pos=z,v=M>=S+P/2+N,k=S-P/2-N>=0,"top"!==t.idealAlign&&v||!k?v?(S+=P/2,t.anchor="start"):t.anchor="middle":(S-=P/2,t.anchor="end")):(t.pos=S,v=w>=z+C/2+N,k=z-C/2-N>=0,"left"!==t.idealAlign&&v||!k?v?(z+=C/2,t.anchor="start"):t.anchor="middle":(z-=C/2,t.anchor="end")),f.attr("text-anchor",t.anchor),m&&d.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+S+")"+(o?"rotate("+T+")":""))}),S}function u(t,e){function n(t){var e=t[0],n=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=n.pos+n.dp+n.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;r=!1}if(!(.01>o)){if(-.01>a){for(l=t.length-1;l>=0;l--)t[l].dp-=o;r=!1}if(r){var c=0;for(i=0;ie.pmax&&c++;for(i=t.length-1;i>=0&&!(0>=c);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=c);i++)if(s=t[i],s.pos=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(0>=c);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var r,a,o,i,l,s,c,u=0,f=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?z:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;r=!1}else i++}f.forEach(n)}for(i=f.length-1;i>=0;i--){var m=f[i];for(l=m.length-1;l>=0;l--){var v=m[l],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function f(t,e){t.each(function(t){var n=h.select(this);if(t.del)return void n.remove();var r="end"===t.anchor?-1:1,a=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(E+O),l=i+o*(t.txwidth+O),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*S),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*E+s)+","+(E+c)+"v"+(t.by/2-E)+"h"+r*t.bx+"v-"+t.by+"H"+(r*E+s)+"V"+(c-E)+"Z"),a.call(b.setPosition,i+s,c+t.ty0-t.by/2+O).selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")}),t.tx2width&&(n.select("text.name, text.name tspan.line").call(b.setPosition,l+o*O+s,c+t.ty0-t.by/2+O),n.select("rect").call(b.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function d(t,e,n){if(!e.target)return!1;if(!n||n.length!==t._hoverdata.length)return!0;for(var r=n.length-1;r>=0;r--){var a=n[r],o=t._hoverdata[r];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var h=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),m=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),b=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),k=t("./constants"),M=t("./dragbox"),A=e.exports={};A.unhover=_.unhover,A.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},A.supplyLayoutDefaults=function(t,e,n){function r(n,r){return m.coerce(t,e,A.layoutAttributes,n,r)}r("dragmode");var a;if(e._has("cartesian")){var o=e._isHoriz=A.isHoriz(n);a=o?"y":"x"}else a="closest";r("hovermode",a)},A.isHoriz=function(t){for(var e=!0,n=0;nt._lastHoverTime+k.HOVERMINTIME?(i(t,e,n),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){i(t,e,n),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},A.getDistanceFunction=function(t,e,n,r){return"closest"===t?r||o(e,n):"x"===t?e:n},A.getClosest=function(t,e,n){if(n.index!==!1)n.index>=0&&n.indext*e||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":48,"../../lib":103,"../../lib/events":100,"../../lib/svg_text_utils":114,"./axes":124,"./constants":129,"./dragbox":130,d3:14,"fast-isnumeric":17,tinycolor2:20}],132:[function(t,e,n){"use strict";var r=t("../plots"),a=t("./constants");n.name="cartesian",n.attr=["xaxis","yaxis"],n.idRoot=["x","y"],n.idRegex=a.idRegex,n.attrRegex=a.attrRegex,n.attributes=t("./attributes"),n.plot=function(t){function e(t,e){for(var n=[],r=0;rf[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":103,"fast-isnumeric":17}],137:[function(t,e,n){"use strict";function r(t){return t._id}var a=t("../../lib/polygon"),o=t("../../components/color"),i=t("./axes"),l=t("./constants"),s=a.filter,c=a.tester,u=l.MINSELECT;e.exports=function(t,e,n,a,f){function d(t){var e="y"===t._id.charAt(0)?1:0;return function(n){return t.p2d(n[e])}}function h(t,e){return t-e}var p,g=a.gd._fullLayout._zoomlayer,m=a.element.getBoundingClientRect(),v=a.plotinfo.x()._offset,y=a.plotinfo.y()._offset,x=e-m.left,b=n-m.top,_=x,w=b,k="M"+x+","+b,M=a.xaxes[0]._length,A=a.yaxes[0]._length,T=a.xaxes.map(r),L=a.yaxes.map(r),z=a.xaxes.concat(a.yaxes);"lasso"===f&&(p=s([[x,b]],l.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",k+"Z");var C,E,O,P,N,D=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),I=[],R=a.gd,j=[];for(C=0;C0)return Math.log(e)/Math.LN10;if(0>=e&&n&&t.range&&2===t.range.length){var r=t.range[0],a=t.range[1];return.5*(r+a-3*u*Math.abs(r-a))}return i.BADNUM}function n(t){return Math.pow(10,t)}function c(t){return a(t)?Number(t):i.BADNUM}var u=10;if(t.c2l="log"===t.type?e:c,t.l2c="log"===t.type?n:c,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,n=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var r=s.getFromId(t._gd,t.overlaying);t.domain=r.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)a(t.range[e])||(t.range[e]=a(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return a(e)?r.round(t._b+t._m*e,2):i.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,n){return t.l2p(t.c2l(e,n))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=c,t.d2c=function(t){return t=l(t),a(t)?Number(t):i.BADNUM},t.d2l=function(e,n){return"log"===t.type?t.c2l(t.d2c(e),n):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return a(t)?o.ms2DateTime(t):i.BADNUM},t.d2c=function(t){return a(t)?Number(t):o.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var f=t.range.map(o.dateTime2ms);!a(t.range[0])&&a(f[0])&&(t.range[0]=f[0]),!a(t.range[1])&&a(f[1])&&(t.range[1]=f[1])}catch(d){o.error(d,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var n=t._categories.indexOf(e);return-1===n?i.BADNUM:n},t.d2l=t.d2c);t.makeCalcdata=function(e,n){var r,a,o;if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var i=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),c=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&a(t,i),l.text(i.text()&&c.text()?" - ":"")},h.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=s.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),a=r.append("input").attr({type:"text",name:"data"});return a.node().value=h.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},h.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},a=t.layout||{},i=t._fullData||[],l=t._fullData=[],s=t.data||[];h.supplyLayoutGlobalDefaults(a,r),r._dataLength=s.length,h.supplyDataDefaults(s,l,r),r._has=h._hasPlotType.bind(r);var c=r._modules;for(e=0;eo&&(e=(n-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),0>i&&(e=(r-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},h.autoMargin=function(t,e,n){var r=t._fullLayout;if(r._pushmargin||(r._pushmargin={}),r.margin.autoexpand!==!1){if(n){var a=void 0===n.pad?12:n.pad;n.l+n.r>.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+a},r:{val:n.x,size:n.r+a},b:{val:n.y,size:n.b+a},t:{val:n.y,size:n.t+a}}}else delete r._pushmargin[e];t._replotting||h.doAutoMargin(t)}},h.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;return e.margin.autoexpand!==!1&&(s.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}},Object.keys(s).forEach(function(t){var n=s[t].l||{},r=s[t].b||{},u=n.val,f=n.size,d=r.val,h=r.size;Object.keys(s).forEach(function(t){if(c(f)&&s[t].r){var n=s[t].r.val,r=s[t].r.size;if(n>u){var p=(f*n+(r-e.width)*u)/(n-u),g=(r*(1-u)+(f-e.width)*(1-n))/(n-u);p>=0&&g>=0&&p+g>a+o&&(a=p,o=g)}}if(c(h)&&s[t].t){var m=s[t].t.val,v=s[t].t.size;if(m>d){var y=(h*m+(v-e.height)*d)/(m-d),x=(v*(1-d)+(h-e.height)*(1-m))/(m-d);y>=0&&x>=0&&y+x>l+i&&(l=y,i=x)}}})})),n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(i),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,t._replotting||"{}"===r||r===JSON.stringify(e._size)?void 0:u.plot(t)},h.graphJson=function(t,e,n,r,a){function o(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,r,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0&&!f.isPlainObject(t.stream))continue}else if("keepall"!==n&&(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0))continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):t&&t.getTime?f.ms2DateTime(t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&h.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s={data:(i||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(s.layout=o(l)),t.framework&&t.framework.isPolar&&(s=t.framework.getConfig()),"object"===r?s:JSON.stringify(s)}},{"../components/color":25,"../lib":103,"../plotly":121,"./attributes":122,"./font_attributes":142,"./layout_attributes":143,d3:14,"fast-isnumeric":17}],145:[function(t,e,n){"use strict";var r=t("../../traces/scatter/attributes"),a=r.marker;e.exports={r:r.r,t:r.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity}}},{"../../traces/scatter/attributes":237}],146:[function(t,e,n){"use strict";function r(t,e){var n={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return o({},e,n)}var a=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,i=o({},a.domain,{});e.exports={radialaxis:r("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:i,orientation:{valType:"number"}}),angularaxis:r("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:i}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":101,"../cartesian/layout_attributes":133}],147:[function(t,e,n){var r=t("../../plotly"),a=t("d3"),o=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},i=r.Lib.extendDeepAll;o.Axis=function(){function t(t){n=t||n;var c=s.data,f=s.layout;return("string"==typeof n||n.nodeName)&&(n=a.select(n)),n.datum(c).each(function(t,n){function s(t,e){return l(t)%360+f.orientation}var c=t.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(f)};var d=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[d],d=(d+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:a.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var h=c.filter(function(t,e){var n=t.visible;return"undefined"==typeof n||n===!0}),p=!1,g=h.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var m=a.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),v=[],y=m.map(function(t,e){if("unstacked"===t.key)return t.values;var n=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,r){t.yStack=[n],v.push(n),n=o.util.sumArrays(t.r,n)}),t.values});h=a.merge(y)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;x=Math.max(10,x);var b,_=[f.margin.left+x,f.margin.top+x];if(p){var w=a.max(o.util.sumArrays(o.util.arrayLast(h).r[0],o.util.arrayLast(v)));b=[0,w]}else b=a.extent(o.util.flattenArray(h.map(function(t,e){return t.r})));f.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=a.scale.linear().domain(f.radialAxis.domain!=o.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var k,M=o.util.flattenArray(h.map(function(t,e){return t.t})),A="string"==typeof M[0];A&&(M=o.util.deduplicate(M),k=M.slice(),M=a.range(M.length),h=h.map(function(t,e){var n=t;return t.t=[M],p&&(n.yStack=t.yStack),n}));var T=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,L=null===f.needsEndSpacing?A||!T:f.needsEndSpacing,z=f.angularAxis.domain&&f.angularAxis.domain!=o.DATAEXTENT&&!A&&f.angularAxis.domain[0]>=0,S=z?f.angularAxis.domain:a.extent(M),C=Math.abs(M[1]-M[0]);T&&!A&&(C=0);var E=S.slice();L&&A&&(E[1]+=C);var O=f.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),f.angularAxis.ticksStep&&(O=(E[1]-E[0])/O);var P=f.angularAxis.ticksStep||(E[1]-E[0])/(O*(f.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),E[2]||(E[2]=P);var N=a.range.apply(this,E);if(N=N.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=a.scale.linear().domain(E.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=L?C:0,e=a.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var D="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",I=(new DOMParser).parseFromString(D,"application/xml"),R=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=a.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var j,F=e.select(".chart-group"),q={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){j=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var H=h.map(function(t,e){var n=o.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});o.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:j,elements:H,reverseOrder:f.legend.reverseOrder})})();var V=j.node().getBBox();x=Math.min(f.width-V.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),j.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else j=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var Z=[(f.width-(f.margin.left+f.margin.right+2*x+(V?V.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(Z[0]=Math.max(0,Z[0]),Z[1]=Math.max(0,Z[1]),e.select(".outer-group").attr("transform","translate("+Z+")"),f.title){var U=e.select("g.title-group text").style(B).text(f.title),Y=U.node().getBBox();U.attr({x:_[0]-Y.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=X.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({"class":"grid-circle"}).style(q),G.attr("r",r),G.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(q);var $=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Q=a.svg.axis().scale(r).ticks(5).tickSize(5);X.call(Q).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(q),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(N),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+s(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(q),J.selectAll(".minor").style({stroke:f.minorTickColor}),W.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var K=W.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var n=s(t,e),r=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?270>n&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(180>=n&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":k?k[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(B);f.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=a.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));j.attr({transform:"translate("+[x+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,nt=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(nt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),nt.exit().remove(),h[0]||et){var rt=[];h.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=nt.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,rt.push({data:t,geometryConfig:n})});var at=a.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(rt),ot=[];at.forEach(function(t,e){"unstacked"===t.key?ot=ot.concat(t.values.map(function(t,e){return[t]})):ot.push(t.values)}),ot.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return i(o[n].defaultConfig(),t)});o[n]().config(r)()})}var it,lt,st=e.select(".guides-group"),ct=e.select(".tooltips-group"),ut=o.tooltipPanel().config({container:ct,fontSize:8})(),ft=o.tooltipPanel().config({container:ct,fontSize:8})(),dt=o.tooltipPanel().config({container:ct,hasTick:!0})();if(!A){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var n=o.util.getMousePos($).angle;ht.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-f.orientation)%360;it=l.invert(r);var a=o.util.convertToCartesian(x+12,n+180);ut.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var pt=st.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos($).radius;pt.attr({r:n}).style({opacity:.5}),lt=r.invert(o.util.getMousePos($).radius);var a=o.util.convertToCartesian(n,f.radialAxis.orientation);ft.text(o.util.round(lt)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),dt.hide(),ut.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var r=a.select(this),i=r.style("fill"),l="black",s=r.style("opacity")||1;if(r.attr({"data-opacity":s}),"none"!=i){r.attr({"data-fill":i}),l=a.hsl(i).darker().toString(),r.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-Z[0]-d.left,f.top+f.height/2-Z[1]-d.top];dt.config({color:l}).text(u),dt.move(h)}else i=r.style("stroke"),r.attr({"data-stroke":i}),l=a.hsl(i).darker().toString(),r.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=a.event.which?!1:void(a.select(this).attr("data-fill")&&dt.show())}).on("mouseout.tooltip",function(t,e){dt.hide();var n=a.select(this),r=n.attr("data-fill");r?n.style({fill:r,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),d}var e,n,r,l,s={data:[],layout:{}},c={},u={},f=a.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),i(s.data[e],o.Axis.defaultConfig().data[0]),i(s.data[e],t)}),i(s.layout,o.Axis.defaultConfig().layout),i(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return e},a.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){var n={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:a.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return n},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},o.util._extend=function(t,e){for(var n in t)e[n]=t[n]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var n=e||6,r=a.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180,a=t(r);return[e,a]});return r},o.util.dataFromEquation=function(t,e,n){var r=e||6,o=[],i=[];a.range(0,360+r,r).forEach(function(e,n){var r=e*Math.PI/180,a=t(r);o.push(e),i.push(a)});var l={t:o,r:i};return n&&(l.name=n),l},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var n=[].concat(t);return a.range(e).map(function(t,e){return n[e]||n[0]})},o.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=o.util.ensureArray(t[e],n)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},o.util.sumArrays=function(t,e){return a.zip(t,e).map(function(t,e){return a.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var n=e*Math.PI/180,r=t*Math.cos(n),a=t*Math.sin(n);return[r,a]},o.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},o.util.getMousePos=function(t){var e=a.mouse(t.node()),n=e[0],r=e[1],o={};return o.x=n,o.y=r,o.pos=e,o.angle=180*(Math.atan2(r,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+r*r),o},o.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;o>a;a++)e=t[a],e in n?(n[e]++,r[e]=n[e]):n[e]=1;return r},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,n,r){if(r){var a=n.slice();n=e,e=a}var o=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof o&&(e.reduce(function(t,n,r){return"undefined"!=typeof t?(r===e.length-1&&delete t[n],t[n]):void 0},t),n.reduce(function(t,e,r){return"undefined"==typeof t[e]&&(t[e]={}),r===n.length-1&&(t[e]=o),t[e]},t))},o.PolyChart=function(){function t(){var t=n[0].geometryConfig,e=t.container;"string"==typeof e&&(e=a.select(e)),e.datum(n).each(function(e,n){function r(e,n){var r=t.radialScale(e[1]),a=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:r,t:a}}function o(t){var e=t.r*Math.cos(t.t),n=t.r*Math.sin(t.t);return{x:e,y:n}}var i=!!e[0].data.yStack,s=e.map(function(t,e){return i?a.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):a.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(n,r,o){var i=e[o].data,l=t.radialScale(n[1])-t.radialScale(0),s=t.radialScale(n[2]||0),u=i.barWidth;a.select(this).attr({"class":"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,n){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,n,i){var l=t[2]?[t[0],t[1]+t[2]]:t,s=a.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(t,n);a.select(this).attr({"class":"mark dot",d:s,transform:function(t,e){var n=o(r(l));return"translate("+[n.x,n.y]+")"}})};var d=a.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(n,r,o){var i=n[2]?s[o].map(function(t,e){return[t[0],t[1]+t[2]]}):s[o];if(a.select(this).each(f.dot).style({opacity:function(t,n){return+e[o].data.dotVisible},fill:m.stroke(n,r,o)}).attr({"class":"mark dot"}),!(r>0)){var l=a.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({"class":"line",d:d(i),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return m.fill(n,r,o)},"fill-opacity":0,stroke:function(t,e){return m.stroke(n,r,o)},"stroke-width":function(t,e){return m["stroke-width"](n,r,o)},"stroke-dasharray":function(t,e){return m["stroke-dasharray"](n,r,o)},opacity:function(t,e){return m.opacity(n,r,o)},display:function(t,e){return m.display(n,r,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=a.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,n,r){a.select(this).attr({"class":"mark arc",d:g,transform:function(e,n){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var m={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return l[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return"undefined"==typeof e[r].data.visible||e[r].data.visible?"block":"none"}},v=a.select(this).selectAll("g.layer").data(s);v.enter().append("g").attr({"class":"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(m).each(f[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,n=[o.PolyChart.defaultConfig()],r=a.dispatch("hover"),l={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){n[e]||(n[e]={}),i(n[e],o.PolyChart.defaultConfig()),i(n[e],t)}),this):n},t.getColorScale=function(){return e},a.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:a.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var n=e.legendConfig,r=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var a=i({},n.elements[e]);return a.name=t,a.color=[].concat(n.elements[e].color)[r],a})}),o=a.merge(r);o=o.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||"undefined"==typeof n.elements[e].visibleInLegend)}),n.reverseOrder&&(o=o.reverse());var l=n.container;("string"==typeof l||l.nodeName)&&(l=a.select(l));var s=o.map(function(t,e){return t.color}),c=n.fontSize,u=null==n.isContinuous?"number"==typeof o[0]:n.isContinuous,f=u?n.height:c*o.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=a.range(o.length),m=a.scale[u?"linear":"ordinal"]().domain(g).range(s),v=a.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=a.svg.symbolTypes.indexOf(t)?a.svg.symbol().type(t).size(n)():a.svg.symbol().type("square").size(n)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var n=t.symbol;return y(n,c)},fill:function(t,e){return m(e)}}),b.exit().remove()}var _=a.svg.axis().scale(v).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?n.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),n=a.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},a.rebind(t,n,"on"),t},o.Legend.defaultConfig=function(t,e){var n={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return n},o.tooltipPanel=function(){var t,e,n,r={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){t=r.container.selectAll("g."+l).data([0]);var a=t.enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return n=a.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=a.append("text").attr({dx:r.padding+s,dy:.3*+r.fontSize}),c};return c.text=function(o){var i=a.hsl(r.color).l,l=i>=.5?"#aaa":"white",u=i>=.5?"black":"white",f=o||"";e.style({fill:u,"font-size":r.fontSize+"px"}).text(f);var d=r.padding,h=e.node().getBBox(),p={fill:r.color,stroke:l,"stroke-width":"2px"},g=h.width+2*d+s,m=h.height+2*d;return n.attr({d:"M"+[[s,-m/2],[s,-m/4],[r.hasTick?0:s,0],[s,m/4],[s,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[s,-m/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c):void 0},c.hide=function(){return t?(t.style({display:"none"}),c):void 0},c.show=function(){return t?(t.style({display:"block"}),c):void 0},c.config=function(t){return i(r,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=i({},t),a=[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]];return a.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",r.dotVisible===!0?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var r=o.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var a=r.indexOf(t.geometry);-1!=a&&(n.data[e].groupId=a)})}if(t.layout){var l=i({},t.layout),s=[[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]];if(s.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var c=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],f={};a.entries(l.margin).forEach(function(t,e){f[u[c.indexOf(t.key)]]=t.value}),l.margin=f}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),n.layout=l}return n},t}},{"../../plotly":121,"./micropolar_manager":148,d3:14}],148:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("d3"),o=t("./undo_manager"),i=e.exports={},l=r.Lib.extendDeepAll; -i.framework=function(t){function e(e,o){return o&&(f=o),a.select(a.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?l(n,e):e,c||(c=r.micropolar.Axis()),u=r.micropolar.adapter.plotly().convert(n),c.config(u).render(f),t.data=n.data,t.layout=n.layout,i.fillLayout(t),n}var n,s,c,u,f,d=new o;return e.isPolar=!0,e.svg=function(){return c.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return r.micropolar.adapter.plotly().convert(c.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:c.angularScale(),r:c.radialScale()}},e.setUndoPoint=function(){var t=this,e=r.micropolar.util.cloneJson(n);!function(e,n){d.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,s),s=r.micropolar.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},i.fillLayout=function(t){var e=a.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),o=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:r.Color.background,_container:e,_paperdiv:n,_paper:o};t._fullLayout=l(i,t.layout)}},{"../../plotly":121,"./undo_manager":149,d3:14}],149:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,n=[],r=-1,a=!1;return{add:function(t){return a?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=n[r];return a?(t(a,"undo"),r-=1,e&&e(a.undo),this):this},redo:function(){var a=n[r+1];return a?(t(a,"redo"),r+=1,e&&e(a.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return rg;g++){var m=h[g];l=t[m]?t[m]:t[m]={},e[m]=s={},i("domain."+d,[g/p,(g+1)/p]),i("domain."+{x:"y",y:"x"}[d]),o.id=m,f(l,s,i,o)}}},{"../lib":103,"./plots":144}],151:[function(t,e,n){"use strict";var r=t("./ternary"),a=t("../../plots/plots");n.name="ternary",n.attr="subplot",n.idRoot="ternary",n.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,n.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,n.attributes=t("./layout/attributes"),n.layoutAttributes=t("./layout/layout_attributes"),n.supplyLayoutDefaults=t("./layout/defaults"),n.plot=function(t){for(var e=t._fullLayout,n=t._fullData,o=a.getSubplotIds(e,"ternary"),i=0;i=i&&(h.min=0,p.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var a=t("../../../components/color"),o=t("../../subplot_defaults"),i=t("./layout_attributes"),l=t("./axis_defaults"),s=["aaxis","baxis","caxis"];e.exports=function(t,e,n){o(t,e,n,{type:"ternary",attributes:i,handleDefaults:r,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":25,"../../subplot_defaults":150,"./axis_defaults":154,"./layout_attributes":156}],156:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a}},{"../../../components/color/attributes":24,"./axis_attributes":153}],157:[function(t,e,n){"use strict";function r(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function a(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),i=t("tinycolor2"),l=t("../../plotly"),s=t("../../lib"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,h=t("../cartesian/axes"),p=t("../../lib/filter_visible"),g=t("../../components/dragelement"),m=t("../../components/titles"),v=t("../cartesian/select"),y=t("../cartesian/constants"),x=t("../cartesian/graph_interact");e.exports=r;var b=r.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},b.plot=function(t,e){var n,r=this,a=e[r.id],o=e._size;s.getPlotDiv(r.plotContainer.node())!==r.graphDiv&&(r.init(r.graphDiv._fullLayout),r.makeFramework()),r.adjustLayout(a,o);var i=r.traceHash,l={};for(n=0;n_*y?(o=y,a=o*_):(a=v,o=a/_),i=g*a/v,l=m*o/y,n=e.l+e.w*h-a/2,r=e.t+e.h*(1-p)-o/2,s.x0=n,s.y0=r,s.w=a,s.h=o,s.sum=x,s.xaxis={type:"linear",range:[b+2*k-x,x-b-2*w],domain:[h-i/2,h+i/2],_id:"x",_gd:s.graphDiv},f(s.xaxis),s.xaxis.setScale(),s.yaxis={type:"linear",range:[b,x-w-k],domain:[p-l/2,p+l/2],_id:"y",_gd:s.graphDiv},f(s.yaxis),s.yaxis.setScale();var M=s.yaxis.domain[0],A=s.aaxis=d({},t.aaxis,{range:[b,x-w-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*_],_axislayer:s.layers.aaxis,_gridlayer:s.layers.agrid,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l"+o+",-"+a/2});f(A);var T=s.baxis=d({},t.baxis,{range:[x-b-k,w],side:"bottom",_counterangle:30,domain:s.xaxis.domain,_axislayer:s.layers.baxis,_gridlayer:s.layers.bgrid,_counteraxis:s.aaxis,_pos:0,_gd:s.graphDiv,_id:"x",_length:a,_gridpath:"M0,0l-"+a/2+",-"+o});f(T),A._counteraxis=T;var L=s.caxis=d({},t.caxis,{range:[x-b-w,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*_],_axislayer:s.layers.caxis,_gridlayer:s.layers.cgrid,_counteraxis:s.baxis,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l-"+o+","+a/2});f(L);var z="M"+n+","+(r+o)+"h"+a+"l-"+a/2+",-"+o+"Z";s.clipDef.select("path").attr("d",z),s.layers.plotbg.select("path").attr("d",z);var S="translate("+n+","+r+")";s.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",S);var C="translate("+n+","+(r+o)+")";s.layers.baxis.attr("transform",C),s.layers.bgrid.attr("transform",C);var E="translate("+(n+a/2)+","+r+")rotate(30)";s.layers.aaxis.attr("transform",E),s.layers.agrid.attr("transform",E);var O="translate("+(n+a/2)+","+r+")rotate(-30)";s.layers.caxis.attr("transform",O),s.layers.cgrid.attr("transform",O),s.drawAxes(!0),s.plotContainer.selectAll(".crisp").classed("crisp",!1);var P=s.layers.axlines;P.select(".aline").attr("d",A.showline?"M"+n+","+(r+o)+"l"+a/2+",-"+o:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),P.select(".bline").attr("d",T.showline?"M"+n+","+(r+o)+"h"+a:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),P.select(".cline").attr("d",L.showline?"M"+(n+a/2)+","+r+"l"+a/2+","+o:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px")},b.drawAxes=function(t){var e=this,n=e.graphDiv,r=e.id.substr(7)+"title",a=e.aaxis,o=e.baxis,i=e.caxis;if(h.doTicks(n,a,!0),h.doTicks(n,o,!0),h.doTicks(n,i,!0),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(i.showticklabels?.75*i.tickfont.size:0)+("outside"===i.ticks?.87*i.ticklen:0));m.draw(n,"a"+r,{propContainer:a,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-a.titlefont.size/3-l,"text-anchor":"middle"}});var s=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;m.draw(n,"b"+r,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-s,y:e.y0+e.h+.83*o.titlefont.size+s,"text-anchor":"middle"}}),m.draw(n,"c"+r,{propContainer:i,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+s,y:e.y0+e.h+.83*i.titlefont.size+s,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,k="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",M="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",L=!0;b.initInteractions=function(){function t(t,e,n){var r=R.getBoundingClientRect();b=e-r.left,w=n-r.top,z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},C=z,S=I.aaxis.range[1]-z.a,E=i(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),O="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",P=!1,N=F.append("path").attr("class","zoombox").style({fill:E>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",O),D=F.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}function e(t,e){return 1-e/I.h}function n(t,e){return 1-(t+(I.h-e)/Math.sqrt(3))/I.w}function r(t,e){return(t-(I.h-e)/Math.sqrt(3))/I.w}function o(t,a){var o=b+t,i=w+a,l=Math.max(0,Math.min(1,e(b,w),e(o,i))),s=Math.max(0,Math.min(1,n(b,w),n(o,i))),c=Math.max(0,Math.min(1,r(b,w),r(o,i))),u=(l/2+c)*I.w,f=(1-l/2-s)*I.w,d=(u+f)/2,h=f-u,p=(1-l)*I.h,g=p-h/_;h.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),D.transition().style("opacity",1).duration(200),P=!0)}function u(t,e){if(C===z)return 2===e&&m(),a(j);a(j);var n={};n[I.id+".aaxis.min"]=C.a,n[I.id+".baxis.min"]=C.b,n[I.id+".caxis.min"]=C.c,l.relayout(j,n),L&&j.data&&j._context.showTips&&(s.notifier("Double-click to
zoom back out","long"),L=!1)}function f(){z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},C=z}function d(t,e){var n=t/I.xaxis._m,r=e/I.yaxis._m;C={a:z.a-r,b:z.b+(n+r)/2,c:z.c-(n-r)/2};var a=[C.a,C.b,C.c].sort(),o={a:a.indexOf(C.a),b:a.indexOf(C.b),c:a.indexOf(C.c)};a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),C={a:a[o.a],b:a[o.b],c:a[o.c]},e=(z.a-C.a)*I.yaxis._m,t=(z.c-C.c-z.b+C.b)*I.xaxis._m);var i="translate("+(I.x0+t)+","+(I.y0+e)+")";I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",i),I.aaxis.range=[C.a,I.sum-C.b-C.c],I.baxis.range=[I.sum-C.a-C.c,C.b],I.caxis.range=[I.sum-C.a-C.b,C.c],I.drawAxes(!1),I.plotContainer.selectAll(".crisp").classed("crisp",!1)}function h(t,e){if(t){var n={};n[I.id+".aaxis.min"]=C.a,n[I.id+".baxis.min"]=C.b,n[I.id+".caxis.min"]=C.c,l.relayout(j,n)}else 2===e&&m()}function p(){I.plotContainer.selectAll(".select-outline").remove()}function m(){var t={};t[I.id+".aaxis.min"]=0,t[I.id+".baxis.min"]=0,t[I.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),l.relayout(j,t)}var b,w,z,S,C,E,O,P,N,D,I=this,R=I.layers.plotbg.select("path").node(),j=I.graphDiv,F=I.layers.zoom,q={element:R,gd:j,plotinfo:{plot:F},doubleclick:m,subplot:I.id,prepFn:function(e,n,r){q.xaxes=[I.xaxis],q.yaxes=[I.yaxis];var a=j._fullLayout.dragmode;e.shiftKey&&(a="pan"===a?"zoom":"pan"),"lasso"===a?q.minDrag=1:q.minDrag=void 0,"zoom"===a?(q.moveFn=o,q.doneFn=u,t(e,n,r)):"pan"===a?(q.moveFn=d,q.doneFn=h,f(),p()):"select"!==a&&"lasso"!==a||v(e,n,r,q,a)}};R.onmousemove=function(t){x.hover(j,t,I.id),j._fullLayout._lasthover=R,j._fullLayout._hoversubplot=I.id},R.onmouseout=function(t){j._dragging||g.unhover(j,t)},R.onclick=function(t){x.click(j,t)},g.init(q)}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":48,"../../components/titles":88,"../../lib":103,"../../lib/extend":101,"../../lib/filter_visible":102,"../../plotly":121,"../cartesian/axes":124,"../cartesian/constants":129,"../cartesian/graph_interact":131,"../cartesian/select":137,"../cartesian/set_convert":138,d3:14,tinycolor2:20}],158:[function(t,e,n){"use strict";function r(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var o=t("../plotly"),i=o.Lib.extendFlat,l=o.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,s=t.data,c=t.layout,u=l([],s),f=l({},c,r(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var d=Object.keys(f);for(n=0;ns;s++)r(n[s])&&h.push({p:n[s],s:l[s],b:0});return o(e,"marker")&&i(e,e.marker.color,"marker","c"),o(e,"marker.line")&&i(e,e.marker.line.color,"marker.line","c"),h}},{"../../components/colorscale/calc":32,"../../components/colorscale/has_colorscale":38,"../../plots/cartesian/axes":124,"fast-isnumeric":17}],168:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../components/color"),o=t("../scatter/xy_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,n,c){function u(n,a){return r.coerce(t,e,s,n,a)}var f=o(t,e,u);return f?(u("orientation",e.x&&!e.y?"h":"v"),u("text"),i(t,e,u,n,c),l(t,e,a.defaultLine,{axis:"y"}),void l(t,e,a.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":25,"../../components/errorbars/defaults":53,"../../lib":103,"../bar/style_defaults":176,"../scatter/xy_defaults":258,"./attributes":166}],169:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/graph_interact"),a=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,n,i){var l,s=t.cd,c=s[0].trace,u=s[0].t,f=t.xa,d=t.ya,h="closest"===i?u.barwidth/2:u.dbar*(1-f._gd._fullLayout.bargap)/2;l="closest"!==i?function(t){return t.p}:"h"===c.orientation?function(t){return t.y}:function(t){return t.x};var p,g;"h"===c.orientation?(p=function(t){return r.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},g=function(t){var e=l(t)-n;return r.inbox(e-h,e+h)}):(g=function(t){return r.inbox(t.b-n,t.y-n)+(t.y-n)/(t.y-t.b)},p=function(t){var n=l(t)-e;return r.inbox(n-h,n+h)});var m=r.getDistanceFunction(i,p,g);if(r.getClosest(s,m,t),t.index!==!1){var v=s[t.index],y=v.mcc||c.marker.color,x=v.mlcc||c.marker.line.color,b=v.mlw||c.marker.line.width;return o.opacity(y)?t.color=y:o.opacity(x)&&b&&(t.color=x),"h"===c.orientation?(t.x0=t.x1=f.c2p(v.x,!0),t.xLabelVal=v.s,t.y0=d.c2p(l(v)-h,!0),t.y1=d.c2p(l(v)+h,!0),t.yLabelVal=v.p):(t.y0=t.y1=d.c2p(v.y,!0),t.yLabelVal=v.s,t.x0=f.c2p(l(v)-h,!0),t.x1=f.c2p(l(v)+h,!0),t.xLabelVal=v.p),v.tx&&(t.text=v.tx),a.hoverInfo(v,c,t),[t]}}},{"../../components/color":25,"../../components/errorbars":54,"../../plots/cartesian/graph_interact":131}],170:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.calc=t("./calc"),r.setPositions=t("./set_positions"),r.colorbar=t("../scatter/colorbar"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.moduleType="trace",r.name="bar",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../scatter/colorbar":240,"./arrays_to_calcdata":165,"./attributes":166,"./calc":167,"./defaults":168,"./hover":169,"./layout_attributes":171,"./layout_defaults":172,"./plot":173,"./set_positions":174,"./style":175}],171:[function(t,e,n){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],172:[function(t,e,n){"use strict";var r=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,n){function l(n,r){return o.coerce(t,e,i,n,r)}for(var s=!1,c=!1,u=!1,f={},d=0;d=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var d,h,p,g;if("h"===l.orientation?(p=u.c2p(n.poffset+e.p,!0),g=u.c2p(n.poffset+e.p+n.barwidth,!0),d=c.c2p(e.b,!0),h=c.c2p(e.s+e.b,!0)):(d=c.c2p(n.poffset+e.p,!0),h=c.c2p(n.poffset+e.p+n.barwidth,!0),g=u.c2p(e.s+e.b,!0),p=u.c2p(e.b,!0)),!(a(d)&&a(h)&&a(p)&&a(g)&&d!==h&&p!==g))return void r.select(this).remove();var m=(e.mlw+1||l.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,v=r.round(m/2%1,2);if(!t._context.staticPlot){var y=i.opacity(e.mc||l.marker.color),x=1>y||m>.01?o:s;d=x(d,h),h=x(h,d),p=x(p,g),g=x(g,p)}r.select(this).attr("d","M"+d+","+p+"V"+g+"H"+h+"V"+p+"Z")})}),d.call(l.plot,e)}},{"../../components/color":25,"../../components/errorbars":54,"../../lib":103,"./arrays_to_calcdata":165,d3:14,"fast-isnumeric":17}],174:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var n,l,s=t._fullLayout,c=e.x(),u=e.y();["v","h"].forEach(function(f){function d(e){function n(t){t[p]=t.p+d}var r=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){r.push(t.p)})});var a=i.distinctVals(r),l=a.vals,c=a.minDiff,u=!1,f=[];"group"===s.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||f.forEach(function(e){Math.abs(t.p-e)_&&(S=!0,A=_),_>M+P&&(S=!0,M=_))}o.expand(v,[A,M],{tozero:!0,padded:S})}else{var N=function(t){return t[g]=t.s,t.s};for(n=0;n1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,n=e.marker,i=n.line,l=(e._input||{}).marker||{},s=o.tryColorscale(n,l,""),c=o.tryColorscale(n,l,"line.");r.select(this).selectAll("path").each(function(t){var e,o,l=(t.mlw+1||i.width+1)-1,u=r.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(n.color)?a.defaultLine:n.color,u.style("stroke-width",l+"px").call(a.fill,e),l&&(o="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":25,"../../components/drawing":48,"../../components/errorbars":54,d3:14}],176:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,n,i,l){n("marker.color",i),a(t,"marker")&&o(t,e,l,n,{prefix:"marker.",cLetter:"c"}),n("marker.line.color",r.defaultLine),a(t,"marker.line")&&o(t,e,l,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width")}},{"../../components/color":25,"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38}],177:[function(t,e,n){"use strict";var r=t("../scatter/attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,i=r.marker,l=i.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:o({},i.symbol,{arrayOk:!1}),opacity:o({},i.opacity,{arrayOk:!1,dflt:1}),size:o({},i.size,{arrayOk:!1}),color:o({},i.color,{arrayOk:!1}),line:{color:o({},l.color,{arrayOk:!1,dflt:a.defaultLine}),width:o({},l.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:r.fillcolor}},{"../../components/color/attributes":24,"../../lib/extend":101,"../scatter/attributes":237}],178:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes");e.exports=function(t,e){function n(t,e,n,o,i){var l;return n in e?p=o.makeCalcdata(e,n):(l=n+"0"in e?e[n+"0"]:"name"in e&&("category"===o.type||r(e.name)&&-1!==["linear","log"].indexOf(o.type)||a.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,l=o.d2c(l),p=i.map(function(){return l})),p}function i(t,e,n,o,i){var l,s,c,u,f=o.length,d=e.length,h=[],p=[];for(l=0;f>l;++l)s=o[l],t[l]={pos:s},p[l]=s-i,h[l]=[];for(p.push(o[f-1]+i),l=0;d>l;++l)u=e[l],r(u)&&(c=a.findBin(n[l],p),c>=0&&d>c&&h[c].push(u));return h}function l(t,e){var n,r,o,i;for(i=0;i1,v=n.dPos*(1-d.boxgap)*(1-d.boxgroupgap)/(m?t.numboxes:1),y=m?2*n.dPos*(-.5+(n.boxnum+.5)/t.numboxes)*(1-d.boxgap):0,x=v*g.whiskerwidth;return g.visible!==!0||n.emptybox?void o.select(this).remove():("h"===g.orientation?(s=p,f=h):(s=h,f=p),n.bPos=y,n.bdPos=v,r(),o.select(this).selectAll("path.box").data(i.identity).enter().append("path").attr("class","box").each(function(t){var e=s.c2p(t.pos+y,!0),n=s.c2p(t.pos+y-v,!0),r=s.c2p(t.pos+y+v,!0),a=s.c2p(t.pos+y-x,!0),l=s.c2p(t.pos+y+x,!0),c=f.c2p(t.q1,!0),u=f.c2p(t.q3,!0),d=i.constrain(f.c2p(t.med,!0),Math.min(c,u)+1,Math.max(c,u)-1),h=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),p=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?o.select(this).attr("d","M"+d+","+n+"V"+r+"M"+c+","+n+"V"+r+"H"+u+"V"+n+"ZM"+c+","+e+"H"+h+"M"+u+","+e+"H"+p+(0===g.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+p+","+a+"V"+l)):o.select(this).attr("d","M"+n+","+d+"H"+r+"M"+n+","+c+"H"+r+"V"+u+"H"+n+"ZM"+e+","+c+"V"+h+"M"+e+","+u+"V"+p+(0===g.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+p+"H"+l))}),g.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=n,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,n,r,o,l,s,f,d="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=(t.q3-t.q1)*u,p=[],m=0;if(g.jitter){for(e=0;et.lo&&(r.so=!0),r})}).enter().append("path").call(l.translatePoints,h,p),void(g.boxmean&&o.select(this).selectAll("path.mean").data(i.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=s.c2p(t.pos+y,!0),n=s.c2p(t.pos+y-v,!0),r=s.c2p(t.pos+y+v,!0),a=f.c2p(t.mean,!0),i=f.c2p(t.mean-t.sd,!0),l=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?o.select(this).attr("d","M"+a+","+n+"V"+r+("sd"!==g.boxmean?"":"m0,0L"+i+","+e+"L"+a+","+n+"L"+l+","+e+"Z")):o.select(this).attr("d","M"+n+","+a+"H"+r+("sd"!==g.boxmean?"":"m0,0L"+e+","+i+"L"+n+","+a+"L"+e+","+l+"Z"))})))})}},{"../../components/drawing":48,"../../lib":103,d3:14}],185:[function(t,e,n){"use strict";var r=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var n,i,l,s,c=t._fullLayout,u=e.x(),f=e.y(),d=["v","h"];for(i=0;in;n++)e=f[n],h[n]=e[0]*(t.zmax-t.zmin)+t.zmin,p[n]=e[1];var g=r.extent([t.zmin,t.zmax,o.start,o.start+s*(c-1)]),m=g[t.zminn;n++)e=f[n],h[n]=(e[0]*(c+u-1)-u/2)*s+i,p[n]=e[1];var y=r.scale.linear().interpolate(r.interpolateRgb).domain(h).range(p);return y}},{"../../components/colorscale/get_scale":37,d3:14}],194:[function(t,e,n){"use strict";function r(t,e,n){var r=n[0].trace,o=n[0].x,l=n[0].y,c=r.contours,u=r.uid,f=e.x(),d=e.y(),m=t._fullLayout,x="contour"+u,b=a(c,e,n[0]);if(r.visible!==!0)return m._paper.selectAll("."+x+",.hm"+u).remove(),void m._infolayer.selectAll(".cb"+u).remove();"heatmap"===c.coloring?(r.zauto&&r.autocontour===!1&&(r._input.zmin=r.zmin=c.start-c.size/2,r._input.zmax=r.zmax=r.zmin+b.length*c.size),k(t,e,[n])):m._paper.selectAll(".hm"+u).remove(),i(b),s(b);var _=f.c2p(o[0],!0),w=f.c2p(o[o.length-1],!0),M=d.c2p(l[0],!0),A=d.c2p(l[l.length-1],!0),T=[[_,A],[w,A],[w,M],[_,M]],L=h(e,n,x);p(L,T,c),g(L,b,T,c),v(L,b,c),y(L,e,n[0],T)}function a(t,e,n){for(var r=t.size||1,a=[],o=t.start;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===n||10===n){var r=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>r?5===n?713:1114:5===n?104:208}return 15===n?0:n}function i(t){var e,n,r,a,i,l,s,c,u,f=t[0].z,d=f.length,h=f[0].length,p=2===d||2===h;for(n=0;d-1>n;n++)for(a=[],0===n&&(a=a.concat(M)),n===d-2&&(a=a.concat(A)),e=0;h-1>e;e++)for(r=a.slice(),0===e&&(r=r.concat(T)),e===h-2&&(r=r.concat(L)),i=e+","+n,l=[[f[n][e],f[n][e+1]],[f[n+1][e],f[n+1][e+1]]],u=0;ua;a++){if(l>20?(l=S[l][(s[0]||s[1])<0?0:1],t.crossings[i]=C[l]):delete t.crossings[i],s=z[l],!s){_.log("Found bad marching index:",l,e,t.level);break}if(h.push(d(t,e,s)),e[0]+=s[0],e[1]+=s[1],u(h[h.length-1],h[h.length-2])&&h.pop(),i=e.join(","),i===o&&s.join(",")===p||n&&(s[0]&&(e[0]<0||e[0]>m-2)||s[1]&&(e[1]<0||e[1]>g-2)))break;l=t.crossings[i]}1e4===a&&_.log("Infinite loop in contour?");var v,y,x,b,w,k,M,A=u(h[0],h[h.length-1]),T=0,L=.2*t.smoothing,E=[],O=0;for(a=1;a=O;a--)if(v=E[a],P>v){for(x=0,y=a-1;y>=O&&v+E[y]x&&v+E[x]e;)e++,n=Object.keys(a.crossings)[0].split(",").map(Number),l(a,n);1e4===e&&_.log("Infinite loop in contour?")}}function c(t,e,n){var r=0,a=0;return t>20&&e?208===t||1114===t?r=0===n[0]?1:-1:a=0===n[1]?1:-1:-1!==M.indexOf(t)?a=1:-1!==T.indexOf(t)?r=1:-1!==A.indexOf(t)?a=-1:r=-1,[r,a]}function u(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function d(t,e,n){var r=e[0]+Math.max(n[0],0),a=e[1]+Math.max(n[1],0),o=t.z[a][r],i=t.xaxis,l=t.yaxis;if(n[1]){var s=(t.level-o)/(t.z[a][r+1]-o);return[i.c2p((1-s)*t.x[r]+s*t.x[r+1],!0),l.c2p(t.y[a],!0)]}var c=(t.level-o)/(t.z[a+1][r]-o);return[i.c2p(t.x[r],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0)]}function h(t,e,n){var r=t.plot.select(".maplayer").selectAll("g.contour."+n).data(e);return r.enter().append("g").classed("contour",!0).classed(n,!0),r.exit().remove(),r}function p(t,e,n){var r=t.selectAll("g.contourbg").data([0]);r.enter().append("g").classed("contourbg",!0);var a=r.selectAll("path").data("fill"===n.coloring?[0]:[]);a.enter().append("path"),a.exit().remove(),a.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,n,r){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var o=a.selectAll("path").data("fill"===r.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=m(t,n);e?b.select(this).attr("d",e).style("stroke","none"):b.select(this).remove()})}function m(t,e){function n(t){return Math.abs(t[1]-e[0][1])<.01}function r(t){return Math.abs(t[1]-e[2][1])<.01}function a(t){return Math.abs(t[0]-e[0][0])<.01}function o(t){return Math.abs(t[0]-e[2][0])<.01}for(var i,l,s,c,u,f,d=t.edgepaths.length||t.z[0][0]s;s++){if(!i){_.log("Missing end?",h,t);break}for(n(i)&&!o(i)?l=e[1]:a(i)?l=e[0]:r(i)?l=e[3]:o(i)&&(l=e[2]),u=0;u=0&&(l=m,c=u):Math.abs(i[1]-l[1])<.01?Math.abs(i[1]-m[1])<.01&&(m[0]-i[0])*(l[0]-m[0])>=0&&(l=m,c=u):_.log("endpt to newendpt is not vert. or horz.",i,l,m)}if(i=l,c>=0)break;d+="L"+l}if(c===t.edgepaths.length){_.log("unclosed perimeter path");break}h=c,g=-1===p.indexOf(h),g&&(h=p[0],d+="Z")}for(h=0;he;e++)l.push(1);for(e=0;o>e;e++)a.push(l.slice());for(e=0;ei;i++)for(r=a(s,i),u[i]=new Array(r),l=0;r>l;l++)u[i][l]=e(o(s,i,l));return u}function a(t,e,n,r,a,o){var i,l,s,c=[],u=d.traceIs(t,"contour"),f=d.traceIs(t,"histogram"),h=d.traceIs(t,"gl2d"),p=Array.isArray(e)&&e.length>1;if(p&&!f&&"category"!==o.type){e=e.map(o.d2c);var g=e.length;if(!(a>=g))return u?e.slice(0,a):e.slice(0,a+1);if(u||h)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],s=1;g>s;s++)c.push(.5*(e[s-1]+e[s]));c.push(1.5*e[g-1]-.5*e[g-2])}if(a>g){var m=c[c.length-1],v=m-c[c.length-2];for(s=g;a>s;s++)m+=v,c.push(m)}}else for(l=r||1,i=f||"category"===o.type?n||0:Array.isArray(e)&&1===e.length?e[0]:void 0===n?0:o.d2c(n),s=u||h?0:-.5;a>s;s++)c.push(i+l*s);return c}function o(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,n){var r,a,i=1;if(Array.isArray(n))for(r=0;rr&&i>y;r++)i=s(t,e,o(i));return i>y&&u.log("interp2d didn't converge quickly",i),t}function l(t){var e,n,r,a,o,i,l,s,c=[],u={},f=[],d=t[0],h=[],p=[0,0,0],g=v(t);for(n=0;nr;r++)void 0===h[r]&&(i=(void 0!==h[r-1]?1:0)+(void 0!==h[r+1]?1:0)+(void 0!==e[r]?1:0)+(void 0!==d[r]?1:0),i?(0===n&&i++,0===r&&i++,n===t.length-1&&i++,r===h.length-1&&i++,4>i&&(u[[n,r]]=[n,r,i]),c.push([n,r,i])):f.push([n,r]));for(;f.length;){for(l={},s=!1,o=f.length-1;o>=0;o--)a=f[o],n=a[0],r=a[1],i=((u[[n-1,r]]||p)[2]+(u[[n+1,r]]||p)[2]+(u[[n,r-1]]||p)[2]+(u[[n,r+1]]||p)[2])/20,i&&(l[a]=[n,r,i],f.splice(o,1),s=!0);if(!s)throw"findEmpties iterated with no new neighbors";for(a in l)u[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}function s(t,e,n){var r,a,o,i,l,s,c,u,f,d,h,p,g,m=0;for(i=0;il;l++)s=x[l],c=t[a+s[0]],c&&(u=c[o+s[1]],void 0!==u&&(0===d?p=g=u:(p=Math.min(p,u),g=Math.max(g,u)),f++,d+=u));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[a][o]=d/f,void 0===h?4>f&&(m=1):(t[a][o]=(1+n)*t[a][o]-n*h,g>p&&(m=Math.max(m,Math.abs(t[a][o]-h)/(g-p))))}return m}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../../plots/plots"),h=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),g=t("./has_columns"),m=t("./convert_column_xyz"),v=t("./max_row_length");e.exports=function(t,e){function n(t){z=e._input.zsmooth=e.zsmooth=!1,u.notifier("cannot fast-zsmooth: "+t)}var o,s,c,y,x,b,_,w,k=f.getFromId(t,e.xaxis||"x"),M=f.getFromId(t,e.yaxis||"y"),A=d.traceIs(e,"contour"),T=d.traceIs(e,"histogram"),L=d.traceIs(e,"gl2d"),z=A?"best":e.zsmooth;if(k._minDtick=0,M._minDtick=0,T){var S=h(t,e);o=S.x,s=S.x0,c=S.dx,y=S.y,x=S.y0,b=S.dy,_=S.z}else g(e)&&m(e,k,M),o=e.x?k.makeCalcdata(e,"x"):[],y=e.y?M.makeCalcdata(e,"y"):[],s=e.x0||0,c=e.dx||1,x=e.y0||0,b=e.dy||1,_=r(e),(A||e.connectgaps)&&(e._emptypoints=l(_),e._interpz=i(_,e._emptypoints,e._interpz));if("fast"===z)if("log"===k.type||"log"===M.type)n("log axis found");else if(!T){if(o.length){var C=(o[o.length-1]-o[0])/(o.length-1),E=Math.abs(C/100);for(w=0;wE){n("x scale is not linear");break}}if(y.length&&"fast"===z){var O=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(O/100);for(w=0;wP){n("y scale is not linear");break}}}var N=v(_),D="scaled"===e.xtype?"":e.x,I=a(e,D,s,c,N,k),R="scaled"===e.ytype?"":e.y,j=a(e,R,x,b,_.length,M);L||(f.expand(k,I),f.expand(M,j));var F={x:I,y:j,z:_};if(p(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var q="contour"===e.type?"heatmap":"histogram2d";F.xfill=a(q,D,s,c,N,k),F.yfill=a(q,R,x,b,_.length,M)}return[F]};var y=.01,x=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":32,"../../lib":103,"../../plots/cartesian/axes":124,"../../plots/plots":144,"../histogram2d/calc":210,"./convert_column_xyz":200,"./has_columns":202,"./max_row_length":205,"fast-isnumeric":17}],199:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,c="cb"+n.uid,u=l(n.colorscale),f=n.zmin,d=n.zmax;if(a(f)||(f=o.aggNums(Math.min,null,n.z)),a(d)||(d=o.aggNums(Math.max,null,n.z)),t._fullLayout._infolayer.selectAll("."+c).remove(),!n.showscale)return void i.autoMargin(t,c);var h=e[0].t.cb=s(t,c);h.fillcolor(r.scale.linear().domain(u.map(function(t){return f+t[0]*(d-f)})).range(u.map(function(t){return t[1]}))).filllevels({start:f,end:d,size:(d-f)/254}).options(n.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale/get_scale":37, -"../../lib":103,"../../plots/plots":144,d3:14,"fast-isnumeric":17}],200:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n){var a,o=t.x.slice(),i=t.y.slice(),l=t.z,s=t.text,c=Math.min(o.length,i.length,l.length),u=void 0!==s&&!Array.isArray(s[0]);for(ca;a++)o[a]=e.d2c(o[a]),i[a]=n.d2c(i[a]);var f,d,h,p=r.distinctVals(o),g=p.vals,m=r.distinctVals(i),v=m.vals,y=r.init2dArray(v.length,g.length);for(u&&(h=r.init2dArray(v.length,g.length)),a=0;c>a;a++)f=r.findBin(o[a]+p.minDiff/2,g),d=r.findBin(i[a]+m.minDiff/2,v),y[d][f]=l[a],u&&(h[d][f]=s[a]);t.x=g,t.y=v,t.z=y,u&&(t.text=h)}},{"../../lib":103}],201:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./has_columns"),o=t("./xyz_defaults"),i=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,n,s){function c(n,a){return r.coerce(t,e,l,n,a)}var u=o(t,e,c);return u?(c("text"),c("zsmooth"),c("connectgaps",a(e)&&e.zsmooth!==!1),void i(t,e,s,c,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":35,"../../lib":103,"./attributes":197,"./has_columns":202,"./xyz_defaults":208}],202:[function(t,e,n){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],203:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/graph_interact"),a=t("../../lib"),o=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,n,i,l){if(!(t.distanceu||u>=y[0].length||0>f||f>y.length)return}else{if(r.inbox(e-m[0],e-m[m.length-1])>o||r.inbox(n-v[0],n-v[v.length-1])>o)return;if(l){var k;for(b=[2*m[0]-m[1]],k=1;k0;)_=m.c2p(C[A]),A--;for(b>_&&(w=_,_=b,b=w,I=!0),A=0;void 0===k&&A0;)M=v.c2p(E[A]),A--;if(k>M&&(w=k,k=M,M=w,R=!0),O&&(C=n[0].xfill,E=n[0].yfill),"fast"!==P){var j="best"===P?0:.5;b=Math.max(-j*m._length,b),_=Math.min((1+j)*m._length,_),k=Math.max(-j*v._length,k),M=Math.min((1+j)*v._length,M)}var F=Math.round(_-b),q=Math.round(M-k),B=0>=F||0>=q,H=e.plot.select(".imagelayer").selectAll("g.hm."+x).data(B?[]:[0]);if(H.enter().append("g").classed("hm",!0).classed(x,!0),H.exit().remove(),!B){var V,Z;"fast"===P?(V=D,Z=N):(V=F,Z=q);var U=document.createElement("canvas");U.width=V,U.height=Z;var Y,X,G=U.getContext("2d"),$=a.scale.linear().domain(S.map(function(t){return t[0]})).range(S.map(function(t){var e=o(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===P?(Y=I?function(t){return D-1-t}:i.identity,X=R?function(t){return N-1-t}:i.identity):(Y=function(t){return i.constrain(Math.round(m.c2p(C[t])-b),0,F)},X=function(t){return i.constrain(Math.round(v.c2p(E[t])-k),0,q)});var Q,W,J,K,tt,et,nt=X(0),rt=[nt,nt],at=I?0:1,ot=R?0:1,it=0,lt=0,st=0,ct=0;if(P){var ut=0,ft=new Uint8Array(F*q*4);if("best"===P){var dt,ht,pt,gt=new Array(C.length),mt=new Array(E.length),vt=new Array(F);for(A=0;AA;A++)vt[A]=r(A,gt);for(W=0;q>W;W++)for(dt=r(W,mt),ht=T[dt.bin0],pt=T[dt.bin1],A=0;F>A;A++,ut+=4)et=h(ht,pt,vt[A],dt),d(ft,ut,et)}else for(W=0;N>W;W++)for(tt=T[W],rt=X(W),A=0;F>A;A++)et=f(tt[A],1),ut=4*(rt*F+Y(A)),d(ft,ut,et);var yt=G.createImageData(F,q);yt.data.set(ft),G.putImageData(yt,0,0)}else for(W=0;N>W;W++)if(tt=T[W],rt.reverse(),rt[ot]=X(W+1),rt[0]!==rt[1]&&void 0!==rt[0]&&void 0!==rt[1])for(J=Y(0),Q=[J,J],A=0;D>A;A++)Q.reverse(),Q[at]=Y(A+1),Q[0]!==Q[1]&&void 0!==Q[0]&&void 0!==Q[1]&&(K=tt[A],et=f(K,(Q[1]-Q[0])*(rt[1]-rt[0])),G.fillStyle="rgba("+et.join(",")+")",G.fillRect(Q[0],rt[0],Q[1]-Q[0],rt[1]-rt[0]));lt=Math.round(lt/it),st=Math.round(st/it),ct=Math.round(ct/it);var xt=o("rgb("+lt+","+st+","+ct+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*xt.getLuminance();var bt=H.selectAll("image").data(n);bt.enter().append("svg:image").attr({xmlns:c.svg,preserveAspectRatio:"none"}),bt.attr({height:q,width:F,x:b,y:k,"xlink:href":U.toDataURL("image/png")}),bt.exit().remove()}}var a=t("d3"),o=t("tinycolor2"),i=t("../../lib"),l=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),c=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,n){for(var a=0;a0&&(r=!0);for(var l=0;lv&&p.splice(v,p.length-v),m.length>v&&m.splice(v,m.length-v),!e.autobinx&&"xbins"in e||(e.xbins=a.autoBin(p,h,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=a.autoBin(m,g,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),f=[];var y,x,b=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,k="string"==typeof e.xbins.size?[]:e.ybins,M=0,A=[],T=e.histnorm,L=e.histfunc,z=-1!==T.indexOf("density"),S="max"===L||"min"===L,C=S?null:0,E=o.count,O=i[T],P=!1,N=[],D=[],I="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";I&&"count"!==L&&(P="avg"===L,E=o[L]);var R=e.xbins,j=R.end+(R.start-a.tickIncrement(R.start,R.size))/1e6;for(d=R.start;j>d;d=a.tickIncrement(d,R.size))b.push(C),Array.isArray(w)&&w.push(d),P&&_.push(0);Array.isArray(w)&&w.push(d);var F=b.length;for(n=e.xbins.start,s=(d-n)/F,n+=s/2,R=e.ybins,j=R.end+(R.start-a.tickIncrement(R.start,R.size))/1e6,d=R.start;j>d;d=a.tickIncrement(d,R.size))f.push(b.concat()),Array.isArray(k)&&k.push(d),P&&A.push(_.concat());Array.isArray(k)&&k.push(d);var q=f.length;for(c=e.ybins.start,u=(d-c)/q,c+=u/2,z&&(N=b.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/s}),D=f.map(function(t,e){return Array.isArray(k)?1/(k[e+1]-k[e]):1/u})),d=0;v>d;d++)y=r.findBin(p[d],w),x=r.findBin(m[d],k),y>=0&&F>y&&x>=0&&q>x&&(M+=E(y,d,f[x],I,A[x]));if(P)for(x=0;q>x;x++)M+=l(f[x],A[x]);if(O)for(x=0;q>x;x++)O(f[x],M,N,D[x]);return{x:p,x0:n,dx:s,y:m,y0:c,dy:u,z:f}}},{"../../lib":103,"../../plots/cartesian/axes":124,"../histogram/average":218,"../histogram/bin_functions":220,"../histogram/norm_functions":224}],211:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./sample_defaults"),o=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,n){function l(n,a){return r.coerce(t,e,i,n,a)}a(t,e,l),l("zsmooth"),o(t,e,n,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":35,"../../lib":103,"./attributes":209,"./sample_defaults":213}],212:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../heatmap/calc"),r.plot=t("../heatmap/plot"),r.colorbar=t("../heatmap/colorbar"),r.style=t("../heatmap/style"),r.hoverPoints=t("../heatmap/hover"),r.moduleType="trace",r.name="histogram2d",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","2dMap","histogram"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../heatmap/calc":198,"../heatmap/colorbar":199,"../heatmap/hover":203,"../heatmap/plot":206,"../heatmap/style":207,"./attributes":209,"./defaults":211}],213:[function(t,e,n){"use strict";var r=t("../histogram/bin_defaults");e.exports=function(t,e,n){var a=n("x"),o=n("y");if(!(a&&a.length&&o&&o.length))return void(e.visible=!1);var i=n("z")||n("marker.color");i&&n("histfunc");var l=["x","y"];r(t,e,n,l)}},{"../histogram/bin_defaults":219}],214:[function(t,e,n){"use strict";var r=t("../histogram2d/attributes"),a=t("../contour/attributes"),o=t("../../components/colorscale/attributes"),i=t("../../lib/extend").extendFlat;e.exports=i({},{x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,autobinx:r.autobinx,nbinsx:r.nbinsx,xbins:r.xbins,autobiny:r.autobiny,nbinsy:r.nbinsy,ybins:r.ybins,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:a.line,_nestedModules:{colorbar:"Colorbar"}},o)},{"../../components/colorscale/attributes":31,"../../lib/extend":101,"../contour/attributes":187,"../histogram2d/attributes":209}],215:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../histogram2d/sample_defaults"),o=t("../contour/style_defaults"),i=t("./attributes");e.exports=function(t,e,n,l){function s(n,a){return r.coerce(t,e,i,n,a)}a(t,e,s);var c=r.coerce2(t,e,i,"contours.start"),u=r.coerce2(t,e,i,"contours.end"),f=s("autocontour",!(c&&u));s(f?"ncontours":"contours.size"),o(t,e,s,l)}},{"../../lib":103,"../contour/style_defaults":196,"../histogram2d/sample_defaults":213,"./attributes":214}],216:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../contour/calc"),r.plot=t("../contour/plot"),r.style=t("../contour/style"),r.colorbar=t("../contour/colorbar"),r.hoverPoints=t("../contour/hover"),r.moduleType="trace",r.name="histogram2dcontour",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","2dMap","contour","histogram"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../contour/calc":188,"../contour/colorbar":189,"../contour/hover":191,"../contour/plot":194,"../contour/style":195,"./attributes":214,"./defaults":215}],217:[function(t,e,n){"use strict";function r(t){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var a=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:a.text,orientation:a.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:r("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:r("y"),marker:a.marker,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:a._deprecated.bardir}}},{"../bar/attributes":166}],218:[function(t,e,n){"use strict";e.exports=function(t,e){for(var n=t.length,r=0,a=0;n>a;a++)e[a]?(t[a]/=e[a],r+=t[a]):t[a]=null;return r}},{}],219:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){return n("histnorm"),r.forEach(function(t){var e=n(t+"bins.start"),r=n(t+"bins.end"),a=n("autobin"+t,!(e&&r));n(a?"nbins"+t:t+"bins.size")}),e}},{}],220:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports={count:function(t,e,n){return n[t]++,1},sum:function(t,e,n,a){var o=a[e];return r(o)?(o=Number(o),n[t]+=o,o):0},avg:function(t,e,n,a,o){var i=a[e];return r(i)&&(i=Number(i),n[t]+=i,o[t]++),0},min:function(t,e,n,a){var o=a[e];if(r(o)){if(o=Number(o),!r(n[t]))return n[t]=o,o;if(n[t]>o)return n[t]=o,o-n[t]}return 0},max:function(t,e,n,a){var o=a[e];if(r(o)){if(o=Number(o),!r(n[t]))return n[t]=o,o;if(n[t]n&&c.length<5e3;)g=o.tickIncrement(n,x.size),c.push((n+g)/2),u.push(S),b&&_.push(n),L&&w.push(1/(g-n)),O&&k.push(0),n=g;var P=u.length;for(n=0;n=0&&P>v&&(M+=C(v,n,u,y,k));O&&(M=s(u,k)),E&&E(u,M,w);var N=Math.min(c.length,u.length),D=[],I=0,R=N-1;for(n=0;N>n;n++)if(u[n]){I=n;break}for(n=N-1;n>I;n--)if(u[n]){R=n;break}for(n=I;R>=n;n++)r(c[n])&&r(u[n])&&D.push({p:c[n],s:u[n],b:0});return D}}},{"../../lib":103,"../../plots/cartesian/axes":124,"./average":218,"./bin_functions":220,"./norm_functions":224,"fast-isnumeric":17}],222:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,n,c){function u(n,a){return r.coerce(t,e,s,n,a)}var f=u("x"),d=u("y");u("text");var h=u("orientation",d&&!f?"h":"v"),p=e["v"===h?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===h?"x":"y"];g&&u("histfunc");var m="h"===h?["y"]:["x"];o(t,e,u,m),i(t,e,u,n,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":25,"../../components/errorbars/defaults":53,"../../lib":103,"../bar/style_defaults":176,"./attributes":217,"./bin_defaults":219}],223:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.layoutAttributes=t("../bar/layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("../bar/layout_defaults"),r.calc=t("./calc"),r.setPositions=t("../bar/set_positions"),r.plot=t("../bar/plot"),r.style=t("../bar/style"),r.colorbar=t("../scatter/colorbar"),r.hoverPoints=t("../bar/hover"),r.moduleType="trace",r.name="histogram",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../bar/hover":169,"../bar/layout_attributes":171,"../bar/layout_defaults":172,"../bar/plot":173,"../bar/set_positions":174,"../bar/style":175,"../scatter/colorbar":240,"./attributes":217,"./calc":221,"./defaults":222}],224:[function(t,e,n){"use strict";e.exports={percent:function(t,e){for(var n=t.length,r=100/e,a=0;n>a;a++)t[a]*=r},probability:function(t,e){for(var n=t.length,r=0;n>r;r++)t[r]/=e},density:function(t,e,n,r){var a=t.length;r=r||1;for(var o=0;a>o;o++)t[o]*=n[o]*r},"probability density":function(t,e,n,r){var a=t.length;r&&(e/=r);for(var o=0;a>o;o++)t[o]*=n[o]/e}}},{}],225:[function(t,e,n){"use strict";var r=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:r.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":24,"../../lib/extend":101,"../../plots/attributes":122,"../../plots/font_attributes":142}],226:[function(t,e,n){"use strict";function r(t,e){for(var n=[],r=0;rs||(c=p[n],void 0!==c&&""!==c||(c=n),c=String(c),void 0===y[c]&&(y[c]=!0,u=o(e.marker.colors[n]),u.isValid()?(u=i.addOpacity(u,u.getAlpha()),v[c]||(v[c]=u)):v[c]?u=v[c]:(u=!1,x=!0),f=-1!==_.indexOf(c),f||(b+=s),g.push({v:s,label:c,color:u,i:n,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(n=0;n")}return g};var s},{"../../components/color":25,"./helpers":229,"fast-isnumeric":17,tinycolor2:20}],228:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes");e.exports=function(t,e,n,o){function i(n,o){return r.coerce(t,e,a,n,o)}var l=r.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel"));var u=i("marker.line.width");u&&i("marker.line.color");var f=i("marker.colors");Array.isArray(f)||(e.marker.colors=[]),i("scalegroup");var d=i("text"),h=i("textinfo",Array.isArray(d)?"text+percent":"percent");if(i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var p=i("textposition"),g=Array.isArray(p)||"auto"===p,m=g||"inside"===p,v=g||"outside"===p;if(m||v){var y=l(i,"textfont",o.font);m&&l(i,"insidetextfont",y),v&&l(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":103,"./attributes":225}],229:[function(t,e,n){"use strict";var r=t("../../lib");n.formatPiePercent=function(t,e){var n=(100*t).toPrecision(3);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)+"%"},n.formatPieValue=function(t,e){var n=t.toPrecision(10);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)}},{"../../lib":103}],230:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.layoutAttributes=t("./layout_attributes"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.styleOne=t("./style_one"),r.moduleType="trace",r.name="pie",r.basePlotModule=t("./base_plot"),r.categories=["pie","showLegend"],r.meta={},e.exports=r},{"./attributes":225,"./base_plot":226,"./calc":227,"./defaults":228,"./layout_attributes":231,"./layout_defaults":232,"./plot":233,"./style":234,"./style_one":235}],231:[function(t,e,n){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],232:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function n(n,o){return r.coerce(t,e,a,n,o)}n("hiddenlabels")}},{"../../lib":103,"./layout_attributes":231}],233:[function(t,e,n){"use strict";function r(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/n.vTotal,.5),l=1-n.trace.hole,s=a(e,n),c={scale:s*n.r*2/r,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=n.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/n.r)-f*o/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=n.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),m={scale:2*g/t.width,rCenter:Math.cos(g/n.r)-g/o/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>d.scale?m:d;return c.scale<1&&v.scale>c.scale?v:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var n=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(n)),(1-e.trace.hole)/2)}function o(t,e){var n=e.pxmid[0],r=e.pxmid[1],a=t.width/2,o=t.height/2;return 0>n&&(a*=-1),0>r&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}function i(t,e){function n(t,e){return t.pxmid[1]-e.pxmid[1]}function r(t,e){return e.pxmid[1]-t.pxmid[1]}function a(t,n){n||(n={});var r,a,o,l,d,h,g=n.labelExtraY+(i?n.yLabelMax:n.yLabelMin),m=i?t.yLabelMin:t.yLabelMax,v=i?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),x=g-m;if(x*f>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*f>0?(l=o.cyFinal+c(o.px0[1],o.px1[1]),x=l-m-t.labelExtraY,x*f>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*f>0&&(r=3*u*Math.abs(a-p.indexOf(t)),d=o.cxFinal+s(o.px0[0],o.px1[0]),h=d+r-(t.cxFinal+t.pxmid[0])-t.labelExtraX,h*u>0&&(t.labelExtraX+=h)))}var o,i,l,s,c,u,f,d,h,p,g,m,v;for(i=0;2>i;i++)for(l=i?n:r,c=i?Math.max:Math.min,f=i?1:-1,o=0;2>o;o++){for(s=o?Math.max:Math.min,u=o?1:-1,d=t[i][o],d.sort(l),h=t[1-i][o],p=h.concat(d),m=[],g=0;gu&&(u=l.pull[o]);i.r=Math.min(n/c(l.tilt,Math.sin(s),l.depth),r/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===h.indexOf(l.scalegroup)&&h.push(l.scalegroup)}for(o=0;of.vTotal/2?1:0)}function c(t,e,n){if(!t)return 1;var r=Math.sin(t*Math.PI/180);return Math.max(.01,n*r*Math.abs(e)+2*Math.sqrt(1-r*r*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var n=t._fullLayout;l(e,n._size);var c=n._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],m=c.trace,v=0,y=(m.depth||0)*c.r*Math.sin(v)/2,x=m.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=c.r*Math.cos(v),k=l.selectAll("g.part").data(m.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],v=!1;l.each(function(i){function l(e){var r=t._fullLayout,o=t._fullData[m.index],l=o.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),!t._dragging&&r.hovermode!==!1&&"none"!==l&&l){var s=a(i,c),u=k+i.pxmid[0]*(1-s),d=M+i.pxmid[1]*(1-s),h=n.separators,p=[];-1!==l.indexOf("label")&&p.push(i.label),o.text&&o.text[i.i]&&-1!==l.indexOf("text")&&p.push(o.text[i.i]),-1!==l.indexOf("value")&&p.push(g.formatPieValue(i.v,h)),-1!==l.indexOf("percent")&&p.push(g.formatPiePercent(i.v/c.vTotal,h)),f.loneHover({x0:u-s*c.r,x1:u+s*c.r,y:d,text:p.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,color:i.color,idealAlign:i.pxmid[0]<0?"left":"right"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()}),f.hover(t,e,"pie"),L=!0}}function d(e){t.emit("plotly_unhover",{points:[e]}),L&&(f.loneUnhover(n._hoverlayer.node()),L=!1)}function y(){t._hoverdata=[i],i.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,f.click(t,{target:!0})}function b(t,e,n,r){return"a"+r*c.r+","+r*w+" "+x+" "+i.largeArc+(n?" 1 ":" 0 ")+r*(e[0]-t[0])+","+r*(e[1]-t[1])}if(i.hidden)return void u.select(this).selectAll("path,g").remove();s[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var k=c.cx+_[0],M=c.cy+_[1],A=u.select(this),T=A.selectAll("path.surface").data([i]),L=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),A.select("path.textline").remove(),A.on("mouseover",l).on("mouseout",d).on("click",y).on("contextmenu",y),m.pull){var z=+(Array.isArray(m.pull)?m.pull[i.i]:m.pull)||0;z>0&&(k+=z*i.pxmid[0],M+=z*i.pxmid[1])}i.cxFinal=k,i.cyFinal=M;var S=m.hole;if(i.v===c.vTotal){var C="M"+(k+i.px0[0])+","+(M+i.px0[1])+b(i.px0,i.pxmid,!0,1)+b(i.pxmid,i.px0,!0,1)+"Z";S?T.attr("d","M"+(k+S*i.px0[0])+","+(M+S*i.px0[1])+b(i.px0,i.pxmid,!1,S)+b(i.pxmid,i.px0,!1,S)+"Z"+C):T.attr("d",C)}else{var E=b(i.px0,i.px1,!0,1);if(S){var O=1-S;T.attr("d","M"+(k+S*i.px1[0])+","+(M+S*i.px1[1])+b(i.px1,i.px0,!1,S)+"l"+O*i.px0[0]+","+O*i.px0[1]+E+"Z")}else T.attr("d","M"+k+","+M+"l"+i.px0[0]+","+i.px0[1]+E+"Z")}var P=Array.isArray(m.textposition)?m.textposition[i.i]:m.textposition,N=A.selectAll("g.slicetext").data(i.text&&"none"!==P?[0]:[]);N.enter().append("g").classed("slicetext",!0),N.exit().remove(),N.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(i.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===P?m.outsidetextfont:m.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,n=h.bBox(t.node());"outside"===P?e=o(n,i):(e=r(n,i,c),"auto"===P&&e.scale<1&&(t.call(h.font,m.outsidetextfont),m.outsidetextfont.family===m.insidetextfont.family&&m.outsidetextfont.size===m.insidetextfont.size||(t.attr({"data-bb":""}),n=h.bBox(t.node())),e=o(n,i)));var a=k+i.pxmid[0]*e.rCenter+(e.x||0),l=M+i.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(i.yLabelMin=l-n.height/2, -i.yLabelMid=l,i.yLabelMax=l+n.height/2,i.labelExtraX=0,i.labelExtraY=0,v=!0),t.attr("transform","translate("+a+","+l+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(n.left+n.right)/2+","+-(n.top+n.bottom)/2+")")})}),v&&i(s,m),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),n=e.select("g.slicetext text");n.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+n.attr("transform"));var r=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+r+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(l)>Math.abs(s)?"l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(r+t.labelExtraX+i):"l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,m.outsidetextfont.color).attr({"stroke-width":Math.min(2,m.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":25,"../../components/drawing":48,"../../lib/svg_text_utils":114,"../../plots/cartesian/graph_interact":131,"./helpers":229,d3:14}],234:[function(t,e,n){"use strict";var r=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],n=e.trace,o=r.select(this);o.style({opacity:n.opacity}),o.selectAll(".top path.surface").each(function(t){r.select(this).call(a,t,n)})})}},{"./style_one":235,d3:14}],235:[function(t,e,n){"use strict";var r=t("../../components/color");e.exports=function(t,e,n){var a=n.marker.line.color;Array.isArray(a)&&(a=a[e.i]||r.defaultLine);var o=n.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(r.stroke,a)}},{"../../components/color":25}],236:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t){var e=t[0].trace,n=e.marker;if(r.mergeArray(e.text,t,"tx"),r.mergeArray(e.textposition,t,"tp"),e.textfont&&(r.mergeArray(e.textfont.size,t,"ts"),r.mergeArray(e.textfont.color,t,"tc"),r.mergeArray(e.textfont.family,t,"tf")),n&&n.line){var a=n.line;r.mergeArray(n.opacity,t,"mo"),r.mergeArray(n.symbol,t,"mx"),r.mergeArray(n.color,t,"mc"),r.mergeArray(a.color,t,"mlc"),r.mergeArray(a.width,t,"mlw")}}},{"../../lib":103}],237:[function(t,e,n){"use strict";var r=t("../../components/colorscale/color_attributes"),a=t("../../components/drawing"),o=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:o({},{symbol:{valType:"enumerated",values:a.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:o({},{width:{valType:"number",min:0,arrayOk:!0}},r("marker.line"))},r("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":33,"../../components/drawing":48,"../../lib/extend":101,"./constants":242}],238:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./subtypes"),l=t("./colorscale_calc");e.exports=function(t,e){var n,s,c,u=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=u.makeCalcdata(e,"x"),h=f.makeCalcdata(e,"y"),p=Math.min(d.length,h.length);u._minDtick=0,f._minDtick=0,d.length>p&&d.splice(p,d.length-p),h.length>p&&h.splice(p,h.length-p);var g={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(n=e.marker,s=n.size,Array.isArray(s)){var v={type:"linear"};a.setConvert(v),s=v.makeCalcdata(e.marker,"size"),s.length>p&&s.splice(p,s.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},g.ppad=m.ppad=Array.isArray(s)?s.map(y):y(s)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(i.hasMarkers(e)||i.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(m.padded=!1):m.tozero=!0,a.expand(u,d,g),a.expand(f,h,m);var b=new Array(p);for(c=0;p>c;c++)b[c]=r(d[c])&&r(h[c])?{x:d[c],y:h[c]}:{x:!1,y:!1};return void 0!==typeof s&&o.mergeArray(s,b,"ms"),t.firstscatter=!1,b}},{"../../lib":103,"../../plots/cartesian/axes":124,"./colorscale_calc":241,"./subtypes":256,"fast-isnumeric":17}],239:[function(t,e,n){"use strict";e.exports=function(t){var e,n,r,a,o;for(e=0;e=0;a--)if(o=t[a],"scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}},{}],240:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,c=n.marker,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===c||!c.showscale)return void i.autoMargin(t,u);var f=l(c.colorscale),d=c.color,h=c.cmin,p=c.cmax;a(h)||(h=o.aggNums(Math.min,null,d)),a(p)||(p=o.aggNums(Math.max,null,d));var g=e[0].t.cb=s(t,u);g.fillcolor(r.scale.linear().domain(f.map(function(t){return h+t[0]*(p-h)})).range(f.map(function(t){return t[1]}))).filllevels({start:h,end:p,size:(p-h)/254}).options(c.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale/get_scale":37,"../../lib":103,"../../plots/plots":144,d3:14,"fast-isnumeric":17}],241:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&r(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(r(t,"marker")&&a(t,t.marker.color,"marker","c"),r(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":32,"../../components/colorscale/has_colorscale":38,"./subtypes":256}],242:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20}},{}],243:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,n,p){function g(n,o){return r.coerce(t,e,a,n,o)}var m=l(t,e,g),v=mB!=P>=B&&(C=z[T-1][0],E=z[T][0],S=C+(E-C)*(B-O)/(P-O),R=Math.min(R,S),j=Math.max(j,S));R=Math.max(R,0),j=Math.min(j,d._length);var H=s.defaultLine;return s.opacity(f.fillcolor)?H=f.fillcolor:s.opacity((f.line||{}).color)&&(H=f.line.color),r.extendFlat(t,{distance:o.MAXDIST+10,x0:R,x1:j,y0:B,y1:B,color:H}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":25,"../../components/errorbars":54,"../../lib":103,"../../plots/cartesian/constants":129,"../../plots/cartesian/graph_interact":131,"./get_trace_color":245}],247:[function(t,e,n){"use strict";var r={},a=t("./subtypes");r.hasLines=a.hasLines,r.hasMarkers=a.hasMarkers,r.hasText=a.hasText,r.isBubble=a.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"./arrays_to_calcdata":236,"./attributes":237,"./calc":238,"./clean_data":239,"./colorbar":240,"./defaults":243,"./hover":246,"./plot":253,"./select":254,"./style":255,"./subtypes":256}],248:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,n,o,i){var l=(t.marker||{}).color;if(i("line.color",n),r(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{var s=(Array.isArray(l)?!1:l)||n;i("line.color",s)}i("line.width"),i("line.dash")}},{"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38}],249:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes");e.exports=function(t,e){function n(e){var n=w.c2p(t[e].x),r=k.c2p(t[e].y);return n===z||r===z?!1:[n,r]}function a(t){var e=t[0]/w._length,n=t[1]/k._length;return(1+10*Math.max(0,-e,e-1,-n,n-1))*A}function o(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}var i,l,s,c,u,f,d,h,p,g,m,v,y,x,b,_,w=e.xaxis,k=e.yaxis,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],z=r.BADNUM,S=.2,C=new Array(t.length),E=0;for(i=0;ia(f))break;s=f,y=g[0]*p[0]+g[1]*p[1],y>m?(m=y,c=f,h=!1):v>y&&(v=y,u=f,h=!0)}if(h?(C[E++]=c,s!==u&&(C[E++]=u)):(u!==l&&(C[E++]=u),s!==c&&(C[E++]=c)),C[E++]=s,i>=t.length||!f)break;C[E++]=f,l=f}}else C[E++]=c}L.push(C.slice(0,E))}return L}},{"../../plots/cartesian/axes":124}],250:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=n("line.shape");"spline"===r&&n("line.smoothing")}},{}],251:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t){var e=t.marker,n=e.sizeref||1,a=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/n)}:function(t){return t/n};return function(t){var e=o(t/2);return r(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":17}],252:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,n,l,s){var c,u=i.isBubble(t),f=(t.line||{}).color;f&&(n=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",n),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c=f&&!Array.isArray(f)&&e.marker.color!==f?f:u?r.background:r.defaultLine,s("marker.line.color",c),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode"))}},{"../../components/color":25,"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38,"./subtypes":256}],253:[function(t,e,n){"use strict";function r(t,e,n){var r=e.x(),o=e.y(),i=a.extent(r.range.map(r.l2c)),l=a.extent(o.range.map(o.l2c));n.forEach(function(t,e){var r=t[0].trace;if(c.hasMarkers(r)){var a=r.marker.maxdisplayed;if(0!==a){var o=t.filter(function(t){return t.x>=i[0]&&t.x<=i[1]&&t.y>=l[0]&&t.y<=l[1]}),s=Math.ceil(o.length/a),u=0;n.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&e>n&&u++});var f=Math.round(u*s/3+Math.floor(u/3)*s/7.1);t.forEach(function(t){delete t.vis}),o.forEach(function(t,e){0===Math.round((e+f)%s)&&(t.vis=!0)})}}})}var a=t("d3"),o=t("../../lib"),i=t("../../components/drawing"),l=t("../../components/errorbars"),s=t("../../lib/polygon").tester,c=t("./subtypes"),u=t("./arrays_to_calcdata"),f=t("./line_points");e.exports=function(t,e,n){function d(t){return t.filter(function(t){return t.vis})}r(t,e,n);var h=e.x(),p=e.y(),g=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(n);g.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),g.call(l.plot,e);var m,v,y,x,b="",_=[];g.each(function(t){var e=t[0].trace,n=e.line,r=a.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=r,u(t),c.hasLines(e)||"none"!==e.fill)){var o,l,d,g,w,k="",M="";m="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?r.append("path").classed("js-fill",!0):null,x&&(y=x.datum(t)),x=r.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(n.shape)?(d=i.steps(n.shape),g=i.steps(n.shape.split("").reverse().join(""))):d=g="spline"===n.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?i.smoothclosed(t.slice(1),n.smoothing):i.smoothopen(t,n.smoothing)}:function(t){return"M"+t.join("L")},w=function(t){return g(t.reverse())};var A,T=f(t,{xaxis:h,yaxis:p,connectGaps:e.connectgaps,baseTolerance:Math.max(n.width||1,3)/4,linear:"linear"===n.shape}),L=e._polygons=new Array(T.length);for(A=0;A1&&r.append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").attr("d",o)}m?z&&C&&(v?("y"===v?z[1]=C[1]=p.c2p(0,!0):"x"===v&&(z[0]=C[0]=h.c2p(0,!0)),m.attr("d",k+"L"+C+"L"+z+"Z")):m.attr("d",k+"Z")):"tonext"===e.fill.substr(0,6)&&k&&b&&("tonext"===e.fill?y.attr("d",k+"Z"+b+"Z"):y.attr("d",k+"L"+b.substr(1)+"Z"),e._polygons=e._polygons.concat(_)),b=M,_=L}}}),g.selectAll("path:not([d])").remove(),g.append("g").attr("class","points").each(function(t){var e=t[0].trace,n=a.select(this),r=c.hasMarkers(e),l=c.hasText(e);!r&&!l||e.visible!==!0?n.remove():(r&&n.selectAll("path.point").data(e.marker.maxdisplayed?d:o.identity).enter().append("path").classed("point",!0).call(i.translatePoints,h,p),l&&n.selectAll("g").data(e.marker.maxdisplayed?d:o.identity).enter().append("g").append("text").call(i.translatePoints,h,p))})}},{"../../components/drawing":48,"../../components/errorbars":54,"../../lib":103,"../../lib/polygon":109,"./arrays_to_calcdata":236,"./line_points":249,"./subtypes":256,d3:14}],254:[function(t,e,n){"use strict";var r=t("./subtypes"),a=.2;e.exports=function(t,e){var n,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.index,p=d.marker,g=!r.hasMarkers(d)&&!r.hasText(d);if(d.visible===!0&&!g){var m=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(n=0;nn;n++)y=e.a[n],x=e.b[n],b=e.c[n],r(y)&&r(x)&&r(b)?(y=+y,x=+x,b=+b,_=m/(y+x+b),1!==_&&(y*=_,x*=_,b*=_),k=y,w=b-x,A[n]={x:w,y:k,a:y,b:x,c:b}):A[n]={x:!1,y:!1};var T,L;if(i.hasMarkers(e)&&(T=e.marker,L=T.size,Array.isArray(L))){var z={type:"linear"};a.setConvert(z),L=z.makeCalcdata(e.marker,"size"),L.length>M&&L.splice(M,L.length-M)}return l(e),void 0!==typeof L&&o.mergeArray(L,A,"ms"),A}},{"../../lib":103,"../../plots/cartesian/axes":124,"../scatter/colorscale_calc":241,"../scatter/subtypes":256,"fast-isnumeric":17}],261:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../scatter/constants"),o=t("../scatter/subtypes"),i=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,n,d){function h(n,a){return r.coerce(t,e,f,n,a)}var p,g=h("a"),m=h("b"),v=h("c");if(g?(p=g.length,m?(p=Math.min(p,m.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):m&&v&&(p=Math.min(m.length,v.length)),!p)return void(e.visible=!1);g&&p"),l}}},{"../../plots/cartesian/axes":124,"../scatter/hover":246}],263:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scatterternary",r.basePlotModule=t("../../plots/ternary"),r.categories=["ternary","symbols","markerColorscale","showLegend"],r.meta={},e.exports=r},{"../../plots/ternary":151,"../scatter/colorbar":240,"./attributes":259,"./calc":260,"./defaults":261,"./hover":262,"./plot":264,"./select":265,"./style":266}],264:[function(t,e,n){"use strict";var r=t("../scatter/plot");e.exports=function(t,e){var n=t.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var a={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:n},o=new Array(e.length),i=t.graphDiv.calcdata,l=0;ls;s++){var c=l[s],u={_fullLayout:e},f=b.coerceRef(t,r,u,c);if("path"!==i){var d=.25,h=.75;if("paper"!==f){var p=b.getFromId(u,f),g=o(p);d=g(p.range[0]+d*(p.range[1]-p.range[0])),h=g(p.range[0]+h*(p.range[1]-p.range[0]))}n(c+"0",d),n(c+"1",h)}}return"path"===i?n("path"):x.noneOrAll(t,r,["x0","x1","y0","y1"]),r}function a(t){return"category"===t.type?t.c2l:t.d2l}function o(t){return"category"===t.type?t.l2c:t.l2d}function i(t,e){t.layout.shapes=e,k.supplyLayoutDefaults(t.layout,t._fullLayout),k.drawAll(t)}function l(t){delete t.layout.shapes,t._fullLayout.shapes=[],k.drawAll(t)}function s(t,e,n){for(var r=0;re;a--)d(t,a).selectAll('[data-index="'+(a-1)+'"]').attr("data-index",a),k.draw(t,a)}function f(t,e,n,i){function l(n){var r={"data-index":e,"fill-rule":"evenodd",d:g(t,S)},a=S.line.width?S.line.color:"rgba(0,0,0,0)",o=n.append("path").attr(r).style("opacity",S.opacity).call(_.stroke,a).call(_.fill,S.fillcolor).call(w.dashLine,S.line.dash,S.line.width);C&&o.call(w.setClipUrl,"clip"+t._fullLayout._uid+C)}var s,c;d(t,e).selectAll('[data-index="'+e+'"]').remove();var u=t.layout.shapes[e];if(u){var f={xref:u.xref,yref:u.yref},p={};"string"==typeof n&&n?p[n]=i:x.isPlainObject(n)&&(p=n);var m=Object.keys(p);for(s=0;ss;s++){var k=y[s];if(void 0===p[k]&&void 0!==u[k]){var M,A=k.charAt(0),T=b.getFromId(t,b.coerceRef(f,{},t,A)),L=b.getFromId(t,b.coerceRef(u,{},t,A)),z=u[k];void 0!==p[A+"ref"]&&(T?(M=a(T)(z),z=(M-T.range[0])/(T.range[1]-T.range[0])):z=(z-L.domain[0])/(L.domain[1]-L.domain[0]),L?(M=L.range[0]+z*(L.range[1]-L.range[0]),z=o(L)(M)):z=T.domain[0]+z*(T.domain[1]-T.domain[0])),u[k]=z}}var S=r(u,t._fullLayout);t._fullLayout.shapes[e]=S;var C;if("below"!==S.layer)C=(S.xref+S.yref).replace(/paper/g,""),l(t._fullLayout._shapeUpperLayer);else if("paper"===S.xref&&"paper"===S.yref)C="",l(t._fullLayout._shapeLowerLayer);else{var E,O=t._fullLayout._plots||{},P=Object.keys(O);for(s=0,c=P.length;c>s;s++)E=O[P[s]],C=P[s],h(t,S,E)&&l(E.shapelayer)}}}function d(t,e){var n=t._fullLayout.shapes[e],r=t._fullLayout._shapeUpperLayer;return n?"below"===n.layer&&(r="paper"===n.xref&&"paper"===n.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):x.log("getShapeLayer: undefined shape: index",e),r}function h(t,e,n){var r=y.Axes.getFromId(t,n.id,"x")._id,a=y.Axes.getFromId(t,n.id,"y")._id,o="below"===e.layer,i=r===e.xref||a===e.yref,l=!!n.shapelayer;return o&&i&&l}function p(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}}function g(t,e){var n,r,o,i,l=e.type,s=b.getFromId(t,e.xref),c=b.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(n=a(s),r=function(t){return s._offset+s.l2p(n(t,!0))}):r=function(t){return u.l+u.w*t},c?(o=a(c),i=function(t){return c._offset+c.l2p(o(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===l)return s&&"date"===s.type&&(r=p(r)),c&&"date"===c.type&&(i=p(i)),k.convertPath(e.path,r,i);var f=r(e.x0),d=r(e.x1),h=i(e.y0),g=i(e.y1);if("line"===l)return"M"+f+","+h+"L"+d+","+g;if("rect"===l)return"M"+f+","+h+"H"+d+"V"+g+"H"+f+"Z";var m=(f+d)/2,v=(h+g)/2,y=Math.abs(m-f),x=Math.abs(v-h),_="A"+y+","+x,w=m+y+","+v,M=m+","+(v-x);return"M"+w+_+" 0 1,1 "+M+_+" 0 0,1 "+w+"Z"}function m(t,e,n,r,a){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(n)];if(r){var i,l,s,c,u,f=1/0,d=-(1/0),h=r.match(M);for("date"===t.type&&(o=p(o)),i=0;iu&&(f=u),u>d&&(d=u)));return d>=f?[f,d]:void 0}}var v=t("fast-isnumeric"),y=t("../../plotly"),x=t("../../lib"),b=t("../../plots/cartesian/axes"),_=t("../color"),w=t("../drawing"),k=(t("../dragelement"),t("../../lib/setcursor"),e.exports={});k.layoutAttributes=t("./attributes"),k.supplyLayoutDefaults=function(t,e){for(var n=t.shapes||[],a=e.shapes=[],o=0;ol&&(t="X"),t});return r>l&&(s=s.replace(/[\s,]*X.*/,""),x.log("Ignoring extra params in segment "+t)),a+s})},k.calcAutorange=function(t){var e,n,r,a,o,i=t._fullLayout,l=i.shapes;if(l.length&&t._fullData.length)for(e=0;ed?n=d:(u.left-=x.offsetLeft,u.right-=x.offsetLeft,u.top-=x.offsetTop,u.bottom-=x.offsetTop,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(n=Math.max(n,i*(t[x.side]-u[o])+c))}),n=Math.min(d,n)),n>0||0>d){var h={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[x.side];e.attr("transform","translate("+h+")")}}}function p(){L=0,z=!0,S=E,k._infolayer.select("."+e).attr({"data-unformatted":S}).text(S).on("mouseover.opacity",function(){r.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(1e3).style("opacity",0)})}var g=n.propContainer,m=n.propName,v=n.traceIndex,y=n.dfltName,x=n.avoid||{},b=n.attributes,_=n.transform,w=n.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,z=!1,S=g.title.trim();""===S&&(L=0),S.match(/Click to enter .+ title/)&&(L=.2,z=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(S).attr("class",e),C.attr({"data-unformatted":S}).call(f);var E="Click to enter "+y+" title",O=t._context.editable;O&&(g===k?O=t._context.editableMainTitle:g===k.xaxis?O=t._context.editableAxisXTitle:g===k.yaxis?O=t._context.editableAxisYTitle:g===k.yaxis2?O=t._context.editableAxisY2Title:g===k.xaxis2&&(O=t._context.editableAxisX2Title)),O?(S||p(),C.call(u.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,m,e,v):o.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):S&&!S.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",z),g._titleElement=C}},{"../../lib":103,"../../lib/svg_text_utils":114,"../../plotly":121,"../../plots/plots":144,"../color":25,"../drawing":48,d3:14,"fast-isnumeric":17}],89:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i={_isLinkedToArray:!0,method:{valType:"enumerated",values:["restyle","relayout"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:!0,visible:{valType:"boolean"},active:{valType:"integer",min:-1,dflt:0},buttons:i,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:"bottom"},font:o({},r,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":101,"../../plots/font_attributes":142,"../color/attributes":24}],90:[function(t,e,n){"use strict";e.exports={name:"updatemenus",itemName:"updatemenu",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",buttonGroupClassName:"updatemenu-button-group",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],91:[function(t,e,n){"use strict";function r(t,e,n){function r(n,r){return o.coerce(t,e,i,n,r)}var l=a(t,e),s=r("visible",l.length>0);s&&(r("active"),r("x"),r("y"),o.noneOrAll(t,e,["x","y"]),r("xanchor"),r("yanchor"),o.coerceFont(r,"font",n.font),r("bgcolor",n.paper_bgcolor),r("bordercolor"),r("borderwidth"))}function a(t,e){function n(t,e){return o.coerce(r,a,c,t,e)}for(var r,a,i=t.buttons||[],l=e.buttons=[],s=0;s0?[0]:[]);if(s.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),s.exit().remove(),s.exit().size()&&v(t),0!==n.length){var c=s.selectAll("g."+T.headerGroupClassName).data(n,a);c.enter().append("g").classed(T.headerGroupClassName,!0);var u=s.selectAll("g."+T.buttonGroupClassName).data([0]);u.enter().append("g").classed(T.buttonGroupClassName,!0).style("pointer-events","all"),c.enter().size()&&u.call(m).attr(T.menuIndexAttrName,"-1"),c.exit().each(function(e){y.select(this).remove(),u.call(m).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var f=0;f",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],95:[function(t,e,n){"use strict";n.xmlns="http://www.w3.org/2000/xmlns/",n.svg="http://www.w3.org/2000/svg",n.xlink="http://www.w3.org/1999/xlink",n.svgAttrs={xmlns:n.svg,"xmlns:xlink":n.xlink}},{}],96:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.16.3-d17",n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.extendTraces=r.extendTraces,n.prependTraces=r.prependTraces,n.addTraces=r.addTraces,n.deleteTraces=r.deleteTraces,n.moveTraces=r.moveTraces,n.purge=r.purge,n.setPlotConfig=t("./plot_api/set_plot_config"),n.register=r.register,n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=r.Fx,n.Snapshot=r.Snapshot,n.PlotSchema=r.PlotSchema,n.Queue=r.Queue,n.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":118,"./plot_api/to_image":119,"./plot_api/validate":120,"./plotly":121,"./snapshot/download":159,d3:14}],97:[function(t,e,n){"use strict";"undefined"!=typeof MathJax?(n.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):n.MathJax=!1},{}],98:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("./nested_property"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);n.valObjects={data_array:{coerceFunction:function(t,e,n){Array.isArray(t)?e.set(t):void 0!==n&&e.set(n)}},enumerated:{coerceFunction:function(t,e,n,r){r.coerceNumber&&(t=+t),-1===r.values.indexOf(t)?e.set(n):e.set(t)}},"boolean":{coerceFunction:function(t,e,n){t===!0||t===!1?e.set(t):e.set(n)}},number:{coerceFunction:function(t,e,n,a){!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},integer:{coerceFunction:function(t,e,n,a){t%1||!r(t)||void 0!==a.min&&ta.max?e.set(n):e.set(+t)}},string:{coerceFunction:function(t,e,n,r){if("string"!=typeof t){var a="number"==typeof t;r.strict!==!0&&a?e.set(String(t)):e.set(n)}else r.noBlank&&!t?e.set(n):e.set(t)}},color:{coerceFunction:function(t,e,n){a(t).isValid()?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,n){e.set(i(t,n))}},angle:{coerceFunction:function(t,e,n){"auto"===t?e.set("auto"):r(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){var r=n.length;return"string"==typeof t&&t.substr(0,r)===n&&l.test(t.substr(r))?void e.set(t):void e.set(n)},validateFunction:function(t,e){var n=e.dflt,r=n.length;return t===n?!0:"string"!=typeof t?!1:!(t.substr(0,r)!==n||!l.test(t.substr(r)))}},flaglist:{coerceFunction:function(t,e,n,r){if("string"!=typeof t)return void e.set(n);if(-1!==(r.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),o=0;o2)return!1;var s=i[0].split("-");if(s.length>3||3!==s.length&&i[1])return!1;if(4===s[0].length)n=Number(s[0]);else{if(2!==s[0].length)return!1;var c=(new Date).getFullYear();n=((Number(s[0])-c+70)%100+200)%100+c-70}return l(n)?1===s.length?new Date(n,0,1).getTime():(r=Number(s[1])-1,s[1].length>2||!(r>=0&&11>=r)?!1:2===s.length?new Date(n,r,1).getTime():(a=Number(s[2]),s[2].length>2||!(a>=1&&31>=a)?!1:(a=new Date(n,r,a).getTime(),i[1]?(s=i[1].split(":"),s.length>3?!1:(o=Number(s[0]),s[0].length>2||!(o>=0&&23>=o)?!1:(a+=36e5*o,1===s.length?a:(r=Number(s[1]),s[1].length>2||!(r>=0&&59>=r)?!1:(a+=6e4*r,2===s.length?a:(t=Number(s[2]),t>=0&&60>t?a+1e3*t:!1)))))):a))):!1},n.isDateTime=function(t){return n.dateTime2ms(t)!==!1},n.ms2DateTime=function(t,e){if("undefined"==typeof i)return void s.error("d3 is not defined.");e||(e=0);var n=new Date(t),a=i.time.format("%Y-%m-%d")(n);return 7776e6>e?(a+=" "+r(n.getHours(),2),432e6>e&&(a+=":"+r(n.getMinutes(),2),108e5>e&&(a+=":"+r(n.getSeconds(),2),3e5>e&&(a+="."+r(n.getMilliseconds(),3)))),a.replace(/([:\s]00)*\.?[0]*$/,"")):a};var c={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},f=i.time.format.utc,d={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(f),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(f)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(f)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){d[t].D.push(f(e)),["H","I","D"].forEach(function(n){c[n].forEach(function(r){var a=d[t][n];a.push(f(e+"~"+r)),a.push(f(r+"~"+e))})})})});var h=/[a-z]*/g,p=function(t){return t.substr(0,3)},g=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,m=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},x=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,k=/q([1-4])/,M=["31~mar","30~jun","30~sep","31~dec"],A=function(t,e){return M[e-1]; +},T=/ ?([+\-]\d\d:?\d\d|Z)$/;n.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(h,p).replace(g,"").replace(m,"~").replace(v,y).replace(k,A).trim().replace(T,"");var e,n,r=null,i=a(t),l=o(t);e=d[i][l],n=e.length;for(var s=0;n>s&&!(r=e[s].parse(t));s++);if(!(r instanceof Date))return!1;var c=r.getTimezoneOffset();return r.setTime(r.getTime()+60*c*1e3),r}},{"../lib":103,d3:14,"fast-isnumeric":17}],100:[function(t,e,n){"use strict";var r=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof r)return t;var e=new r;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(n,r){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,r),e.emit(n,r)},t},triggerHandler:function(t,e,n){var r,a;"undefined"!=typeof jQuery&&(r=jQuery(t).triggerHandler(e,n));var o=t._ev;if(!o)return r;var i=o._events[e];if(!i)return r;"function"==typeof i&&(i=[i]);for(var l=i.pop(),s=0;sv;v++){s=t[v];for(c in s)u=g[c],f=s[c],l&&i(f)?g[c]=f:e&&f&&(o(f)||(d=i(f)))?(d?(d=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},g[c]=a([h,f],e,n,l)):("undefined"!=typeof f||n)&&(g[c]=f)}return g}var o=t("./is_plain_object.js"),i=Array.isArray;n.extendFlat=function(){return a(arguments,!1,!1,!1)},n.extendDeep=function(){return a(arguments,!0,!1,!1)},n.extendDeepAll=function(){return a(arguments,!0,!0,!1)},n.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":104}],102:[function(t,e,n){"use strict";e.exports=function(t){for(var e=[],n=0;nn?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},a.bBoxIntersect=function(t,e,n){return n=n||0,t.left<=e.right+n&&e.left<=t.right+n&&t.top<=e.bottom+n&&e.top<=t.bottom+n},a.identity=function(t){return t},a.randstr=function d(t,e,n){if(n||(n=16),void 0===e&&(e=24),0>=e)return"0";var r,a,o,i=Math.log(Math.pow(2,e))/Math.log(n),l="";for(r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var s=i-Math.floor(i);for(r=0;r-1||c!==1/0&&c>=Math.pow(2,e)?d(t,e,n):l},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={};return n.optionList=[],n._newoption=function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)},n["_"+e]=t,n},a.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var n,r,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(n=0;s>n;n++)c[n]=(1-Math.cos(Math.PI*(n+1)/e))/(2*e);for(n=0;i>n;n++){for(o=0,r=0;s>r;r++)a=n+r+1-e,-i>a?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),0>a?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},a.syncOrAsync=function(t,e,n){function r(){return a.syncOrAsync(t,e,n)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],o=i(e),o&&o.then)return o.then(r).then(void 0,a.promiseError);return n&&n(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,n){if(t){var r,a,o=!1,i=!0;for(r=0;ra;a++)e[a][n]=t[a]},a.minExtend=function(t,e){var n={};"object"!=typeof e&&(e={});var r,o,i,l=3,s=Object.keys(t);for(r=0;r1?r+o[1]:"";if(a&&(o.length>1||i.length>4))for(;n.test(i);)i=i.replace(n,"$1"+a+"$2");return i+l}},{"./coerce":98,"./dates":99,"./extend":101,"./is_plain_object":104,"./loggers":105,"./matrix":106,"./nested_property":107,"./notifier":108,"./search":111,"./stats":113,d3:14}],104:[function(t,e,n){"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}},{}],105:[function(t,e,n){"use strict";var r=t("../plot_api/plot_config"),a=e.exports={};a.log=function(){if(r.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;er;r++)n[r]=new Array(e);return n},n.transposeRagged=function(t){var e,n,r=0,a=t.length;for(e=0;a>e;e++)r=Math.max(r,t[e].length);var o=new Array(r);for(e=0;r>e;e++)for(o[e]=new Array(a),n=0;a>n;n++)o[e][n]=t[n][e];return o},n.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var r,a,o=t.length;if(t[0].length)for(r=new Array(o),a=0;o>a;a++)r[a]=n.dot(t[a],e);else if(e[0].length){var i=n.transposeRagged(e);for(r=new Array(i.length),a=0;aa;a++)r+=t[a]*e[a];return r},n.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},n.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},n.rotationXYMatrix=function(t,e,r){return n.dot(n.dot(n.translationMatrix(e,r),n.rotationMatrix(t)),n.translationMatrix(-e,-r))},n.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var r=1===arguments.length?e[0]:[e[0],e[1]];return n.dot(t,[r[0],r[1],1]).slice(0,2)}},n.apply2DTransform2=function(t){var e=n.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],107:[function(t,e,n){"use strict";function r(t,e){return function(){var n,a,o,i,l,s=t;for(i=0;i=0;e--){if(r=t[e],i=!1,Array.isArray(r))for(n=r.length-1;n>=0;n--)c(r[n])?i?r[n]=void 0:r.pop():i=!0;else if("object"==typeof r&&null!==r)for(o=Object.keys(r),i=!1,n=o.length-1;n>=0;n--)c(r[o[n]])&&!a(r[o[n]],o[n])?delete r[o[n]]:i=!0;if(i)return}}function c(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function u(t,e,n){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:n,obj:t}}var f=t("fast-isnumeric");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var n,a,i,l=0,s=e.split(".");ln||n>o||i>r||r>l?!1:!e||!c(t)}function n(t,e){var n=t[0],s=t[1];if(a>n||n>o||i>s||s>l)return!1;var c,u,f,d,h,p=r.length,g=r[0][0],m=r[0][1],v=0;for(c=1;p>c;c++)if(u=g,f=m,g=r[c][0],m=r[c][1],d=Math.min(u,g),!(d>n||n>Math.max(u,g)||s>Math.max(f,m)))if(s=s&&n!==d&&v++}return v%2===1}var r=t.slice(),a=r[0][0],o=a,i=r[0][1],l=i;r.push(r[0]);for(var s=1;so;o++)if(i=[t[o][0]-s[0],t[o][1]-s[1]],l=r(i,c),0>l||l>u||Math.abs(r(i,d))>a)return!0;return!1};a.filter=function(t,e){function n(n){t.push(n);var l=r.length,s=a;r.splice(i+1);for(var c=s+1;c1){var l=t.pop();n(l)}return{addPt:n,raw:t,filtered:r}}},{"./matrix":106}],110:[function(t,e,n){"use strict";function r(t,e){for(var n,r=[],o=0;oo.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,n;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;nt}function a(t,e){return e>=t}function o(t,e){return t>e}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("../lib");n.findBin=function(t,e,n){if(l(e.start))return n?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?n?r:a:n?i:o;d>f&&h++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return h>90&&s.log("Long binary search..."),f-1},n.sorterAsc=function(t,e){return t-e},n.sorterDes=function(t,e){return e-t},n.distinctVals=function(t){var e=t.slice();e.sort(n.sorterAsc);for(var r=e.length-1,a=e[r]-e[0]||1,o=a/(r||1)/1e4,i=[e[0]],l=0;r>l;l++)e[l+1]>e[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},n.roundUp=function(t,e,n){for(var r,a=0,o=e.length-1,i=0,l=n?0:1,s=n?1:0,c=n?Math.ceil:Math.floor;o>a&&i++<100;)r=c((a+o)/2),e[r]<=t?a=r+l:o=r-s;return e[a]}},{"../lib":103,"fast-isnumeric":17}],112:[function(t,e,n){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],113:[function(t,e,n){"use strict";var r=t("fast-isnumeric");n.aggNums=function(t,e,a,o){var i,l;if(o||(o=a.length),r(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(o),i=0;o>i;i++)l[i]=n.aggNums(t,e,a[i]);a=l}for(i=0;o>i;i++)r(e)?r(a[i])&&(e=t(+e,+a[i])):e=a[i];return e},n.len=function(t){return n.aggNums(function(t){return t+1},0,t)},n.mean=function(t,e){return e||(e=n.len(t)),n.aggNums(function(t,e){return t+e},0,t)/e},n.variance=function(t,e,a){return e||(e=n.len(t)),r(a)||(a=n.mean(t,e)),n.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},n.stdev=function(t,e,r){return Math.sqrt(n.variance(t,e,r))},n.interp=function(t,e){if(!r(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var n=e%1;return n*t[Math.ceil(e)]+(1-n)*t[Math.floor(e)]}},{"fast-isnumeric":17}],114:[function(t,e,n){"use strict";function r(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,n){var r="math-output-"+d.randstr([],64),o=f.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())d.log("There was an error in the tex syntax.",t),n();else{var r=o.select("svg").node().getBoundingClientRect();n(o.select(".MathJax_SVG"),e,r)}o.remove()})}function i(t,e){for(var n=t||"",r=0;r]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),a=g[r];if(void 0!==a){var o=e[1],i=e[3],l=i.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(o)return"
";if("href"!==i.substr(0,4).toLowerCase())return"";var c=i.substr(4).replace(/["']/g,"").replace(/=/,""),u=document.createElement("a");return u.href=c,-1===m.indexOf(u.protocol)?"":''}if("br"===r)return"
";if(o)return"sup"===r?'':"sub"===r?'':"";var f=""}return n.xml_entity_encode(t).replace(/");a>0;a=e.indexOf("
",a+1))r.push(a);var o=0;r.forEach(function(t){for(var n=t+o,r=e.slice(0,n),a="",i=r.length-1;i>=0;i--){var l=r[i].match(/<(\/?).*>/i);if(l&&"
"!==r[i]){l[1]||(a=r[i]);break}}a&&(e.splice(n+1,0,a),e.splice(n,0,""),o+=2)});var i=e.join(""),c=i.split(/
/gi);return c.length>1&&(e=c.map(function(t,e){return''+t+""})),e.join("")}function u(t,e,n){var r,a,o,i=n.horizontalAlign,l=n.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-r.height}:"middle"===l?function(){return s.top+(s.height-r.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-r.width}:"center"===i?function(){return s.left+(s.width-r.width)/2}:function(){return s.left},function(){return r=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),h=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");f.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),n=(new DOMParser).parseFromString(e,"application/xml"),r=n.documentElement.firstChild;r;)this.node().appendChild(this.node().ownerDocument.importNode(r,!0)),r=r.nextSibling;return n.querySelector("parsererror")?(d.log(n.querySelector("parsererror div").textContent),null):f.select(this.node().lastChild)},n.html_entity_decode=function(t){var e=f.select("body").append("div").style({display:"none"}).html(""),n=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),n},n.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},n.convertToTspans=function(t,e){function n(){h.empty()||(p=l.attr("class")+"-math",h.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,h=f.select(l.node().parentNode);if(!h.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var m=d.getPlotDiv(l.node());(m&&m._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return n(),void t();var c=h.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var f=r(s,"width"),d=r(s,"height"),g=+l.attr("x")-f*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],m=parseInt(l.style("font-size"),10)||r(l,"height"),v=-m/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-f/2,v-d/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:v-d/2}):"a"===p[0]?s.attr({x:0,y:v}):s.attr({x:g,y:+l.attr("y")+v-d/2}),e&&e.call(l,c),t(c)})}))}else n();return t}};var g={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},m=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),x=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}});n.plainText=function(t){return(t||"").replace(v," ")},n.makeEditable=function(t,e,n){function r(){o(),i.style({opacity:0});var t,e=c.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}function o(){var t=f.select(d.getPlotDiv(i.node())),e=t.select(".svg-container"),r=e.append("div");r.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:n.fill||i.style("fill")||"black",opacity:1,"background-color":n.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(n.text||i.attr("data-unformatted")).call(u(i,e,n)).on("blur",function(){i.text(this.textContent).style({opacity:1});var t,e=f.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&f.select(i.node().parentNode).select(t).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(i,n)}).on("focus",function(){var t=this;f.select(document).on("mouseup",function(){return f.event.target===t?!1:void(document.activeElement===r.node()&&r.node().blur())})}).on("keyup",function(){27===f.event.which?(i.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),f.select(this).call(u(i,e,n)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(a)}n||(n={});var i=this,l=f.dispatch("edit","input","cancel"),s=f.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),n.immediate?r():c.on("click",r),f.rebind(this,l,"on")}},{"../constants/string_mappings":94,"../constants/xmlns_namespaces":95,"../lib":103,d3:14}],115:[function(t,e,n){"use strict";function r(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function a(t){Array.isArray(t._promises)&&t._promises.length>0&&N.log("Clearing previous rejected promises from queue."),t._promises=[]}function o(t,e){t._fullLayout._paperdiv.style("background","white"),P.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=N.extendFlat({},P.defaultConfig));var n=t._context;e&&(Object.keys(e).forEach(function(t){t in n&&("setBackground"===t&&"opaque"===e[t]?n[t]=o:n[t]=e[t])}),e.plot3dPixelRatio&&!n.plotGlPixelRatio&&(n.plotGlPixelRatio=n.plot3dPixelRatio)),n.staticPlot&&(n.editable=!1,n.autosizable=!1,n.scrollZoom=!1,n.doubleClick=!1,n.showTips=!1,n.showLink=!1,n.displayModeBar=!1)}function l(t,e,n){var r=C.select(t).selectAll(".plot-container").data([0]);r.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=r.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e),n&&(t.layout=n),P.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(k(t,{}),t._fullLayout.autosize=n.autosize=!0),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=P.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),i=1,l=t._fullLayout.title;""!==l&&l||(i=0);var s="Click to enter title",c=function(){this.call(P.util.convertToTspans)},u=o.select(".title-group text").call(c);if(t._context.editable){u.attr({"data-unformatted":l}),l&&l!==s||(i=.2,u.attr({"data-unformatted":s}).text(s).style({opacity:i}).on("mouseover.opacity",function(){C.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){C.select(this).transition().duration(1e3).style("opacity",0)}));var f=function(){this.call(P.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(c),this.call(f)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(c)})};u.call(f)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),R.addLinks(t),Promise.resolve()}function s(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);var r=P.Axes.list({_fullLayout:t});for(e=0;ee;e++){var i=t.annotations[e];i.ref&&("paper"===i.ref?(i.xref="paper",i.yref="paper"):"data"===i.ref&&(i.xref="x",i.yref="y"),delete i.ref),c(i,"xref"),c(i,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(N.warn("Shapes must be an array."),delete t.shapes);var l=(t.shapes||[]).length;for(e=0;l>e;e++){var s=t.shapes[e];c(s,"xref"),c(s,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var f=R.getSubplotIds(t,"gl3d");for(e=0;en;++n)x[n]=m[e]+v*y[2+4*n];h.camera={eye:{x:x[0],y:x[1],z:x[2]},center:{x:m[0],y:m[1],z:m[2]},up:{x:y[1],y:y[5],z:y[9]}},delete h.cameraposition}}return F.clean(t),t}function c(t,e){var n=t[e],r=e.charAt(0);n&&"paper"!==n&&(t[e]=P.Axes.cleanId(n,r))}function u(t,e){for(var n=[],r=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),a=0;ao&&(l=N.randstr(r),-1!==n.indexOf(l));o++);i.uid=N.randstr(r),r.push(i.uid)}if(n.push(i.uid),"histogramy"===i.type&&"xbins"in i&&!("ybins"in i)&&(i.ybins=i.xbins,delete i.xbins),i.error_y&&"opacity"in i.error_y){var s=F.defaults,c=i.error_y.color||(R.traceIs(i,"bar")?F.defaultLine:s[a%s.length]);i.error_y.color=F.addOpacity(F.rgb(c),F.opacity(c)*i.error_y.opacity),delete i.error_y.opacity}if("bardir"in i&&("h"!==i.bardir||!R.traceIs(i,"bar")&&"histogram"!==i.type.substr(0,9)||(i.orientation="h",_(i)),delete i.bardir),"histogramy"===i.type&&_(i),"histogramx"!==i.type&&"histogramy"!==i.type||(i.type="histogram"),"scl"in i&&(i.colorscale=i.scl,delete i.scl),"reversescl"in i&&(i.reversescale=i.reversescl,delete i.reversescl),i.xaxis&&(i.xaxis=P.Axes.cleanId(i.xaxis,"x")),i.yaxis&&(i.yaxis=P.Axes.cleanId(i.yaxis,"y")),R.traceIs(i,"gl3d")&&i.scene&&(i.scene=R.subplotsRegistry.gl3d.cleanId(i.scene)),R.traceIs(i,"pie")||(Array.isArray(i.textposition)?i.textposition=i.textposition.map(f):i.textposition&&(i.textposition=f(i.textposition))),R.traceIs(i,"2dMap")&&("YIGnBu"===i.colorscale&&(i.colorscale="YlGnBu"),"YIOrRd"===i.colorscale&&(i.colorscale="YlOrRd")),R.traceIs(i,"markerColorscale")&&i.marker){var u=i.marker;"YIGnBu"===u.colorscale&&(u.colorscale="YlGnBu"),"YIOrRd"===u.colorscale&&(u.colorscale="YlOrRd")}if("surface"===i.type&&N.isPlainObject(i.contours)){var h=["x","y","z"];for(o=0;or?o.push(a+r):o.push(r);return o}function g(t,e,n){var r,a;for(r=0;r=t.data.length||a<-t.data.length)throw new Error(n+" must be valid indices for gd.data.");if(e.indexOf(a,r+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||0>a&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+n+" must be unique.")}}function m(t,e,n){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]),g(t,e,"currentIndices"),"undefined"==typeof n||Array.isArray(n)||(n=[n]),"undefined"!=typeof n&&g(t,n,"newIndices"),"undefined"!=typeof n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,n){var r,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),r=0;r=0&&s0){var l=w(t._boundingBoxMargins),s=l.left+l.right,c=l.bottom+l.top,u=o._container.node().getBoundingClientRect(),f=1-2*i.frameMargins;a=Math.round(f*(u.width-s)),r=Math.round(f*(u.height-c))}else n=window.getComputedStyle(t),r=parseFloat(n.height)||o.height,a=parseFloat(n.width)||o.width;return Math.abs(o.width-a)>1||Math.abs(o.height-r)>1?(o.height=t.layout.height=r,o.width=t.layout.width=a):"initial"!==o.autosize&&(delete e.autosize,o.autosize=t.layout.autosize=!0),R.sanitizeMargins(o),e}function M(t){var e=C.select(t),n=t._fullLayout;if(n._container=e.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===n.autosize&&(k(t,{}),n.autosize=!0,t.layout.autosize=!0),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([0]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._geocontainer=n._paperdiv.selectAll(".geo-container").data([0]),n._geocontainer.enter().append("div").classed("geo-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var r=[];C.selectAll("defs").each(function(){this.id&&r.push(this.id.split("-")[1])}),n._uid=N.randstr(r)}n._paperdiv.selectAll(".main-svg").attr(Q.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._draggers=n._paper.append("g").classed("draglayer",!0);var a=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=a.append("g").classed("imagelayer",!0),n._shapeLowerLayer=a.append("g").classed("shapelayer",!0);var o=P.Axes.getSubplots(t);o.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&A(t,o),n._has("cartesian")&&T(t,o),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0);var i=n._paper.selectAll(".layer-subplot");n._imageSubplotLayer=i.selectAll(".imagelayer"),n._shapeSubplotLayer=i.selectAll(".shapelayer");var l=n._paper.append("g").classed("layer-above",!0);n._imageUpperLayer=l.append("g").classed("imagelayer",!0),n._shapeUpperLayer=l.append("g").classed("shapelayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0),n._geoimages=n._paper.append("g").classed("geoimages",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var s=N.syncOrAsync([L,function(){return P.Axes.doTicks(t,"redraw")},j.init],t);return s&&s.then&&t._promises.push(s),s}function A(t,e){function n(e,n){return function(){return P.Axes.getFromId(t,e,n)}}for(var r,a,o=t._fullLayout._plots={},i=0;i0,_=P.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),k=w===_;b?t.framework===M&&!x&&k||(t.framework=M,M(t)):k?x&&M(t):(t.framework=M,M(t)),x&&P.Axes.saveRangeInitial(t);var A=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&h(t);for(var z=0;zG.range[0]?[1,2]:[2,1]);else{var Q=G.range[0],W=G.range[1];"log"===j?(0>=Q&&0>=W&&o(U+".autorange",!0),0>=Q?Q=W/1e6:0>=W&&(W=Q/1e6),o(U+".range[0]",Math.log(Q)/Math.LN10),o(U+".range[1]",Math.log(W)/Math.LN10)):(o(U+".range[0]",Math.pow(10,Q)),o(U+".range[1]",Math.pow(10,W)))}else o(U+".autorange",!0)}if("reverse"===B)Y.range?Y.range.reverse():(o(U+".autorange",!0),Y.range=[1,0]),X.autorange?w=!0:_=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var J=D.parts[1],K=D.parts[0],tt=g[K]||[],et=P[N.titleCase(K)],nt=tt[J]||{};2===D.parts.length&&("add"===v[E]||N.isPlainObject(v[E])?z[E]="remove":"remove"===v[E]?-1===J?(z[K]=tt,delete z[E]):z[E]=nt:N.log("???",v)),!i(nt,"x")&&!i(nt,"y")||N.containsAny(E,["color","opacity","align","dash"])||(w=!0),et.draw(t,J,D.parts.slice(2).join("."),v[E]),delete v[E]}else if("images"===D.parts[0]){var at=N.objectFromPath(E,j);N.extendDeepAll(t.layout,at),H.supplyLayoutDefaults(t.layout,t._fullLayout),H.draw(t)}else if("mapbox"===D.parts[0]&&"layers"===D.parts[1]){N.extendDeepAll(t.layout,N.objectFromPath(E,j));var ot=(t._fullLayout.mapbox||{}).layers||[];for(O=D.parts[2]+1-ot.length,p=0;O>p;p++)ot.push({});_=!0}else if("updatemenus"===D.parts[0]){N.extendDeepAll(t.layout,N.objectFromPath(E,j));var it=t._fullLayout.updatemenus||[];for(O=D.parts[2]+1-it.length,p=0;O>p;p++)it.push({});_=!0}else 0===D.parts[0].indexOf("scene")?_=!0:0===D.parts[0].indexOf("geo")?_=!0:0===D.parts[0].indexOf("ternary")?_=!0:!m._has("gl2d")||-1===E.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===E?w=!0:-1!==D.parts[0].indexOf("legend")?y=!0:-1!==E.indexOf("title")?x=!0:-1!==D.parts[0].indexOf("bgcolor")?b=!0:D.parts.length>1&&N.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?x=!0:-1!==E.indexOf(".linewidth")&&-1!==E.indexOf("axis")?x=b=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?b=!0:D.parts.length>1&&"mirror"===D.parts[1]?x=b=!0:"margin.pad"===E?x=b=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||E.match(/^(bar|box|font)/)?w=!0:-1!==["hovermode","dragmode"].indexOf(E)?M=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(E)&&(_=!0):_=!0, +D.set(j)}I.add(t,rt,[t,z],rt,[t,T]),v.autosize&&(v=k(t,v)),(v.height||v.width||v.autosize)&&(w=!0);var lt=Object.keys(v),st=[R.previousPromises];if(_||w)st.push(function(){return t.layout=void 0,w&&(t.calcdata=void 0),P.plot(t,"",g)});else if(lt.length&&(R.supplyDefaults(t),m=t._fullLayout,y&&st.push(function(){return V.draw(t),R.previousPromises(t)}),b&&st.push(L),x&&st.push(function(){return P.Axes.doTicks(t,"redraw"),S(t),R.previousPromises(t)}),M)){var ct;for($(t),P.Fx.supplyLayoutDefaults(t.layout,m,t._fullData),P.Fx.init(t),ct=R.getSubplotIds(m,"gl3d"),p=0;p1)};c(n.width)&&c(n.height)||l(new Error("Height and width should be pixel values."));var u=r.clone(e,{format:"png",height:n.height,width:n.width}),f=u.td;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=r.getRedrawFunc(f);o.plot(f,u.data,u.layout,u.config).then(d).then(s).then(function(e){t(e)}).catch(function(t){l(t)})});return l}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib");e.exports=r},{"../lib":103,"../plotly":121,"../snapshot":161,"fast-isnumeric":17}],120:[function(t,e,n){"use strict";function r(t,e,n,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,m=n.length,v=0;m>v;v++){var y=n[v],x=["data",v];if(p(y)){var b=u[v],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&s.push(i("invisible",x)),r(y,b,w,s,x);var k=y.transforms,M=b.transforms;if(k){g(k)||s.push(i("array",x,["transforms"])),x.push("transforms");for(var A=0;Ac&&u>e&&(void 0===a[n]?o[f]=T.tickText(t,e):o[f]=l(t,e,String(a[n])),f++);return f=864e5?t._tickround="d":n>=36e5?t._tickround="H":n>=6e4?t._tickround="M":n>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(n/2)/Math.LN10);else{x(n)||(n=Number(n.substr(1))),t._tickround=2-Math.floor(Math.log(n)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var r=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(r)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((r-1)/3):t._tickexponent=r)}else"M"===n.charAt(0)?t._tickround=2===n.length?"m":"y":t._tickround=null}function i(t,e){var n=t.match(B),r=new Date(e);if(n){var a=Math.min(+n[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,a).replace(/0+$/,"")||"0";return y.time.format(t.replace(B,o))(r)}return y.time.format(t)(r)}function l(t,e,n){var r=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}function s(t,e,n,r){var a,o=e.x,l=t._tickround,s=new Date(o),c="";n&&t.hoverformat?a=i(t.hoverformat,o):t.tickformat?a=i(t.tickformat,o):(r&&(x(l)?l+=2:l={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[l]),"y"===l?a=D(s):"m"===l?a=I(s):(o!==t._tmin||n||(c="
"+D(s)),"d"===l?a=R(s):"H"===l?a=j(s):(o!==t._tmin||n||(c="
"+R(s)+", "+D(s)),a=F(s),"M"!==l&&(a+=q(s),"S"!==l&&(a+=d(v(o/1e3,1),t,"none",n).substr(1)))))),e.text=a+c}function c(t,e,n,r,a){var o=t.dtick,i=e.x;if(!r||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=d(Math.pow(10,i),t,a,r);else if(x(o)||"D"===o.charAt(0)&&v(i+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var l=Math.round(i);0===l?e.text=1:1===l?e.text="10":l>1?e.text="10"+l+"":e.text="10\u2212"+-l+"",e.fontSize*=1.25}else e.text=d(Math.pow(10,i),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,v(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(0>i?.5:.25)))}}function u(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n=""),e.text=String(n)}function f(t,e,n,r,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=d(e.x,t,a,r)}function d(t,e,n,r){var a=0>t,i=e._tickround,l=n||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat;if(r){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};o(u),i=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-i)/2;if("none"===l&&(s=0),t=Math.abs(t),f>t)t="0",a=!1;else{if(t+=f,s&&(t*=Math.pow(10,-s),i+=s),0===i)t=String(Math.floor(t));else if(0>i){t=String(Math.round(t)),t=t.substr(0,t.length+i);for(var d=i;0>d;d++)t+="0"}else{t=String(t);var h=t.indexOf(".")+1;h&&(t=t.substr(0,h+i).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(s&&"hide"!==l){var p;p=0>s?"\u2212"+-s:"power"!==l?"+"+s:String(s),"e"===l||("SI"===l||"B"===l)&&(s>12||-15>s)?t+="e"+p:"E"===l?t+="E"+p:"power"===l?t+="\xd710"+p+"":"B"===l&&9===s?t+="B":"SI"!==l&&"B"!==l||(t+=H[s/3+5])}return a?"\u2212"+t:t}function h(t,e){var n,r,a=[];for(n=0;n1)for(r=1;r2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.getAutoRange=function(t){var e,n=[],r=t._min[0].val,a=t._max[0].val;for(e=1;e0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(r===a){var p=r-1,g=r+1;n="tozero"===t.rangemode?0>r?[p,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,p),Math.max(0,g)]:[p,g]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),n=[s.val-d*s.pad,c.val+d*c.pad]);return n[0]===n[1]&&("tozero"===t.rangemode?n=n[0]<0?[n[0],0]:n[0]>0?[0,n[0]]:[0,1]:(n=[n[0]-1,n[0]+1],"nonnegative"===t.rangemode&&(n[0]=Math.max(0,n[0])))),h&&n.reverse(),n},T.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=T.getAutoRange(t);var n=t._gd.layout[t._name];n||(t._gd.layout[t._name]=n={}),n!==t&&(n.range=t.range.slice(),n.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var n=T.list(t,"",!0),r=!1,a=0;ap&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),r(c)){for(h=!0,i=0;i=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(r(u)){for(h=!0,i=0;i=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),n||(n={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,m=e.length,v=n.padded?.05*t._length:0,y=n.tozero&&("linear"===t.type||"-"===t.type),b=r((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),_=r((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),w=r(n.vpadplus||n.vpad),k=r(n.vpadminus||n.vpad);for(o=0;6>o;o++)a(o);for(o=m-1;o>5;o--)a(o)}},T.autoBin=function(t,e,n,r){function a(t){return(1+100*(t-h)/f.dtick)%100<2}var o=_.aggNums(Math.min,null,t),i=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:i+.5,size:1};var l;if(n)l=(i-o)/n;else{var s=_.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(s.minDiff)/Math.LN10)),u=c*_.roundUp(s.minDiff/c,[.9,1.9,4.9,9.9],!0);l=Math.max(u,2*_.stdev(t)/Math.pow(t.length,r?.25:.4))}var f={type:"log"===e.type?"linear":e.type,range:[o,i]};T.autoTicks(f,l);var d,h=T.tickIncrement(T.tickFirst(f),f.dtick,"reverse");if("number"==typeof f.dtick){for(var p=0,g=0,m=0,v=0,y=0;yg&&(p>.3*b||a(o)||a(i))){var w=f.dtick/2;h+=o>h+w?w:-w}var k=1+Math.floor((i-h)/f.dtick);d=h+k*f.dtick}else for(d=h;i>=d;)d=T.tickIncrement(d,f.dtick);return{start:h,end:d,size:f.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return r(t);if("auto"===t.tickmode||!t.dtick){var e,n=t.nticks;n||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/e):(e="y"===t._id.charAt(0)?40:80,n=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),o(t),t._tmin=T.tickFirst(t);var a=t.range[1]=l:l>=s)&&(i.push(s),!(i.length>1e3));s=T.tickIncrement(s,t.dtick,a));t._tmax=i[i.length-1];for(var c=new Array(i.length),u=0;u157788e5?(e/=315576e5,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*a(e,n,S)):e>12096e5?(e/=26298e5,t.dtick="M"+a(e,1,C)):e>432e5?(t.dtick=a(e,864e5,O),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=a(e,36e5,C):e>3e4?t.dtick=a(e,6e4,E):e>500?t.dtick=a(e,1e3,E):(n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,n,S));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var r=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/r,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+a(e,n,S)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,n=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,n,S));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},T.tickIncrement=function(t,e,n){var r=n?-1:1;if(x(e))return t+r*e;var a=e.charAt(0),o=r*Number(e.substr(1));if("M"===a){var i=new Date(t);return i.setMonth(i.getMonth()+o)}if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var l="D2"===e?N:P,s=t+.01*r,c=_.roundUp(v(s,1),l,n);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]r:r>c;)c=T.tickIncrement(c,a,e);return c}if("L"===u)return Math.log(n((Math.pow(10,r)-o)/f)*f+o)/Math.LN10;if("D"===u){var d="D2"===a?N:P,h=_.roundUp(v(r,1),d,e);return Math.floor(r)+Math.log(y.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(a)};var D=y.time.format("%Y"),I=y.time.format("%b %Y"),R=y.time.format("%b %-d"),j=y.time.format("%b %-d %Hh"),F=y.time.format("%H:%M"),q=y.time.format(":%S"),B=/%(\d?)f/g;T.tickText=function(t,e,n){function r(r){var a;return void 0===r?!0:n?"none"===r:(a={first:t._tmin,last:t._tmax}[r],"all"!==r&&e!==a)}var a,o,i=l(t,e),d="array"===t.tickmode,h=n||d;if(d&&Array.isArray(t.ticktext)){var p=Math.abs(t.range[1]-t.range[0])/1e4;for(o=0;o1&&en&&(E=90),a(d,E)}c._lastangle=E}return s(),i(e),e+" done"}function s(){var e=.25,n=200,r=("x"===m?t._fullLayout.height:t._fullLayout.width)*e;r=Math.min(r,n),d.each(function(t){var e=y.select(this),n=A.bBox(e.node()),a="x"===m?n.height:n.width;if(a>r){var o=t.text,i=Math.round(r/(a/o.length)),l=Math.floor(i/2),s=i-l-1;o=o.substr(0,l)+"\u2026"+o.substr(-s);var c=e.select("text");c.text(o),e.insert("title","text").text(t.text)}})}function u(){var e,n,r=c._boundingBox,a=0,o=0;if("x"===c._id.charAt(0)?(e="height", +"2"===c._id.charAt(1)?(o=1,n="t"):n="b"):"y"===c._id.charAt(0)&&(e="width","2"===c._id.charAt(1)?(a=1,n="r"):n="l"),e&&n){var i=r[e];if(c._titleElement){var l=c._titleElement.node().getBoundingClientRect();i+=l[e]+2}var s=.5*t._fullLayout[e];i=Math.min(i,s);var u={x:a,y:o,l:0,r:0,b:0,t:0};u[n]=i,b.Plots.autoMargin(t,c._name,u)}}function f(){c._boundingBox=n.node().getBoundingClientRect()}n.style("pointer-events","all");var d=n.selectAll("g."+C).data(z,S);if(!c.showticklabels||!x(r))return d.remove(),void i(e);var p,v,k,M,T;"x"===m?(T="bottom"===q?1:-1,p=function(t){return t.dx+D*T},M=r+(N+P)*T,v=function(t){return t.dy+M+t.fontSize*("bottom"===q?1:-.5)},k=function(t){return x(t)&&0!==t&&180!==t?0>t*T?"end":"start":"middle"}):(T="right"===q?1:-1,v=function(t){return t.dy+t.fontSize/2-D*T},p=function(t){return t.dx+r+(N+P+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*T},k=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var L=0,E=0,O=[],I=d.enter().append("g").classed(C,1);I.append("text").attr("text-anchor","middle").each(function(e){var n=y.select(this),r=t._promises.length;n.call(A.setPosition,p(e),v(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),r=t._promises[r],r?O.push(t._promises.pop().then(function(){a(n,c.tickangle)})):a(n,c.tickangle)}),d.exit().remove(),d.each(function(t){L=Math.max(L,t.fontSize)}),a(d,c._lastangle||c.tickangle);var R=_.syncOrAsync([o,l,f,u]);return R&&R.then&&t._promises.push(R),R}function i(e){if(!n){var r,a,o,i,l=L.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=1.5,p=l.titlefont.size;if(s.size()){var g=y.select(s.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);g&&(c.offsetLeft=+g[1],c.offsetTop=+g[2])}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:L.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-p*(h+(l.showticklabels?1:0)):a._length+10+p*(h+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:L.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+p*(h+(l.showticklabels?1:.5)):-10-p*(h+(l.showticklabels?.5:0))),r={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:r,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:b.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[m]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===m}function s(e,n,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:H,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+n._length,f=o.selectAll("path."+E).data(c.showgrid===!1?[]:s,S);if(f.enter().append("path").classed(E,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)g;g++){var y=c.mirrors[i._id+d[g]];"ticks"!==y&&"labels"!==y||(f[g]=!0)}return void 0!==r[2]&&(f[2]=!0),f.forEach(function(t,e){var n=r[e],a=B[e];t&&x(n)&&(h+=p(n+P*a,a*c.ticklen))}),a(n,h),s(e,i,t),o(n,r[3])}}).filter(function(t){return t&&t.then});return Z.length?Promise.all(Z):0},T.swap=function(t,e){for(var n=h(t,e),r=0;r2*r}function u(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,a=0,o=0;o2*r}var f=t("fast-isnumeric"),d=t("tinycolor2").mix,h=t("../../lib"),p=t("../plots"),g=t("../../components/color/attributes").lightFraction,m=t("./layout_attributes"),v=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),x=t("./tick_label_defaults"),b=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),k=t("./clean_datum"),M=t("./axis_ids");e.exports=function(t,e,n,a){function o(n,r){return h.coerce2(t,e,m,n,r)}var i=a.letter,l=a.font||{},s="Click to enter "+(a.title||i.toUpperCase()+" axis")+" title";a.name&&(e._name=a.name,e._id=M.name2id(a.name));var c=n("type");"-"===c&&(r(e,a.data),"-"===e.type?e.type="linear":c=t.type=e.type),_(e);var u=n("color"),p=u===t.color?u:l.color;n("title",s),h.coerceFont(n,"titlefont",{family:l.family,size:Math.round(1.2*l.size),color:p});var k=2===(t.range||[]).length&&f(t.range[0])&&f(t.range[1]),A=n("autorange",!k);A&&n("rangemode");var T=n("range",[-1,"x"===i?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),h.noneOrAll(t.range,e.range,[0,1]),n("fixedrange"),v(t,e,n,c),x(t,e,n,c,a),y(t,e,n,a),b(t,e,n);var L=o("linecolor",u),z=o("linewidth"),S=n("showline",!!L||!!z);S||(delete e.linecolor,delete e.linewidth),(S||e.ticks)&&n("mirror");var C=o("gridcolor",d(u,a.bgColor,g).toRgbString()),E=o("gridwidth"),O=n("showgrid",a.showGrid||!!C||!!E);O||(delete e.gridcolor,delete e.gridwidth);var P=o("zerolinecolor",u),N=o("zerolinewidth"),D=n("zeroline",a.showGrid||!!P||!!N);return D||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===c?w(i,e.categoryorder,e.categoryarray,a.data):[],e}},{"../../components/color/attributes":24,"../../lib":103,"../plots":144,"./axis_ids":126,"./category_order_defaults":127,"./clean_datum":128,"./layout_attributes":133,"./ordered_categories":135,"./set_convert":138,"./tick_label_defaults":139,"./tick_mark_defaults":140,"./tick_value_defaults":141,"fast-isnumeric":17,tinycolor2:20}],126:[function(t,e,n){"use strict";function r(t,e,n){function r(t,n){for(var r=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],128:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return a.ms2DateTime(t);if("string"!=typeof t&&!r(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){a.error(e,t)}return t}},{"../../lib":103,"fast-isnumeric":17}],129:[function(t,e,n){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],130:[function(t,e,n){"use strict";function r(t,e){var n,r=t.range[e],a=Math.abs(r-t.range[1-e]);return"date"===t.type?u.ms2DateTime(r,a):"log"===t.type?(n=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,l.format("."+n+"g")(Math.pow(10,r))):(n=Math.floor(Math.log(Math.abs(r))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,l.format("."+String(n)+"g")(r))}function a(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function o(t){l.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function i(t){var e=["lasso","select"];return-1!==e.indexOf(t)}var l=t("d3"),s=t("tinycolor2"),c=t("../../plotly"),u=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/setcursor"),g=t("../../components/dragelement"),m=t("./axes"),v=t("./select"),y=t("./constants"),x=!0;e.exports=function(t,e,n,l,b,_,w,k){function M(t,e){for(var n=0;n.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+pt+", "+gt+")").attr("d",st+"Z"),dt=ht.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+pt+", "+gt+")").attr("d","M0,0Z"),L();for(var o=0;oa?(ut="",it.r=it.l,it.t=it.b,dt.attr("d","M0,0Z")):(it.t=0,it.b=V,ut="x",dt.attr("d","M"+(it.l-.5)+","+(ot-U-.5)+"h-3v"+(2*U+1)+"h3ZM"+(it.r+.5)+","+(ot-U-.5)+"h3v"+(2*U+1)+"h-3Z")):!W||a.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),dt.transition().style("opacity",1).duration(200),ct=!0)}function S(t,e,n){var r,a,o,i=[];for(r=0;rzoom back out","long"),x=!1),l.pre=!1,t.emit("plotly_zoom",l))}function E(e,n){var a=1===(w+k).length;if(e)I();else if(2!==n||a){if(1===n&&a){var o=w?B[0]:q[0],i="s"===w||"w"===k?0:1,l=o._name+".range["+i+"]",s=r(o,i),u="left",d="middle";if(o.fixedrange)return;w?(d="n"===w?"top":"bottom","right"===o.side&&(u="right")):"e"===k&&(u="right"),et.call(f.makeEditable,null,{immediate:!0,background:j.paper_bgcolor,text:String(s),fill:o.tickfont?o.tickfont.color:"#444",horizontalAlign:u,verticalAlign:d}).on("edit",function(e){var n="category"===o.type?o.c2l(e):o.d2l(e);void 0!==n&&c.relayout(t,l,n)})}}else D()}function O(e){function n(t,e,n){if(!t.fixedrange){A(t.range);var r=t.range,a=r[0]+(r[1]-r[0])*e;t.range=[a+(r[0]-a)*n,a+(r[1]-a)*n]}}if(t._context.scrollZoom||j._enablescrollzoom){var r=t.querySelector(".plotly");if(!(r.scrollHeight-r.clientHeight>10||r.scrollWidth-r.clientWidth>10)){clearTimeout(vt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void u.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=xt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=mt[0]+mt[2]*s,f=(l.bottom-e.clientY)/l.height,d=mt[1]+mt[3]*(1-f);if(k){for(o=0;o=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function a(t,e,n){for(var a=1-e,o=0,i=0;i0;r--)n.push(e);return n}function a(t,e){for(var n=[],r=0;rT;T++){var L=o[T],z=h[L];if(z)M[T]=w.getFromId(t,z.xaxis._id),A[T]=w.getFromId(t,z.yaxis._id);else{var S=i[L]._subplot;M[T]=S.xaxis,A[T]=S.yaxis}}var C=e.hovermode||i.hovermode;if(-1===["x","y","closest"].indexOf(C)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var E,O,P,N,D,I,R,j,F,q,B,H,V=[],Z=[];if(Array.isArray(e))for(C="array",P=0;PU||U>X.width||0>Y||Y>X.height)return _.unhoverRaw(t,e)}else U="xpx"in e?e.xpx:M[0]._length/2,Y="ypx"in e?e.ypx:A[0]._length/2;if(E="xval"in e?r(o,e.xval):a(M,U),O="yval"in e?r(o,e.yval):a(A,Y),!g(E[0])||!g(O[0]))return m.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var G=1/0;for(N=0;N1||-1!==I.hoverinfo.indexOf("name")?I.name:void 0,index:!1,distance:Math.min(G,k.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},H=V.length,"array"===j){var $=e[N];"pointNumber"in $?(B.index=$.pointNumber,j="closest"):(j="","xval"in $&&(F=$.xval,j="x"),"yval"in $&&(q=$.yval,j=j?"closest":"y"))}else F=E[R],q=O[R];if(I._module&&I._module.hoverPoints){var Q=I._module.hoverPoints(B,F,q,j);if(Q)for(var W,J=0;JH&&(V.splice(0,H),G=V[0].distance)}if(0===V.length)return _.unhoverRaw(t,e);var K="y"===C&&Z.length>1;V.sort(function(t,e){return t.distance-e.distance});var tt=x.combine(i.plot_bgcolor||x.background,i.paper_bgcolor),et={hovermode:C,rotateLabels:K,bgColor:tt,container:i._hoverlayer,outerContainer:i._paperdiv},nt=c(V,et);u(V,K?"xa":"ya"),f(nt,K);var rt=t._hoverdata,at=[];for(P=0;P128?"#000":x.background;if(t.name&&void 0===t.zLabelVal){var u=document.createElement("p");u.innerHTML=t.name,n=u.textContent||"",n.length>15&&(n=n.substr(0,12)+"...")}void 0!==t.extraText&&(r+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(r+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(r+="y: "+t.yLabel+"
"),r+=(r?"z: ":"")+t.zLabel):A&&t[a+"Label"]===g?r=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(r=t.yLabel):r=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(r+=(r?"
":"")+t.text),""===r&&(""===n&&e.remove(),r=n);var f=e.select("text.nums").style("fill",c).call(b.setPosition,0,0).text(r).attr("data-notex",1).call(y.convertToTspans);f.selectAll("tspan.line").call(b.setPosition,0,0);var d=e.select("text.name"),m=0;n&&n!==r?(d.style("fill",s).text(n).call(b.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),d.selectAll("tspan.line").call(b.setPosition,0,0),m=d.node().getBoundingClientRect().width+2*O):(d.remove(),e.select("rect").remove()),e.select("path").style({fill:s,stroke:c});var v,k,L=f.node().getBoundingClientRect(),z=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,C=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),N=L.width+E+O+m;t.ty0=_-L.top,t.bx=L.width+2*O,t.by=L.height+2*O,t.anchor="start",t.txwidth=L.width,t.tx2width=m,t.offset=0,t.trace&&t.trace._input&&t.trace._input.rect?t.anchor="middle":o?(t.pos=z,v=M>=S+P/2+N,k=S-P/2-N>=0,"top"!==t.idealAlign&&v||!k?v?(S+=P/2,t.anchor="start"):t.anchor="middle":(S-=P/2,t.anchor="end")):(t.pos=S,v=w>=z+C/2+N,k=z-C/2-N>=0,"left"!==t.idealAlign&&v||!k?v?(z+=C/2,t.anchor="start"):t.anchor="middle":(z-=C/2,t.anchor="end")),f.attr("text-anchor",t.anchor),m&&d.attr("text-anchor",t.anchor),e.attr("transform","translate("+z+","+S+")"+(o?"rotate("+T+")":""))}),S}function u(t,e){function n(t){var e=t[0],n=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=n.pos+n.dp+n.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;r=!1}if(!(.01>o)){if(-.01>a){for(l=t.length-1;l>=0;l--)t[l].dp-=o;r=!1}if(r){var c=0;for(i=0;ie.pmax&&c++;for(i=t.length-1;i>=0&&!(0>=c);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=c);i++)if(s=t[i],s.pos=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(0>=c);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var r,a,o,i,l,s,c,u=0,f=t.map(function(t,n){var r=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===r._id.charAt(0)?z:1)/2,pmin:r._offset,pmax:r._offset+r._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;r=!1}else i++}f.forEach(n)}for(i=f.length-1;i>=0;i--){var m=f[i];for(l=m.length-1;l>=0;l--){var v=m[l],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function f(t,e){t.each(function(t){var n=h.select(this);if(t.del)return void n.remove();var r="end"===t.anchor?-1:1,a=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(E+O),l=i+o*(t.txwidth+O),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*S),n.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(r*E+s)+","+(E+c)+"v"+(t.by/2-E)+"h"+r*t.bx+"v-"+t.by+"H"+(r*E+s)+"V"+(c-E)+"Z"), +a.call(b.setPosition,i+s,c+t.ty0-t.by/2+O).selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")}),t.tx2width&&(n.select("text.name, text.name tspan.line").call(b.setPosition,l+o*O+s,c+t.ty0-t.by/2+O),n.select("rect").call(b.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function d(t,e,n){if(!e.target)return!1;if(!n||n.length!==t._hoverdata.length)return!0;for(var r=n.length-1;r>=0;r--){var a=n[r],o=t._hoverdata[r];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var h=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),m=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),b=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),k=t("./constants"),M=t("./dragbox"),A=e.exports={};A.unhover=_.unhover,A.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},A.supplyLayoutDefaults=function(t,e,n){function r(n,r){return m.coerce(t,e,A.layoutAttributes,n,r)}r("dragmode");var a;if(e._has("cartesian")){var o=e._isHoriz=A.isHoriz(n);a=o?"y":"x"}else a="closest";r("hovermode",a)},A.isHoriz=function(t){for(var e=!0,n=0;nt._lastHoverTime+k.HOVERMINTIME?(i(t,e,n),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){i(t,e,n),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},A.getDistanceFunction=function(t,e,n,r){return"closest"===t?r||o(e,n):"x"===t?e:n},A.getClosest=function(t,e,n){if(n.index!==!1)n.index>=0&&n.indext*e||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":48,"../../lib":103,"../../lib/events":100,"../../lib/svg_text_utils":114,"./axes":124,"./constants":129,"./dragbox":130,d3:14,"fast-isnumeric":17,tinycolor2:20}],132:[function(t,e,n){"use strict";var r=t("../plots"),a=t("./constants");n.name="cartesian",n.attr=["xaxis","yaxis"],n.idRoot=["x","y"],n.idRegex=a.idRegex,n.attrRegex=a.attrRegex,n.attributes=t("./attributes"),n.plot=function(t){function e(t,e){for(var n=[],r=0;rf[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":103,"fast-isnumeric":17}],137:[function(t,e,n){"use strict";function r(t){return t._id}var a=t("../../lib/polygon"),o=t("../../components/color"),i=t("./axes"),l=t("./constants"),s=a.filter,c=a.tester,u=l.MINSELECT;e.exports=function(t,e,n,a,f){function d(t){var e="y"===t._id.charAt(0)?1:0;return function(n){return t.p2d(n[e])}}function h(t,e){return t-e}var p,g=a.gd._fullLayout._zoomlayer,m=a.element.getBoundingClientRect(),v=a.plotinfo.x()._offset,y=a.plotinfo.y()._offset,x=e-m.left,b=n-m.top,_=x,w=b,k="M"+x+","+b,M=a.xaxes[0]._length,A=a.yaxes[0]._length,T=a.xaxes.map(r),L=a.yaxes.map(r),z=a.xaxes.concat(a.yaxes);"lasso"===f&&(p=s([[x,b]],l.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",k+"Z");var C,E,O,P,N,D=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),I=[],R=a.gd,j=[];for(C=0;C0)return Math.log(e)/Math.LN10;if(0>=e&&n&&t.range&&2===t.range.length){var r=t.range[0],a=t.range[1];return.5*(r+a-3*u*Math.abs(r-a))}return i.BADNUM}function n(t){return Math.pow(10,t)}function c(t){return a(t)?Number(t):i.BADNUM}var u=10;if(t.c2l="log"===t.type?e:c,t.l2c="log"===t.type?n:c,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,n=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var r=s.getFromId(t._gd,t.overlaying);t.domain=r.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)a(t.range[e])||(t.range[e]=a(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return a(e)?r.round(t._b+t._m*e,2):i.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,n){return t.l2p(t.c2l(e,n))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=c,t.d2c=function(t){return t=l(t),a(t)?Number(t):i.BADNUM},t.d2l=function(e,n){return"log"===t.type?t.c2l(t.d2c(e),n):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return a(t)?o.ms2DateTime(t):i.BADNUM},t.d2c=function(t){return a(t)?Number(t):o.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var f=t.range.map(o.dateTime2ms);!a(t.range[0])&&a(f[0])&&(t.range[0]=f[0]),!a(t.range[1])&&a(f[1])&&(t.range[1]=f[1])}catch(d){o.error(d,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var n=t._categories.indexOf(e);return-1===n?i.BADNUM:n},t.d2l=t.d2c);t.makeCalcdata=function(e,n){var r,a,o;if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),n.attr(o);var i=n.select(".js-link-to-tool"),l=n.select(".js-link-spacer"),c=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&a(t,i),l.text(i.text()&&c.text()?" - ":"")},h.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=s.select(t).append("div").attr("id","hiddenform").style("display","none"),r=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),a=r.append("input").attr({type:"text",name:"data"});return a.node().value=h.graphJson(t,!1,"keepdata"),r.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},h.supplyDefaults=function(t){var e,n=t._fullLayout||{},r=t._fullLayout={},a=t.layout||{},i=t._fullData||[],l=t._fullData=[],s=t.data||[];h.supplyLayoutGlobalDefaults(a,r),r._dataLength=s.length,h.supplyDataDefaults(s,l,r),r._has=h._hasPlotType.bind(r);var c=r._modules;for(e=0;eo&&(e=(n-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),0>i&&(e=(r-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},h.autoMargin=function(t,e,n){var r=t._fullLayout;if(r._pushmargin||(r._pushmargin={}),r.margin.autoexpand!==!1){if(n){var a=void 0===n.pad?12:n.pad;n.l+n.r>.5*r.width&&(n.l=n.r=0),n.b+n.t>.5*r.height&&(n.b=n.t=0),r._pushmargin[e]={l:{val:n.x,size:n.l+a},r:{val:n.x,size:n.r+a},b:{val:n.y,size:n.b+a},t:{val:n.y,size:n.t+a}}}else delete r._pushmargin[e];t._replotting||h.doAutoMargin(t)}},h.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;return e.margin.autoexpand!==!1&&(s.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}},Object.keys(s).forEach(function(t){var n=s[t].l||{},r=s[t].b||{},u=n.val,f=n.size,d=r.val,h=r.size;Object.keys(s).forEach(function(t){if(c(f)&&s[t].r){var n=s[t].r.val,r=s[t].r.size;if(n>u){var p=(f*n+(r-e.width)*u)/(n-u),g=(r*(1-u)+(f-e.width)*(1-n))/(n-u);p>=0&&g>=0&&p+g>a+o&&(a=p,o=g)}}if(c(h)&&s[t].t){var m=s[t].t.val,v=s[t].t.size;if(m>d){var y=(h*m+(v-e.height)*d)/(m-d),x=(v*(1-d)+(h-e.height)*(1-m))/(m-d);y>=0&&x>=0&&y+x>l+i&&(l=y,i=x)}}})})),n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(i),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,t._replotting||"{}"===r||r===JSON.stringify(e._size)?void 0:u.plot(t)},h.graphJson=function(t,e,n,r,a){function o(t){if("function"==typeof t)return null; +if(f.isPlainObject(t)){var e,r,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===n){if("src"===e.substr(e.length-3))continue}else if("keepstream"===n){if(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0&&!f.isPlainObject(t.stream))continue}else if("keepall"!==n&&(r=t[e+"src"],"string"==typeof r&&r.indexOf(":")>0))continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):t&&t.getTime?f.ms2DateTime(t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&h.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s={data:(i||[]).map(function(t){var n=o(t);return e&&delete n.fit,n})};return e||(s.layout=o(l)),t.framework&&t.framework.isPolar&&(s=t.framework.getConfig()),"object"===r?s:JSON.stringify(s)}},{"../components/color":25,"../lib":103,"../plotly":121,"./attributes":122,"./font_attributes":142,"./layout_attributes":143,d3:14,"fast-isnumeric":17}],145:[function(t,e,n){"use strict";var r=t("../../traces/scatter/attributes"),a=r.marker;e.exports={r:r.r,t:r.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity}}},{"../../traces/scatter/attributes":237}],146:[function(t,e,n){"use strict";function r(t,e){var n={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return o({},e,n)}var a=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,i=o({},a.domain,{});e.exports={radialaxis:r("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:i,orientation:{valType:"number"}}),angularaxis:r("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:i}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":101,"../cartesian/layout_attributes":133}],147:[function(t,e,n){var r=t("../../plotly"),a=t("d3"),o=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},i=r.Lib.extendDeepAll;o.Axis=function(){function t(t){n=t||n;var c=s.data,f=s.layout;return("string"==typeof n||n.nodeName)&&(n=a.select(n)),n.datum(c).each(function(t,n){function s(t,e){return l(t)%360+f.orientation}var c=t.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(f)};var d=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[d],d=(d+1)%f.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:a.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var h=c.filter(function(t,e){var n=t.visible;return"undefined"==typeof n||n===!0}),p=!1,g=h.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var m=a.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),v=[],y=m.map(function(t,e){if("unstacked"===t.key)return t.values;var n=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,r){t.yStack=[n],v.push(n),n=o.util.sumArrays(t.r,n)}),t.values});h=a.merge(y)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;x=Math.max(10,x);var b,_=[f.margin.left+x,f.margin.top+x];if(p){var w=a.max(o.util.sumArrays(o.util.arrayLast(h).r[0],o.util.arrayLast(v)));b=[0,w]}else b=a.extent(o.util.flattenArray(h.map(function(t,e){return t.r})));f.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=a.scale.linear().domain(f.radialAxis.domain!=o.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var k,M=o.util.flattenArray(h.map(function(t,e){return t.t})),A="string"==typeof M[0];A&&(M=o.util.deduplicate(M),k=M.slice(),M=a.range(M.length),h=h.map(function(t,e){var n=t;return t.t=[M],p&&(n.yStack=t.yStack),n}));var T=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,L=null===f.needsEndSpacing?A||!T:f.needsEndSpacing,z=f.angularAxis.domain&&f.angularAxis.domain!=o.DATAEXTENT&&!A&&f.angularAxis.domain[0]>=0,S=z?f.angularAxis.domain:a.extent(M),C=Math.abs(M[1]-M[0]);T&&!A&&(C=0);var E=S.slice();L&&A&&(E[1]+=C);var O=f.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),f.angularAxis.ticksStep&&(O=(E[1]-E[0])/O);var P=f.angularAxis.ticksStep||(E[1]-E[0])/(O*(f.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),E[2]||(E[2]=P);var N=a.range.apply(this,E);if(N=N.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=a.scale.linear().domain(E.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=L?C:0,e=a.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var D="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",I=(new DOMParser).parseFromString(D,"application/xml"),R=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));e=a.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var j,F=e.select(".chart-group"),q={fill:"none",stroke:f.tickColor},B={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){j=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var H=h.map(function(t,e){var n=o.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});o.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:j,elements:H,reverseOrder:f.legend.reverseOrder})})();var V=j.node().getBBox();x=Math.min(f.width-V.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),j.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else j=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var Z=[(f.width-(f.margin.left+f.margin.right+2*x+(V?V.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(Z[0]=Math.max(0,Z[0]),Z[1]=Math.max(0,Z[1]),e.select(".outer-group").attr("transform","translate("+Z+")"),f.title){var U=e.select("g.title-group text").style(B).text(f.title),Y=U.node().getBBox();U.attr({x:_[0]-Y.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=X.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({"class":"grid-circle"}).style(q),G.attr("r",r),G.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(q);var $=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Q=a.svg.axis().scale(r).ticks(5).tickSize(5);X.call(Q).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(q),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(N),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+s(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(q),J.selectAll(".minor").style({stroke:f.minorTickColor}),W.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(B);var K=W.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var n=s(t,e),r=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?270>n&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(180>=n&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":k?k[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(B);f.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var tt=a.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));j.attr({transform:"translate("+[x+tt,f.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,nt=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(nt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),nt.exit().remove(),h[0]||et){var rt=[];h.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=l,n.container=nt.filter(function(t,n){return n==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,rt.push({data:t,geometryConfig:n})});var at=a.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(rt),ot=[];at.forEach(function(t,e){"unstacked"===t.key?ot=ot.concat(t.values.map(function(t,e){return[t]})):ot.push(t.values)}),ot.forEach(function(t,e){var n;n=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var r=t.map(function(t,e){return i(o[n].defaultConfig(),t)});o[n]().config(r)()})}var it,lt,st=e.select(".guides-group"),ct=e.select(".tooltips-group"),ut=o.tooltipPanel().config({container:ct,fontSize:8})(),ft=o.tooltipPanel().config({container:ct,fontSize:8})(),dt=o.tooltipPanel().config({container:ct,hasTick:!0})();if(!A){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var n=o.util.getMousePos($).angle;ht.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-f.orientation)%360;it=l.invert(r);var a=o.util.convertToCartesian(x+12,n+180);ut.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var pt=st.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos($).radius;pt.attr({r:n}).style({opacity:.5}),lt=r.invert(o.util.getMousePos($).radius);var a=o.util.convertToCartesian(n,f.radialAxis.orientation);ft.text(o.util.round(lt)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),dt.hide(),ut.hide(),ft.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,n){var r=a.select(this),i=r.style("fill"),l="black",s=r.style("opacity")||1;if(r.attr({"data-opacity":s}),"none"!=i){r.attr({"data-fill":i}),l=a.hsl(i).darker().toString(),r.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-Z[0]-d.left,f.top+f.height/2-Z[1]-d.top];dt.config({color:l}).text(u),dt.move(h)}else i=r.style("stroke"),r.attr({"data-stroke":i}),l=a.hsl(i).darker().toString(),r.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=a.event.which?!1:void(a.select(this).attr("data-fill")&&dt.show())}).on("mouseout.tooltip",function(t,e){dt.hide();var n=a.select(this),r=n.attr("data-fill");r?n.style({fill:r,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})}),d}var e,n,r,l,s={data:[],layout:{}},c={},u={},f=a.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return s;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),i(s.data[e],o.Axis.defaultConfig().data[0]),i(s.data[e],t)}),i(s.layout,o.Axis.defaultConfig().layout),i(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return r},d.angularScale=function(t){return l},d.svg=function(){return e},a.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){var n={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:a.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return n},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},o.util._extend=function(t,e){for(var n in t)e[n]=t[n]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var n=e||6,r=a.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180,a=t(r);return[e,a]});return r},o.util.dataFromEquation=function(t,e,n){var r=e||6,o=[],i=[];a.range(0,360+r,r).forEach(function(e,n){var r=e*Math.PI/180,a=t(r);o.push(e),i.push(a)});var l={t:o,r:i};return n&&(l.name=n),l},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var n=[].concat(t);return a.range(e).map(function(t,e){return n[e]||n[0]})},o.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=o.util.ensureArray(t[e],n)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},o.util.sumArrays=function(t,e){return a.zip(t,e).map(function(t,e){return a.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var n=e*Math.PI/180,r=t*Math.cos(n),a=t*Math.sin(n);return[r,a]},o.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},o.util.getMousePos=function(t){var e=a.mouse(t.node()),n=e[0],r=e[1],o={};return o.x=n,o.y=r,o.pos=e,o.angle=180*(Math.atan2(r,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+r*r),o},o.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;o>a;a++)e=t[a],e in n?(n[e]++,r[e]=n[e]):n[e]=1;return r},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,n,r){if(r){var a=n.slice();n=e,e=a}var o=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof o&&(e.reduce(function(t,n,r){return"undefined"!=typeof t?(r===e.length-1&&delete t[n],t[n]):void 0},t),n.reduce(function(t,e,r){return"undefined"==typeof t[e]&&(t[e]={}),r===n.length-1&&(t[e]=o),t[e]},t))},o.PolyChart=function(){function t(){var t=n[0].geometryConfig,e=t.container;"string"==typeof e&&(e=a.select(e)),e.datum(n).each(function(e,n){function r(e,n){var r=t.radialScale(e[1]),a=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:r,t:a}}function o(t){var e=t.r*Math.cos(t.t),n=t.r*Math.sin(t.t);return{x:e,y:n}}var i=!!e[0].data.yStack,s=e.map(function(t,e){return i?a.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):a.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(n,r,o){var i=e[o].data,l=t.radialScale(n[1])-t.radialScale(0),s=t.radialScale(n[2]||0),u=i.barWidth;a.select(this).attr({"class":"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,n){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,n,i){var l=t[2]?[t[0],t[1]+t[2]]:t,s=a.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(t,n);a.select(this).attr({"class":"mark dot",d:s,transform:function(t,e){var n=o(r(l));return"translate("+[n.x,n.y]+")"}})};var d=a.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(n,r,o){var i=n[2]?s[o].map(function(t,e){return[t[0],t[1]+t[2]]}):s[o];if(a.select(this).each(f.dot).style({opacity:function(t,n){return+e[o].data.dotVisible},fill:m.stroke(n,r,o)}).attr({"class":"mark dot"}),!(r>0)){var l=a.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({"class":"line",d:d(i),transform:function(e,n){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return m.fill(n,r,o)},"fill-opacity":0,stroke:function(t,e){return m.stroke(n,r,o)},"stroke-width":function(t,e){return m["stroke-width"](n,r,o)},"stroke-dasharray":function(t,e){return m["stroke-dasharray"](n,r,o)},opacity:function(t,e){return m.opacity(n,r,o)},display:function(t,e){return m.display(n,r,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=a.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,n,r){a.select(this).attr({"class":"mark arc",d:g,transform:function(e,n){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var m={fill:function(t,n,r){return e[r].data.color},stroke:function(t,n,r){return e[r].data.strokeColor},"stroke-width":function(t,n,r){return e[r].data.strokeSize+"px"},"stroke-dasharray":function(t,n,r){return l[e[r].data.strokeDash]},opacity:function(t,n,r){return e[r].data.opacity},display:function(t,n,r){return"undefined"==typeof e[r].data.visible||e[r].data.visible?"block":"none"}},v=a.select(this).selectAll("g.layer").data(s);v.enter().append("g").attr({"class":"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(m).each(f[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,n=[o.PolyChart.defaultConfig()],r=a.dispatch("hover"),l={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){n[e]||(n[e]={}),i(n[e],o.PolyChart.defaultConfig()),i(n[e],t)}),this):n},t.getColorScale=function(){return e},a.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:a.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var n=e.legendConfig,r=e.data.map(function(t,e){return[].concat(t).map(function(t,r){var a=i({},n.elements[e]);return a.name=t,a.color=[].concat(n.elements[e].color)[r],a})}),o=a.merge(r);o=o.filter(function(t,e){return n.elements[e]&&(n.elements[e].visibleInLegend||"undefined"==typeof n.elements[e].visibleInLegend)}),n.reverseOrder&&(o=o.reverse());var l=n.container;("string"==typeof l||l.nodeName)&&(l=a.select(l));var s=o.map(function(t,e){return t.color}),c=n.fontSize,u=null==n.isContinuous?"number"==typeof o[0]:n.isContinuous,f=u?n.height:c*o.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=a.range(o.length),m=a.scale[u?"linear":"ordinal"]().domain(g).range(s),v=a.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var n=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=a.svg.symbolTypes.indexOf(t)?a.svg.symbol().type(t).size(n)():a.svg.symbol().type("square").size(n)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:n.height,width:n.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var n=t.symbol;return y(n,c)},fill:function(t,e){return m(e)}}),b.exit().remove()}var _=a.svg.axis().scale(v).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?n.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?n.textColor:"none"}),w.selectAll("text").style({fill:n.textColor,"font-size":n.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),n=a.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},a.rebind(t,n,"on"),t},o.Legend.defaultConfig=function(t,e){var n={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return n},o.tooltipPanel=function(){var t,e,n,r={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){t=r.container.selectAll("g."+l).data([0]);var a=t.enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return n=a.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=a.append("text").attr({dx:r.padding+s,dy:.3*+r.fontSize}),c};return c.text=function(o){var i=a.hsl(r.color).l,l=i>=.5?"#aaa":"white",u=i>=.5?"black":"white",f=o||"";e.style({fill:u,"font-size":r.fontSize+"px"}).text(f);var d=r.padding,h=e.node().getBBox(),p={fill:r.color,stroke:l,"stroke-width":"2px"},g=h.width+2*d+s,m=h.height+2*d;return n.attr({d:"M"+[[s,-m/2],[s,-m/4],[r.hasTick?0:s,0],[s,m/4],[s,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[s,-m/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c):void 0},c.hide=function(){return t?(t.style({display:"none"}),c):void 0},c.show=function(){return t?(t.style({display:"block"}),c):void 0},c.config=function(t){return i(r,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=i({},t),a=[[r,["marker","color"],["color"]],[r,["marker","opacity"],["opacity"]],[r,["marker","line","color"],["strokeColor"]],[r,["marker","line","dash"],["strokeDash"]],[r,["marker","line","width"],["strokeSize"]],[r,["marker","symbol"],["dotType"]],[r,["marker","size"],["dotSize"]],[r,["marker","barWidth"],["barWidth"]],[r,["line","interpolation"],["lineInterpolation"]],[r,["showlegend"],["visibleInLegend"]]];return a.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",r.dotVisible===!0?(delete r.dotVisible,r.mode="lines+markers"):r.mode="lines"):"DotPlot"===r.geometry?(r.type="scatter",r.mode="markers"):"AreaChart"===r.geometry?r.type="area":"BarChart"===r.geometry&&(r.type="bar"),delete r.geometry):("scatter"===r.type?"lines"===r.mode?r.geometry="LinePlot":"markers"===r.mode?r.geometry="DotPlot":"lines+markers"===r.mode&&(r.geometry="LinePlot",r.dotVisible=!0):"area"===r.type?r.geometry="AreaChart":"bar"===r.type&&(r.geometry="BarChart"),delete r.mode,delete r.type),r}),!e&&t.layout&&"stack"===t.layout.barmode)){var r=o.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var a=r.indexOf(t.geometry);-1!=a&&(n.data[e].groupId=a)})}if(t.layout){var l=i({},t.layout),s=[[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]];if(s.forEach(function(t,n){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&"undefined"!=typeof l.margin.t){var c=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],f={};a.entries(l.margin).forEach(function(t,e){f[u[c.indexOf(t.key)]]=t.value}),l.margin=f}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),n.layout=l}return n},t}},{"../../plotly":121,"./micropolar_manager":148,d3:14}],148:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("d3"),o=t("./undo_manager"),i=e.exports={},l=r.Lib.extendDeepAll;i.framework=function(t){function e(e,o){return o&&(f=o),a.select(a.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),n=n?l(n,e):e,c||(c=r.micropolar.Axis()),u=r.micropolar.adapter.plotly().convert(n),c.config(u).render(f),t.data=n.data,t.layout=n.layout,i.fillLayout(t),n}var n,s,c,u,f,d=new o;return e.isPolar=!0,e.svg=function(){return c.svg()},e.getConfig=function(){return n},e.getLiveConfig=function(){return r.micropolar.adapter.plotly().convert(c.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:c.angularScale(),r:c.radialScale()}},e.setUndoPoint=function(){var t=this,e=r.micropolar.util.cloneJson(n);!function(e,n){d.add({undo:function(){n&&t(n)},redo:function(){t(e)}})}(e,s),s=r.micropolar.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},i.fillLayout=function(t){var e=a.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),o=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:r.Color.background,_container:e,_paperdiv:n,_paper:o};t._fullLayout=l(i,t.layout)}},{"../../plotly":121,"./undo_manager":149,d3:14}],149:[function(t,e,n){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,n=[],r=-1,a=!1;return{add:function(t){return a?this:(n.splice(r+1,n.length-r),n.push(t),r=n.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=n[r];return a?(t(a,"undo"),r-=1,e&&e(a.undo),this):this},redo:function(){var a=n[r+1];return a?(t(a,"redo"),r+=1,e&&e(a.redo),this):this},clear:function(){n=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return rg;g++){var m=h[g];l=t[m]?t[m]:t[m]={},e[m]=s={},i("domain."+d,[g/p,(g+1)/p]),i("domain."+{x:"y",y:"x"}[d]),o.id=m,f(l,s,i,o)}}},{"../lib":103,"./plots":144}],151:[function(t,e,n){"use strict";var r=t("./ternary"),a=t("../../plots/plots");n.name="ternary",n.attr="subplot", +n.idRoot="ternary",n.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,n.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,n.attributes=t("./layout/attributes"),n.layoutAttributes=t("./layout/layout_attributes"),n.supplyLayoutDefaults=t("./layout/defaults"),n.plot=function(t){for(var e=t._fullLayout,n=t._fullData,o=a.getSubplotIds(e,"ternary"),i=0;i=i&&(h.min=0,p.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var a=t("../../../components/color"),o=t("../../subplot_defaults"),i=t("./layout_attributes"),l=t("./axis_defaults"),s=["aaxis","baxis","caxis"];e.exports=function(t,e,n){o(t,e,n,{type:"ternary",attributes:i,handleDefaults:r,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":25,"../../subplot_defaults":150,"./axis_defaults":154,"./layout_attributes":156}],156:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a}},{"../../../components/color/attributes":24,"./axis_attributes":153}],157:[function(t,e,n){"use strict";function r(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function a(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),i=t("tinycolor2"),l=t("../../plotly"),s=t("../../lib"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,h=t("../cartesian/axes"),p=t("../../lib/filter_visible"),g=t("../../components/dragelement"),m=t("../../components/titles"),v=t("../cartesian/select"),y=t("../cartesian/constants"),x=t("../cartesian/graph_interact");e.exports=r;var b=r.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},b.plot=function(t,e){var n,r=this,a=e[r.id],o=e._size;s.getPlotDiv(r.plotContainer.node())!==r.graphDiv&&(r.init(r.graphDiv._fullLayout),r.makeFramework()),r.adjustLayout(a,o);var i=r.traceHash,l={};for(n=0;n_*y?(o=y,a=o*_):(a=v,o=a/_),i=g*a/v,l=m*o/y,n=e.l+e.w*h-a/2,r=e.t+e.h*(1-p)-o/2,s.x0=n,s.y0=r,s.w=a,s.h=o,s.sum=x,s.xaxis={type:"linear",range:[b+2*k-x,x-b-2*w],domain:[h-i/2,h+i/2],_id:"x",_gd:s.graphDiv},f(s.xaxis),s.xaxis.setScale(),s.yaxis={type:"linear",range:[b,x-w-k],domain:[p-l/2,p+l/2],_id:"y",_gd:s.graphDiv},f(s.yaxis),s.yaxis.setScale();var M=s.yaxis.domain[0],A=s.aaxis=d({},t.aaxis,{range:[b,x-w-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[M,M+l*_],_axislayer:s.layers.aaxis,_gridlayer:s.layers.agrid,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l"+o+",-"+a/2});f(A);var T=s.baxis=d({},t.baxis,{range:[x-b-k,w],side:"bottom",_counterangle:30,domain:s.xaxis.domain,_axislayer:s.layers.baxis,_gridlayer:s.layers.bgrid,_counteraxis:s.aaxis,_pos:0,_gd:s.graphDiv,_id:"x",_length:a,_gridpath:"M0,0l-"+a/2+",-"+o});f(T),A._counteraxis=T;var L=s.caxis=d({},t.caxis,{range:[x-b-w,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[M,M+l*_],_axislayer:s.layers.caxis,_gridlayer:s.layers.cgrid,_counteraxis:s.baxis,_pos:0,_gd:s.graphDiv,_id:"y",_length:a,_gridpath:"M0,0l-"+o+","+a/2});f(L);var z="M"+n+","+(r+o)+"h"+a+"l-"+a/2+",-"+o+"Z";s.clipDef.select("path").attr("d",z),s.layers.plotbg.select("path").attr("d",z);var S="translate("+n+","+r+")";s.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",S);var C="translate("+n+","+(r+o)+")";s.layers.baxis.attr("transform",C),s.layers.bgrid.attr("transform",C);var E="translate("+(n+a/2)+","+r+")rotate(30)";s.layers.aaxis.attr("transform",E),s.layers.agrid.attr("transform",E);var O="translate("+(n+a/2)+","+r+")rotate(-30)";s.layers.caxis.attr("transform",O),s.layers.cgrid.attr("transform",O),s.drawAxes(!0),s.plotContainer.selectAll(".crisp").classed("crisp",!1);var P=s.layers.axlines;P.select(".aline").attr("d",A.showline?"M"+n+","+(r+o)+"l"+a/2+",-"+o:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),P.select(".bline").attr("d",T.showline?"M"+n+","+(r+o)+"h"+a:"M0,0").call(c.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),P.select(".cline").attr("d",L.showline?"M"+(n+a/2)+","+r+"l"+a/2+","+o:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px")},b.drawAxes=function(t){var e=this,n=e.graphDiv,r=e.id.substr(7)+"title",a=e.aaxis,o=e.baxis,i=e.caxis;if(h.doTicks(n,a,!0),h.doTicks(n,o,!0),h.doTicks(n,i,!0),t){var l=Math.max(a.showticklabels?a.tickfont.size/2:0,(i.showticklabels?.75*i.tickfont.size:0)+("outside"===i.ticks?.87*i.ticklen:0));m.draw(n,"a"+r,{propContainer:a,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-a.titlefont.size/3-l,"text-anchor":"middle"}});var s=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;m.draw(n,"b"+r,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-s,y:e.y0+e.h+.83*o.titlefont.size+s,"text-anchor":"middle"}}),m.draw(n,"c"+r,{propContainer:i,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+s,y:e.y0+e.h+.83*i.titlefont.size+s,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,k="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",M="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",L=!0;b.initInteractions=function(){function t(t,e,n){var r=R.getBoundingClientRect();b=e-r.left,w=n-r.top,z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},C=z,S=I.aaxis.range[1]-z.a,E=i(I.graphDiv._fullLayout[I.id].bgcolor).getLuminance(),O="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",P=!1,N=F.append("path").attr("class","zoombox").style({fill:E>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",O),D=F.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}function e(t,e){return 1-e/I.h}function n(t,e){return 1-(t+(I.h-e)/Math.sqrt(3))/I.w}function r(t,e){return(t-(I.h-e)/Math.sqrt(3))/I.w}function o(t,a){var o=b+t,i=w+a,l=Math.max(0,Math.min(1,e(b,w),e(o,i))),s=Math.max(0,Math.min(1,n(b,w),n(o,i))),c=Math.max(0,Math.min(1,r(b,w),r(o,i))),u=(l/2+c)*I.w,f=(1-l/2-s)*I.w,d=(u+f)/2,h=f-u,p=(1-l)*I.h,g=p-h/_;h.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),D.transition().style("opacity",1).duration(200),P=!0)}function u(t,e){if(C===z)return 2===e&&m(),a(j);a(j);var n={};n[I.id+".aaxis.min"]=C.a,n[I.id+".baxis.min"]=C.b,n[I.id+".caxis.min"]=C.c,l.relayout(j,n),L&&j.data&&j._context.showTips&&(s.notifier("Double-click to
zoom back out","long"),L=!1)}function f(){z={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},C=z}function d(t,e){var n=t/I.xaxis._m,r=e/I.yaxis._m;C={a:z.a-r,b:z.b+(n+r)/2,c:z.c-(n-r)/2};var a=[C.a,C.b,C.c].sort(),o={a:a.indexOf(C.a),b:a.indexOf(C.b),c:a.indexOf(C.c)};a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),C={a:a[o.a],b:a[o.b],c:a[o.c]},e=(z.a-C.a)*I.yaxis._m,t=(z.c-C.c-z.b+C.b)*I.xaxis._m);var i="translate("+(I.x0+t)+","+(I.y0+e)+")";I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",i),I.aaxis.range=[C.a,I.sum-C.b-C.c],I.baxis.range=[I.sum-C.a-C.c,C.b],I.caxis.range=[I.sum-C.a-C.b,C.c],I.drawAxes(!1),I.plotContainer.selectAll(".crisp").classed("crisp",!1)}function h(t,e){if(t){var n={};n[I.id+".aaxis.min"]=C.a,n[I.id+".baxis.min"]=C.b,n[I.id+".caxis.min"]=C.c,l.relayout(j,n)}else 2===e&&m()}function p(){I.plotContainer.selectAll(".select-outline").remove()}function m(){var t={};t[I.id+".aaxis.min"]=0,t[I.id+".baxis.min"]=0,t[I.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),l.relayout(j,t)}var b,w,z,S,C,E,O,P,N,D,I=this,R=I.layers.plotbg.select("path").node(),j=I.graphDiv,F=I.layers.zoom,q={element:R,gd:j,plotinfo:{plot:F},doubleclick:m,subplot:I.id,prepFn:function(e,n,r){q.xaxes=[I.xaxis],q.yaxes=[I.yaxis];var a=j._fullLayout.dragmode;e.shiftKey&&(a="pan"===a?"zoom":"pan"),"lasso"===a?q.minDrag=1:q.minDrag=void 0,"zoom"===a?(q.moveFn=o,q.doneFn=u,t(e,n,r)):"pan"===a?(q.moveFn=d,q.doneFn=h,f(),p()):"select"!==a&&"lasso"!==a||v(e,n,r,q,a)}};R.onmousemove=function(t){x.hover(j,t,I.id),j._fullLayout._lasthover=R,j._fullLayout._hoversubplot=I.id},R.onmouseout=function(t){j._dragging||g.unhover(j,t)},R.onclick=function(t){x.click(j,t)},g.init(q)}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":48,"../../components/titles":88,"../../lib":103,"../../lib/extend":101,"../../lib/filter_visible":102,"../../plotly":121,"../cartesian/axes":124,"../cartesian/constants":129,"../cartesian/graph_interact":131,"../cartesian/select":137,"../cartesian/set_convert":138,d3:14,tinycolor2:20}],158:[function(t,e,n){"use strict";function r(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var o=t("../plotly"),i=o.Lib.extendFlat,l=o.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var n,s=t.data,c=t.layout,u=l([],s),f=l({},c,r(e.tileClass));if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var d=Object.keys(f);for(n=0;ns;s++)r(n[s])&&h.push({p:n[s],s:l[s],b:0});return o(e,"marker")&&i(e,e.marker.color,"marker","c"),o(e,"marker.line")&&i(e,e.marker.line.color,"marker.line","c"),h}},{"../../components/colorscale/calc":32,"../../components/colorscale/has_colorscale":38,"../../plots/cartesian/axes":124,"fast-isnumeric":17}],168:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../components/color"),o=t("../scatter/xy_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,n,c){function u(n,a){return r.coerce(t,e,s,n,a)}var f=o(t,e,u);return f?(u("orientation",e.x&&!e.y?"h":"v"),u("text"),i(t,e,u,n,c),l(t,e,a.defaultLine,{axis:"y"}),void l(t,e,a.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":25,"../../components/errorbars/defaults":53,"../../lib":103,"../bar/style_defaults":176,"../scatter/xy_defaults":258,"./attributes":166}],169:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/graph_interact"),a=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,n,i){var l,s=t.cd,c=s[0].trace,u=s[0].t,f=t.xa,d=t.ya,h="closest"===i?u.barwidth/2:u.dbar*(1-f._gd._fullLayout.bargap)/2;l="closest"!==i?function(t){return t.p}:"h"===c.orientation?function(t){return t.y}:function(t){return t.x};var p,g;"h"===c.orientation?(p=function(t){return r.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},g=function(t){var e=l(t)-n;return r.inbox(e-h,e+h)}):(g=function(t){return r.inbox(t.b-n,t.y-n)+(t.y-n)/(t.y-t.b)},p=function(t){var n=l(t)-e;return r.inbox(n-h,n+h)});var m=r.getDistanceFunction(i,p,g);if(r.getClosest(s,m,t),t.index!==!1){var v=s[t.index],y=v.mcc||c.marker.color,x=v.mlcc||c.marker.line.color,b=v.mlw||c.marker.line.width;return o.opacity(y)?t.color=y:o.opacity(x)&&b&&(t.color=x),"h"===c.orientation?(t.x0=t.x1=f.c2p(v.x,!0),t.xLabelVal=v.s,t.y0=d.c2p(l(v)-h,!0),t.y1=d.c2p(l(v)+h,!0),t.yLabelVal=v.p):(t.y0=t.y1=d.c2p(v.y,!0),t.yLabelVal=v.s,t.x0=f.c2p(l(v)-h,!0),t.x1=f.c2p(l(v)+h,!0),t.xLabelVal=v.p),v.tx&&(t.text=v.tx),a.hoverInfo(v,c,t),[t]}}},{"../../components/color":25,"../../components/errorbars":54,"../../plots/cartesian/graph_interact":131}],170:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.calc=t("./calc"),r.setPositions=t("./set_positions"),r.colorbar=t("../scatter/colorbar"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.moduleType="trace",r.name="bar",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../scatter/colorbar":240,"./arrays_to_calcdata":165,"./attributes":166,"./calc":167,"./defaults":168,"./hover":169,"./layout_attributes":171,"./layout_defaults":172,"./plot":173,"./set_positions":174,"./style":175}],171:[function(t,e,n){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],172:[function(t,e,n){"use strict";var r=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,n){function l(n,r){return o.coerce(t,e,i,n,r)}for(var s=!1,c=!1,u=!1,f={},d=0;d=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var d,h,p,g;if("h"===l.orientation?(p=u.c2p(n.poffset+e.p,!0),g=u.c2p(n.poffset+e.p+n.barwidth,!0),d=c.c2p(e.b,!0),h=c.c2p(e.s+e.b,!0)):(d=c.c2p(n.poffset+e.p,!0),h=c.c2p(n.poffset+e.p+n.barwidth,!0),g=u.c2p(e.s+e.b,!0),p=u.c2p(e.b,!0)),!(a(d)&&a(h)&&a(p)&&a(g)&&d!==h&&p!==g))return void r.select(this).remove();var m=(e.mlw+1||l.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,v=r.round(m/2%1,2);if(!t._context.staticPlot){var y=i.opacity(e.mc||l.marker.color),x=1>y||m>.01?o:s;d=x(d,h),h=x(h,d),p=x(p,g),g=x(g,p)}r.select(this).attr("d","M"+d+","+p+"V"+g+"H"+h+"V"+p+"Z")})}),d.call(l.plot,e)}},{"../../components/color":25,"../../components/errorbars":54,"../../lib":103,"./arrays_to_calcdata":165,d3:14,"fast-isnumeric":17}],174:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../plots/cartesian/axes"),i=t("../../lib");e.exports=function(t,e){var n,l,s=t._fullLayout,c=e.x(),u=e.y();["v","h"].forEach(function(f){function d(e){function n(t){t[p]=t.p+d}var r=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){r.push(t.p)})});var a=i.distinctVals(r),l=a.vals,c=a.minDiff,u=!1,f=[];"group"===s.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||f.forEach(function(e){Math.abs(t.p-e)_&&(S=!0,A=_),_>M+P&&(S=!0,M=_))}o.expand(v,[A,M],{tozero:!0,padded:S})}else{var N=function(t){return t[g]=t.s,t.s};for(n=0;n1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,n=e.marker,i=n.line,l=(e._input||{}).marker||{},s=o.tryColorscale(n,l,""),c=o.tryColorscale(n,l,"line.");r.select(this).selectAll("path").each(function(t){var e,o,l=(t.mlw+1||i.width+1)-1,u=r.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(n.color)?a.defaultLine:n.color,u.style("stroke-width",l+"px").call(a.fill,e),l&&(o="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":25,"../../components/drawing":48,"../../components/errorbars":54,d3:14}],176:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,n,i,l){n("marker.color",i),a(t,"marker")&&o(t,e,l,n,{prefix:"marker.",cLetter:"c"}),n("marker.line.color",r.defaultLine),a(t,"marker.line")&&o(t,e,l,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width")}},{"../../components/color":25,"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38}],177:[function(t,e,n){"use strict";var r=t("../scatter/attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,i=r.marker,l=i.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any" +},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:o({},i.symbol,{arrayOk:!1}),opacity:o({},i.opacity,{arrayOk:!1,dflt:1}),size:o({},i.size,{arrayOk:!1}),color:o({},i.color,{arrayOk:!1}),line:{color:o({},l.color,{arrayOk:!1,dflt:a.defaultLine}),width:o({},l.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:r.fillcolor}},{"../../components/color/attributes":24,"../../lib/extend":101,"../scatter/attributes":237}],178:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes");e.exports=function(t,e){function n(t,e,n,o,i){var l;return n in e?p=o.makeCalcdata(e,n):(l=n+"0"in e?e[n+"0"]:"name"in e&&("category"===o.type||r(e.name)&&-1!==["linear","log"].indexOf(o.type)||a.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,l=o.d2c(l),p=i.map(function(){return l})),p}function i(t,e,n,o,i){var l,s,c,u,f=o.length,d=e.length,h=[],p=[];for(l=0;f>l;++l)s=o[l],t[l]={pos:s},p[l]=s-i,h[l]=[];for(p.push(o[f-1]+i),l=0;d>l;++l)u=e[l],r(u)&&(c=a.findBin(n[l],p),c>=0&&d>c&&h[c].push(u));return h}function l(t,e){var n,r,o,i;for(i=0;i1,v=n.dPos*(1-d.boxgap)*(1-d.boxgroupgap)/(m?t.numboxes:1),y=m?2*n.dPos*(-.5+(n.boxnum+.5)/t.numboxes)*(1-d.boxgap):0,x=v*g.whiskerwidth;return g.visible!==!0||n.emptybox?void o.select(this).remove():("h"===g.orientation?(s=p,f=h):(s=h,f=p),n.bPos=y,n.bdPos=v,r(),o.select(this).selectAll("path.box").data(i.identity).enter().append("path").attr("class","box").each(function(t){var e=s.c2p(t.pos+y,!0),n=s.c2p(t.pos+y-v,!0),r=s.c2p(t.pos+y+v,!0),a=s.c2p(t.pos+y-x,!0),l=s.c2p(t.pos+y+x,!0),c=f.c2p(t.q1,!0),u=f.c2p(t.q3,!0),d=i.constrain(f.c2p(t.med,!0),Math.min(c,u)+1,Math.max(c,u)-1),h=f.c2p(g.boxpoints===!1?t.min:t.lf,!0),p=f.c2p(g.boxpoints===!1?t.max:t.uf,!0);"h"===g.orientation?o.select(this).attr("d","M"+d+","+n+"V"+r+"M"+c+","+n+"V"+r+"H"+u+"V"+n+"ZM"+c+","+e+"H"+h+"M"+u+","+e+"H"+p+(0===g.whiskerwidth?"":"M"+h+","+a+"V"+l+"M"+p+","+a+"V"+l)):o.select(this).attr("d","M"+n+","+d+"H"+r+"M"+n+","+c+"H"+r+"V"+u+"H"+n+"ZM"+e+","+c+"V"+h+"M"+e+","+u+"V"+p+(0===g.whiskerwidth?"":"M"+a+","+h+"H"+l+"M"+a+","+p+"H"+l))}),g.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=n,t.trace=g}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,n,r,o,l,s,f,d="all"===g.boxpoints?t.val:t.val.filter(function(e){return et.uf}),h=(t.q3-t.q1)*u,p=[],m=0;if(g.jitter){for(e=0;et.lo&&(r.so=!0),r})}).enter().append("path").call(l.translatePoints,h,p),void(g.boxmean&&o.select(this).selectAll("path.mean").data(i.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=s.c2p(t.pos+y,!0),n=s.c2p(t.pos+y-v,!0),r=s.c2p(t.pos+y+v,!0),a=f.c2p(t.mean,!0),i=f.c2p(t.mean-t.sd,!0),l=f.c2p(t.mean+t.sd,!0);"h"===g.orientation?o.select(this).attr("d","M"+a+","+n+"V"+r+("sd"!==g.boxmean?"":"m0,0L"+i+","+e+"L"+a+","+n+"L"+l+","+e+"Z")):o.select(this).attr("d","M"+n+","+a+"H"+r+("sd"!==g.boxmean?"":"m0,0L"+e+","+i+"L"+n+","+a+"L"+e+","+l+"Z"))})))})}},{"../../components/drawing":48,"../../lib":103,d3:14}],185:[function(t,e,n){"use strict";var r=t("../../plots/plots"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var n,i,l,s,c=t._fullLayout,u=e.x(),f=e.y(),d=["v","h"];for(i=0;in;n++)e=f[n],h[n]=e[0]*(t.zmax-t.zmin)+t.zmin,p[n]=e[1];var g=r.extent([t.zmin,t.zmax,o.start,o.start+s*(c-1)]),m=g[t.zminn;n++)e=f[n],h[n]=(e[0]*(c+u-1)-u/2)*s+i,p[n]=e[1];var y=r.scale.linear().interpolate(r.interpolateRgb).domain(h).range(p);return y}},{"../../components/colorscale/get_scale":37,d3:14}],194:[function(t,e,n){"use strict";function r(t,e,n){var r=n[0].trace,o=n[0].x,l=n[0].y,c=r.contours,u=r.uid,f=e.x(),d=e.y(),m=t._fullLayout,x="contour"+u,b=a(c,e,n[0]);if(r.visible!==!0)return m._paper.selectAll("."+x+",.hm"+u).remove(),void m._infolayer.selectAll(".cb"+u).remove();"heatmap"===c.coloring?(r.zauto&&r.autocontour===!1&&(r._input.zmin=r.zmin=c.start-c.size/2,r._input.zmax=r.zmax=r.zmin+b.length*c.size),k(t,e,[n])):m._paper.selectAll(".hm"+u).remove(),i(b),s(b);var _=f.c2p(o[0],!0),w=f.c2p(o[o.length-1],!0),M=d.c2p(l[0],!0),A=d.c2p(l[l.length-1],!0),T=[[_,A],[w,A],[w,M],[_,M]],L=h(e,n,x);p(L,T,c),g(L,b,T,c),v(L,b,c),y(L,e,n[0],T)}function a(t,e,n){for(var r=t.size||1,a=[],o=t.start;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===n||10===n){var r=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>r?5===n?713:1114:5===n?104:208}return 15===n?0:n}function i(t){var e,n,r,a,i,l,s,c,u,f=t[0].z,d=f.length,h=f[0].length,p=2===d||2===h;for(n=0;d-1>n;n++)for(a=[],0===n&&(a=a.concat(M)),n===d-2&&(a=a.concat(A)),e=0;h-1>e;e++)for(r=a.slice(),0===e&&(r=r.concat(T)),e===h-2&&(r=r.concat(L)),i=e+","+n,l=[[f[n][e],f[n][e+1]],[f[n+1][e],f[n+1][e+1]]],u=0;ua;a++){if(l>20?(l=S[l][(s[0]||s[1])<0?0:1],t.crossings[i]=C[l]):delete t.crossings[i],s=z[l],!s){_.log("Found bad marching index:",l,e,t.level);break}if(h.push(d(t,e,s)),e[0]+=s[0],e[1]+=s[1],u(h[h.length-1],h[h.length-2])&&h.pop(),i=e.join(","),i===o&&s.join(",")===p||n&&(s[0]&&(e[0]<0||e[0]>m-2)||s[1]&&(e[1]<0||e[1]>g-2)))break;l=t.crossings[i]}1e4===a&&_.log("Infinite loop in contour?");var v,y,x,b,w,k,M,A=u(h[0],h[h.length-1]),T=0,L=.2*t.smoothing,E=[],O=0;for(a=1;a=O;a--)if(v=E[a],P>v){for(x=0,y=a-1;y>=O&&v+E[y]x&&v+E[x]e;)e++,n=Object.keys(a.crossings)[0].split(",").map(Number),l(a,n);1e4===e&&_.log("Infinite loop in contour?")}}function c(t,e,n){var r=0,a=0;return t>20&&e?208===t||1114===t?r=0===n[0]?1:-1:a=0===n[1]?1:-1:-1!==M.indexOf(t)?a=1:-1!==T.indexOf(t)?r=1:-1!==A.indexOf(t)?a=-1:r=-1,[r,a]}function u(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function f(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function d(t,e,n){var r=e[0]+Math.max(n[0],0),a=e[1]+Math.max(n[1],0),o=t.z[a][r],i=t.xaxis,l=t.yaxis;if(n[1]){var s=(t.level-o)/(t.z[a][r+1]-o);return[i.c2p((1-s)*t.x[r]+s*t.x[r+1],!0),l.c2p(t.y[a],!0)]}var c=(t.level-o)/(t.z[a+1][r]-o);return[i.c2p(t.x[r],!0),l.c2p((1-c)*t.y[a]+c*t.y[a+1],!0)]}function h(t,e,n){var r=t.plot.select(".maplayer").selectAll("g.contour."+n).data(e);return r.enter().append("g").classed("contour",!0).classed(n,!0),r.exit().remove(),r}function p(t,e,n){var r=t.selectAll("g.contourbg").data([0]);r.enter().append("g").classed("contourbg",!0);var a=r.selectAll("path").data("fill"===n.coloring?[0]:[]);a.enter().append("path"),a.exit().remove(),a.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,n,r){var a=t.selectAll("g.contourfill").data([0]);a.enter().append("g").classed("contourfill",!0);var o=a.selectAll("path").data("fill"===r.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=m(t,n);e?b.select(this).attr("d",e).style("stroke","none"):b.select(this).remove()})}function m(t,e){function n(t){return Math.abs(t[1]-e[0][1])<.01}function r(t){return Math.abs(t[1]-e[2][1])<.01}function a(t){return Math.abs(t[0]-e[0][0])<.01}function o(t){return Math.abs(t[0]-e[2][0])<.01}for(var i,l,s,c,u,f,d=t.edgepaths.length||t.z[0][0]s;s++){if(!i){_.log("Missing end?",h,t);break}for(n(i)&&!o(i)?l=e[1]:a(i)?l=e[0]:r(i)?l=e[3]:o(i)&&(l=e[2]),u=0;u=0&&(l=m,c=u):Math.abs(i[1]-l[1])<.01?Math.abs(i[1]-m[1])<.01&&(m[0]-i[0])*(l[0]-m[0])>=0&&(l=m,c=u):_.log("endpt to newendpt is not vert. or horz.",i,l,m)}if(i=l,c>=0)break;d+="L"+l}if(c===t.edgepaths.length){_.log("unclosed perimeter path");break}h=c,g=-1===p.indexOf(h),g&&(h=p[0],d+="Z")}for(h=0;he;e++)l.push(1);for(e=0;o>e;e++)a.push(l.slice());for(e=0;ei;i++)for(r=a(s,i),u[i]=new Array(r),l=0;r>l;l++)u[i][l]=e(o(s,i,l));return u}function a(t,e,n,r,a,o){var i,l,s,c=[],u=d.traceIs(t,"contour"),f=d.traceIs(t,"histogram"),h=d.traceIs(t,"gl2d"),p=Array.isArray(e)&&e.length>1;if(p&&!f&&"category"!==o.type){e=e.map(o.d2c);var g=e.length;if(!(a>=g))return u?e.slice(0,a):e.slice(0,a+1);if(u||h)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],s=1;g>s;s++)c.push(.5*(e[s-1]+e[s]));c.push(1.5*e[g-1]-.5*e[g-2])}if(a>g){var m=c[c.length-1],v=m-c[c.length-2];for(s=g;a>s;s++)m+=v,c.push(m)}}else for(l=r||1,i=f||"category"===o.type?n||0:Array.isArray(e)&&1===e.length?e[0]:void 0===n?0:o.d2c(n),s=u||h?0:-.5;a>s;s++)c.push(i+l*s);return c}function o(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,n){var r,a,i=1;if(Array.isArray(n))for(r=0;rr&&i>y;r++)i=s(t,e,o(i));return i>y&&u.log("interp2d didn't converge quickly",i),t}function l(t){var e,n,r,a,o,i,l,s,c=[],u={},f=[],d=t[0],h=[],p=[0,0,0],g=v(t);for(n=0;nr;r++)void 0===h[r]&&(i=(void 0!==h[r-1]?1:0)+(void 0!==h[r+1]?1:0)+(void 0!==e[r]?1:0)+(void 0!==d[r]?1:0),i?(0===n&&i++,0===r&&i++,n===t.length-1&&i++,r===h.length-1&&i++,4>i&&(u[[n,r]]=[n,r,i]),c.push([n,r,i])):f.push([n,r]));for(;f.length;){for(l={},s=!1,o=f.length-1;o>=0;o--)a=f[o],n=a[0],r=a[1],i=((u[[n-1,r]]||p)[2]+(u[[n+1,r]]||p)[2]+(u[[n,r-1]]||p)[2]+(u[[n,r+1]]||p)[2])/20,i&&(l[a]=[n,r,i],f.splice(o,1),s=!0);if(!s)throw"findEmpties iterated with no new neighbors";for(a in l)u[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}function s(t,e,n){var r,a,o,i,l,s,c,u,f,d,h,p,g,m=0;for(i=0;il;l++)s=x[l],c=t[a+s[0]],c&&(u=c[o+s[1]],void 0!==u&&(0===d?p=g=u:(p=Math.min(p,u),g=Math.max(g,u)),f++,d+=u));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[a][o]=d/f,void 0===h?4>f&&(m=1):(t[a][o]=(1+n)*t[a][o]-n*h,g>p&&(m=Math.max(m,Math.abs(t[a][o]-h)/(g-p))))}return m}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../../plots/plots"),h=t("../histogram2d/calc"),p=t("../../components/colorscale/calc"),g=t("./has_columns"),m=t("./convert_column_xyz"),v=t("./max_row_length");e.exports=function(t,e){function n(t){z=e._input.zsmooth=e.zsmooth=!1,u.notifier("cannot fast-zsmooth: "+t)}var o,s,c,y,x,b,_,w,k=f.getFromId(t,e.xaxis||"x"),M=f.getFromId(t,e.yaxis||"y"),A=d.traceIs(e,"contour"),T=d.traceIs(e,"histogram"),L=d.traceIs(e,"gl2d"),z=A?"best":e.zsmooth;if(k._minDtick=0,M._minDtick=0,T){var S=h(t,e);o=S.x,s=S.x0,c=S.dx,y=S.y,x=S.y0,b=S.dy,_=S.z}else g(e)&&m(e,k,M),o=e.x?k.makeCalcdata(e,"x"):[],y=e.y?M.makeCalcdata(e,"y"):[],s=e.x0||0,c=e.dx||1,x=e.y0||0,b=e.dy||1,_=r(e),(A||e.connectgaps)&&(e._emptypoints=l(_),e._interpz=i(_,e._emptypoints,e._interpz));if("fast"===z)if("log"===k.type||"log"===M.type)n("log axis found");else if(!T){if(o.length){var C=(o[o.length-1]-o[0])/(o.length-1),E=Math.abs(C/100);for(w=0;wE){n("x scale is not linear");break}}if(y.length&&"fast"===z){var O=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(O/100);for(w=0;wP){n("y scale is not linear");break}}}var N=v(_),D="scaled"===e.xtype?"":e.x,I=a(e,D,s,c,N,k),R="scaled"===e.ytype?"":e.y,j=a(e,R,x,b,_.length,M);L||(f.expand(k,I),f.expand(M,j));var F={x:I,y:j,z:_};if(p(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var q="contour"===e.type?"heatmap":"histogram2d";F.xfill=a(q,D,s,c,N,k),F.yfill=a(q,R,x,b,_.length,M)}return[F]};var y=.01,x=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":32,"../../lib":103,"../../plots/cartesian/axes":124,"../../plots/plots":144,"../histogram2d/calc":210,"./convert_column_xyz":200,"./has_columns":202,"./max_row_length":205,"fast-isnumeric":17}],199:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,c="cb"+n.uid,u=l(n.colorscale),f=n.zmin,d=n.zmax;if(a(f)||(f=o.aggNums(Math.min,null,n.z)),a(d)||(d=o.aggNums(Math.max,null,n.z)),t._fullLayout._infolayer.selectAll("."+c).remove(),!n.showscale)return void i.autoMargin(t,c);var h=e[0].t.cb=s(t,c);h.fillcolor(r.scale.linear().domain(u.map(function(t){return f+t[0]*(d-f)})).range(u.map(function(t){return t[1]}))).filllevels({start:f,end:d,size:(d-f)/254}).options(n.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale/get_scale":37,"../../lib":103,"../../plots/plots":144,d3:14,"fast-isnumeric":17}],200:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n){var a,o=t.x.slice(),i=t.y.slice(),l=t.z,s=t.text,c=Math.min(o.length,i.length,l.length),u=void 0!==s&&!Array.isArray(s[0]);for(ca;a++)o[a]=e.d2c(o[a]),i[a]=n.d2c(i[a]);var f,d,h,p=r.distinctVals(o),g=p.vals,m=r.distinctVals(i),v=m.vals,y=r.init2dArray(v.length,g.length);for(u&&(h=r.init2dArray(v.length,g.length)),a=0;c>a;a++)f=r.findBin(o[a]+p.minDiff/2,g),d=r.findBin(i[a]+m.minDiff/2,v),y[d][f]=l[a],u&&(h[d][f]=s[a]);t.x=g,t.y=v,t.z=y,u&&(t.text=h)}},{"../../lib":103}],201:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./has_columns"),o=t("./xyz_defaults"),i=t("../../components/colorscale/defaults"),l=t("./attributes");e.exports=function(t,e,n,s){function c(n,a){return r.coerce(t,e,l,n,a)}var u=o(t,e,c);return u?(c("text"),c("zsmooth"),c("connectgaps",a(e)&&e.zsmooth!==!1),void i(t,e,s,c,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":35,"../../lib":103,"./attributes":197,"./has_columns":202,"./xyz_defaults":208}],202:[function(t,e,n){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],203:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/graph_interact"),a=t("../../lib"),o=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,n,i,l){if(!(t.distanceu||u>=y[0].length||0>f||f>y.length)return}else{if(r.inbox(e-m[0],e-m[m.length-1])>o||r.inbox(n-v[0],n-v[v.length-1])>o)return;if(l){var k;for(b=[2*m[0]-m[1]],k=1;k0;)_=m.c2p(C[A]),A--;for(b>_&&(w=_,_=b,b=w,I=!0),A=0;void 0===k&&A0;)M=v.c2p(E[A]),A--;if(k>M&&(w=k,k=M,M=w,R=!0),O&&(C=n[0].xfill,E=n[0].yfill),"fast"!==P){var j="best"===P?0:.5;b=Math.max(-j*m._length,b),_=Math.min((1+j)*m._length,_),k=Math.max(-j*v._length,k),M=Math.min((1+j)*v._length,M)}var F=Math.round(_-b),q=Math.round(M-k),B=0>=F||0>=q,H=e.plot.select(".imagelayer").selectAll("g.hm."+x).data(B?[]:[0]);if(H.enter().append("g").classed("hm",!0).classed(x,!0),H.exit().remove(),!B){var V,Z;"fast"===P?(V=D,Z=N):(V=F,Z=q);var U=document.createElement("canvas");U.width=V,U.height=Z;var Y,X,G=U.getContext("2d"),$=a.scale.linear().domain(S.map(function(t){return t[0]})).range(S.map(function(t){var e=o(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===P?(Y=I?function(t){return D-1-t}:i.identity,X=R?function(t){return N-1-t}:i.identity):(Y=function(t){return i.constrain(Math.round(m.c2p(C[t])-b),0,F)},X=function(t){return i.constrain(Math.round(v.c2p(E[t])-k),0,q)});var Q,W,J,K,tt,et,nt=X(0),rt=[nt,nt],at=I?0:1,ot=R?0:1,it=0,lt=0,st=0,ct=0;if(P){var ut=0,ft=new Uint8Array(F*q*4);if("best"===P){var dt,ht,pt,gt=new Array(C.length),mt=new Array(E.length),vt=new Array(F);for(A=0;AA;A++)vt[A]=r(A,gt);for(W=0;q>W;W++)for(dt=r(W,mt),ht=T[dt.bin0],pt=T[dt.bin1],A=0;F>A;A++,ut+=4)et=h(ht,pt,vt[A],dt),d(ft,ut,et)}else for(W=0;N>W;W++)for(tt=T[W],rt=X(W),A=0;F>A;A++)et=f(tt[A],1),ut=4*(rt*F+Y(A)),d(ft,ut,et);var yt=G.createImageData(F,q);yt.data.set(ft),G.putImageData(yt,0,0)}else for(W=0;N>W;W++)if(tt=T[W],rt.reverse(),rt[ot]=X(W+1),rt[0]!==rt[1]&&void 0!==rt[0]&&void 0!==rt[1])for(J=Y(0),Q=[J,J],A=0;D>A;A++)Q.reverse(),Q[at]=Y(A+1),Q[0]!==Q[1]&&void 0!==Q[0]&&void 0!==Q[1]&&(K=tt[A],et=f(K,(Q[1]-Q[0])*(rt[1]-rt[0])),G.fillStyle="rgba("+et.join(",")+")",G.fillRect(Q[0],rt[0],Q[1]-Q[0],rt[1]-rt[0]));lt=Math.round(lt/it),st=Math.round(st/it),ct=Math.round(ct/it);var xt=o("rgb("+lt+","+st+","+ct+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*xt.getLuminance();var bt=H.selectAll("image").data(n);bt.enter().append("svg:image").attr({xmlns:c.svg,preserveAspectRatio:"none"}),bt.attr({height:q,width:F,x:b,y:k,"xlink:href":U.toDataURL("image/png")}),bt.exit().remove()}}var a=t("d3"),o=t("tinycolor2"),i=t("../../lib"),l=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),c=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,n){for(var a=0;a0&&(r=!0);for(var l=0;lv&&p.splice(v,p.length-v),m.length>v&&m.splice(v,m.length-v),!e.autobinx&&"xbins"in e||(e.xbins=a.autoBin(p,h,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=a.autoBin(m,g,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),f=[];var y,x,b=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,k="string"==typeof e.xbins.size?[]:e.ybins,M=0,A=[],T=e.histnorm,L=e.histfunc,z=-1!==T.indexOf("density"),S="max"===L||"min"===L,C=S?null:0,E=o.count,O=i[T],P=!1,N=[],D=[],I="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";I&&"count"!==L&&(P="avg"===L,E=o[L]);var R=e.xbins,j=R.end+(R.start-a.tickIncrement(R.start,R.size))/1e6;for(d=R.start;j>d;d=a.tickIncrement(d,R.size))b.push(C),Array.isArray(w)&&w.push(d),P&&_.push(0);Array.isArray(w)&&w.push(d);var F=b.length;for(n=e.xbins.start,s=(d-n)/F,n+=s/2,R=e.ybins,j=R.end+(R.start-a.tickIncrement(R.start,R.size))/1e6,d=R.start;j>d;d=a.tickIncrement(d,R.size))f.push(b.concat()),Array.isArray(k)&&k.push(d),P&&A.push(_.concat());Array.isArray(k)&&k.push(d);var q=f.length;for(c=e.ybins.start,u=(d-c)/q,c+=u/2,z&&(N=b.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/s}),D=f.map(function(t,e){return Array.isArray(k)?1/(k[e+1]-k[e]):1/u})),d=0;v>d;d++)y=r.findBin(p[d],w),x=r.findBin(m[d],k),y>=0&&F>y&&x>=0&&q>x&&(M+=E(y,d,f[x],I,A[x]));if(P)for(x=0;q>x;x++)M+=l(f[x],A[x]);if(O)for(x=0;q>x;x++)O(f[x],M,N,D[x]);return{x:p,x0:n,dx:s,y:m,y0:c,dy:u,z:f}}},{"../../lib":103,"../../plots/cartesian/axes":124,"../histogram/average":218,"../histogram/bin_functions":220,"../histogram/norm_functions":224}],211:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./sample_defaults"),o=t("../../components/colorscale/defaults"),i=t("./attributes");e.exports=function(t,e,n){function l(n,a){return r.coerce(t,e,i,n,a)}a(t,e,l),l("zsmooth"),o(t,e,n,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":35,"../../lib":103,"./attributes":209,"./sample_defaults":213}],212:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../heatmap/calc"),r.plot=t("../heatmap/plot"),r.colorbar=t("../heatmap/colorbar"),r.style=t("../heatmap/style"),r.hoverPoints=t("../heatmap/hover"),r.moduleType="trace",r.name="histogram2d",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","2dMap","histogram"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../heatmap/calc":198,"../heatmap/colorbar":199,"../heatmap/hover":203,"../heatmap/plot":206,"../heatmap/style":207,"./attributes":209,"./defaults":211}],213:[function(t,e,n){"use strict";var r=t("../histogram/bin_defaults");e.exports=function(t,e,n){var a=n("x"),o=n("y");if(!(a&&a.length&&o&&o.length))return void(e.visible=!1);var i=n("z")||n("marker.color");i&&n("histfunc");var l=["x","y"];r(t,e,n,l)}},{"../histogram/bin_defaults":219}],214:[function(t,e,n){"use strict";var r=t("../histogram2d/attributes"),a=t("../contour/attributes"),o=t("../../components/colorscale/attributes"),i=t("../../lib/extend").extendFlat;e.exports=i({},{x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,autobinx:r.autobinx,nbinsx:r.nbinsx,xbins:r.xbins,autobiny:r.autobiny,nbinsy:r.nbinsy,ybins:r.ybins,autocontour:a.autocontour,ncontours:a.ncontours,contours:a.contours,line:a.line,_nestedModules:{colorbar:"Colorbar"}},o)},{"../../components/colorscale/attributes":31,"../../lib/extend":101,"../contour/attributes":187,"../histogram2d/attributes":209}],215:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../histogram2d/sample_defaults"),o=t("../contour/style_defaults"),i=t("./attributes");e.exports=function(t,e,n,l){function s(n,a){return r.coerce(t,e,i,n,a)}a(t,e,s);var c=r.coerce2(t,e,i,"contours.start"),u=r.coerce2(t,e,i,"contours.end"),f=s("autocontour",!(c&&u));s(f?"ncontours":"contours.size"),o(t,e,s,l)}},{"../../lib":103,"../contour/style_defaults":196,"../histogram2d/sample_defaults":213,"./attributes":214}],216:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.calc=t("../contour/calc"),r.plot=t("../contour/plot"),r.style=t("../contour/style"),r.colorbar=t("../contour/colorbar"),r.hoverPoints=t("../contour/hover"),r.moduleType="trace",r.name="histogram2dcontour",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","2dMap","contour","histogram"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../contour/calc":188,"../contour/colorbar":189,"../contour/hover":191,"../contour/plot":194,"../contour/style":195,"./attributes":214,"./defaults":215}],217:[function(t,e,n){"use strict";function r(t){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var a=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:a.text,orientation:a.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:r("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:r("y"),marker:a.marker,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:a._deprecated.bardir}}},{"../bar/attributes":166}],218:[function(t,e,n){"use strict";e.exports=function(t,e){for(var n=t.length,r=0,a=0;n>a;a++)e[a]?(t[a]/=e[a],r+=t[a]):t[a]=null;return r}},{}],219:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){return n("histnorm"),r.forEach(function(t){var e=n(t+"bins.start"),r=n(t+"bins.end"),a=n("autobin"+t,!(e&&r));n(a?"nbins"+t:t+"bins.size")}),e}},{}],220:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports={count:function(t,e,n){return n[t]++,1},sum:function(t,e,n,a){var o=a[e];return r(o)?(o=Number(o),n[t]+=o,o):0},avg:function(t,e,n,a,o){var i=a[e];return r(i)&&(i=Number(i),n[t]+=i,o[t]++),0},min:function(t,e,n,a){var o=a[e];if(r(o)){if(o=Number(o),!r(n[t]))return n[t]=o,o;if(n[t]>o)return n[t]=o,o-n[t]}return 0},max:function(t,e,n,a){var o=a[e];if(r(o)){if(o=Number(o),!r(n[t]))return n[t]=o,o;if(n[t]n&&c.length<5e3;)g=o.tickIncrement(n,x.size),c.push((n+g)/2),u.push(S),b&&_.push(n),L&&w.push(1/(g-n)),O&&k.push(0),n=g;var P=u.length;for(n=0;n=0&&P>v&&(M+=C(v,n,u,y,k));O&&(M=s(u,k)),E&&E(u,M,w);var N=Math.min(c.length,u.length),D=[],I=0,R=N-1;for(n=0;N>n;n++)if(u[n]){I=n;break}for(n=N-1;n>I;n--)if(u[n]){R=n;break}for(n=I;R>=n;n++)r(c[n])&&r(u[n])&&D.push({p:c[n],s:u[n],b:0});return D}}},{"../../lib":103,"../../plots/cartesian/axes":124,"./average":218,"./bin_functions":220,"./norm_functions":224,"fast-isnumeric":17}],222:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,n,c){function u(n,a){return r.coerce(t,e,s,n,a)}var f=u("x"),d=u("y");u("text");var h=u("orientation",d&&!f?"h":"v"),p=e["v"===h?"x":"y"];if(!p||!p.length)return void(e.visible=!1);var g=e["h"===h?"x":"y"];g&&u("histfunc");var m="h"===h?["y"]:["x"];o(t,e,u,m),i(t,e,u,n,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":25,"../../components/errorbars/defaults":53,"../../lib":103,"../bar/style_defaults":176,"./attributes":217,"./bin_defaults":219}],223:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.layoutAttributes=t("../bar/layout_attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("../bar/layout_defaults"),r.calc=t("./calc"),r.setPositions=t("../bar/set_positions"),r.plot=t("../bar/plot"),r.style=t("../bar/style"),r.colorbar=t("../scatter/colorbar"),r.hoverPoints=t("../bar/hover"),r.moduleType="trace",r.name="histogram",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"../bar/hover":169,"../bar/layout_attributes":171,"../bar/layout_defaults":172,"../bar/plot":173,"../bar/set_positions":174,"../bar/style":175,"../scatter/colorbar":240,"./attributes":217,"./calc":221,"./defaults":222}],224:[function(t,e,n){"use strict";e.exports={percent:function(t,e){for(var n=t.length,r=100/e,a=0;n>a;a++)t[a]*=r},probability:function(t,e){for(var n=t.length,r=0;n>r;r++)t[r]/=e},density:function(t,e,n,r){var a=t.length;r=r||1;for(var o=0;a>o;o++)t[o]*=n[o]*r},"probability density":function(t,e,n,r){var a=t.length;r&&(e/=r);for(var o=0;a>o;o++)t[o]*=n[o]/e}}},{}],225:[function(t,e,n){"use strict";var r=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:r.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":24,"../../lib/extend":101,"../../plots/attributes":122,"../../plots/font_attributes":142}],226:[function(t,e,n){"use strict";function r(t,e){for(var n=[],r=0;rs||(c=p[n],void 0!==c&&""!==c||(c=n),c=String(c),void 0===y[c]&&(y[c]=!0,u=o(e.marker.colors[n]),u.isValid()?(u=i.addOpacity(u,u.getAlpha()),v[c]||(v[c]=u)):v[c]?u=v[c]:(u=!1,x=!0),f=-1!==_.indexOf(c),f||(b+=s),g.push({v:s,label:c,color:u,i:n,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(n=0;n")}return g};var s},{"../../components/color":25,"./helpers":229,"fast-isnumeric":17,tinycolor2:20}],228:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes");e.exports=function(t,e,n,o){function i(n,o){return r.coerce(t,e,a,n,o)}var l=r.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel"));var u=i("marker.line.width");u&&i("marker.line.color");var f=i("marker.colors");Array.isArray(f)||(e.marker.colors=[]),i("scalegroup");var d=i("text"),h=i("textinfo",Array.isArray(d)?"text+percent":"percent");if(i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var p=i("textposition"),g=Array.isArray(p)||"auto"===p,m=g||"inside"===p,v=g||"outside"===p;if(m||v){var y=l(i,"textfont",o.font);m&&l(i,"insidetextfont",y),v&&l(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":103,"./attributes":225}],229:[function(t,e,n){"use strict";var r=t("../../lib");n.formatPiePercent=function(t,e){var n=(100*t).toPrecision(3);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)+"%"},n.formatPieValue=function(t,e){var n=t.toPrecision(10);return-1!==n.lastIndexOf(".")&&(n=n.replace(/[.]?0+$/,"")),r.numSeparate(n,e)}},{"../../lib":103}],230:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.supplyLayoutDefaults=t("./layout_defaults"),r.layoutAttributes=t("./layout_attributes"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.styleOne=t("./style_one"),r.moduleType="trace",r.name="pie",r.basePlotModule=t("./base_plot"),r.categories=["pie","showLegend"],r.meta={},e.exports=r},{"./attributes":225,"./base_plot":226,"./calc":227,"./defaults":228,"./layout_attributes":231,"./layout_defaults":232,"./plot":233,"./style":234,"./style_one":235}],231:[function(t,e,n){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],232:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function n(n,o){return r.coerce(t,e,a,n,o)}n("hiddenlabels")}},{"../../lib":103,"./layout_attributes":231}],233:[function(t,e,n){"use strict";function r(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/n.vTotal,.5),l=1-n.trace.hole,s=a(e,n),c={scale:s*n.r*2/r,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=n.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/n.r)-f*o/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=n.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),m={scale:2*g/t.width,rCenter:Math.cos(g/n.r)-g/o/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>d.scale?m:d;return c.scale<1&&v.scale>c.scale?v:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var n=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(n)),(1-e.trace.hole)/2)}function o(t,e){var n=e.pxmid[0],r=e.pxmid[1],a=t.width/2,o=t.height/2;return 0>n&&(a*=-1),0>r&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}function i(t,e){function n(t,e){return t.pxmid[1]-e.pxmid[1]}function r(t,e){return e.pxmid[1]-t.pxmid[1]}function a(t,n){n||(n={});var r,a,o,l,d,h,g=n.labelExtraY+(i?n.yLabelMax:n.yLabelMin),m=i?t.yLabelMin:t.yLabelMax,v=i?t.yLabelMax:t.yLabelMin,y=t.cyFinal+c(t.px0[1],t.px1[1]),x=g-m;if(x*f>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*f>0?(l=o.cyFinal+c(o.px0[1],o.px1[1]),x=l-m-t.labelExtraY,x*f>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*f>0&&(r=3*u*Math.abs(a-p.indexOf(t)),d=o.cxFinal+s(o.px0[0],o.px1[0]),h=d+r-(t.cxFinal+t.pxmid[0])-t.labelExtraX,h*u>0&&(t.labelExtraX+=h)))}var o,i,l,s,c,u,f,d,h,p,g,m,v;for(i=0;2>i;i++)for(l=i?n:r,c=i?Math.max:Math.min,f=i?1:-1,o=0;2>o;o++){for(s=o?Math.max:Math.min,u=o?1:-1,d=t[i][o],d.sort(l),h=t[1-i][o],p=h.concat(d),m=[],g=0;gu&&(u=l.pull[o]);i.r=Math.min(n/c(l.tilt,Math.sin(s),l.depth),r/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===h.indexOf(l.scalegroup)&&h.push(l.scalegroup)}for(o=0;of.vTotal/2?1:0)}function c(t,e,n){if(!t)return 1;var r=Math.sin(t*Math.PI/180);return Math.max(.01,n*r*Math.abs(e)+2*Math.sqrt(1-r*r*e*e))}var u=t("d3"),f=t("../../plots/cartesian/graph_interact"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var n=t._fullLayout;l(e,n._size);var c=n._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],m=c.trace,v=0,y=(m.depth||0)*c.r*Math.sin(v)/2,x=m.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=c.r*Math.cos(v),k=l.selectAll("g.part").data(m.tilt?["top","sides"]:["top"]);k.enter().append("g").attr("class",function(t){return t+" part"}),k.exit().remove(),k.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],v=!1;l.each(function(i){function l(e){var r=t._fullLayout,o=t._fullData[m.index],l=o.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),!t._dragging&&r.hovermode!==!1&&"none"!==l&&l){var s=a(i,c),u=k+i.pxmid[0]*(1-s),d=M+i.pxmid[1]*(1-s),h=n.separators,p=[];-1!==l.indexOf("label")&&p.push(i.label),o.text&&o.text[i.i]&&-1!==l.indexOf("text")&&p.push(o.text[i.i]),-1!==l.indexOf("value")&&p.push(g.formatPieValue(i.v,h)),-1!==l.indexOf("percent")&&p.push(g.formatPiePercent(i.v/c.vTotal,h)),f.loneHover({x0:u-s*c.r,x1:u+s*c.r,y:d,text:p.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,color:i.color,idealAlign:i.pxmid[0]<0?"left":"right"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()}),f.hover(t,e,"pie"),L=!0}}function d(e){t.emit("plotly_unhover",{points:[e]}),L&&(f.loneUnhover(n._hoverlayer.node()),L=!1)}function y(){t._hoverdata=[i],i.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,f.click(t,{target:!0})}function b(t,e,n,r){return"a"+r*c.r+","+r*w+" "+x+" "+i.largeArc+(n?" 1 ":" 0 ")+r*(e[0]-t[0])+","+r*(e[1]-t[1])}if(i.hidden)return void u.select(this).selectAll("path,g").remove();s[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var k=c.cx+_[0],M=c.cy+_[1],A=u.select(this),T=A.selectAll("path.surface").data([i]),L=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),A.select("path.textline").remove(),A.on("mouseover",l).on("mouseout",d).on("click",y).on("contextmenu",y),m.pull){var z=+(Array.isArray(m.pull)?m.pull[i.i]:m.pull)||0;z>0&&(k+=z*i.pxmid[0],M+=z*i.pxmid[1])}i.cxFinal=k,i.cyFinal=M;var S=m.hole;if(i.v===c.vTotal){var C="M"+(k+i.px0[0])+","+(M+i.px0[1])+b(i.px0,i.pxmid,!0,1)+b(i.pxmid,i.px0,!0,1)+"Z";S?T.attr("d","M"+(k+S*i.px0[0])+","+(M+S*i.px0[1])+b(i.px0,i.pxmid,!1,S)+b(i.pxmid,i.px0,!1,S)+"Z"+C):T.attr("d",C)}else{var E=b(i.px0,i.px1,!0,1);if(S){var O=1-S;T.attr("d","M"+(k+S*i.px1[0])+","+(M+S*i.px1[1])+b(i.px1,i.px0,!1,S)+"l"+O*i.px0[0]+","+O*i.px0[1]+E+"Z")}else T.attr("d","M"+k+","+M+"l"+i.px0[0]+","+i.px0[1]+E+"Z")}var P=Array.isArray(m.textposition)?m.textposition[i.i]:m.textposition,N=A.selectAll("g.slicetext").data(i.text&&"none"!==P?[0]:[]);N.enter().append("g").classed("slicetext",!0),N.exit().remove(),N.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(i.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===P?m.outsidetextfont:m.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,n=h.bBox(t.node());"outside"===P?e=o(n,i):(e=r(n,i,c),"auto"===P&&e.scale<1&&(t.call(h.font,m.outsidetextfont),m.outsidetextfont.family===m.insidetextfont.family&&m.outsidetextfont.size===m.insidetextfont.size||(t.attr({"data-bb":""}),n=h.bBox(t.node())),e=o(n,i)));var a=k+i.pxmid[0]*e.rCenter+(e.x||0),l=M+i.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(i.yLabelMin=l-n.height/2,i.yLabelMid=l,i.yLabelMax=l+n.height/2,i.labelExtraX=0,i.labelExtraY=0,v=!0),t.attr("transform","translate("+a+","+l+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(n.left+n.right)/2+","+-(n.top+n.bottom)/2+")")})}),v&&i(s,m),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),n=e.select("g.slicetext text");n.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+n.attr("transform"));var r=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+r+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(l)>Math.abs(s)?"l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(r+t.labelExtraX+i):"l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,m.outsidetextfont.color).attr({"stroke-width":Math.min(2,m.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":25,"../../components/drawing":48,"../../lib/svg_text_utils":114,"../../plots/cartesian/graph_interact":131,"./helpers":229,d3:14}],234:[function(t,e,n){"use strict";var r=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],n=e.trace,o=r.select(this);o.style({opacity:n.opacity}),o.selectAll(".top path.surface").each(function(t){r.select(this).call(a,t,n)})})}},{"./style_one":235,d3:14}],235:[function(t,e,n){"use strict";var r=t("../../components/color");e.exports=function(t,e,n){var a=n.marker.line.color;Array.isArray(a)&&(a=a[e.i]||r.defaultLine);var o=n.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(r.stroke,a)}},{"../../components/color":25}],236:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t){var e=t[0].trace,n=e.marker;if(r.mergeArray(e.text,t,"tx"),r.mergeArray(e.textposition,t,"tp"),e.textfont&&(r.mergeArray(e.textfont.size,t,"ts"),r.mergeArray(e.textfont.color,t,"tc"),r.mergeArray(e.textfont.family,t,"tf")), +n&&n.line){var a=n.line;r.mergeArray(n.opacity,t,"mo"),r.mergeArray(n.symbol,t,"mx"),r.mergeArray(n.color,t,"mc"),r.mergeArray(a.color,t,"mlc"),r.mergeArray(a.width,t,"mlw")}}},{"../../lib":103}],237:[function(t,e,n){"use strict";var r=t("../../components/colorscale/color_attributes"),a=t("../../components/drawing"),o=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:o({},{symbol:{valType:"enumerated",values:a.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:o({},{width:{valType:"number",min:0,arrayOk:!0}},r("marker.line"))},r("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":33,"../../components/drawing":48,"../../lib/extend":101,"./constants":242}],238:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./subtypes"),l=t("./colorscale_calc");e.exports=function(t,e){var n,s,c,u=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=u.makeCalcdata(e,"x"),h=f.makeCalcdata(e,"y"),p=Math.min(d.length,h.length);u._minDtick=0,f._minDtick=0,d.length>p&&d.splice(p,d.length-p),h.length>p&&h.splice(p,h.length-p);var g={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(n=e.marker,s=n.size,Array.isArray(s)){var v={type:"linear"};a.setConvert(v),s=v.makeCalcdata(e.marker,"size"),s.length>p&&s.splice(p,s.length-p)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},g.ppad=m.ppad=Array.isArray(s)?s.map(y):y(s)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(i.hasMarkers(e)||i.hasText(e))||(g.padded=!1,g.ppad=0):g.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[p-1]&&h[0]===h[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(m.padded=!1):m.tozero=!0,a.expand(u,d,g),a.expand(f,h,m);var b=new Array(p);for(c=0;p>c;c++)b[c]=r(d[c])&&r(h[c])?{x:d[c],y:h[c]}:{x:!1,y:!1};return void 0!==typeof s&&o.mergeArray(s,b,"ms"),t.firstscatter=!1,b}},{"../../lib":103,"../../plots/cartesian/axes":124,"./colorscale_calc":241,"./subtypes":256,"fast-isnumeric":17}],239:[function(t,e,n){"use strict";e.exports=function(t){var e,n,r,a,o;for(e=0;e=0;a--)if(o=t[a],"scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}},{}],240:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,c=n.marker,u="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===c||!c.showscale)return void i.autoMargin(t,u);var f=l(c.colorscale),d=c.color,h=c.cmin,p=c.cmax;a(h)||(h=o.aggNums(Math.min,null,d)),a(p)||(p=o.aggNums(Math.max,null,d));var g=e[0].t.cb=s(t,u);g.fillcolor(r.scale.linear().domain(f.map(function(t){return h+t[0]*(p-h)})).range(f.map(function(t){return t[1]}))).filllevels({start:h,end:p,size:(p-h)/254}).options(c.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale/get_scale":37,"../../lib":103,"../../plots/plots":144,d3:14,"fast-isnumeric":17}],241:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&r(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(r(t,"marker")&&a(t,t.marker.color,"marker","c"),r(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":32,"../../components/colorscale/has_colorscale":38,"./subtypes":256}],242:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20}},{}],243:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,n,p){function g(n,o){return r.coerce(t,e,a,n,o)}var m=l(t,e,g),v=mv[y].x0&&ev[y].y0&&nH!=N>=H&&(E=S[L-1][0],O=S[L][0],C=E+(O-E)*(H-P)/(N-P),j=Math.min(j,C),F=Math.max(F,C));j=Math.max(j,0),F=Math.min(F,d._length);var V=s.defaultLine;return s.opacity(f.fillcolor)?V=f.fillcolor:s.opacity((f.line||{}).color)&&(V=f.line.color),r.extendFlat(t,{distance:o.MAXDIST+10,x0:j,x1:F,y0:H,y1:H,color:V}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":25,"../../components/errorbars":54,"../../lib":103,"../../plots/cartesian/constants":129,"../../plots/cartesian/graph_interact":131,"./get_trace_color":245}],247:[function(t,e,n){"use strict";var r={},a=t("./subtypes");r.hasLines=a.hasLines,r.hasMarkers=a.hasMarkers,r.hasText=a.hasText,r.isBubble=a.isBubble,r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.cleanData=t("./clean_data"),r.calc=t("./calc"),r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],r.meta={},e.exports=r},{"../../plots/cartesian":132,"./arrays_to_calcdata":236,"./attributes":237,"./calc":238,"./clean_data":239,"./colorbar":240,"./defaults":243,"./hover":246,"./plot":253,"./select":254,"./style":255,"./subtypes":256}],248:[function(t,e,n){"use strict";var r=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,n,o,i){var l=(t.marker||{}).color;if(i("line.color",n),r(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{var s=(Array.isArray(l)?!1:l)||n;i("line.color",s)}i("line.width"),i("line.dash")}},{"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38}],249:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes");e.exports=function(t,e){function n(e){var n=w.c2p(t[e].x),r=k.c2p(t[e].y);return n===z||r===z?!1:[n,r]}function a(t){var e=t[0]/w._length,n=t[1]/k._length;return(1+10*Math.max(0,-e,e-1,-n,n-1))*A}function o(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}var i,l,s,c,u,f,d,h,p,g,m,v,y,x,b,_,w=e.xaxis,k=e.yaxis,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],z=r.BADNUM,S=.2,C=new Array(t.length),E=0;for(i=0;ia(f))break;s=f,y=g[0]*p[0]+g[1]*p[1],y>m?(m=y,c=f,h=!1):v>y&&(v=y,u=f,h=!0)}if(h?(C[E++]=c,s!==u&&(C[E++]=u)):(u!==l&&(C[E++]=u),s!==c&&(C[E++]=c)),C[E++]=s,i>=t.length||!f)break;C[E++]=f,l=f}}else C[E++]=c}L.push(C.slice(0,E))}return L}},{"../../plots/cartesian/axes":124}],250:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=n("line.shape");"spline"===r&&n("line.smoothing")}},{}],251:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t){var e=t.marker,n=e.sizeref||1,a=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/n)}:function(t){return t/n};return function(t){var e=o(t/2);return r(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":17}],252:[function(t,e,n){"use strict";var r=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,n,l,s){var c,u=i.isBubble(t),f=(t.line||{}).color;f&&(n=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",n),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c=f&&!Array.isArray(f)&&e.marker.color!==f?f:u?r.background:r.defaultLine,s("marker.line.color",c),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode"))}},{"../../components/color":25,"../../components/colorscale/defaults":35,"../../components/colorscale/has_colorscale":38,"./subtypes":256}],253:[function(t,e,n){"use strict";function r(t,e,n){var r=e.x(),o=e.y(),i=a.extent(r.range.map(r.l2c)),l=a.extent(o.range.map(o.l2c));n.forEach(function(t,e){var r=t[0].trace;if(c.hasMarkers(r)){var a=r.marker.maxdisplayed;if(0!==a){var o=t.filter(function(t){return t.x>=i[0]&&t.x<=i[1]&&t.y>=l[0]&&t.y<=l[1]}),s=Math.ceil(o.length/a),u=0;n.forEach(function(t,n){var r=t[0].trace;c.hasMarkers(r)&&r.marker.maxdisplayed>0&&e>n&&u++});var f=Math.round(u*s/3+Math.floor(u/3)*s/7.1);t.forEach(function(t){delete t.vis}),o.forEach(function(t,e){0===Math.round((e+f)%s)&&(t.vis=!0)})}}})}var a=t("d3"),o=t("../../lib"),i=t("../../components/drawing"),l=t("../../components/errorbars"),s=t("../../lib/polygon").tester,c=t("./subtypes"),u=t("./arrays_to_calcdata"),f=t("./line_points");e.exports=function(t,e,n){function d(t){return t.filter(function(t){return t.vis})}r(t,e,n);var h=e.x(),p=e.y(),g=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(n);g.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),g.call(l.plot,e);var m,v,y,x,b="",_=[];g.each(function(t){var e=t[0].trace,n=e.line,r=a.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=r,u(t),c.hasLines(e)||"none"!==e.fill)){var o,l,d,g,w,k="",M="";m="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?r.append("path").classed("js-fill",!0):null,x&&(y=x.datum(t)),x=r.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(n.shape)?(d=i.steps(n.shape),g=i.steps(n.shape.split("").reverse().join(""))):d=g="spline"===n.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?i.smoothclosed(t.slice(1),n.smoothing):i.smoothopen(t,n.smoothing)}:function(t){return"M"+t.join("L")},w=function(t){return g(t.reverse())};var A,T=f(t,{xaxis:h,yaxis:p,connectGaps:e.connectgaps,baseTolerance:Math.max(n.width||1,3)/4,linear:"linear"===n.shape}),L=e._polygons=new Array(T.length);for(A=0;A1&&r.append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").attr("d",o)}m?z&&C&&(v?("y"===v?z[1]=C[1]=p.c2p(0,!0):"x"===v&&(z[0]=C[0]=h.c2p(0,!0)),m.attr("d",k+"L"+C+"L"+z+"Z")):m.attr("d",k+"Z")):"tonext"===e.fill.substr(0,6)&&k&&b&&("tonext"===e.fill?y.attr("d",k+"Z"+b+"Z"):y.attr("d",k+"L"+b.substr(1)+"Z"),e._polygons=e._polygons.concat(_)),b=M,_=L}}}),g.selectAll("path:not([d])").remove(),g.append("g").attr("class","points").each(function(t){var e=t[0].trace,n=a.select(this),r=c.hasMarkers(e),l=c.hasText(e);!r&&!l||e.visible!==!0?n.remove():(r&&n.selectAll("path.point").data(e.marker.maxdisplayed?d:o.identity).enter().append("path").classed("point",!0).call(i.translatePoints,h,p),l&&n.selectAll("g").data(e.marker.maxdisplayed?d:o.identity).enter().append("g").append("text").call(i.translatePoints,h,p))})}},{"../../components/drawing":48,"../../components/errorbars":54,"../../lib":103,"../../lib/polygon":109,"./arrays_to_calcdata":236,"./line_points":249,"./subtypes":256,d3:14}],254:[function(t,e,n){"use strict";var r=t("./subtypes"),a=.2;e.exports=function(t,e){var n,o,i,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,h=d.index,p=d.marker,g=!r.hasMarkers(d)&&!r.hasText(d);if(d.visible===!0&&!g){var m=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(n=0;nn;n++)y=e.a[n],x=e.b[n],b=e.c[n],r(y)&&r(x)&&r(b)?(y=+y,x=+x,b=+b,_=m/(y+x+b),1!==_&&(y*=_,x*=_,b*=_),k=y,w=b-x,A[n]={x:w,y:k,a:y,b:x,c:b}):A[n]={x:!1,y:!1};var T,L;if(i.hasMarkers(e)&&(T=e.marker,L=T.size,Array.isArray(L))){var z={type:"linear"};a.setConvert(z),L=z.makeCalcdata(e.marker,"size"),L.length>M&&L.splice(M,L.length-M)}return l(e),void 0!==typeof L&&o.mergeArray(L,A,"ms"),A}},{"../../lib":103,"../../plots/cartesian/axes":124,"../scatter/colorscale_calc":241,"../scatter/subtypes":256,"fast-isnumeric":17}],261:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../scatter/constants"),o=t("../scatter/subtypes"),i=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),s=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,n,d){function h(n,a){return r.coerce(t,e,f,n,a)}var p,g=h("a"),m=h("b"),v=h("c");if(g?(p=g.length,m?(p=Math.min(p,m.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):m&&v&&(p=Math.min(m.length,v.length)),!p)return void(e.visible=!1);g&&p"),l}}},{"../../plots/cartesian/axes":124,"../scatter/hover":246}],263:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../scatter/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scatterternary",r.basePlotModule=t("../../plots/ternary"),r.categories=["ternary","symbols","markerColorscale","showLegend"],r.meta={},e.exports=r},{"../../plots/ternary":151,"../scatter/colorbar":240,"./attributes":259,"./calc":260,"./defaults":261,"./hover":262,"./plot":264,"./select":265,"./style":266}],264:[function(t,e,n){"use strict";var r=t("../scatter/plot");e.exports=function(t,e){var n=t.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var a={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:n},o=new Array(e.length),i=t.graphDiv.calcdata,l=0;ll;l++){var c=s[l],h=o[c].exports;if(h===t||h&&h.default===t){r=c;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var f={},l=0,u=s.length;u>l;l++){var c=s[l];f[c]=c}i[r]=[Function(["require","module","exports"],"("+t+")(self)"),f]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),d={};d[r]=r,i[p]=[Function(["require"],"var f = require("+a(r)+");(f.default ? f.default : f)(self);"),d];var m="("+n+")({"+Object.keys(i).map(function(t){return a(t)+":["+i[t][0]+","+a(i[t][1])+"]"}).join(",")+"},{},["+a(p)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,v=new Blob([m],{type:"text/javascript"});if(e&&e.bare)return v;var y=g.createObjectURL(v),x=new Worker(y);return x.objectURL=y,x}},{}],490:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],491:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,o,a){a=a||{};var s=t+"?"+["bbox="+r(n,i,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&");return s}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),o=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+o[0]+","+o[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],492:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":86}],493:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":492}],494:[function(t,e,r){"use strict";e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],495:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),a=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:a({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":578,"../../plots/cartesian/constants":612,"../../plots/font_attributes":625,"./arrow_paths":494}],496:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return u.coerce(t,n,g.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),o=h.opacity(i);r("borderpad");var a=r("borderwidth"),s=r("showarrow");s&&(r("arrowcolor",o?n.bordercolor:h.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(o&&a||1)),r("ax"),r("ay"),r("axref"),r("ayref"),u.noneOrAll(t,n,["ax","ay"])),r("text",s?" ":"new text"),r("textangle"),u.coerceFont(r,"font",e.font);for(var l=["x","y"],f=0;2>f;f++){var p=l[f],d={_fullLayout:e},m=c.coerceRef(t,n,d,p),v=c.coerceARef(t,n,d,p),y=.5;if("paper"!==m){var x=c.getFromId(d,m);if(y=x.range[0]+y*(x.range[1]-x.range[0]),-1!==["date","category"].indexOf(x.type)&&"string"==typeof t[p]){var b;if("date"===x.type){if(b=u.dateTime2ms(t[p]),b!==!1&&(t[p]=b),v===m){var _=u.dateTime2ms(t["a"+p]);_!==!1&&(t["a"+p]=_)}}else(x._categories||[]).length&&(b=x._categories.indexOf(t[p]),-1!==b&&(t[p]=b))}}r(p,y),s||r(p+"anchor")}return u.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=c.getFromId(t,e.xref),n=c.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,o=e._xshift||0,a=(e._ysize||0)/2,s=e._yshift||0,l=i-o,u=i+o,h=a-s,f=a+s;if(e.showarrow){var p=3*e.arrowsize*e.arrowwidth;l=Math.max(l,p),u=Math.max(u,p),h=Math.max(h,p),f=Math.max(f,p)}r&&r.autorange&&c.expand(r,[r.l2c(e.x)],{ppadplus:u,ppadminus:l}),n&&n.autorange&&c.expand(n,[n.l2c(e.y)],{ppadplus:f,ppadminus:h})}})}function o(t,e,r,n,i,o,a,s){var l=r-t,u=i-t,c=a-i,h=n-e,f=o-e,p=s-o,d=l*p-c*h;if(0===d)return null;var m=(u*p-c*f)/d,g=(u*h-l*f)/d;return 0>g||g>1||0>m||m>1?null:{x:t+l*m,y:e+h*m}}var a=t("d3"),s=t("fast-isnumeric"),l=t("../../plotly"),u=t("../../lib"),c=t("../../plots/cartesian/axes"),h=t("../color"),f=t("../drawing"),p=t("../../lib/svg_text_utils"),d=t("../../lib/setcursor"),m=t("../dragelement"),g=e.exports={};g.ARROWPATHS=t("./arrow_paths"),g.layoutAttributes=t("./attributes"),g.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],o=0;ot?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}tt.selectAll("tspan.line").attr({y:0,x:0});var n=W.select(".annotation-math-group"),i=!n.empty(),s=f.bBox((i?n:tt).node()),p=s.width,v=s.height,y=Math.round(p+2*K),x=Math.round(v+2*K);U._w=p,U._h=v;var b=!1;if(["x","y"].forEach(function(e){var n,i=U[e+"ref"]||e,o=c.getFromId(t,i),a=(H+("x"===e?0:90))*Math.PI/180,s=y*Math.abs(Math.cos(a))+x*Math.abs(Math.sin(a)),l=U[e+"anchor"];if(o){if(!o.autorange&&(U[e]-o.range[0])*(U[e]-o.range[1])>0&&(U["a"+e+"ref"]===i?(U["a"+e]-o.range[0])*(U["a"+e]-o.range[1])>0&&(b=!0):b=!0,b))return;G[e]=o._offset+o.l2p(U[e]),n=.5}else n=U[e],"y"===e&&(n=1-n),G[e]="x"===e?L.l+L.w*n:L.t+L.h*n;var u=0;U["a"+e+"ref"]===i?G["aa"+e]=o._offset+o.l2p(U["a"+e]):(u=U.showarrow?U["a"+e]:s*r(n,l),G[e]+=u),U["_"+e+"type"]=o&&o.type,U["_"+e+"size"]=s,U["_"+e+"shift"]=u}),b)return void W.remove();var w,M;U.showarrow&&(w=U.axref===U.xref?G.x:u.constrain(G.x-U.ax,1,_.width-1),M=U.ayref===U.yref?G.y:u.constrain(G.y-U.ay,1,_.height-1)),G.x=u.constrain(G.x,1,_.width-1),G.y=u.constrain(G.y,1,_.height-1);var A=K-s.top,k=K-s.left;i?n.select("svg").attr({x:K-1,y:K}):(tt.attr({x:k,y:A}),tt.selectAll("tspan.line").attr({y:A,x:k})),$.call(f.setRect,Z/2,Z/2,y-Z,x-Z);var T=0,E=0;T=U.axref===U.xref?Math.round(G.aax-y/2):Math.round(G.x-y/2),E=U.ayref===U.yref?Math.round(G.aay-x/2):Math.round(G.y-x/2),W.call(u.setTranslate,T,E);var S="annotations["+e+"]",z=function(r,n){a.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i,s;i=U.axref===U.xref?G.aax+r:G.x+r,s=U.ayref===U.yref?G.aay+n:G.y+n;var c=u.rotationXYMatrix(H,i,s),f=u.apply2DTransform(c),p=u.apply2DTransform2(c),d=$.attr("width")/2,v=$.attr("height")/2,y=[[i-d,s-v,i-d,s+v],[i-d,s+v,i+d,s+v],[i+d,s+v,i+d,s-v],[i+d,s-v,i-d,s-v]].map(p);if(!y.reduce(function(t,e){return t^!!o(w,M,w+1e6,M+1e6,e[0],e[1],e[2],e[3])},!1)){y.forEach(function(t){var e=o(i,s,w,M,t[0],t[1],t[2],t[3]);e&&(i=e.x,s=e.y)});var x=U.arrowwidth,b=U.arrowcolor,_=X.append("g").style({opacity:h.opacity(b)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),A=_.append("path").attr("d","M"+i+","+s+"L"+w+","+M).style("stroke-width",x+"px").call(h.stroke,h.rgb(b));g.arrowhead(A,U.arrowhead,"end",U.arrowsize);var k=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-w)+","+(s-M),transform:"translate("+w+","+M+")"}).style("stroke-width",x+6+"px").call(h.stroke,"rgba(0,0,0,0)").call(h.fill,"rgba(0,0,0,0)");if(t._context.editable){var T,E,z;m.init({element:k.node(),prepFn:function(){var t=u.getTranslate(W);E=t.x,z=t.y,T={},V&&V.autorange&&(T[V._name+".autorange"]=!0),q&&q.autorange&&(T[q._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=f(E,z),n=r[0]+t,i=r[1]+e;W.call(u.setTranslate,n,i),T[S+".x"]=V?U.x+t/V._m:(w+t-L.l)/L.w,T[S+".y"]=q?U.y+e/q._m:1-(M+e-L.t)/L.h,U.axref===U.xref&&(T[S+".ax"]=V?U.ax+t/V._m:(w+t-L.l)/L.w),U.ayref===U.yref&&(T[S+".ay"]=q?U.ay+e/q._m:1-(M+e-L.t)/L.h),Y.attr({transform:"rotate("+H+","+n+","+i+")"})},doneFn:function(e){if(e){l.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};U.showarrow&&z(0,0);var I=u.rotationXYMatrix(H,G.x,G.y),P=u.apply2DTransform(I);if(t._context.editable){var C,R,D;m.init({element:W.node(),prepFn:function(){var t=u.getTranslate(W);C=t.x,R=t.y,D={}},moveFn:function(t,e){W.call(u.setTranslate,C+t,R+e);var r="pointer";if(U.showarrow)U.axref===U.xref?D[S+".ax"]=V.p2l(V.l2p(U.ax)+t):D[S+".ax"]=U.ax+t,U.ayref===U.yref?D[S+".ay"]=q.p2l(q.l2p(U.ay)+e):D[S+".ay"]=U.ay+e,z(t,e);else{if(V)D[S+".x"]=U.x+t/V._m;else{var n=U._xsize/L.w,i=U.x+U._xshift/L.w-n/2;D[S+".x"]=m.align(i+t/L.w,n,0,1,U.xanchor)}if(q)D[S+".y"]=U.y+e/q._m;else{var o=U._ysize/L.h,a=U.y-U._yshift/L.h-o/2;D[S+".y"]=m.align(a-e/L.h,o,0,1,U.yanchor)}V&&q||(r=m.getCursor(V?.5:D[S+".x"],q?.5:D[S+".y"],U.xanchor,U.yanchor))}var s=P(C,R),l=s[0]+t,c=s[1]+e;W.call(u.setTranslate,C+t,R+e),Y.attr({transform:"rotate("+H+","+l+","+c+")"}),d(W,r)},doneFn:function(e){if(d(W),e){l.relayout(t,D);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var x,b=t.layout,_=t._fullLayout;if(!s(e)||-1===e){if(!e&&Array.isArray(i))return b.annotations=i,g.supplyLayoutDefaults(b,_),void g.drawAll(t);if("remove"===i)return delete b.annotations,_.annotations=[],void g.drawAll(t);if(r&&"add"!==i){for(x=0;x<_.annotations.length;x++)g.draw(t,x,r,i);return}e=_.annotations.length,_.annotations.push({})}if(!r&&i){if("remove"===i){for(_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove(),_.annotations.splice(e,1),b.annotations.splice(e,1),x=e;x<_.annotations.length;x++)_._infolayer.selectAll('.annotation[data-index="'+(x+1)+'"]').attr("data-index",String(x)),g.draw(t,x);return}if("add"===i||u.isPlainObject(i)){_.annotations.splice(e,0,{});var w=u.isPlainObject(i)?u.extendFlat({},i):{text:"New text"};for(b.annotations?b.annotations.splice(e,0,w):b.annotations=[w],x=_.annotations.length-1;x>e;x--)_._infolayer.selectAll('.annotation[data-index="'+(x-1)+'"]').attr("data-index",String(x)),g.draw(t,x)}}_._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var M=b.annotations[e],A=_.annotations[e];if(M){var k={xref:M.xref,yref:M.yref},T={};"string"==typeof r&&r?T[r]=i:u.isPlainObject(r)&&(T=r);var E=Object.keys(T);for(x=0;xx;x++){var I=z[x];if(void 0===T[I]&&void 0!==M[I]){var P=c.getFromId(t,c.coerceRef(k,{},t,I)),C=c.getFromId(t,c.coerceRef(M,{},t,I)),R=M[I],D=A["_"+I+"type"];if(void 0!==T[I+"ref"]){var O="auto"===M[I+"anchor"],j="x"===I?L.w:L.h,F=(A["_"+I+"size"]||0)/(2*j);if(P&&C)R=(R-P.range[0])/(P.range[1]-P.range[0]),R=C.range[0]+R*(C.range[1]-C.range[0]);else if(P){if(R=(R-P.range[0])/(P.range[1]-P.range[0]),R=P.domain[0]+R*(P.domain[1]-P.domain[0]),O){var N=R+F,B=R-F;2/3>R+B?R=B:R+N>4/3&&(R=N)}}else C&&(O&&(1/3>R?R+=F:R>2/3&&(R-=F)),R=(R-C.domain[0])/(C.domain[1]-C.domain[0]),R=C.range[0]+R*(C.range[1]-C.range[0]))}C&&C===P&&D&&("log"===D&&"log"!==C.type?R=Math.pow(10,R):"log"!==D&&"log"===C.type&&(R=R>0?Math.log(R)/Math.LN10:void 0)),M[I]=R}}var U=n(M,_);_.annotations[e]=U;var V=c.getFromId(t,U.xref),q=c.getFromId(t,U.yref),G={x:0,y:0},H=+U.textangle||0,X=_._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",U.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:M,fullAnnotation:U})}),Y=X.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),W=Y.append("g"),Z=U.borderwidth,Q=U.borderpad,K=Z+Q,$=W.append("rect").attr("class","bg").style("stroke-width",Z+"px").call(h.stroke,U.bordercolor).call(h.fill,U.bgcolor),J=U.font,tt=W.append("text").classed("annotation",!0).attr("data-unformatted",U.text).text(U.text);t._context.editable?tt.call(p.makeEditable,W).call(v).on("edit",function(r){U.text=r,this.attr({"data-unformatted":U.text}),this.call(v);var n={};n["annotations["+e+"].text"]=U.text,V&&V.autorange&&(n[V._name+".autorange"]=!0),q&&q.autorange&&(n[q._name+".autorange"]=!0),l.relayout(t,n)}):tt.call(v),Y.attr({transform:"rotate("+H+","+G.x+","+G.y+")"}).call(f.setPosition,G.x,G.y)}},g.arrowhead=function(t,e,r,n){s(n)||(n=1);var i=t.node(),o=g.ARROWPATHS[e||0];if(o){"string"==typeof r&&r||(r="end");var l,u,c,p,d=(f.getPx(t,"stroke-width")||1)*n,m=t.style("stroke")||h.defaultLine,v=t.style("stroke-opacity")||1,y=r.indexOf("start")>=0,x=r.indexOf("end")>=0,b=o.backoff*d;if("line"===i.nodeName){if(l={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")},c=Math.atan2(l.y-u.y,l.x-u.x),p=c+Math.PI,b){var _=b*Math.cos(c),w=b*Math.sin(c);y&&(l.x-=_,l.y-=w,t.attr({x1:l.x,y1:l.y})),x&&(u.x+=_,u.y+=w,t.attr({x2:u.x,y2:u.y}))}}else if("path"===i.nodeName){var M=i.getTotalLength(),A="";if(y){var k=i.getPointAtLength(0),T=i.getPointAtLength(.1);c=Math.atan2(k.y-T.y,k.x-T.x),l=i.getPointAtLength(Math.min(b,M)),b&&(A="0px,"+b+"px,")}if(x){var E=i.getPointAtLength(M),S=i.getPointAtLength(M-.1);if(p=Math.atan2(E.y-S.y,E.x-S.x),u=i.getPointAtLength(Math.max(0,M-b)),b){var L=A?2*b:b;A+=M-L+"px,"+M+"px"}}else A&&(A+=M+"px");A&&t.style("stroke-dasharray",A)}var z=function(r,n){e>5&&(n=0),a.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:o.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+d+")"}).style({fill:m,opacity:v,"stroke-width":0})};y&&z(l,c),x&&z(u,p)}},g.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var o=c.list(t).filter(function(t){return t.autorange&&n[t._id]});if(o.length)return u.syncOrAsync([g.drawAll,i],t)}}},{"../../lib":583,"../../lib/setcursor":592,"../../lib/svg_text_utils":596,"../../plotly":604,"../../plots/cartesian/axes":607,"../color":498,"../dragelement":519,"../drawing":521,"./arrow_paths":494,"./attributes":495,d3:90,"fast-isnumeric":99}],497:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],498:[function(t,e,r){"use strict";function n(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var a=0;a=0))return t;if(3===a)n[a]>1&&(n[a]=1);else if(n[a]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),o=t("fast-isnumeric"),a=e.exports={},s=t("./attributes");a.defaults=s.defaults,a.defaultLine=s.defaultLine,a.lightLine=s.lightLine,a.background=s.background,a.overrideDefaults=function(t){a.defaults=t},a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(i(t))},a.opacity=function(t){return t?i(t).getAlpha():0},a.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||a.background).toRgb(),o=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},a.contrast=function(t,e,r){var n=i(t),o=n.isLight()?n.darken(r):n.lighten(e);return o.toString()},a.stroke=function(t,e){var r=i(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=i(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,i,o,s=Object.keys(t);for(e=0;el&&(o[1]-=(at-l)/2)):r.node()&&!r.classed("js-placeholder")&&(at=f.bBox(e.node()).height),at){if(at+=5,"top"===b.titleside)$.domain[1]-=at/k.h,o[1]*=-1;else{$.domain[0]+=at/k.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),$.setScale()}}it.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(k.h*(1-$.domain[1]))+")");var h=it.select(".cbfills").selectAll("rect.cbfill").data(L);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?E[0]:(L[e]+L[e-1])/2,e===L.length-1?E[1]:(L[e]+L[e+1])/2].map($.c2p).map(Math.round);e!==L.length-1&&(r[1]+=r[1]>r[0]?1:-1);var o=I(t).replace("e-",""),a=i(o).toHexString();n.select(this).attr({x:X,width:Math.max(N,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:a})});var p=it.select(".cblines").selectAll("path.cbline").data(b.line.color&&b.line.width?S:[]);return p.enter().append("path").classed("cbline",!0),p.exit().remove(),p.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round($.c2p(t))+b.line.width/2%1)+"h"+N).call(f.lineGroupStyle,b.line.width,z(t),b.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=X+N+(b.outlinewidth||0)/2-("outside"===b.ticks?1:0),$.side="right",u.syncOrAsync([function(){return s.doTicks(t,$,!0)},function(){if(-1===["top","bottom"].indexOf(b.titleside)){var e=$.titlefont.size,r=$._offset+$._length/2,i=k.l+($.position||0)*k.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));w("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:b.titleside,offsetLeft:k.l,offsetTop:k.t,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function w(e,r){var n,i=x();n=a.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:$,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:it.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;it.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(t,e,c(o,r||{}))}function M(){var r=N+b.outlinewidth/2+f.bBox($._axislayer.node()).width;if(O=ot.select("text"),O.node()&&!O.classed("js-placeholder")){var n,i=ot.select(".h"+$._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(b.titleside)?f.bBox(i).width:f.bBox(ot.node()).right-X-k.l,r=Math.max(r,n)}var o=2*b.xpad+r+b.borderwidth+b.outlinewidth/2,s=Z-Q;it.select(".cbbg").attr({x:X-b.xpad-(b.borderwidth+b.outlinewidth)/2,y:Q-G,width:Math.max(o,2),height:Math.max(s+2*G,2)}).call(p.fill,b.bgcolor).call(p.stroke,b.bordercolor).style({"stroke-width":b.borderwidth}),it.selectAll(".cboutline").attr({x:X,y:Q+b.ypad+("top"===b.titleside?at:0),width:Math.max(N,2),height:Math.max(s-2*b.ypad-at,2)}).call(p.stroke,b.outlinecolor).style({fill:"None","stroke-width":b.outlinewidth});var l=({center:.5,right:1}[b.xanchor]||0)*o;it.attr("transform","translate("+(k.l-l)+","+k.t+")"),a.autoMargin(t,e,{x:b.x,y:b.y,l:o*({right:1,center:.5}[b.xanchor]||0),r:o*({left:1,center:.5}[b.xanchor]||0),t:s*({bottom:1,middle:.5}[b.yanchor]||0),b:s*({top:1,middle:.5}[b.yanchor]||0)})}var A=t._fullLayout,k=A._size;if("function"!=typeof b.fillcolor&&"function"!=typeof b.line.color)return void A._infolayer.selectAll("g."+e).remove();var T,E=n.extent(("function"==typeof b.fillcolor?b.fillcolor:b.line.color).domain()),S=[],L=[],z="function"==typeof b.line.color?b.line.color:function(){return b.line.color},I="function"==typeof b.fillcolor?b.fillcolor:function(){return b.fillcolor},P=b.levels.end+b.levels.size/100,C=b.levels.size,R=1.001*E[0]-.001*E[1],D=1.001*E[1]-.001*E[0];for(T=b.levels.start;0>(T-P)*C;T+=C)T>R&&D>T&&S.push(T);if("function"==typeof b.fillcolor)if(b.filllevels)for(P=b.filllevels.end+b.filllevels.size/100,C=b.filllevels.size,T=b.filllevels.start;0>(T-P)*C;T+=C)T>E[0]&&T1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*u.roundUp(rt/nt,[2,5,10]),(Math.abs(b.levels.start)/b.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=tt}$.domain=[W+H,W+V-H],$.setScale();var it=A._infolayer.selectAll("g."+e).data([0]);it.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),it.attr("transform","translate("+Math.round(k.l)+","+Math.round(k.t)+")");var ot=it.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(k.l)+",-"+Math.round(k.t)+")");$._axislayer=it.select(".cbaxis");var at=0;if(-1!==["top","bottom"].indexOf(b.titleside)){var st,lt=k.l+(b.x+q)*k.w,ut=$.titlefont.size;st="top"===b.titleside?(1-(W+V-H))*k.h+k.t+3+.75*ut:(1-(W+H))*k.h+k.t-3-.25*ut,w($._id+"title",{attributes:{x:lt,y:st,"text-anchor":"start"}})}var ct=u.syncOrAsync([a.previousPromises,_,a.previousPromises,M],t);if(ct&&ct.then&&(t._promises||[]).push(ct),t._context.editable){var ht,ft,pt;l.init({element:it.node(),prepFn:function(){ht=it.attr("transform"),h(it)},moveFn:function(t,e){it.attr("transform",ht+" translate("+t+","+e+")"),ft=l.align(Y+t/k.w,B,0,1,b.xanchor),pt=l.align(W-e/k.h,V,0,1,b.yanchor);var r=l.getCursor(ft,pt,b.xanchor,b.yanchor);h(it,r)},doneFn:function(e){h(it),e&&void 0!==ft&&void 0!==pt&&o.restyle(t,{"colorbar.x":ft,"colorbar.y":pt},x().index)}})}return ct}function x(){var r,n,i=e.substr(2);for(r=0;rc*h?i.RdBu:c>=0?i.Reds:i.Blues,l.colorscale=f,s.reversescale&&(f=o(f)),s.colorscale=f)}},{"../../lib":583,"./flip_scale":509,"./scales":516}],506:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":578,"./attributes":504,"./scales.js":516}],507:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":516}],508:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("../colorbar/has_colorbar"),a=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,p=h.slice(0,h.length-1),d=h?i.nestedProperty(t,p).get()||{}:t,m=h?i.nestedProperty(e,p).get()||{}:e,g=d[f+"min"],v=d[f+"max"],y=d.colorscale,x=n(g)&&n(v)&&v>g;u(h+f+"auto",!x),u(h+f+"min"),u(h+f+"max");var b;void 0!==y&&(b=!s(y)),u(h+"autocolorscale",b);var _=u(h+"colorscale"),w=u(h+"reversescale");if(w&&(m.colorscale=l(_)),"marker.line."!==h){var M;h&&(M=o(d));var A=u(h+"showscale",M);A&&a(d,m,r)}}},{"../../lib":583,"../colorbar/defaults":500,"../colorbar/has_colorbar":502,"./flip_scale":509,"./is_valid_scale":513,"fast-isnumeric":99}],509:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,o=0;i>=0;i--,o++)e=t[i],n[o]=[1-e[0],e[1]];return n}},{}],510:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e):e}},{"./default_scale":507,"./is_valid_scale_array":514,"./scales":516}],511:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,a=r.color,s=!1;if(Array.isArray(a))for(var l=0;lf;f++)l=t[f],c[f]=e+l[0]*(r-e),h[f]=i(l[1]).toRgb();var p=n.scale.linear().domain(c).interpolate(n.interpolateObject).range(h);return function(t){if(o(t)){var n=a.constrain(t,e,r),l=p(n);return i(l).toRgbString()}return i(t).isValid()?t:s.defaultLine}}},{"../../lib":583,"../color":498,d3:90,"fast-isnumeric":99,tinycolor2:461}],516:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],517:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var o=(t-r)/(n-r),a=o+e/(n-r),s=(o+a)/2;return"left"===i||"bottom"===i?o:"center"===i||"middle"===i?s:"right"===i||"top"===i?a:2/3-s>o?o:a>4/3-s?a:s}},{}],518:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":583}],519:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),a=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){function e(e){return t.element.onmousemove=d,m._dragged=!1,m._dragging=!0,u=e.clientX,c=e.clientY,p=e.target,h=(new Date).getTime(),h-m._mouseDownTimev&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(m._dragged,g),!m._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),p.dispatchEvent(r)}return i(m),m._dragged=!1,a.pauseEvent(e)}var u,c,h,f,p,d,m=a.getPlotDiv(t.element)||{},g=1,v=s.DBLCLICKDELAY;m._mouseDownTime||(m._mouseDownTime=0),d=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"}},{"../../lib":583,"../../plotly":604,"../../plots/cartesian/constants":612,"./align":517,"./cursor":518,"./unhover":520}],520:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":577}],521:[function(t,e,r){"use strict";function n(t,e,r,n){var o=t[0]-e[0],a=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(o*o+a*a,b/2),c=Math.pow(s*s+l*l,b/2),h=(c*c*o-u*u*s)*n,f=(c*c*a-u*u*l)*n,p=3*c*(u+c),d=3*u*(u+c);return[[i.round(e[0]+(p&&h/p),2),i.round(e[1]+(p&&f/p),2)],[i.round(e[0]-(d&&h/d),2),i.round(e[1]-(d&&f/d),2)]]}var i=t("d3"),o=t("fast-isnumeric"),a=t("../../plots/plots"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),f=t("../../traces/scatter/subtypes"),p=t("../../traces/scatter/make_bubble_size_func"),d=e.exports={};d.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},d.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},d.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},d.setRect=function(t,e,r,n,i){t.call(d.setPosition,e,r).call(d.setSize,n,i)},d.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),a=t.yp||r.c2p(t.y),s=i.select(this);o(n)&&o(a)?"text"===this.nodeName?s.attr("x",n).attr("y",a):s.attr("transform","translate("+n+","+a+")"):s.remove()})},d.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},d.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},d.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},a=e||o.width||0,l=n||o.dash||"";i.select(this).call(s.stroke,r||o.color).call(d.dashLine,l,a)})},d.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},d.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=i.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(n){u.error(n,t),r.remove()}})};var m=t("./symbol_defs");d.symbolNames=[],d.symbolFuncs=[],d.symbolNeedLines={},d.symbolNoDot={},d.symbolList=[],Object.keys(m).forEach(function(t){var e=m[t];d.symbolList=d.symbolList.concat([e.n,t,e.n+100,t+"-open"]),d.symbolNames[e.n]=t,d.symbolFuncs[e.n]=e.f,e.needLine&&(d.symbolNeedLines[e.n]=!0),e.noDot?d.symbolNoDot[e.n]=!0:d.symbolList=d.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var g=d.symbolNames.length,v="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";d.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=d.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=g||t>=400?0:Math.floor(Math.max(t,0))},d.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(a.traceIs(e,"symbols")){var o=p(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:f.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var i=d.symbolNumber(t.mx||r.symbol)||0,a=i%100;return t.om=i%200>=100,d.symbolFuncs[a](n)+(i>=200?v:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=d.tryColorscale(r,l,""),c=d.tryColorscale(r,l,"line.");t.each(function(t){var e,o,a;t.so?(a=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(a=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=c(t.mlc):Array.isArray(n.color)?s.defaultLine:n.color,e="mc"in t?t.mcc=u(t.mc):Array.isArray(r.color)?s.defaultLine:r.color||"rgba(0,0,0,0)");var l=i.select(this);t.om?l.call(s.stroke,e).style({"stroke-width":(a||1)+"px",fill:"none"}):(l.style("stroke-width",a+"px").call(s.fill,e),a&&l.call(s.stroke,o))})}},d.tryColorscale=function(t,e,r){var n=u.nestedProperty(t,r+"color").get(),i=u.nestedProperty(t,r+"colorscale").get(),a=u.nestedProperty(t,r+"cauto").get(),s=u.nestedProperty(t,r+"cmin"),c=u.nestedProperty(t,r+"cmax"),h=s.get(),f=c.get();return i&&Array.isArray(n)?(!a&&o(h)&&o(f)||(h=1/0,f=-(1/0),n.forEach(function(t){o(t)&&(h>t&&(h=+t),t>f&&(f=+t))}),h>f&&(h=0,f=1),s.set(h),c.set(f),u.nestedProperty(e,r+"cmin").set(h),u.nestedProperty(e,r+"cmax").set(f)),l.makeScaleFunction(i,h,f)):u.identity};var y={start:1,end:-1,middle:0,bottom:1,top:-1},x=1.3;d.textPointStyle=function(t,e){t.each(function(t){var r=i.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,s=-1!==a.indexOf("top")?"top":-1!==a.indexOf("bottom")?"bottom":"middle",l=-1!==a.indexOf("left")?"end":-1!==a.indexOf("right")?"start":"middle",u=t.ts||e.textfont.size,h=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(d.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(c.convertToTspans);var f=i.select(this.parentNode),p=r.selectAll("tspan.line"),m=((p[0].length||1)-1)*x+1,g=y[l]*h,v=.75*u+y[s]*h+(y[s]-1)*m*u/2;f.attr("transform","translate("+g+","+v+")"),m>1&&p.attr({x:r.attr("x"),y:r.attr("y")})})};var b=.5;d.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],o=[];for(r=1;rr;r++)a.push(n(t[r-1],t[r],t[r+1],e));for(a.push(n(t[o-1],t[o],t[0],e)),r=1;o>=r;r++)i+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return i+="C"+a[o][1]+" "+a[0][0]+" "+t[0]+"Z"};var _={hv:function(t,e){return"H"+i.round(e[0],2)+"V"+i.round(e[1],2)},vh:function(t,e){return"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},hvh:function(t,e){return"H"+i.round((t[0]+e[0])/2,2)+"V"+i.round(e[1],2)+"H"+i.round(e[0],2)},vhv:function(t,e){return"V"+i.round((t[1]+e[1])/2,2)+"H"+i.round(e[0],2)+"V"+i.round(e[1],2)}},w=function(t,e){return"L"+i.round(e[0],2)+","+i.round(e[1],2)};d.steps=function(t){var e=_[t]||w;return function(t){for(var r="M"+i.round(t[0][0],2)+","+i.round(t[0][1],2),n=1;n=A&&(i.selectAll("[data-bb]").attr("data-bb",null),M=[]),t.setAttribute("data-bb",M.length),M.push(l),u.extendFlat({},l)},d.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=i.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../constants/xmlns_namespaces":571,"../../lib":583,"../../lib/svg_text_utils":596,"../../plots/plots":663,"../../traces/scatter/make_bubble_size_func":785,"../../traces/scatter/subtypes":790,"../color":498,"../colorscale":512,"./symbol_defs":522,d3:90,"fast-isnumeric":99}],522:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,o="l-"+e+",-"+e,a="l-"+e+","+e;return"M0,"+e+r+i+o+i+o+a+o+a+r+a+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),o=n.round(t*-.309,2),a=n.round(.809*t,2);return"M"+e+","+o+"L"+r+","+a+"H-"+r+"L-"+e+","+o+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),o=n.round(.363*e,2),a=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+o+","+u+"L"+a+","+c+"L0,"+h+"L-"+a+","+c+"L-"+o+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),o=n.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+a+e+","+r+a+"0,-"+i+a+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),o=n.round(4*t,2),a="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+a+"-"+e+",-"+r+a+"0,"+i+a+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:90}],523:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],524:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},l=o.visible&&-1!==["linear","log"].indexOf(r.type),u=[];if(l){for(var c=s(o),h=0;hs;s++)a[s]={x:r[s],y:i[s]};return a[0].trace=t,n.calc({calcdata:[a],_fullLayout:e}),a},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":523,"./calc":524,"./defaults":526,"./plot":528,"./style":529}],528:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),o(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),o(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),o=t("fast-isnumeric"),a=t("../../lib"),s=t("../../traces/scatter/subtypes");e.exports=function(t,e){var r=e.x(),l=e.y();t.each(function(t){var e=t[0].trace,u=e.error_x||{},c=e.error_y||{},h=s.hasMarkers(e)&&e.marker.maxdisplayed>0;if(c.visible||u.visible){var f=i.select(this).selectAll("g.errorbar").data(a.identity);f.enter().append("g").classed("errorbar",!0),f.each(function(t){var e=i.select(this),a=n(t,r,l);if(!h||t.vis){var s;if(c.visible&&o(a.x)&&o(a.yh)&&o(a.ys)){var f=c.width;s="M"+(a.x-f)+","+a.yh+"h"+2*f+"m-"+f+",0V"+a.ys,a.noYS||(s+="m-"+f+",0h"+2*f),e.append("path").classed("yerror",!0).attr("d",s)}if(u.visible&&o(a.y)&&o(a.xh)&&o(a.xs)){var p=(u.copy_ystyle?c:u).width;s="M"+a.xh+","+(a.y-p)+"v"+2*p+"m0,-"+p+"H"+a.xs,a.noXS||(s+="m0,-"+p+"v"+2*p),e.append("path").classed("xerror",!0).attr("d",s)}}})}})}},{"../../lib":583,"../../traces/scatter/subtypes":790,d3:90,"fast-isnumeric":99}],529:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},a=n.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(i.stroke,o.color)})}},{"../color":498,d3:90}],530:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:!0,source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"number",dflt:0},y:{valType:"number",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()], dflt:"paper"}}},{"../../plots/cartesian/constants":612}],531:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,a,r,n)}e=e||{},n("source"),n("layer"),n("x"),n("y"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var s=0;2>s;s++){var l={_fullLayout:r},u=["x","y"][s];i.coerceRef(t,e,l,u,"paper")}return e}var i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./attributes");e.exports=function(t,e){if(t.images&&Array.isArray(t.images))for(var r=t.images,i=e.images=[],o=0;o=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],535:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":578,"../../plots/font_attributes":625,"../color/attributes":497}],536:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],537:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/plots"),o=t("./attributes"),a=t("./helpers");e.exports=function(t,e,r){function s(t,e){return n.coerce(f,p,o,t,e)}for(var l,u,c,h,f=t.legend||{},p=e.legend={},d=0,m="normal",g=0;g1);if(y!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),n.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(l=0,c="left",u=1.1,h="bottom"):(l=0,c="left",u=-.1,h="top")}s("traceorder",m),a.isGrouped(e.legend)&&s("tracegroupgap"),s("x",l),s("xanchor",c),s("y",u),s("yanchor",h),n.noneOrAll(f,p,["x","y"])}}},{"../../lib":583,"../../plots/plots":663,"./attributes":535,"./helpers":540}],538:[function(t,e,r){"use strict";function n(t,e){function r(r){c.util.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(o,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,s=f.traceIs(a,"pie"),l=a.index,u=s?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.editable&&!s?h.call(c.util.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" "),c.restyle(e,"name",t,l)}):h.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,o=t.data()[0][0],a=e._fullData,s=o.trace,l=s.legendgroup,u=[];if(f.traceIs(s,"pie")){var h=o.label,p=r.indexOf(h);-1===p?r.push(h):r.splice(p,1),c.relayout(e,"hiddenlabels",r)}else{if(""===l)u=[s.index];else for(var d=0;dtspan"),p=f[0].length||1;r=l*p,n=c.node()&&d.bBox(c.node()).width;var m=l*(.3+(1-p)/2);c.attr("y",m),f.attr("y",m)}r=Math.max(r,16)+3,o.attr({x:0,y:-r/2,height:r}),i.height=r,i.width=n}function a(t,e,r){var n=t._fullLayout,i=n.legend,o=i.borderwidth,a=x.isGrouped(i);if(x.isVertical(i))a&&e.each(function(t,e){h.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;h.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,a&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),r.selectAll(".legendtoggle").attr("width",(t._context.editable?0:i.width)+40),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height);else if(a){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),c=0,f=l.length;f>c;c++){var p=l[c].map(function(t){return t[0].width}),d=40+Math.max.apply(null,p);i.width+=i.tracegroupgap+d,s.push(i.width)}e.each(function(t,e){h.setTranslate(this,s[e],0)}),e.each(function(){var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;h.setTranslate(this,0,5+o+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*o,i.width+=2*o,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}else{i.width=0,i.height=0;var m=0,g=0,v=0,y=0;r.each(function(t){v=Math.max(40+t[0].width,v)}),r.each(function(t){var e=t[0],r=v,a=i.tracegroupgap||5;o+y+a+r>n.width-(n.margin.r+n.margin.l)&&(y=0,m+=g,i.height=i.height+g,g=0),h.setTranslate(this,o+y,5+o+e.height/2+m),i.width+=a+r,i.height=Math.max(i.height,e.height),y+=a+r,g=Math.max(e.height,g)}),i.width+=2*o,i.height+=10+2*o,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.selectAll(".legendtoggle").attr("width",t._context.editable?0:i.width)}}function s(t){var e=t._fullLayout,r=e.legend,n="left";b.isRightAnchor(r)?n="right":b.isCenterAnchor(r)&&(n="center");var i="top";b.isBottomAnchor(r)?i="bottom":b.isMiddleAnchor(r)&&(i="middle"),f.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";b.isRightAnchor(r)?n="right":b.isCenterAnchor(r)&&(n="center"),f.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),h=t("../../lib"),f=t("../../plots/plots"),p=t("../dragelement"),d=t("../drawing"),m=t("../color"),g=t("./constants"),v=t("./get_legend_data"),y=t("./style"),x=t("./helpers"),b=t("./anchor_utils");e.exports=function(t){function e(t,e){T.attr("data-scroll",e).call(h.setTranslate,0,e),E.call(d.setRect,F,t,g.scrollBarWidth,g.scrollBarHeight),A.select("rect").attr({y:x.borderwidth-e})}var r=t._fullLayout,o="legend"+r._uid;if(r._infolayer&&t.calcdata){var x=r.legend,_=r.showlegend&&v(t.calcdata,x),w=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+o).remove(),void f.autoMargin(t,"legend");var M=r._infolayer.selectAll("g.legend").data([0]);M.enter().append("g").attr({"class":"legend","pointer-events":"all"});var A=r._topdefs.selectAll("#"+o).data([0]);A.enter().append("clipPath").attr("id",o).append("rect");var k=M.selectAll("rect.bg").data([0]);k.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}),k.call(m.stroke,x.bordercolor),k.call(m.fill,x.bgcolor),k.style("stroke-width",x.borderwidth+"px");var T=M.selectAll("g.scrollbox").data([0]);T.enter().append("g").attr("class","scrollbox");var E=M.selectAll("rect.scrollbar").data([0]);E.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var S=T.selectAll("g.groups").data(_);S.enter().append("g").attr("class","groups"),S.exit().remove();var L=S.selectAll("g.traces").data(h.identity);L.enter().append("g").attr("class","traces"),L.exit().remove(),L.call(y).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var z=0!==M.enter().size();z&&(a(t,S,L),s(t));var I=0,P=r.width,C=0,R=r.height;a(t,S,L),x.height>R?l(t):s(t);var D=r._size,O=D.l+D.w*x.x,j=D.t+D.h*(1-x.y);b.isRightAnchor(x)?O-=x.width:b.isCenterAnchor(x)&&(O-=x.width/2),b.isBottomAnchor(x)?j-=x.height:b.isMiddleAnchor(x)&&(j-=x.height/2);var F=x.width;D.w;O+F>P&&(O=P-F),I>O&&(O=I),F=Math.min(P-O,x.width);var N=x.height,B=D.h;N>B?(j=D.t,N=B):(j+N>R&&(j=R-N),C>j&&(j=C),N=Math.min(R-j,x.height)),h.setTranslate(M,O,j);var U,V,q=N-g.scrollBarHeight-2*g.scrollBarMargin,G=x.height-N;if(x.height<=N||t._context.staticPlot)k.attr({width:F-x.borderwidth,height:N-x.borderwidth,x:x.borderwidth/2,y:x.borderwidth/2}),h.setTranslate(T,0,0),A.select("rect").attr({width:F-2*x.borderwidth,height:N-2*x.borderwidth,x:x.borderwidth,y:x.borderwidth}),T.call(d.setClipUrl,o);else{U=g.scrollBarMargin,V=T.attr("data-scroll")||0,k.attr({width:F-2*x.borderwidth+g.scrollBarWidth+g.scrollBarMargin,height:N-x.borderwidth,x:x.borderwidth/2,y:x.borderwidth/2}),A.select("rect").attr({width:F-2*x.borderwidth+g.scrollBarWidth+g.scrollBarMargin,height:N-2*x.borderwidth,x:x.borderwidth,y:x.borderwidth-V}),T.call(d.setClipUrl,o),z&&e(U,V),M.on("wheel",null),M.on("wheel",function(){V=h.constrain(T.attr("data-scroll")-u.event.deltaY/q*G,-G,0),U=g.scrollBarMargin-V/G*q,e(U,V),u.event.preventDefault()}),E.on(".drag",null),T.on(".drag",null);var H=u.behavior.drag().on("drag",function(){U=h.constrain(u.event.y-g.scrollBarHeight/2,g.scrollBarMargin,g.scrollBarMargin+q),V=-(U-g.scrollBarMargin)/q*G,e(U,V)});E.call(H),T.call(H)}if(t._context.editable){var X,Y,W,Z;M.classed("cursor-move",!0),p.init({element:M.node(),prepFn:function(){var t=h.getTranslate(M);W=t.x,Z=t.y},moveFn:function(t,e){var r=W+t,n=Z+e;h.setTranslate(M,r,n),X=p.align(r,0,D.l,D.l+D.w,x.xanchor),Y=p.align(n,0,D.t+D.h,D.t,x.yanchor)},doneFn:function(e){e&&void 0!==X&&void 0!==Y&&c.relayout(t,{"legend.x":X,"legend.y":Y})}})}}}},{"../../lib":583,"../../plotly":604,"../../plots/plots":663,"../color":498,"../dragelement":519,"../drawing":521,"./anchor_utils":534,"./constants":536,"./get_legend_data":539,"./helpers":540,"./style":542,d3:90}],539:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var o,a,s={},l=[],u=!1,c={},h=0;for(o=0;oo;o++)v=s[l[o]],y[o]=i.isReversed(e)?v.reverse():v;else{for(y=[new Array(x)],o=0;x>o;o++)v=s[l[o]][0],y[0][i.isReversed(e)?x-o-1:o]=v;x=1}return e._lgroupsLength=x,y}},{"../../plots/plots":663,"./helpers":540}],540:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../plots/plots":663}],541:[function(t,e,r){"use strict";var n=e.exports={};n.layoutAttributes=t("./attributes"),n.supplyLayoutDefaults=t("./defaults"),n.draw=t("./draw"),n.style=t("./style")},{"./attributes":535,"./defaults":537,"./draw":538,"./style":542}],542:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=p.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(h.fillGroupStyle);var o=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(h.lineGroupStyle)}function i(t){function e(t,e,r){var n=u.nestedProperty(a,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,o=t[0],a=o.trace,s=p.hasMarkers(a),c=p.hasText(a),f=p.hasLines(a);if(s||c||f){var d={},m={};s&&(d.mc=e("marker.color",r),d.mo=e("marker.opacity",u.mean,[.2,1]),d.ms=e("marker.size",u.mean,[2,16]),d.mlc=e("marker.line.color",r),d.mlw=e("marker.line.width",u.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(m.line={width:e("line.width",r,[0,10])}),c&&(d.tx="Aa",d.tp=e("textposition",r),d.ts=10,d.tc=e("textfont.color",r),d.tf=e("textfont.family",r)),n=[u.minExtend(o,d)],i=u.minExtend(a,m)}var g=l.select(this).select("g.legendpoints"),v=g.selectAll("path.scatterpts").data(s?n:[]);v.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),v.exit().remove(),v.call(h.pointStyle,i),s&&(n[0].mrc=3);var y=g.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(h.textPointStyle,i)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||n.width+1)-1,i=l.select(this);i.style("stroke-width",e+"px").call(f.fill,t.mc||r.color),e&&i.call(f.stroke,t.mlc||n.color)})}function a(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=l.select(this);n.style("stroke-width",r+"px").call(f.fill,t.fc||e.fillcolor),r&&n.call(f.stroke,t.lc||e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(d,t[0],e)}var l=t("d3"),u=t("../../lib"),c=t("../../plots/plots"),h=t("../drawing"),f=t("../color"),p=t("../../traces/scatter/subtypes"),d=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(a).each(s).each(n).each(i)}},{"../../lib":583,"../../plots/plots":663,"../../traces/pie/style_one":763,"../../traces/scatter/subtypes":790,"../color":498,"../drawing":521,d3:90}],543:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,a={};if("zoom"===n){for(var s,l,c="in"===i?.5:2,h=(1+c)/2,f=(1-c)/2,p=u.Axes.list(t,null,!0),d=0;dy;y++){var x=s[y];f=v[x]={};for(var b=0;b1)return n(["resetViews","toggleHover"]),a(g,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var v=i(s),y=[];return((u||d)&&!v||m)&&(y=["zoom2d","pan2d"]),(u||m)&&o(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!u&&!d||v||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&p?n(["toggleHover"]):d?n(["hoverClosestGl2d"]):u?n(["hoverClosestCartesian","hoverCompareCartesian"]):p&&n(["hoverClosestPie"]),a(g,r)}function i(t){for(var e=l.Axes.list({_fullLayout:t},null,!0),r=!0,n=0;n0);if(d){var m=i(e,r,l);c("x",m[0]),c("y",m[1]),o.noneOrAll(t,e,["x","y"]),c("xanchor"),c("yanchor"),o.coerceFont(c,"font",r.font);var g=c("bgcolor");c("activecolor",a.contrast(g,u.lightAmount,u.darkAmount)),c("bordercolor"),c("borderwidth")}}},{"../../lib":583,"../color":498,"./attributes":546,"./button_attributes":547,"./constants":548}],550:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;ne){var r=e;e=t,t=r}s.setAttributes(w,{"data-min":t,"data-max":e}),s.setAttributes(C,{x:t,width:e-t}),s.setAttributes(k,{width:t}),s.setAttributes(T,{x:e,width:d-e}),s.setAttributes(E,{transform:"translate("+(t-g-1)+")"}),s.setAttributes(z,{transform:"translate("+e+")"})}var h=t._fullLayout,f=h._infolayer.selectAll("g.range-slider"),p=h.xaxis.rangeslider,d=h._size.w,m=(h.height-h.margin.b-h.margin.t)*p.thickness,g=2,v=Math.floor(p.borderwidth/2),y=h.margin.l,x=h.height-m-h.margin.b,b=0,_=d,w=document.createElementNS(a,"g");s.setAttributes(w,{"class":"range-slider","data-min":b,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+x+")"});var M=document.createElementNS(a,"rect"),A=p.borderwidth%2===0?p.borderwidth:p.borderwidth-1;s.setAttributes(M,{fill:p.bgcolor,stroke:p.bordercolor,"stroke-width":p.borderwidth,height:m+A,width:d+A,transform:"translate(-"+v+", -"+v+")","shape-rendering":"crispEdges"});var k=document.createElementNS(a,"rect");s.setAttributes(k,{x:0,width:b,height:m,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(a,"rect");s.setAttributes(T,{x:_,width:d-_,height:m,fill:"rgba(0,0,0,0.4)"});var E=document.createElementNS(a,"g"),S=document.createElementNS(a,"rect"),L=document.createElementNS(a,"rect");s.setAttributes(E,{transform:"translate("+(b-g-1)+")"}),s.setAttributes(S,{width:10,height:m,x:-6,fill:"transparent",cursor:"col-resize"}),s.setAttributes(L,{width:g,height:m/2,y:m/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(E,[L,S]);var z=document.createElementNS(a,"g"),I=document.createElementNS(a,"rect"),P=document.createElementNS(a,"rect");s.setAttributes(z,{transform:"translate("+_+")"}),s.setAttributes(I,{width:10,height:m,x:-2,fill:"transparent",cursor:"col-resize"}),s.setAttributes(P,{width:g,height:m/2,y:m/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(z,[P,I]);var C=document.createElementNS(a,"rect");s.setAttributes(C,{x:b,width:_-b,height:m,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function r(t){var r,n,h=+t.clientX-o;switch(i){case C:w.style.cursor="ew-resize",r=+s+h,n=+l+h,c(r,n),u(e(r),e(n));break;case S:w.style.cursor="col-resize",r=+s+h,n=+l,c(r,n),u(e(r),e(n));break;case I:w.style.cursor="col-resize",r=+s,n=+l+h,c(r,n),u(e(r),e(n));break;default:w.style.cursor="ew-resize",r=a,n=a+h,c(r,n),u(e(r),e(n))}}function n(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n),w.style.cursor="auto"}var i=t.target,o=t.clientX,a=o-w.getBoundingClientRect().left,s=w.getAttribute("data-min"),l=w.getAttribute("data-max");window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}),p.range||(p.range=i.getAutoRange(h.xaxis));var R=l(t,d,m);s.appendChildren(w,[M,R,k,T,C,E,z]),r(h.xaxis.range[0],h.xaxis.range[1]),f.data([0]).enter().append(function(){return p.setRange=r,w})}},{"../../constants/xmlns_namespaces":571,"../../lib":583,"../../plotly":604,"../../plots/cartesian/axes":607,"./helpers":556,"./range_plot":558}],555:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,o){function a(t,e){return n.coerce(s,l,i,t,e)}if(t[r].rangeslider){var s=n.isPlainObject(t[r].rangeslider)?t[r].rangeslider:{},l=e[r].rangeslider={};if(a("bgcolor"),a("bordercolor"),a("borderwidth"),a("thickness"),a("visible"),a("range"),l.range&&!e[r].autorange){var u=l.range,c=e[r].range;u[0]=Math.min(u[0],c[0]),u[1]=Math.max(u[1],c[1])}else e[r]._needsExpand=!0;l.visible&&o.forEach(function(t){var r=e[t]||{};r.fixedrange=!0,e[t]=r})}}},{"../../lib":583,"./attributes":553}],556:[function(t,e,r){"use strict";r.setAttributes=function(t,e){for(var r in e)t.setAttribute(r,e[r])},r.appendChildren=function(t,e){for(var r=0;rl;l++){var u=s[l],c={_fullLayout:e},h=k.coerceRef(t,n,c,u);if("path"!==a){var f=.25,p=.75;if("paper"!==h){var d=k.getFromId(c,h),m=o(d);f=m(d.range[0]+f*(d.range[1]-d.range[0])),p=m(d.range[0]+p*(d.range[1]-d.range[0]))}r(u+"0",f),r(u+"1",p)}}return"path"===a?r("path"):A.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function o(t){return"category"===t.type?t.l2c:t.l2d}function a(t,e){t.layout.shapes=e,z.supplyLayoutDefaults(t.layout,t._fullLayout),z.drawAll(t)}function s(t){delete t.layout.shapes,t._fullLayout.shapes=[],z.drawAll(t)}function l(t,e,r){for(var n=0;ne;i--)p(t,i).selectAll('[data-index="'+(i-1)+'"]').attr("data-index",i),z.draw(t,i)}function h(t,e,r,a){function s(r){var n={"data-index":e,"fill-rule":"evenodd",d:x(t,z)},i=z.line.width?z.line.color:"rgba(0,0,0,0)",o=r.append("path").attr(n).style("opacity",z.opacity).call(T.stroke,i).call(T.fill,z.fillcolor).call(E.dashLine,z.line.dash,z.line.width);I&&o.call(E.setClipUrl,"clip"+t._fullLayout._uid+I),t._context.editable&&f(t,o,z,e)}var l,u;p(t,e).selectAll('[data-index="'+e+'"]').remove();var c=t.layout.shapes[e];if(c){var h={xref:c.xref,yref:c.yref},m={};"string"==typeof r&&r?m[r]=a:A.isPlainObject(r)&&(m=r);var g=Object.keys(m);for(l=0;ll;l++){var b=y[l];if(void 0===m[b]&&void 0!==c[b]){var _,w=b.charAt(0),M=k.getFromId(t,k.coerceRef(h,{},t,w)),S=k.getFromId(t,k.coerceRef(c,{},t,w)),L=c[b];void 0!==m[w+"ref"]&&(M?(_=i(M)(L),L=(_-M.range[0])/(M.range[1]-M.range[0])):L=(L-S.domain[0])/(S.domain[1]-S.domain[0]),S?(_=S.range[0]+L*(S.range[1]-S.range[0]),L=o(S)(_)):L=M.domain[0]+L*(M.domain[1]-M.domain[0])),c[b]=L}}var z=n(c,t._fullLayout);t._fullLayout.shapes[e]=z;var I;if("below"!==z.layer)I=(z.xref+z.yref).replace(/paper/g,""),s(t._fullLayout._shapeUpperLayer);else if("paper"===z.xref&&"paper"===z.yref)I="",s(t._fullLayout._shapeLowerLayer);else{var P,C=t._fullLayout._plots||{},R=Object.keys(C);for(l=0,u=R.length;u>l;l++)P=C[R[l]],I=R[l],d(t,z,P)&&s(P.shapelayer)}}}function f(t,e,r,n){function i(t){var r=K.right-K.left,n=K.bottom-K.top,i=t.clientX-K.left,o=t.clientY-K.top,a=r>W&&n>Z&&!t.shiftKey?S.getCursor(i/r,1-o/n):"move";L(e,a),Y=a.split("-")[0]}function o(e){U=k.getFromId(t,r.xref),V=k.getFromId(t,r.yref),q=v(t,U),G=v(t,V,!0),H=y(t,U),X=y(t,V,!0);var o="shapes["+n+"]";"path"===r.type?(N=r.path,B=o+".path"):(c=q(r.x0),h=G(r.y0),f=q(r.x1),p=G(r.y1),d=o+".x0",m=o+".y0",_=o+".x1",w=o+".y1"),f>c?(E=c,C=o+".x0",j="x0",z=f,R=o+".x1",F="x1"):(E=f,C=o+".x1",j="x1",z=c,R=o+".x0",F="x0"),p>h?(A=h,I=o+".y0",D="y0",T=p,P=o+".y1",O="y1"):(A=p,I=o+".y1",D="y1",T=h,P=o+".y0",O="y0"),u={},i(e),Q.moveFn="move"===Y?s:l}function a(r){L(e),r&&M.relayout(t,u)}function s(n,i){if("path"===r.type){var o=function(t){return H(q(t)+n)};U&&"date"===U.type&&(o=g(o));var a=function(t){return X(G(t)+i)};V&&"date"===V.type&&(a=g(a)),r.path=b(N,o,a),u[B]=r.path}else u[d]=r.x0=H(c+n),u[m]=r.y0=X(h+i),u[_]=r.x1=H(f+n),u[w]=r.y1=X(p+i);e.attr("d",x(t,r))}function l(n,i){if("path"===r.type){var o=function(t){return H(q(t)+n)};U&&"date"===U.type&&(o=g(o));var a=function(t){return X(G(t)+i)};V&&"date"===V.type&&(a=g(a)),r.path=b(N,o,a),u[B]=r.path}else{var s=~Y.indexOf("n")?A+i:A,l=~Y.indexOf("s")?T+i:T,c=~Y.indexOf("w")?E+n:E,h=~Y.indexOf("e")?z+n:z;l-s>Z&&(u[I]=r[D]=X(s),u[P]=r[O]=X(l)),h-c>W&&(u[C]=r[j]=H(c),u[R]=r[F]=H(h))}e.attr("d",x(t,r))}var u,c,h,f,p,d,m,_,w,A,T,E,z,I,P,C,R,D,O,j,F,N,B,U,V,q,G,H,X,Y,W=10,Z=10,Q={setCursor:i,element:e.node(),prepFn:o,doneFn:a},K=Q.element.getBoundingClientRect();S.init(Q)}function p(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):A.log("getShapeLayer: undefined shape: index",e),n}function d(t,e,r){var n=M.Axes.getFromId(t,r.id,"x")._id,i=M.Axes.getFromId(t,r.id,"y")._id,o="below"===e.layer,a=n===e.xref||i===e.yref,s=!!r.shapelayer;return o&&a&&s}function m(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}}function g(t){return function(e){return t(e).replace(" ","_")}}function v(t,e,r){var n,o=t._fullLayout._size;if(e){var a=i(e);n=function(t){return e._offset+e.l2p(a(t,!0))},"date"===e.type&&(n=m(n))}else n=r?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return n}function y(t,e,r){var n,i=t._fullLayout._size;if(e){var a=o(e);n=function(t){return a(e.p2l(t-e._offset))}}else n=r?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return n}function x(t,e){var r,n,o,a,s=e.type,l=k.getFromId(t,e.xref),u=k.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=i(l),n=function(t){return l._offset+l.l2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(o=i(u),a=function(t){return u._offset+u.l2p(o(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===s)return l&&"date"===l.type&&(n=m(n)),u&&"date"===u.type&&(a=m(a)),z.convertPath(e.path,n,a);var h=n(e.x0),f=n(e.x1),p=a(e.y0),d=a(e.y1);if("line"===s)return"M"+h+","+p+"L"+f+","+d;if("rect"===s)return"M"+h+","+p+"H"+f+"V"+d+"H"+h+"Z";var g=(h+f)/2,v=(p+d)/2,y=Math.abs(g-h),x=Math.abs(v-p),b="A"+y+","+x,_=g+y+","+v,w=g+","+(v-x);return"M"+_+b+" 0 1,1 "+w+b+" 0 0,1 "+_+"Z"}function b(t,e,r){return t.replace(I,function(t){var n=0,i=t.charAt(0),o=C[i],a=R[i],s=D[i],l=t.substr(1).replace(P,function(t){return n>=s?t:(o[n]?t=e(t):a[n]&&(t=r(t)),n++,t)});return i+l})}function _(t,e,r,n,i){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var a,s,l,u,c,h=1/0,f=-(1/0),p=n.match(I);for("date"===t.type&&(o=m(o)),a=0;ac&&(h=c),c>f&&(f=c)));return f>=h?[h,f]:void 0}}var w=t("fast-isnumeric"),M=t("../../plotly"),A=t("../../lib"),k=t("../../plots/cartesian/axes"),T=t("../color"),E=t("../drawing"),S=t("../dragelement"),L=t("../../lib/setcursor"),z=e.exports={};z.layoutAttributes=t("./attributes"),z.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],o=0;os&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),A.log("Ignoring extra params in segment "+t)),i+l})},z.calcAutorange=function(t){var e,r,n,i,o,a=t._fullLayout,s=a.shapes;if(s.length&&t._fullData.length)for(e=0;ef?r=f:(c.left-=x.offsetLeft,c.right-=x.offsetLeft,c.top-=x.offsetTop,c.bottom-=x.offsetTop,x.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,a*(t[x.side]-c[o])+u))}),r=Math.min(f,r)),r>0||0>f){var p={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+p+")")}}}function d(){E=0,S=!0,L=I,M._infolayer.select("."+e).attr({"data-unformatted":L}).text(L).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 m=r.propContainer,g=r.propName,v=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,M=t._fullLayout,A=m.titlefont.family,k=m.titlefont.size,T=m.titlefont.color,E=1,S=!1,L=m.title.trim();""===L&&(E=0),L.match(/Click to enter .+ title/)&&(E=.2,S=!0),w||(w=M._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var z=w.selectAll("text").data([0]);z.enter().append("text"),z.text(L).attr("class",e),z.attr({"data-unformatted":L}).call(h);var I="Click to enter "+y+" title",P=t._context.editable;P&&(m===M?P=t._context.editableMainTitle:m===M.xaxis?P=t._context.editableAxisXTitle:m===M.yaxis?P=t._context.editableAxisYTitle:m===M.yaxis2?P=t._context.editableAxisY2Title:m===M.xaxis2&&(P=t._context.editableAxisX2Title)),P?(L||d(),z.call(c.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,g,e,v):o.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):L&&!L.match(/Click to enter .+ title/)||z.remove(),z.classed("js-placeholder",S),m._titleElement=z}},{"../../lib":583,"../../lib/svg_text_utils":596,"../../plotly":604,"../../plots/plots":663,"../color":498,"../drawing":521,d3:90,"fast-isnumeric":99}],562:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),o=t("../../lib/extend").extendFlat,a={_isLinkedToArray:!0,method:{valType:"enumerated",values:["restyle","relayout"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:!0,visible:{valType:"boolean"},active:{valType:"integer",min:-1,dflt:0},buttons:a,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:"bottom"},font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":578,"../../plots/font_attributes":625,"../color/attributes":497}],563:[function(t,e,r){"use strict";e.exports={name:"updatemenus",itemName:"updatemenu",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",buttonGroupClassName:"updatemenu-button-group",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],564:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,a,r,n)}var s=i(t,e),l=n("visible",s.length>0);l&&(n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return o.coerce(n,i,u,t,e)}for(var n,i,a=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(l.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),l.exit().remove(),l.exit().size()&&v(t),0!==r.length){var u=l.selectAll("g."+T.headerGroupClassName).data(r,i);u.enter().append("g").classed(T.headerGroupClassName,!0);var c=l.selectAll("g."+T.buttonGroupClassName).data([0]);c.enter().append("g").classed(T.buttonGroupClassName,!0).style("pointer-events","all"),u.enter().size()&&c.call(g).attr(T.menuIndexAttrName,"-1"),u.exit().each(function(e){y.select(this).remove(),c.call(g).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var h=0;h",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],571:[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}},{}],572:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.16.3-d16",r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=n.register,r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":601,"./plot_api/to_image":602,"./plot_api/validate":603,"./plotly":604,"./snapshot/download":678,d3:90}],573:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],574:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],575:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),o=t("./nested_property"),a=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r?!0:"string"!=typeof t?!1:!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),o=0;o2)return!1;var l=a[0].split("-");if(l.length>3||3!==l.length&&a[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),a[1]?(l=a[1].split(":"),l.length>3?!1:(o=Number(l[0]),l[0].length>2||!(o>=0&&23>=o)?!1:(i+=36e5*o,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof a)return void l.error("d3 is not defined.");e||(e=0);var r=new Date(t),i=a.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var u={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},c={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},h=a.time.format.utc,f={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(h),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(h)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(h)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){c[t].forEach(function(e){f[t].D.push(h(e)),["H","I","D"].forEach(function(r){u[r].forEach(function(n){var i=f[t][r];i.push(h(e+"~"+n)),i.push(h(n+"~"+e))})})})});var p=/[a-z]*/g,d=function(t){return t.substr(0,3)},m=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},x=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,M=/q([1-4])/,A=["31~mar","30~jun","30~sep","31~dec"],k=function(t,e){return A[e-1]},T=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(p,d).replace(m,"").replace(g,"~").replace(v,y).replace(M,k).trim().replace(T,"");var e,r,n=null,a=i(t),s=o(t);e=f[a][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{"../lib":583,d3:90,"fast-isnumeric":99}],577:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof jQuery&&jQuery(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var a=o._events[e];if(!a)return n;"function"==typeof a&&(a=[a]);for(var s=a.pop(),l=0;lv;v++){l=t[v];for(u in l)c=m[u],h=l[u],s&&a(h)?m[u]=h:e&&h&&(o(h)||(f=a(h)))?(f?(f=!1,p=c&&a(c)?c:[]):p=c&&o(c)?c:{},m[u]=i([p,h],e,r,s)):("undefined"!=typeof h||r)&&(m[u]=h)}return m}var o=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":584}],579:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;ry;y++)h=s(d,y),p=l(e,y),v[y]=n(h,p);else v=n(d,e);return v}var s=t("tinycolor2"),l=t("fast-isnumeric"),u=t("../components/colorscale/make_scale_function"),c=t("../components/color/attributes").defaultLine,h=t("./str2rgbarray"),f=1;e.exports=a},{"../components/color/attributes":497,"../components/colorscale/make_scale_function":515,"./str2rgbarray":595,"fast-isnumeric":99,tinycolor2:461}],582:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function o(t){return t.replace(/\<.*\>/g,"")}function a(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(r>n)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return""+a(o(n(i(t))))}var l=t("superscript-text"),u=t("../constants/string_mappings");e.exports=s},{"../constants/string_mappings":570,"superscript-text":458}],583:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var o=t("./coerce");i.valObjects=o.valObjects,i.coerce=o.coerce,i.coerce2=o.coerce2,i.coerceFont=o.coerceFont,i.validate=o.validate;var a=t("./dates");i.dateTime2ms=a.dateTime2ms,i.isDateTime=a.isDateTime,i.ms2DateTime=a.ms2DateTime,i.parseDate=a.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t("./loggers");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;or?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.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},i.identity=function(t){return t},i.randstr=function f(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,o,a=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;a===1/0;n*=2)a=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=a-Math.floor(a);for(n=0;n-1||u!==1/0&&u>=Math.pow(2,e)?f(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,o,a=t.length,s=2*a,l=2*e-1,u=new Array(l),c=new Array(a);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;a>r;r++){for(o=0,n=0;l>n;n++)i=r+n+1-e,-a>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=a&&(i=s-1-i),o+=t[i]*u[n];c[r]=o}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var o,a;t.length;)if(a=t.splice(0,1)[0],o=a(e),o&&o.then)return o.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,o=!1,a=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,a,s=3,l=Object.keys(t);for(n=0;n1?n+o[1]:"";if(i&&(o.length>1||a.length>4))for(;r.test(a);)a=a.replace(r,"$1"+i+"$2");return a+s}},{"./coerce":575,"./dates":576,"./extend":578,"./is_plain_object":584,"./loggers":585,"./matrix":586,"./nested_property":587,"./notifier":588,"./search":591,"./stats":594,d3:90}],584:[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}},{}],585:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;en;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;n>e;e++)for(o[e]=new Array(i),r=0;i>r;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,o=t.length;if(t[0].length)for(n=new Array(o),i=0;o>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var a=r.transposeRagged(e);for(n=new Array(a.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],587:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,o,a,s,l=t;for(a=0;a=0;e--){if(n=t[e],a=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?a?n[r]=void 0:n.pop():a=!0;else if("object"==typeof n&&null!==n)for(o=Object.keys(n),a=!1,r=o.length-1;r>=0;r--)u(n[o[r]])&&!i(n[o[r]],o[r])?delete n[o[r]]:a=!0;if(a)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,a,s=0,l=e.split(".");sr||r>o||a>n||n>s?!1:!e||!u(t)}function r(t,e){var r=t[0],l=t[1];if(i>r||r>o||a>l||l>s)return!1;var u,c,h,f,p,d=n.length,m=n[0][0],g=n[0][1],v=0;for(u=1;d>u;u++)if(c=m,h=g,m=n[u][0],g=n[u][1],f=Math.min(c,m),!(f>r||r>Math.max(c,m)||l>Math.max(h,g)))if(l=l&&r!==f&&v++}return v%2===1}var n=t.slice(),i=n[0][0],o=i,a=n[0][1],s=a;n.push(n[0]);for(var l=1;lo;o++)if(a=[t[o][0]-l[0],t[o][1]-l[1]],s=n(a,u),0>s||s>c||Math.abs(n(a,f))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":586}],590:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;oo.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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;rt}function i(t,e){return e>=t}function o(t,e){return t>e}function a(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("../lib");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,p=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?a:o;f>h&&p++<100;)u=Math.floor((h+f)/2),c(e[u],t)?h=u+1:f=u;return p>90&&l.log("Long binary search..."),h-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,i=e[n]-e[0]||1,o=i/(n||1)/1e4,a=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+o&&(i=Math.min(i,e[s+1]-e[s]),a.push(e[s+1]));return{vals:a,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,o=e.length-1,a=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;o>i&&a++<100;)n=u((i+o)/2),e[n]<=t?i=n+s:o=n-l;return e[i]}},{"../lib":583,"fast-isnumeric":99}],592:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],593:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":498}],594:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,o){var a,s;if(o||(o=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(o),a=0;o>a;a++)s[a]=r.aggNums(t,e,i[a]);i=s}for(a=0;o>a;a++)n(e)?n(i[a])&&(e=t(+e,+i[a])):e=i[a];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":99}],595:[function(t,e,r){"use strict";function n(t){return t=i(t),o.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),o=t("arraytools");e.exports=n},{arraytools:28,tinycolor2:461}],596:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+f.randstr([],64),o=h.select("body").append("div").attr({ -id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function a(t,e){for(var r=t||"",n=0;n]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),n=e&&e[2].toLowerCase(),i=m[n];if(void 0!==i){var o=e[1],a=e[3],s=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===n){if(o)return"
";if("href"!==a.substr(0,4).toLowerCase())return"";var u=a.substr(4).replace(/["']/g,"").replace(/=/,""),c=document.createElement("a");return c.href=u,-1===g.indexOf(c.protocol)?"":''}if("br"===n)return"
";if(o)return"sup"===n?'':"sub"===n?'':"";var h=""}return r.xml_entity_encode(t).replace(/");i>0;i=e.indexOf("
",i+1))n.push(i);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),i="",a=n.length-1;a>=0;a--){var s=n[a].match(/<(\/?).*>/i);if(s&&"
"!==n[a]){s[1]||(i=n[a]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,""),o+=2)});var a=e.join(""),u=a.split(/
/gi);return u.length>1&&(e=u.map(function(t,e){return''+t+""})),e.join("")}function c(t,e,r){var n,i,o,a=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},o="right"===a?function(){return l.right-n.width}:"center"===a?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:o()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),p=t("../constants/xmlns_namespaces"),d=t("../constants/string_mappings");h.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(f.log(r.querySelector("parsererror div").textContent),null):h.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=h.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},r.convertToTspans=function(t,e){function r(){p.empty()||(d=s.attr("class")+"-math",p.select("svg."+d).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),c=t.appendSVG(a),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),a=u(i),s=t,l=!s.attr("data-notex")&&a.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,p=h.select(s.node().parentNode);if(!p.empty()){var d=s.attr("class")?s.attr("class").split(" ")[0]:"text";d+="-math",p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var g=f.getPlotDiv(s.node());(g&&g._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};o(l[2],i,function(i,o,a){p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return r(),void t();var u=p.append("g").classed(d+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),o&&o.node()&&l.node().insertBefore(o.node().cloneNode(!0),l.node().firstChild),l.attr({"class":d,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var h=n(l,"width"),f=n(l,"height"),m=+s.attr("x")-h*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],g=parseInt(s.style("font-size"),10)||n(s,"height"),v=-g/4;"y"===d[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-h/2,v-f/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===d[0]?l.attr({x:s.attr("x"),y:v-f/2}):"a"===d[0]?l.attr({x:0,y:v}):l.attr({x:m,y:+s.attr("y")+v-f/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},g=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(d.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:d.entityToUnicode[t]}}),x=Object.keys(d.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+d.unicodeToEntity[t]+";"}});r.plainText=function(t){return(t||"").replace(v," ")},r.makeEditable=function(t,e,r){function n(){o(),a.style({opacity:0});var t,e=u.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(a.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=h.select(f.getPlotDiv(a.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":a.style("font-family")||"Arial","font-size":a.style("font-size")||12,color:r.fill||a.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(a.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||a.attr("data-unformatted")).call(c(a,e,r)).on("blur",function(){a.text(this.textContent).style({opacity:1});var t,e=h.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(a.node().parentNode).select(t).style({opacity:0});var r=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(a,r)}).on("focus",function(){var t=this;h.select(document).on("mouseup",function(){return h.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===h.event.which?(a.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(a,this.textContent)):(s.input.call(a,this.textContent),h.select(this).call(c(a,e,r)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(i)}r||(r={});var a=this,s=h.dispatch("edit","input","cancel"),l=h.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),r.immediate?n():u.on("click",n),h.rebind(this,s,"on")}},{"../constants/string_mappings":570,"../constants/xmlns_namespaces":571,"../lib":583,d3:90}],597:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,o=t("topojson").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return o(e,n).features}},{"../plots/geo/constants":626,topojson:463}],598:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t){Array.isArray(t._promises)&&t._promises.length>0&&R.log("Clearing previous rejected promises from queue."),t._promises=[]}function o(t,e){t._fullLayout._paperdiv.style("background","white"),C.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=R.extendFlat({},C.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=o:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function s(t,e,r){var n=z.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.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),C.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(M(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=C.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var o=t.framework.svg(),a=1,s=t._fullLayout.title;""!==s&&s||(a=0);var l="Click to enter title",u=function(){this.call(C.util.convertToTspans)},c=o.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(a=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:a}).on("mouseover.opacity",function(){z.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){z.select(this).transition().duration(1e3).style("opacity",0)}));var h=function(){this.call(C.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(h)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(h)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),j.addLinks(t),Promise.resolve()}function l(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var n=C.Axes.list({_fullLayout:t});for(e=0;ee;e++){var a=t.annotations[e];a.ref&&("paper"===a.ref?(a.xref="paper",a.yref="paper"):"data"===a.ref&&(a.xref="x",a.yref="y"),delete a.ref),u(a,"xref"),u(a,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(R.warn("Shapes must be an array."),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var l=t.shapes[e];u(l,"xref"),u(l,"yref")}var c=t.legend;c&&(c.x>3?(c.x=1.02,c.xanchor="left"):c.x<-2&&(c.x=-.02,c.xanchor="right"),c.y>3?(c.y=1.02,c.yanchor="bottom"):c.y<-2&&(c.y=-.02,c.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h=j.getSubplotIds(t,"gl3d");for(e=0;er;++r)x[r]=g[e]+v*y[2+4*r];p.camera={eye:{x:x[0],y:x[1],z:x[2]},center:{x:g[0],y:g[1],z:g[2]},up:{x:y[1],y:y[5],z:y[9]}},delete p.cameraposition}}return N.clean(t),t}function u(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=C.Axes.cleanId(r,n))}function c(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;io&&(s=R.randstr(n),-1!==r.indexOf(s));o++);a.uid=R.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=N.defaults,u=a.error_y.color||(j.traceIs(a,"bar")?N.defaultLine:l[i%l.length]);a.error_y.color=N.addOpacity(N.rgb(u),N.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!j.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",_(a)),delete a.bardir),"histogramy"===a.type&&_(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=C.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=C.Axes.cleanId(a.yaxis,"y")),j.traceIs(a,"gl3d")&&a.scene&&(a.scene=j.subplotsRegistry.gl3d.cleanId(a.scene)),j.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(h):a.textposition&&(a.textposition=h(a.textposition))),j.traceIs(a,"2dMap")&&("YIGnBu"===a.colorscale&&(a.colorscale="YlGnBu"),"YIOrRd"===a.colorscale&&(a.colorscale="YlOrRd")),j.traceIs(a,"markerColorscale")&&a.marker){var c=a.marker;"YIGnBu"===c.colorscale&&(c.colorscale="YlGnBu"),"YIOrRd"===c.colorscale&&(c.colorscale="YlOrRd")}if("surface"===a.type&&R.isPlainObject(a.contours)){var p=["x","y","z"];for(o=0;on?o.push(i+n):o.push(n);return o}function m(t,e,r){var n,i;for(n=0;n=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(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]),m(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&m(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=w(t._boundingBoxMargins),l=s.left+s.right,u=s.bottom+s.top,c=o._container.node().getBoundingClientRect(),h=1-2*a.frameMargins;i=Math.round(h*(c.width-l)),n=Math.round(h*(c.height-u))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||o.height,i=parseFloat(r.width)||o.width;return Math.abs(o.width-i)>1||Math.abs(o.height-n)>1?(o.height=t.layout.height=n,o.width=t.layout.width=i):"initial"!==o.autosize&&(delete e.autosize,o.autosize=t.layout.autosize=!0),j.sanitizeMargins(o),e}function A(t){var e=z.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(M(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];z.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=R.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(Q.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0);var o=C.Axes.getSubplots(t);o.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&k(t,o),r._has("cartesian")&&T(t,o),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var a=r._paper.selectAll(".layer-subplot");r._imageSubplotLayer=a.selectAll(".imagelayer"),r._shapeSubplotLayer=a.selectAll(".shapelayer");var s=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var l=R.syncOrAsync([E,function(){return C.Axes.doTicks(t,"redraw")},F.init],t);return l&&l.then&&t._promises.push(l),l}function k(t,e){function r(e,r){return function(){return C.Axes.getFromId(t,e,r)}}for(var n,i,o=t._fullLayout._plots={},a=0;a0,_=C.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),M=w===_;b?t.framework===A&&!x&&M||(t.framework=A,A(t)):M?x&&A(t):(t.framework=A,A(t)),x&&C.Axes.saveRangeInitial(t);var k=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&p(t);for(var S=0;SW.range[0]?[1,2]:[2,1]);else{var Q=W.range[0],K=W.range[1];"log"===F?(0>=Q&&0>=K&&o(H+".autorange",!0),0>=Q?Q=K/1e6:0>=K&&(K=Q/1e6),o(H+".range[0]",Math.log(Q)/Math.LN10),o(H+".range[1]",Math.log(K)/Math.LN10)):(o(H+".range[0]",Math.pow(10,Q)),o(H+".range[1]",Math.pow(10,K)))}else o(H+".autorange",!0)}if("reverse"===U)X.range?X.range.reverse():(o(H+".autorange",!0),X.range=[1,0]),Y.autorange?w=!0:_=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var $=D.parts[1],J=D.parts[0],tt=m[J]||[],et=C[R.titleCase(J)],rt=tt[$]||{};2===D.parts.length&&("add"===v[I]||R.isPlainObject(v[I])?S[I]="remove":"remove"===v[I]?-1===$?(S[J]=tt,delete S[I]):S[I]=rt:R.log("???",v)),!a(rt,"x")&&!a(rt,"y")||R.containsAny(I,["color","opacity","align","dash"])||(w=!0),et.draw(t,$,D.parts.slice(2).join("."),v[I]),delete v[I]}else if("images"===D.parts[0]){var it=R.objectFromPath(I,F);R.extendDeepAll(t.layout,it),V.supplyLayoutDefaults(t.layout,t._fullLayout),V.draw(t)}else if("mapbox"===D.parts[0]&&"layers"===D.parts[1]){R.extendDeepAll(t.layout,R.objectFromPath(I,F));var ot=(t._fullLayout.mapbox||{}).layers||[];for(P=D.parts[2]+1-ot.length,d=0;P>d;d++)ot.push({});_=!0}else if("updatemenus"===D.parts[0]){R.extendDeepAll(t.layout,R.objectFromPath(I,F));var at=t._fullLayout.updatemenus||[];for(P=D.parts[2]+1-at.length,d=0;P>d;d++)at.push({});_=!0}else 0===D.parts[0].indexOf("scene")?_=!0:0===D.parts[0].indexOf("geo")?_=!0:0===D.parts[0].indexOf("ternary")?_=!0:!g._has("gl2d")||-1===I.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===I?w=!0:-1!==D.parts[0].indexOf("legend")?y=!0:-1!==I.indexOf("title")?x=!0:-1!==D.parts[0].indexOf("bgcolor")?b=!0:D.parts.length>1&&R.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?x=!0:-1!==I.indexOf(".linewidth")&&-1!==I.indexOf("axis")?x=b=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?b=!0:D.parts.length>1&&"mirror"===D.parts[1]?x=b=!0:"margin.pad"===I?x=b=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||I.match(/^(bar|box|font)/)?w=!0:-1!==["hovermode","dragmode"].indexOf(I)?A=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(I)&&(_=!0):_=!0,D.set(F)}O.add(t,nt,[t,S],nt,[t,T]),v.autosize&&(v=M(t,v)),(v.height||v.width||v.autosize)&&(w=!0);var st=Object.keys(v),lt=[j.previousPromises];if(_||w)lt.push(function(){return t.layout=void 0,w&&(t.calcdata=void 0),C.plot(t,"",m)});else if(st.length&&(j.supplyDefaults(t),g=t._fullLayout,y&<.push(function(){return q.draw(t),j.previousPromises(t)}),b&<.push(E),x&<.push(function(){return C.Axes.doTicks(t,"redraw"),L(t),j.previousPromises(t)}),A)){var ut;for(Z(t),C.Fx.supplyLayoutDefaults(t.layout,g,t._fullData),C.Fx.init(t),ut=j.getSubplotIds(g,"gl3d"),d=0;d1)};u(r.width)&&u(r.height)||s(new Error("Height and width should be pixel values."));var c=n.clone(e,{format:"png",height:r.height,width:r.width}),h=c.td;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var f=n.getRedrawFunc(h);o.plot(h,c.data,c.layout,c.config).then(f).then(l).then(function(e){t(e)}).catch(function(t){s(t)})});return s}var i=t("fast-isnumeric"),o=t("../plotly"),a=t("../lib");e.exports=n},{"../lib":583,"../plotly":604,"../snapshot":680,"fast-isnumeric":99}],603:[function(t,e,r){"use strict";function n(t,e,r,i,o,u){u=u||[];for(var c=Object.keys(t),f=0;f1&&l.push(a("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;g>v;v++){var y=r[v],x=["data",v];if(d(y)){var b=c[v],_=b.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&l.push(a("invisible",x)),n(y,b,w,l,x);var M=y.transforms,A=b.transforms;if(M){m(M)||l.push(a("array",x,["transforms"])),x.push("transforms");for(var k=0;ku&&c>e&&(void 0===i[r]?o[h]=T.tickText(t,e):o[h]=s(t,e,String(i[r])),h++);return h=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{x(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function a(t,e){var r=t.match(U),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(U,o))(n)}return y.time.format(t)(n)}function s(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n){var i,o=e.x,s=t._tickround,l=new Date(o),u="";r&&t.hoverformat?i=a(t.hoverformat,o):t.tickformat?i=a(t.tickformat,o):(n&&(x(s)?s+=2:s={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[s]),"y"===s?i=D(l):"m"===s?i=O(l):(o!==t._tmin||r||(u="
"+D(l)),"d"===s?i=j(l):"H"===s?i=F(l):(o!==t._tmin||r||(u="
"+j(l)+", "+D(l)),i=N(l),"M"!==s&&(i+=B(l),"S"!==s&&(i+=f(v(o/1e3,1),t,"none",r).substr(1)))))),e.text=i+u}function u(t,e,r,n,i){var o=t.dtick,a=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=f(Math.pow(10,a),t,i,n);else if(x(o)||"D"===o.charAt(0)&&v(a+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(a);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=f(Math.pow(10,a),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,v(a,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(0>a?.5:.25)))}}function c(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}function f(t,e,r,n){var i=0>t,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat;if(n){var c={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};o(c),a=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var h=Math.pow(10,-a)/2;if("none"===s&&(l=0),t=Math.abs(t),h>t)t="0",i=!1;else{if(t+=h,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var f=a;0>f;f++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(l&&"hide"!==s){var d;d=0>l?"\u2212"+-l:"power"!==s?"+"+l:String(l),"e"===s||("SI"===s||"B"===s)&&(l>12||-15>l)?t+="e"+d:"E"===s?t+="E"+d:"power"===s?t+="\xd710"+d+"":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=V[l/3+5])}return i?"\u2212"+t:t}function p(t,e){var r,n,i=[];for(r=0;r1)for(n=1;n2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&h/c>f&&(l=a,u=s,f=h/c);if(n===i){var d=n-1,m=n+1;r="tozero"===t.rangemode?0>n?[d,0]:[0,m]:"nonnegative"===t.rangemode?[Math.max(0,d),Math.max(0,m)]:[d,m]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),p&&r.reverse(),r},T.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=T.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;id&&(d=m/10),u=t.c2l(d),c=t.c2l(m),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(p=!0,a=0;a=f?p=!1:s.val>=u&&s.pad<=f&&(t._min.splice(a,1),a--);p&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(p=!0,a=0;a=c&&s.pad>=h?p=!1:s.val<=c&&s.pad<=h&&(t._max.splice(a,1),a--);p&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,a,s,l,u,c,h,f,p,d,m,g=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(o=0;6>o;o++)i(o);for(o=g-1;o>5;o--)i(o)}},T.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-p)/h.dtick)%100<2}var o=_.aggNums(Math.min,null,t),a=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:a+.5,size:1};var s;if(r)s=(a-o)/r;else{var l=_.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*_.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*_.stdev(t)/Math.pow(t.length,n?.25:.4))}var h={type:"log"===e.type?"linear":e.type,range:[o,a]};T.autoTicks(h,s);var f,p=T.tickIncrement(T.tickFirst(h),h.dtick,"reverse");if("number"==typeof h.dtick){for(var d=0,m=0,g=0,v=0,y=0;ym&&(d>.3*b||i(o)||i(a))){var w=h.dtick/2;p+=o>p+w?w:-w}var M=1+Math.floor((a-p)/h.dtick);f=p+M*h.dtick}else for(f=p;a>=f;)f=T.tickIncrement(f,h.dtick);return{start:p,end:f,size:h.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return n(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),o(t),t._tmin=T.tickFirst(t);var i=t.range[1]=s:s>=l)&&(a.push(l),!(a.length>1e3));l=T.tickIncrement(l,t.dtick,i));t._tmax=a[a.length-1];for(var u=new Array(a.length),c=0;c157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,L)):e>12096e5?(e/=26298e5,t.dtick="M"+i(e,1,z)):e>432e5?(t.dtick=i(e,864e5,P),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=i(e,36e5,z):e>3e4?t.dtick=i(e,6e4,I):e>500?t.dtick=i(e,1e3,I):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,L));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,L)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,L));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},T.tickIncrement=function(t,e,r){var n=r?-1:1;if(x(e))return t+n*e;var i=e.charAt(0),o=n*Number(e.substr(1));if("M"===i){var a=new Date(t);return a.setMonth(a.getMonth()+o)}if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var s="D2"===e?R:C,l=t+.01*n,u=_.roundUp(v(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]n:n>u;)u=T.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-o)/h)*h+o)/Math.LN10;if("D"===c){var f="D2"===i?R:C,p=_.roundUp(v(n,1),f,e);return Math.floor(n)+Math.log(y.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var D=y.time.format("%Y"),O=y.time.format("%b %Y"),j=y.time.format("%b %-d"),F=y.time.format("%b %-d %Hh"),N=y.time.format("%H:%M"),B=y.time.format(":%S"),U=/%(\d?)f/g;T.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,o,a=s(t,e),f="array"===t.tickmode,p=r||f;if(f&&Array.isArray(t.ticktext)){var d=Math.abs(t.range[1]-t.range[0])/1e4;for(o=0;o1&&er&&(I=90),i(f,I)}u._lastangle=I}return l(),a(e),e+" done"}function l(){var e=.25,r=200,n=("x"===g?t._fullLayout.height:t._fullLayout.width)*e;n=Math.min(n,r),f.each(function(t){var e=y.select(this),r=k.bBox(e.node()),i="x"===g?r.height:r.width;if(i>n){var o=t.text,a=Math.round(n/(i/o.length)),s=Math.floor(a/2),l=a-s-1;o=o.substr(0,s)+"\u2026"+o.substr(-l);var u=e.select("text");u.text(o),e.insert("title","text").text(t.text)}})}function c(){var e,r,n=u._boundingBox,i=0,o=0;if("x"===u._id.charAt(0)?(e="height","2"===u._id.charAt(1)?(o=1,r="t"):r="b"):"y"===u._id.charAt(0)&&(e="width","2"===u._id.charAt(1)?(i=1,r="r"):r="l"),e&&r){var a=n[e];if(u._titleElement){var s=u._titleElement.node().getBoundingClientRect();a+=s[e]+2}var l=.5*t._fullLayout[e];a=Math.min(a,l);var c={x:i,y:o,l:0,r:0,b:0,t:0};c[r]=a,b.Plots.autoMargin(t,u._name,c)}}function h(){u._boundingBox=r.node().getBoundingClientRect()}r.style("pointer-events","all");var f=r.selectAll("g."+z).data(S,L);if(!u.showticklabels||!x(n))return f.remove(),void a(e);var d,v,M,A,T;"x"===g?(T="bottom"===B?1:-1,d=function(t){return t.dx+D*T},A=n+(R+C)*T,v=function(t){return t.dy+A+t.fontSize*("bottom"===B?1:-.5)},M=function(t){return x(t)&&0!==t&&180!==t?0>t*T?"end":"start":"middle"}):(T="right"===B?1:-1,v=function(t){return t.dy+t.fontSize/2-D*T},d=function(t){return t.dx+n+(R+C+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*T},M=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var E=0,I=0,P=[],O=f.enter().append("g").classed(z,1);O.append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(k.setPosition,d(e),v(e)).call(k.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?P.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),f.exit().remove(),f.each(function(t){E=Math.max(E,t.fontSize)}),i(f,u._lastangle||u.tickangle);var j=_.syncOrAsync([o,s,h,c]);return j&&j.then&&t._promises.push(j),j}function a(e){if(!r){var n,i,o,a,s=E.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,p=1.5,d=s.titlefont.size;if(l.size()){var m=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);m&&(u.offsetLeft=+m[1],u.offsetTop=+m[2])}"x"===h?(i="free"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:E.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("top"===s.side?-10-d*(p+(s.showticklabels?1:0)):i._length+10+d*(p+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(a+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:E.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("right"===s.side?i._length+10+d*(p+(s.showticklabels?1:.5)):-10-d*(p+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),M.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:h.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:o,y:a,"text-anchor":"middle"}})}}function s(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:b.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[g]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===g}function l(e,r,i){var o=e.gridlayer,a=e.zerolinelayer,l=e["hidegrid"+g]?[]:V,c=u._gridpath||"M0,0"+("x"===g?"v":"h")+r._length,h=o.selectAll("path."+I).data(u.showgrid===!1?[]:l,L);if(h.enter().append("path").classed(I,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)m;m++){var y=u.mirrors[a._id+f[m]];"ticks"!==y&&"labels"!==y||(h[m]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=U[e];t&&x(r)&&(p+=d(r+C*i,i*u.ticklen))}),i(r,p),l(e,a,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return G.length?Promise.all(G):0},T.swap=function(t,e){for(var r=p(t,e),n=0;n2*n}function c(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,o=0;o2*n}var h=t("fast-isnumeric"),f=t("tinycolor2").mix,p=t("../../lib"),d=t("../plots"),m=t("../../components/color/attributes").lightFraction,g=t("./layout_attributes"),v=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),x=t("./tick_label_defaults"),b=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),M=t("./clean_datum"),A=t("./axis_ids");e.exports=function(t,e,r,i){function o(r,n){return p.coerce2(t,e,g,r,n)}var a=i.letter,s=i.font||{},l="Click to enter "+(i.title||a.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=A.name2id(i.name));var u=r("type");"-"===u&&(n(e,i.data),"-"===e.type?e.type="linear":u=t.type=e.type),_(e);var c=r("color"),d=c===t.color?c:s.color;r("title",l),p.coerceFont(r,"titlefont",{family:s.family,size:Math.round(1.2*s.size),color:d});var M=2===(t.range||[]).length&&h(t.range[0])&&h(t.range[1]),k=r("autorange",!M);k&&r("rangemode");var T=r("range",[-1,"x"===a?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),p.noneOrAll(t.range,e.range,[0,1]),r("fixedrange"),v(t,e,r,u),x(t,e,r,u,i),y(t,e,r,i),b(t,e,r);var E=o("linecolor",c),S=o("linewidth"),L=r("showline",!!E||!!S);L||(delete e.linecolor,delete e.linewidth),(L||e.ticks)&&r("mirror");var z=o("gridcolor",f(c,i.bgColor,m).toRgbString()),I=o("gridwidth"),P=r("showgrid",i.showGrid||!!z||!!I);P||(delete e.gridcolor,delete e.gridwidth);var C=o("zerolinecolor",c),R=o("zerolinewidth"),D=r("zeroline",i.showGrid||!!C||!!R);return D||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===u?w(a,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":497,"../../lib":583,"../plots":663,"./axis_ids":609,"./category_order_defaults":610,"./clean_datum":611,"./layout_attributes":616,"./ordered_categories":618,"./set_convert":621,"./tick_label_defaults":622,"./tick_mark_defaults":623,"./tick_value_defaults":624,"fast-isnumeric":99,tinycolor2:461}],609:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,o=[],a=0;a0;o&&(n="array");var a=r("categoryorder",n);"array"===a&&r("categoryarray"),o||"array"!==a||(e.categoryorder="trace")}}},{}],611:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return i.ms2DateTime(t);if("string"!=typeof t&&!n(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){i.error(e,t)}return t}},{"../../lib":583,"fast-isnumeric":99}],612:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],613:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?c.ms2DateTime(n,i):"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function o(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function a(t){var e=["lasso","select"];return-1!==e.indexOf(t)}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../lib"),h=t("../../lib/svg_text_utils"),f=t("../../components/color"),p=t("../../components/drawing"),d=t("../../lib/setcursor"),m=t("../../components/dragelement"),g=t("./axes"),v=t("./select"),y=t("./constants"),x=!0;e.exports=function(t,e,r,s,b,_,w,M){function A(t,e){for(var r=0;r.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+dt+", "+mt+")").attr("d",lt+"Z"),ft=pt.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+dt+", "+mt+")").attr("d","M0,0Z"),E();for(var o=0;oi?(ct="",at.r=at.l,at.t=at.b,ft.attr("d","M0,0Z")):(at.t=0,at.b=q,ct="x",ft.attr("d","M"+(at.l-.5)+","+(ot-H-.5)+"h-3v"+(2*H+1)+"h3ZM"+(at.r+.5)+","+(ot-H-.5)+"h3v"+(2*H+1)+"h-3Z")):!K||i.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ft.transition().style("opacity",1).duration(200),ut=!0)}function L(t,e,r){var n,i,o,a=[];for(n=0;nzoom back out","long"),x=!1),s.pre=!1,t.emit("plotly_zoom",s))}function I(e,r){var i=1===(w+M).length;if(e)O();else if(2!==r||i){if(1===r&&i){var o=w?U[0]:B[0],a="s"===w||"w"===M?0:1,s=o._name+".range["+a+"]",l=n(o,a),c="left",f="middle";if(o.fixedrange)return;w?(f="n"===w?"top":"bottom","right"===o.side&&(c="right")):"e"===M&&(c="right"),et.call(h.makeEditable,null,{immediate:!0,background:F.paper_bgcolor,text:String(l),fill:o.tickfont?o.tickfont.color:"#444",horizontalAlign:c,verticalAlign:f}).on("edit",function(e){var r="category"===o.type?o.c2l(e):o.d2l(e);void 0!==r&&u.relayout(t,s,r)})}}else D()}function P(e){function r(t,e,r){if(!t.fixedrange){k(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||F._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(vt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void c.log("Did not find wheel motion attributes: ",e);var o,a=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=xt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=gt[0]+gt[2]*l,h=(s.bottom-e.clientY)/s.height,f=gt[1]+gt[3]*(1-h);if(M){for(o=0;o=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,o=0,a=0;a0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nT;T++){var E=o[T],S=p[E];if(S)A[T]=w.getFromId(t,S.xaxis._id),k[T]=w.getFromId(t,S.yaxis._id);else{var L=a[E]._subplot;A[T]=L.xaxis,k[T]=L.yaxis}}var z=e.hovermode||a.hovermode;if(-1===["x","y","closest"].indexOf(z)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var I,P,C,R,D,O,j,F,N,B,U,V,q=[],G=[];if(Array.isArray(e))for(z="array",C=0;CH||H>Y.width||0>X||X>Y.height)return _.unhoverRaw(t,e)}else H="xpx"in e?e.xpx:A[0]._length/2,X="ypx"in e?e.ypx:k[0]._length/2;if(I="xval"in e?n(o,e.xval):i(A,H),P="yval"in e?n(o,e.yval):i(k,X),!m(I[0])||!m(P[0]))return g.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var W=1/0;for(R=0;R1||-1!==O.hoverinfo.indexOf("name")?O.name:void 0,index:!1,distance:Math.min(W,M.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},V=q.length,"array"===F){var Z=e[R];"pointNumber"in Z?(U.index=Z.pointNumber,F="closest"):(F="","xval"in Z&&(N=Z.xval,F="x"),"yval"in Z&&(B=Z.yval,F=F?"closest":"y"))}else N=I[j],B=P[j];if(O._module&&O._module.hoverPoints){var Q=O._module.hoverPoints(U,N,B,F);if(Q)for(var K,$=0;$V&&(q.splice(0,V),W=q[0].distance)}if(0===q.length)return _.unhoverRaw(t,e);var J="y"===z&&G.length>1;q.sort(function(t,e){return t.distance-e.distance});var tt=x.combine(a.plot_bgcolor||x.background,a.paper_bgcolor),et={hovermode:z,rotateLabels:J,bgColor:tt,container:a._hoverlayer,outerContainer:a._paperdiv},rt=u(q,et);c(q,J?"xa":"ya"),h(rt,J);var nt=t._hoverdata,it=[];for(C=0;C128?"#000":x.background;if(t.name&&void 0===t.zLabelVal){var c=document.createElement("p");c.innerHTML=t.name,r=c.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):k&&t[i+"Label"]===m?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var h=e.select("text.nums").style("fill",u).call(b.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);h.selectAll("tspan.line").call(b.setPosition,0,0);var f=e.select("text.name"),g=0;r&&r!==n?(f.style("fill",l).text(r).call(b.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),f.selectAll("tspan.line").call(b.setPosition,0,0),g=f.node().getBoundingClientRect().width+2*P):(f.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var v,M,E=h.node().getBoundingClientRect(),S=t.xa._offset+(t.x0+t.x1)/2,L=t.ya._offset+(t.y0+t.y1)/2,z=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),R=E.width+I+P+g;t.ty0=_-E.top,t.bx=E.width+2*P,t.by=E.height+2*P,t.anchor="start",t.txwidth=E.width,t.tx2width=g,t.offset=0,o?(t.pos=S,v=A>=L+C/2+R,M=L-C/2-R>=0,"top"!==t.idealAlign&&v||!M?v?(L+=C/2,t.anchor="start"):t.anchor="middle":(L-=C/2,t.anchor="end")):(t.pos=L,v=w>=S+z/2+R,M=S-z/2-R>=0,"left"!==t.idealAlign&&v||!M?v?(S+=z/2,t.anchor="start"):t.anchor="middle":(S-=z/2,t.anchor="end")),h.attr("text-anchor",t.anchor),g&&f.attr("text-anchor",t.anchor),e.attr("transform","translate("+S+","+L+")"+(o?"rotate("+T+")":""))}),L}function c(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>o)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=o;n=!1}if(n){var u=0;for(a=0;ae.pmax&&u++;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos>e.pmax-1&&(l.del=!0,u--);for(a=0;a=u);a++)if(l=t[a],l.pos=0;s--)t[s].dp-=o;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,o,a,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?S:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,a=0;a.01&&d.pmin===m.pmin&&d.pmax===m.pmax){for(s=p.length-1;s>=0;s--)p[s].dp+=i;for(f.push.apply(f,p),h.splice(a+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(o=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=o;n=!1}else a++}h.forEach(r)}for(a=h.length-1;a>=0;a--){var g=h[a];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function h(t,e){t.each(function(t){var r=p.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],a=o*(I+P),s=a+o*(t.txwidth+P),l=0,u=t.offset;"middle"===t.anchor&&(a-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-z,l=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*I+l)+","+(I+u)+"v"+(t.by/2-I)+"h"+n*t.bx+"v-"+t.by+"H"+(n*I+l)+"V"+(u-I)+"Z"),i.call(b.setPosition,a+l,u+t.ty0-t.by/2+P).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(b.setPosition,s+o*P+l,u+t.ty0-t.by/2+P),r.select("rect").call(b.setRect,s+(o-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function f(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],o=t._hoverdata[n];if(i.curveNumber!==o.curveNumber||String(i.pointNumber)!==String(o.pointNumber))return!0}return!1}var p=t("d3"),d=t("tinycolor2"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),b=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),M=t("./constants"),A=t("./dragbox"),k=e.exports={};k.unhover=_.unhover,k.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},k.supplyLayoutDefaults=function(t,e,r){function n(r,n){return g.coerce(t,e,k.layoutAttributes,r,n)}n("dragmode");var i;if(e._has("cartesian")){var o=e._isHoriz=k.isHoriz(r);i=o?"y":"x"}else i="closest";n("hovermode",i)},k.isHoriz=function(t){for(var e=!0,r=0;rt._lastHoverTime+M.HOVERMINTIME?(a(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){a(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},M.HOVERMINTIME))},k.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||o(e,r):"x"===t?e:r},k.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indext*e||0===t?M.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":498,"../../components/dragelement":519,"../../components/drawing":521,"../../lib":583,"../../lib/events":577,"../../lib/svg_text_utils":596,"./axes":607,"./constants":612,"./dragbox":613,d3:90,"fast-isnumeric":99,tinycolor2:461}],615:[function(t,e,r){"use strict";var n=t("../plots"),i=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=i.idRegex,r.attrRegex=i.attrRegex,r.attributes=t("./attributes"),r.plot=function(t){function e(t,e){for(var r=[],n=0;nh[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":583,"fast-isnumeric":99}],620:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),o=t("../../components/color"),a=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function p(t,e){return t-e}var d,m=i.gd._fullLayout._zoomlayer,g=i.element.getBoundingClientRect(),v=i.plotinfo.x()._offset,y=i.plotinfo.y()._offset,x=e-g.left,b=r-g.top,_=x,w=b,M="M"+x+","+b,A=i.xaxes[0]._length,k=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),S=i.xaxes.concat(i.yaxes);"lasso"===h&&(d=l([[x,b]],s.BENDPX));var L=m.selectAll("path.select-outline").data([1,2]);L.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",M+"Z");var z,I,P,C,R,D=m.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),O=[],j=i.gd,F=[];for(z=0;z0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*c*Math.abs(n-i))}return a.BADNUM}function r(t){return Math.pow(10,t)}function u(t){return i(t)?Number(t):a.BADNUM}var c=10;if(t.c2l="log"===t.type?e:u,t.l2c="log"===t.type?r:u,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=l.getFromId(t._gd,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)i(t.range[e])||(t.range[e]=i(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?n.round(t._b+t._m*e,2):a.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=u,t.d2c=function(t){return t=s(t),i(t)?Number(t):a.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return i(t)?o.ms2DateTime(t):a.BADNUM},t.d2c=function(t){return i(t)?Number(t):o.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var h=t.range.map(o.dateTime2ms);!i(t.range[0])&&i(h[0])&&(t.range[0]=h[0]),!i(t.range[1])&&i(h[1])&&(t.range[1]=h[1])}catch(f){o.error(f,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?a.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,o;if(r in e)for(n=e[r],i=new Array(n.length),o=0;on?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),o=this.projection,a=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",a),r.selectAll("path.graticulepath").attr("d",a),n.selectAll("path.choroplethlocation").attr("d",a),n.selectAll("path.basepath").attr("d",a),i.selectAll("path.js-line").attr("d",a),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../components/color":498,"../../components/drawing":521,"../../constants/xmlns_namespaces":571,"../../lib/filter_visible":579,"../../lib/topojson_utils":597,"../../plots/cartesian/axes":607,"./constants":626,"./projections":634,"./set_scale":635,"./zoom":636,"./zoom_reset":637,d3:90,topojson:463}],628:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var a=0;a=n}function o(t,e){for(var r=e[0],n=e[1],i=!1,o=0,a=t.length,s=a-1;a>o;s=o++){var l=t[o],u=l[0],c=l[1],h=t[s],f=h[0],p=h[1];c>n^p>n&&(f-u)*(n-c)/(p-c)+u>r&&(i=!i)}return i}function a(t){return t?t/Math.sin(t):1}function s(t){return t>1?P:-1>t?-P:Math.asin(t)}function l(t){return t>1?0:-1>t?I:Math.acos(t)}function u(t,e){var r=(2+P)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>L;n++){var o=Math.cos(e);e-=i=(e+Math.sin(e)*(o+2)-r)/(2*o*(1+o))}return[2/Math.sqrt(I*(4+I))*t*(1+Math.cos(e)),2*Math.sqrt(I/(4+I))*Math.sin(e)]}function c(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?f:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function p(t,e){return[3*t/(2*I)*Math.sqrt(I*I/3-e*e),e]}function d(t,e){return[t,1.25*Math.log(Math.tan(I/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>L&&--i>0);return e/2}}function g(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var o=s(i/e);return[n/(t*Math.cos(o)),s((2*o+Math.sin(2*o))/r)]},n}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/I),i=Math.floor(n),o=n-i,a=(r=N[i])[0],s=r[1],l=(r=N[++i])[0],u=r[1],c=(r=N[Math.min(19,++i)])[0],h=r[1];return[t*(l+o*(c-a)/2+o*o*(c-2*l+a)/2),(e>0?P:-P)*(u+o*(h-s)/2+o*o*(h-2*u+s)/2)]}function x(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=a(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function _(t,e){var r=b(t,e);return[(r[0]+t/P)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},M=[],A=[],k={point:function(t,e){M.push([t,e])},result:function(){var t=M.length?M.length<2?{type:"Point",coordinates:M[0]}:{type:"MultiPoint",coordinates:M}:null;return M=[],t}},T={lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){M.length&&(A.push(M),M=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},E={polygonStart:n,lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){var t=M.length;if(t){do M.push(M[0].slice());while(++t<4);A.push(M),M=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return o(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:T,MultiLineString:T,Polygon:E,MultiPolygon:E,Sphere:E},L=1e-6,z=L*L,I=Math.PI,P=I/2,C=(Math.sqrt(I),I/180),R=180/I,D=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=0>r?-1:1,i=l[+(0>r)],o=0,a=i.length-1;a>o&&t>i[o][2][0];++o);var s=e(t-i[o][1][0],r);return s[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],a=e(t[1][0],t[1][1])[1];return o>a&&(r=o,o=a,a=r),[[n,o],[i,a]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;i>n;++n){var a=l[0][n],s=180*a[0][0]/I,u=180*a[0][1]/I,c=180*a[1][1]/I,h=180*a[2][0]/I,f=180*a[2][1]/I;r.push(o([[s+e,u+e],[s+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var n=l[1].length-1;n>=0;--n){var a=l[1][n],s=180*a[0][0]/I,u=180*a[0][1]/I,c=180*a[1][1]/I,h=180*a[2][0]/I,f=180*a[2][1]/I;r.push(o([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function o(t,e){for(var r,n,i,o=-1,a=t.length,s=t[0],l=[];++ou;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function a(t,e){return Math.abs(t[0]-e[0])n)],o=l[+(0>n)],u=0,c=i.length;c>u;++u){var h=i[u];if(h[0][0]<=t&&tL&&--i>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]},(t.geo.naturalEarth=function(){return D(v)}).raw=v;var N=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];N.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/P,n=90*r,i=Math.min(18,Math.abs(n/5)),o=Math.max(0,Math.floor(i));do{var a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],u=l-a,c=l-2*s+a,h=2*(Math.abs(r)-s)/u,f=c/u,p=h*(1-f*h*(1-2*f*h));if(p>=0||1===o){n=(e>=0?5:-5)*(p+i);var d,m=50;do i=Math.min(18,Math.abs(n)/5),o=Math.floor(i),p=i-o,a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],n-=(d=(e>=0?P:-P)*(s+p*(l-a)/2+p*p*(l-2*s+a)/2)-e)*R;while(Math.abs(d)>z&&--m>0);break}}while(--o>=0);var g=N[o][0],v=N[o+1][0],y=N[Math.min(19,o+2)][0];return[t/(v+p*(y-g)/2+p*p*(y-2*v+g)/2),n*C]},(t.geo.robinson=function(){return D(y)}).raw=y,x.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return D(x)}).raw=x,b.invert=function(t,e){if(!(t*t+4*e*e>I*I+L)){var r=t,n=e,i=25;do{var o,a=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),p=c*c,d=h*h,m=s*s,g=1-d*u*u,v=g?l(h*u)*Math.sqrt(o=1/g):o=0,y=2*v*h*s-t,x=v*c-e,b=o*(d*m+v*h*u*p),_=o*(.5*a*f-2*v*c*s),w=.25*o*(f*s-v*c*d*a),M=o*(p*u+v*m*h),A=_*w-M*b;if(!A)break;var k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return D(b)}).raw=b,_.invert=function(t,e){var r=t,n=e,i=25;do{var o,a=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=a*a,f=Math.sin(r),p=Math.cos(r/2),d=Math.sin(r/2),m=d*d,g=1-h*p*p,v=g?l(a*p)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*a*d+r/P)-t,x=.5*(v*s+n)-e,b=.5*o*(h*m+v*a*p*c)+.5/P,_=o*(f*u/4-v*s*d),w=.125*o*(u*d-v*s*h*f),M=.5*o*(c*p+v*m*a)+.5,A=_*w-M*b,k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return D(_)}).raw=_}e.exports=n},{}],635:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,a=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,p=n.range[1]-s,d=a.range[0]+s,m=a.range[1]-s,g=n._fullRange[0]+s,v=n._fullRange[1]-s,y=a._fullRange[0]+s,x=a._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var b=p-f,_=m-d,w=[f+b/2,d+_/2],M=r._rotate;r._center=[w[0]+M[0],w[1]+M[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var a,s,l,b,_=e.scale(),w=r._translate0,M=i(f,d,p,m),A=i(g,y,v,x);l=o(e,M),a=n(l),b=o(e,A),r._fullScale=n(b),e.scale(a),l=o(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=o(e,M),t._isAlbersUsa||e.clipExtent(l),a=r.scale*a,r._scale=a,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function o(t,e){return a.geo.path().projection(t).bounds(e)}var a=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":626,d3:90}],636:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?o:e._clipAngle?s:a)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function o(t,e){function r(){_.select(this).style(A)}function n(){a.scale(_.event.scale).translate(_.event.translate),t.render()}function o(){_.select(this).style(k)}var a=t.projection,s=i(a,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",o),s}function a(t,e){function r(t){return g.invert(t)}function n(t){var e=g(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function o(){_.select(this).style(A),l=_.mouse(this),u=g.rotate(),c=g.translate(),h=u,f=r(l)}function a(){return p=_.mouse(this),n(l)?(v.scale(g.scale()),void v.translate(g.translate())):(g.scale(_.event.scale),g.translate([c[0],_.event.translate[1]]),f?r(p)&&(m=r(p),d=[h[0]+(m[0]-f[0]),u[1],u[2]],g.rotate(d),h=d):(l=p,f=r(l)),void t.render())}function s(){_.select(this).style(k)}var l,u,c,h,f,p,d,m,g=t.projection,v=i(g,e),y=2;return v.on("zoomstart",o).on("zoom",a).on("zoomend",s),v}function s(t,e){function r(t){v++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function o(t){--v||t({type:"zoomend"})}var a,s=t.projection,p={r:s.rotate(),k:s.scale()},d=i(s,e),m=b(d,"zoomstart","zoom","zoomend"),v=0,y=d.on;return d.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,o=s.translate(),v=u(e);a=l(s,t),y.call(d,"zoom",function(){var r=_.mouse(this);if(s.scale(p.k=_.event.scale),a){if(l(s,r)){s.rotate(e).translate(o);var u=l(s,r),d=h(a,u),y=g(c(v,d)),x=p.r=f(y,a,i);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=i),s.rotate(x),i=x}}else t=r,a=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(k),y.call(d,"zoom",null),o(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(d,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&v(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),o=Math.cos(e),a=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[o*s*u+i*a*l,i*s*u-o*a*l,o*a*u+i*s*l,o*s*l-i*a*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return[r*a-n*s-i*l-o*u,r*s+n*a+i*u-o*l,r*l-n*u+i*a+o*s,r*u+n*l-i*s+o*a]}function h(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),o=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*o,-r[1]*o,r[0]*o]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,o,a=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,a)*M,d=Math.sqrt(a*a+s*s);Math.abs(c)>d?(o=(c>0?90:-90)-f,i=0):(o=Math.asin(c/d)*M-f,i=Math.sqrt(d*d-c*c));var g=180-o-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M,x=p(r[0],r[1],o,v),b=p(r[0],r[1],g,y);return b>=x?[o,v,r[2]]:[g,y,r[2]]}function p(t,e,r,n){var i=d(r-t),o=d(n-e);return Math.sqrt(i*i+o*o)}function d(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),o=0===e?1:0,a=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[o]=t[o]*s-t[a]*l,i[a]=t[a]*s+t[o]*l,i}function g(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function v(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;i>n;++n)r+=t[n]*e[n];return r}function x(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function b(t){for(var e=0,r=arguments.length,n=[];++ep;++p){for(e=u[p],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,d=0;2>=d;d+=2)this.labelEnable[p+d]=!1,this.labels[p+d]=a(n),this.labelColor[p+d]=s(r.titlefont.color),this.labelFont[p+d]=r.titlefont.family,this.labelSize[p+d]=r.titlefont.size,this.labelPad[p+d]=this.getLabelPad(e,r),this.tickEnable[p+d]=!1,this.tickColor[p+d]=s((r.tickfont||{}).color),this.tickAngle[p+d]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[p+d]=this.getTickPad(r),this.tickMarkLength[p+d]=0,this.tickMarkWidth[p+d]=r.tickwidth||0,this.tickMarkColor[p+d]=s(r.tickcolor),this.borderLineEnable[p+d]=!1,this.borderLineColor[p+d]=s(r.linecolor),this.borderLineWidth[p+d]=r.linewidth||0;c=this.hasSharedAxis(r),o=this.hasAxisInDfltPos(e,r)&&!c,l=this.hasAxisInAltrPos(e,r)&&!c,i=r.mirror||!1,h=c?-1!==String(i).indexOf("all"):!!i,f=c?"allticks"===i:-1!==String(i).indexOf("ticks"),o?this.labelEnable[p]=!0:l&&(this.labelEnable[p+2]=!0),o?this.tickEnable[p]=r.showticklabels:l&&(this.tickEnable[p+2]=r.showticklabels),(o||h)&&(this.borderLineEnable[p]=r.showline),(l||h)&&(this.borderLineEnable[p+2]=r.showline),(o||f)&&(this.tickMarkLength[p]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[p+2]=this.getTickMarkLength(r)),this.gridLineEnable[p]=r.showgrid,this.gridLineColor[p]=s(r.gridcolor),this.gridLineWidth[p]=r.gridwidth,this.zeroLineEnable[p]=r.zeroline,this.zeroLineColor[p]=s(r.zerolinecolor),this.zeroLineWidth[p]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=o.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=o.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":582,"../../lib/str2rgbarray":595,"../../plotly":604}],640:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),o=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"gl2d"),a=0;ar;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var o=0;oa;++a,--s)for(var l=0;r>l;++l)for(var u=0;4>u;++u){var c=i[4*(r*a+l)+u];i[4*(r*a+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),p=f.createImageData(r,n);p.data.set(i),f.putImageData(p,0,0);var d;switch(t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(o),d},v.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.calcTicks(this.xaxis),s.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;r_;++_)m[_]=Math.min(m[_],b.bounds[_]),m[_+2]=Math.max(m[_+2],b.bounds[_+2]);for(y=0;2>y;++y)m[y]>m[y+2]&&(m[y]=-1,m[y+2]=1),v=this[g[y]],v._length=h.viewBox[y+2]-h.viewBox[y],s.doAutoRange(v);h.ticks=this.computeTickMarks();var w=this.xaxis.range,M=this.yaxis.range;h.dataBox=[w[0],M[0],w[1],M[1]],h.merge(r),n.update(h),this.glplot.draw()},v.updateTraces=function(t,e){var r,n,i,o=Object.keys(this.traces);t:for(r=0;rf;++f)a=a&&l[f]===s[f],l[f]=s[f];var p=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,a?!p:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),o=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var a=i();n._active.lookAt(a,r,o,e),n._active.lookAt(a+500,r,o,[0,0,1]),n._active.flush(a)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var p=0,d=0;return a(t,function(e,r,o,a){var s="rotate"===f.keyBindingMode,l="pan"===f.keyBindingMode,c="zoom"===f.keyBindingMode,h=!!a.control,m=!!a.alt,g=!!a.shift,v=!!(1&e),y=!!(2&e),x=!!(4&e),b=1/t.clientHeight,_=b*(r-p),w=b*(o-d),M=f.flipX?1:-1,A=f.flipY?1:-1,k=i(),T=Math.PI*f.rotateSpeed;if((s&&v&&!h&&!m&&!g||v&&!h&&!m&&g)&&n.rotate(k,M*T*_,-A*T*w,0),(l&&v&&!h&&!m&&!g||y||v&&h&&!m&&!g)&&n.pan(k,-f.translateSpeed*_*u,f.translateSpeed*w*u,0),c&&v&&!h&&!m&&!g||x||v&&!h&&m&&!g){var E=-f.zoomSpeed*w/window.innerHeight*(k-n.lastT())*100;n.pan(k,0,0,u*(Math.exp(E)-1))}return p=r,d=o,!0}),s(t,function(t,e){var r=f.flipX?1:-1,o=f.flipY?1:-1,a=i();if(Math.abs(t)>Math.abs(e))n.rotate(a,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*o*e/window.innerHeight*(a-n.lastT())/100;n.pan(a,0,0,u*(Math.exp(s)-1))}},!0),f}e.exports=n;var i=t("right-now"),o=t("3d-view"),a=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":22,"mouse-change":385,"mouse-wheel":387,"right-now":431}],643:[function(t,e,r){"use strict";function n(t,e){for(var r=0;3>r;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),o=t("../plots"),a=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,a=o.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;sr;++r){var n=t[u[r]];e.labels[r]=a(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":582,"../../../lib/str2rgbarray":595,arraytools:28}],648:[function(t,e,r){"use strict";function n(t,e,r,n){for(var o=r("bgcolor"),l=i.combine(o,n.paper_bgcolor),u=Object.keys(a.camera),c=0;ce;++e){var r=t[a[e]];this.enabled[e]=r.showspikes,this.colors[e]=o(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":595}],651:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),o=0;oc;++c){var h=i[s[c]];if(h._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(h._length)===1/0)u[c]=[];else{h.range[0]=r[c].lo/t.dataScale[c],h.range[1]=r[c].hi/t.dataScale[c],h._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var p=h.nticks||o.Lib.constrain(h._length/40,4,9);o.Axes.autoTicks(h,Math.abs(h.range[1]-h.range[0])/p)}for(var d=o.Axes.calcTicks(h),m=0;mc;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var m=0;2>m;++m)e.bounds[m][c]=t.glplot.bounds[m][c]}t.contourLevels=n(u)}e.exports=i;var o=t("../../../plotly"),a=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":582,"../../../plotly":604}],652:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],653:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return m.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),o=i.width,a=i.height;n.setAttributeNS(null,"viewBox","0 0 "+o+" "+a),n.setAttributeNS(null,"width",o),n.setAttributeNS(null,"height",a),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;co;++o)l=c[T[o]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(o=0;oa;++a)f[0][a]>f[1][a]?p[a]=1:f[1][a]===f[0][a]?p[a]=1:p[a]=1/(f[1][a]-f[0][a]);for(this.dataScale=p,o=0;oo;++o){if(l=c[T[o]],u=l.type,u in b?(b[u].acc*=p[o],b[u].count+=1):b[u]={acc:p[o],count:1},l.autorange){for(y[0][o]=1/0,y[1][o]=-(1/0),a=0;ay[1][o])y[0][o]=-1,y[1][o]=1;else{var M=y[1][o]-y[0][o];y[0][o]-=M/32,y[1][o]+=M/32}}else{var A=c[T[o]].range;y[0][o]=A[0],y[1][o]=A[1]}y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),x[o]=y[1][o]-y[0][o],this.glplot.bounds[0][o]=y[0][o]*p[o],this.glplot.bounds[1][o]=y[1][o]*p[o]}var k=[1,1,1];for(o=0;3>o;++o){l=c[T[o]],u=l.type;var E=b[u];k[o]=Math.pow(E.acc,1/E.count)/p[o]}var S,L=4;if("auto"===c.aspectmode)S=Math.max.apply(null,k)/Math.min.apply(null,k)<=L?k:[1,1,1];else if("cube"===c.aspectmode)S=[1,1,1];else if("data"===c.aspectmode)S=k;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=c.aspectratio;S=[z.x,z.y,z.z]}c.aspectratio.x=h.aspectratio.x=S[0],c.aspectratio.y=h.aspectratio.y=S[1],c.aspectratio.z=h.aspectratio.z=S[2],this.glplot.aspect=S;var I=c.domain||null,P=e._size||null;if(I&&P){var C=this.container.style;C.position="absolute",C.left=P.l+I.x[0]*P.w+"px",C.top=P.t+(1-I.y[1])*P.h+"px",C.width=P.w*(I.x[1]-I.x[0])+"px",C.height=P.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},k.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],o=["x","y","z"];return e[i[r]]&&t[i[r]][o[n]]===e[i[r]][o[n]]}var r=this.getCamera(),n=p.nestedProperty(t,this.id+".camera"),i=n.get(),o=!1;if(void 0===i)o=!0;else for(var a=0;3>a;a++)for(var s=0;3>s;s++)if(!e(r,i,a,s)){o=!0;break}return o&&n.set(r),o},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,a=n-1;a>o;++o,--a)for(var s=0;r>s;++s)for(var l=0;4>l;++l){var u=i[4*(r*o+s)+l];i[4*(r*o+s)+l]=i[4*(r*a+s)+l],i[4*(r*a+s)+l]=u}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),p=f.createImageData(r,n);p.data.set(i),f.putImageData(p,0,0);var d;switch(t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),d},e.exports=o},{"../../lib":583,"../../lib/show_no_webgl_msg":593,"../../lib/str2rgbarray":595,"../../plots/cartesian/axes":607,"../../plots/cartesian/graph_interact":614,"../../plots/plots":663,"./camera":642,"./layout/convert":647,"./layout/spikes":650,"./layout/tick_marks":651,"./project":652,"./set_convert":654,"gl-plot3d":176}],654:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=function(){};e.exports=function(t){n.setConvert(t),t.setScale=i}},{"../cartesian/axes":607}],655:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("./font_attributes"),o=t("../components/color/attributes"),a=n.Lib.extendFlat;e.exports={font:{family:a({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},i.size,{dflt:12}),color:a({},i.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes",images:"Images",updatemenus:"UpdateMenus",ternary:"ternary",mapbox:"mapbox"}}},{"../components/color/attributes":497,"../plotly":604,"./font_attributes":625}],656:[function(t,e,r){"use strict";e.exports={styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",controlContainerClassName:"mapboxgl-control-container",noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),mapOnErrorMsg:"Mapbox error."}},{}],657:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],o=r[1],a=Array.isArray(e)?n.mean(e):e,s=.5+a/100,l=1.5+a/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(o){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}var h;return h=u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",{anchor:h,offset:c}}},{"../../lib":583}],658:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n0}function o(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function a(t){var e,r=t.sourcetype,n=t.source,i={type:r},o="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=o?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=a(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=o(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":583,"./convert_text_opts":657}],660:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,o=t("../font_attributes"),a=t("../../traces/scatter/attributes").textposition;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:!0,sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},o,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},a,{arrayOk:!1})}}}},{"../../components/color":498,"../../lib":583,"../../traces/scatter/attributes":771,"../font_attributes":625}],661:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return o.coerce(n,i,s.layers,t,e)}for(var n,i,a=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var a=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,a),s.text(a.text()&&u.text()?" - ":"")},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],s=t._fullData=[],l=t.data||[];p.supplyLayoutGlobalDefaults(i,n),n._dataLength=l.length,p.supplyDataDefaults(l,s,n),n._has=p._hasPlotType.bind(n);var u=n._modules;for(e=0;eo&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>a&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),a=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;return e.margin.autoexpand!==!1&&(l.base={l:{val:0,size:i},r:{val:1,size:o},t:{val:1,size:a},b:{val:0,size:s}},Object.keys(l).forEach(function(t){var r=l[t].l||{},n=l[t].b||{},c=r.val,h=r.size,f=n.val,p=n.size;Object.keys(l).forEach(function(t){if(u(h)&&l[t].r){var r=l[t].r.val,n=l[t].r.size;if(r>c){var d=(h*r+(n-e.width)*c)/(r-c),m=(n*(1-c)+(h-e.width)*(1-r))/(r-c);d>=0&&m>=0&&d+m>i+o&&(i=d,o=m)}}if(u(p)&&l[t].t){var g=l[t].t.val,v=l[t].t.size;if(g>f){var y=(p*g+(v-e.height)*f)/(g-f),x=(v*(1-f)+(p-e.height)*(1-g))/(g-f);y>=0&&x>=0&&y+x>s+a&&(s=y,a=x)}}})})),r.l=Math.round(i),r.r=Math.round(o),r.t=Math.round(a),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:c.plot(t)},p.graphJson=function(t,e,r,n,i){function o(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=o(t[e])}return i}return Array.isArray(t)?t.map(o):t&&t.getTime?h.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var a=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(a||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(l.layout=o(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===n?l:JSON.stringify(l)}},{"../components/color":498,"../lib":583,"../plotly":604,"./attributes":605,"./font_attributes":625,"./layout_attributes":655,d3:90,"fast-isnumeric":99}],664:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":771}],665:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return o({},e,r)}var i=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,a=o({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:a,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:a}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"] -},orientation:{valType:"angle"}}}},{"../../lib/extend":578,"../cartesian/layout_attributes":616}],666:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),o=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},a=n.Lib.extendDeepAll;o.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var p=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),d=!1,m=p.map(function(t,e){return d=d||"undefined"!=typeof t.groupId,t});if(d){var g=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(m),v=[],y=g.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],v.push(r),r=o.util.sumArrays(t.r,r)}),t.values});p=i.merge(y)}p.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;x=Math.max(10,x);var b,_=[h.margin.left+x,h.margin.top+x];if(d){var w=i.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(v)));b=[0,w]}else b=i.extent(o.util.flattenArray(p.map(function(t,e){return t.r})));h.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),n=i.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:b).range([0,x]),c.layout.radialAxis.domain=n.domain();var M,A=o.util.flattenArray(p.map(function(t,e){return t.t})),k="string"==typeof A[0];k&&(A=o.util.deduplicate(A),M=A.slice(),A=i.range(A.length),p=p.map(function(t,e){var r=t;return t.t=[A],d&&(r.yStack=t.yStack),r}));var T=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,E=null===h.needsEndSpacing?k||!T:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0,L=S?h.angularAxis.domain:i.extent(A),z=Math.abs(A[1]-A[0]);T&&!k&&(z=0);var I=L.slice();E&&k&&(I[1]+=z);var P=h.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),h.angularAxis.ticksStep&&(P=(I[1]-I[0])/P);var C=h.angularAxis.ticksStep||(I[1]-I[0])/(P*(h.minorTicks+1));M&&(C=Math.max(Math.round(C),1)),I[2]||(I[2]=C);var R=i.range.apply(this,I);if(R=R.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=E?z:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var D="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",O=(new DOMParser).parseFromString(D,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=i.select(j)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var V=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=F.node().getBBox();x=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],n.range([0,x]),c.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var G=[(h.width-(h.margin.left+h.margin.right+2*x+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(G[0]=Math.max(0,G[0]),G[1]=Math.max(0,G[1]),e.select(".outer-group").attr("transform","translate("+G+")"),h.title){var H=e.select("g.title-group text").style(U).text(h.title),X=H.node().getBBox();H.attr({x:_[0]-X.width/2,y:_[1]-x-20})}var Y=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var W=Y.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(B);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);Y.call(Q).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Y.selectAll(".domain").style(B),Y.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var K=e.select(".angular.axis-group").selectAll("g.angular-tick").data(R),$=K.enter().append("g").classed("angular-tick",!0);K.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),K.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:h.minorTickColor}),K.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(U);var J=K.select("text.axis-text").attr({x:x+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),p[0]||et){var nt=[];p.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),ot=[];it.forEach(function(t,e){"unstacked"===t.key?ot=ot.concat(t.values.map(function(t,e){return[t]})):ot.push(t.values)}),ot.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!k){var pt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;pt.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ct.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var dt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(Z).radius;dt.attr({r:r}).style({opacity:.5}),st=n.invert(o.util.getMousePos(Z).radius);var i=o.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(o.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),a=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=a){n.attr({"data-fill":a}),s=i.hsl(a).darker().toString(),n.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),p=[h.left+h.width/2-G[0]-f.left,h.top+h.height/2-G[1]-f.top];ft.config({color:s}).text(c),ft.move(p)}else a=n.style("stroke"),n.attr({"data-stroke":a}),s=i.hsl(a).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,n,s,l={data:[],layout:{}},u={},c={},h=i.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return n},f.angularScale=function(t){return s},f.svg=function(){return e},i.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},o.util.dataFromEquation=function(t,e,r){var n=e||6,o=[],a=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);o.push(e),a.push(i)});var s={t:o,r:a};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],o={};return o.x=r,o.y=n,o.pos=e,o.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+n*n),o},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,o=t.length;o>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var o=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof o&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},o.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function o(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var a=!!e[0].data.yStack,l=e.map(function(t,e){return a?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,n,o){var a=e[o].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=a.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,a){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=o(n(s));return"translate("+[r.x,r.y]+")"}})};var f=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,n,o){var a=r[2]?l[o].map(function(t,e){return[t[0],t[1]+t[2]]}):l[o];if(i.select(this).each(h.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:g.stroke(r,n,o)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:f(a),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,n,o)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,n,o)},"stroke-width":function(t,e){return g["stroke-width"](r,n,o)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,n,o)},opacity:function(t,e){return g.opacity(r,n,o)},display:function(t,e){return g.display(r,n,o)}})}};var p=t.angularScale.range(),d=Math.abs(p[1]-p[0])/l[0].length*Math.PI/180,m=i.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},v=i.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({"class":"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,r=[o.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),a(r[e],o.PolyChart.defaultConfig()),a(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=i.merge(n);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),p=f.selectAll("svg").data([0]),d=p.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var m=i.range(o.length),g=i.scale[c?"linear":"ordinal"]().domain(m).range(l),v=i.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var x=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return g(e)}}),b.exit().remove()}var _=i.svg.axis().scale(v).orient("right"),w=p.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},i.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},o.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(o){var a=i.hsl(n.color).l,s=a>=.5?"#aaa":"white",c=a>=.5?"black":"white",h=o||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(h);var f=n.padding,p=e.node().getBBox(),d={fill:n.color,stroke:s,"stroke-width":"2px"},m=p.width+2*f+l,g=p.height+2*f;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[n.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-g/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return a(n,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};i.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":604,"./micropolar_manager":667,d3:90}],667:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),o=t("./undo_manager"),a=e.exports={},s=n.Lib.extendDeepAll;a.framework=function(t){function e(e,o){return o&&(h=o),i.select(i.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(h),t.data=r.data,t.layout=r.layout,a.fillLayout(t),r}var r,l,u,c,h,f=new o;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},a.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),o=t.framework&&t.framework.svg&&t.framework.svg(),a={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:o};t._fullLayout=s(a,t.layout)}},{"../../plotly":604,"./undo_manager":668,d3:90}],668:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return nm;m++){var g=p[m];s=t[g]?t[g]:t[g]={},e[g]=l={},a("domain."+f,[m/d,(m+1)/d]),a("domain."+{x:"y",y:"x"}[f]),o.id=g,h(s,l,a,o)}}},{"../lib":583,"./plots":663}],670:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"ternary"),a=0;a=a&&(p.min=0,d.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),o=t("../../subplot_defaults"),a=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:a,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":498,"../../subplot_defaults":669,"./axis_defaults":673,"./layout_attributes":675}],675:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":497,"./axis_attributes":672}],676:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),a=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,p=t("../cartesian/axes"),d=t("../../lib/filter_visible"),m=t("../../components/dragelement"),g=t("../../components/titles"),v=t("../cartesian/select"),y=t("../cartesian/constants"),x=t("../cartesian/graph_interact");e.exports=n;var b=n.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},b.plot=function(t,e){var r,n=this,i=e[n.id],o=e._size;l.getPlotDiv(n.plotContainer.node())!==n.graphDiv&&(n.init(n.graphDiv._fullLayout),n.makeFramework()),n.adjustLayout(i,o);var a=n.traceHash,s={};for(r=0;r_*y?(o=y,i=o*_):(i=v,o=i/_),a=m*i/v,s=g*o/y,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-d)-o/2,l.x0=r,l.y0=n,l.w=i,l.h=o,l.sum=x,l.xaxis={type:"linear",range:[b+2*M-x,x-b-2*w],domain:[p-a/2,p+a/2],_id:"x",_gd:l.graphDiv},h(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[b,x-w-M],domain:[d-s/2,d+s/2],_id:"y",_gd:l.graphDiv},h(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],k=l.aaxis=f({},t.aaxis,{range:[b,x-w-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+o+",-"+i/2});h(k);var T=l.baxis=f({},t.baxis,{range:[x-b-M,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+o});h(T),k._counteraxis=T;var E=l.caxis=f({},t.caxis,{range:[x-b-w,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+o+","+i/2});h(E);var S="M"+r+","+(n+o)+"h"+i+"l-"+i/2+",-"+o+"Z";l.clipDef.select("path").attr("d",S),l.layers.plotbg.select("path").attr("d",S);var L="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",L);var z="translate("+r+","+(n+o)+")";l.layers.baxis.attr("transform",z),l.layers.bgrid.attr("transform",z);var I="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var C=l.layers.axlines;C.select(".aline").attr("d",k.showline?"M"+r+","+(n+o)+"l"+i/2+",-"+o:"M0,0").call(u.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),C.select(".bline").attr("d",T.showline?"M"+r+","+(n+o)+"h"+i:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),C.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+o:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px")},b.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,o=e.baxis,a=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,o,!0),p.doTicks(r,a,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:a,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",A="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",k="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;b.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();b=e-n.left,w=r-n.top,S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},z=S,L=O.aaxis.range[1]-S.a,I=a(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),P="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",C=!1,R=N.append("path").attr("class","zoombox").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",P),D=N.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),d()}function e(t,e){return 1-e/O.h}function r(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function n(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function o(t,i){var o=b+t,a=w+i,s=Math.max(0,Math.min(1,e(b,w),e(o,a))),l=Math.max(0,Math.min(1,r(b,w),r(o,a))),u=Math.max(0,Math.min(1,n(b,w),n(o,a))),c=(s/2+u)*O.w,h=(1-s/2-l)*O.w,f=(c+h)/2,p=h-c,d=(1-s)*O.h,m=d-p/_;p.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),D.transition().style("opacity",1).duration(200),C=!0)}function c(t,e){if(z===S)return 2===e&&g(),i(F);i(F);var r={};r[O.id+".aaxis.min"]=z.a,r[O.id+".baxis.min"]=z.b,r[O.id+".caxis.min"]=z.c,s.relayout(F,r),E&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),E=!1)}function h(){S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},z=S}function f(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m;z={a:S.a-n,b:S.b+(r+n)/2,c:S.c-(r-n)/2};var i=[z.a,z.b,z.c].sort(),o={a:i.indexOf(z.a),b:i.indexOf(z.b),c:i.indexOf(z.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),z={a:i[o.a],b:i[o.b],c:i[o.c]},e=(S.a-z.a)*O.yaxis._m,t=(S.c-z.c-S.b+z.b)*O.xaxis._m);var a="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",a),O.aaxis.range=[z.a,O.sum-z.b-z.c],O.baxis.range=[O.sum-z.a-z.c,z.b],O.caxis.range=[O.sum-z.a-z.b,z.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1)}function p(t,e){if(t){var r={};r[O.id+".aaxis.min"]=z.a,r[O.id+".baxis.min"]=z.b,r[O.id+".caxis.min"]=z.c,s.relayout(F,r)}else 2===e&&g()}function d(){O.plotContainer.selectAll(".select-outline").remove()}function g(){var t={};t[O.id+".aaxis.min"]=0,t[O.id+".baxis.min"]=0,t[O.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),s.relayout(F,t)}var b,w,S,L,z,I,P,C,R,D,O=this,j=O.layers.plotbg.select("path").node(),F=O.graphDiv,N=O.layers.zoom,B={element:j,gd:F,plotinfo:{plot:N},doubleclick:g,subplot:O.id,prepFn:function(e,r,n){B.xaxes=[O.xaxis],B.yaxes=[O.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=o,B.doneFn=c,t(e,r,n)):"pan"===i?(B.moveFn=f,B.doneFn=p,h(),d()):"select"!==i&&"lasso"!==i||v(e,r,n,B,i)}};j.onmousemove=function(t){x.hover(F,t,O.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=O.id},j.onmouseout=function(t){F._dragging||m.unhover(F,t)},j.onclick=function(t){x.click(F,t)},m.init(B)}},{"../../components/color":498,"../../components/dragelement":519,"../../components/drawing":521,"../../components/titles":561,"../../lib":583,"../../lib/extend":578,"../../lib/filter_visible":579,"../../plotly":604,"../cartesian/axes":607,"../cartesian/constants":612,"../cartesian/graph_interact":614,"../cartesian/select":620,"../cartesian/set_convert":621,d3:90,tinycolor2:461}],677:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var o=t("../plotly"),a=o.Lib.extendFlat,s=o.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),h=s({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;rl;l++)n(r[l])&&p.push({p:r[l],s:s[l],b:0});return o(e,"marker")&&a(e,e.marker.color,"marker","c"),o(e,"marker.line")&&a(e,e.marker.line.color,"marker.line","c"),p}},{"../../components/colorscale/calc":505,"../../components/colorscale/has_colorscale":511,"../../plots/cartesian/axes":607,"fast-isnumeric":99}],687:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),o=t("../scatter/xy_defaults"),a=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=o(t,e,c);return h?(c("orientation",e.x&&!e.y?"h":"v"),c("text"),a(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),void s(t,e,i.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":498,"../../components/errorbars/defaults":526,"../../lib":583,"../bar/style_defaults":695,"../scatter/xy_defaults":792,"./attributes":685}],688:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,r,a){var s,l=t.cd,u=l[0].trace,c=l[0].t,h=t.xa,f=t.ya,p="closest"===a?c.barwidth/2:c.dbar*(1-h._gd._fullLayout.bargap)/2;s="closest"!==a?function(t){return t.p}:"h"===u.orientation?function(t){return t.y}:function(t){return t.x};var d,m;"h"===u.orientation?(d=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},m=function(t){var e=s(t)-r;return n.inbox(e-p,e+p)}):(m=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},d=function(t){var r=s(t)-e;return n.inbox(r-p,r+p)});var g=n.getDistanceFunction(a,d,m);if(n.getClosest(l,g,t),t.index!==!1){var v=l[t.index],y=v.mcc||u.marker.color,x=v.mlcc||u.marker.line.color,b=v.mlw||u.marker.line.width;return o.opacity(y)?t.color=y:o.opacity(x)&&b&&(t.color=x),"h"===u.orientation?(t.x0=t.x1=h.c2p(v.x,!0),t.xLabelVal=v.s,t.y0=f.c2p(s(v)-p,!0),t.y1=f.c2p(s(v)+p,!0),t.yLabelVal=v.p):(t.y0=t.y1=f.c2p(v.y,!0),t.yLabelVal=v.s,t.x0=h.c2p(s(v)-p,!0),t.x1=h.c2p(s(v)+p,!0),t.xLabelVal=v.p),v.tx&&(t.text=v.tx),i.hoverInfo(v,u,t),[t]}}},{"../../components/color":498,"../../components/errorbars":527,"../../plots/cartesian/graph_interact":614}],689:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../scatter/colorbar":774,"./arrays_to_calcdata":684,"./attributes":685,"./calc":686,"./defaults":687,"./hover":688,"./layout_attributes":690,"./layout_defaults":691,"./plot":692,"./set_positions":693,"./style":694}],690:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],691:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return o.coerce(t,e,a,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var f,p,d,m;if("h"===s.orientation?(d=c.c2p(r.poffset+e.p,!0),m=c.c2p(r.poffset+e.p+r.barwidth,!0),f=u.c2p(e.b,!0),p=u.c2p(e.s+e.b,!0)):(f=u.c2p(r.poffset+e.p,!0),p=u.c2p(r.poffset+e.p+r.barwidth,!0),m=c.c2p(e.s+e.b,!0),d=c.c2p(e.b,!0)),!(i(f)&&i(p)&&i(d)&&i(m)&&f!==p&&d!==m))return void n.select(this).remove();var g=(e.mlw+1||s.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,v=n.round(g/2%1,2);if(!t._context.staticPlot){var y=a.opacity(e.mc||s.marker.color),x=1>y||g>.01?o:l;f=x(f,p),p=x(p,f),d=x(d,m),m=x(m,d)}n.select(this).attr("d","M"+f+","+d+"V"+m+"H"+p+"V"+d+"Z")})}),f.call(s.plot,e)}},{"../../components/color":498,"../../components/errorbars":527,"../../lib":583,"./arrays_to_calcdata":684,d3:90,"fast-isnumeric":99}],693:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,s,l=t._fullLayout,u=e.x(),c=e.y();["v","h"].forEach(function(h){function f(e){function r(t){t[d]=t.p+f}var n=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){n.push(t.p)})});var i=a.distinctVals(n),s=i.vals,u=i.minDiff,c=!1,h=[];"group"===l.barmode&&e.forEach(function(e){c||(t.calcdata[e].forEach(function(t){c||h.forEach(function(e){Math.abs(t.p-e)_&&(L=!0,k=_),_>A+C&&(L=!0,A=_))}o.expand(v,[k,A],{tozero:!0,padded:L})}else{var R=function(t){return t[m]=t.s,t.s};for(r=0;r1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,a=r.line,s=(e._input||{}).marker||{},l=o.tryColorscale(r,s,""),u=o.tryColorscale(r,s,"line.");n.select(this).selectAll("path").each(function(t){var e,o,s=(t.mlw+1||a.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",s+"px").call(i.fill,e),s&&(o="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(a.color)?i.defaultLine:a.color,c.call(i.stroke,o))})}),e.call(a.style)}},{"../../components/color":498,"../../components/drawing":521,"../../components/errorbars":527,d3:90}],695:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,s){r("marker.color",a),i(t,"marker")&&o(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&o(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":498,"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511}],696:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,a=n.marker,s=a.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:o({},a.symbol,{arrayOk:!1}),opacity:o({},a.opacity,{arrayOk:!1,dflt:1}),size:o({},a.size,{arrayOk:!1}),color:o({},a.color,{arrayOk:!1}),line:{color:o({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:o({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":497,"../../lib/extend":578,"../scatter/attributes":771}],697:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,o,a){var s;return r in e?d=o.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===o.type||n(e.name)&&-1!==["linear","log"].indexOf(o.type)||i.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,s=o.d2c(s),d=a.map(function(){return s})),d}function a(t,e,r,o,a){var s,l,u,c,h=o.length,f=e.length,p=[],d=[];for(s=0;h>s;++s)l=o[s],t[s]={pos:l},d[s]=l-a,p[s]=[];for(d.push(o[h-1]+a),s=0;f>s;++s)c=e[s],n(c)&&(u=i.findBin(r[s],d),u>=0&&f>u&&p[u].push(c));return p}function s(t,e){var r,n,o,a;for(a=0;a1,v=r.dPos*(1-f.boxgap)*(1-f.boxgroupgap)/(g?t.numboxes:1),y=g?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-f.boxgap):0,x=v*m.whiskerwidth;return m.visible!==!0||r.emptybox?void o.select(this).remove():("h"===m.orientation?(l=d,h=p):(l=p,h=d),r.bPos=y,r.bdPos=v,n(),o.select(this).selectAll("path.box").data(a.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=l.c2p(t.pos+y-x,!0),s=l.c2p(t.pos+y+x,!0),u=h.c2p(t.q1,!0),c=h.c2p(t.q3,!0),f=a.constrain(h.c2p(t.med,!0),Math.min(u,c)+1,Math.max(u,c)-1),p=h.c2p(m.boxpoints===!1?t.min:t.lf,!0),d=h.c2p(m.boxpoints===!1?t.max:t.uf,!0);"h"===m.orientation?o.select(this).attr("d","M"+f+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+c+"V"+r+"ZM"+u+","+e+"H"+p+"M"+c+","+e+"H"+d+(0===m.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+d+","+i+"V"+s)):o.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+u+"H"+n+"V"+c+"H"+r+"ZM"+e+","+u+"V"+p+"M"+e+","+c+"V"+d+(0===m.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+d+"H"+s))}),m.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=m}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,o,s,l,h,f="all"===m.boxpoints?t.val:t.val.filter(function(e){return et.uf}),p=(t.q3-t.q1)*c,d=[],g=0;if(m.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,p,d),void(m.boxmean&&o.select(this).selectAll("path.mean").data(a.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=h.c2p(t.mean,!0),a=h.c2p(t.mean-t.sd,!0),s=h.c2p(t.mean+t.sd,!0);"h"===m.orientation?o.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==m.boxmean?"":"m0,0L"+a+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):o.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==m.boxmean?"":"m0,0L"+e+","+a+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":521,"../../lib":583,d3:90}],704:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var r,a,s,l,u=t._fullLayout,c=e.x(),h=e.y(),f=["v","h"];for(a=0;al&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,a,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===a._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":706}],709:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":628,"../heatmap/colorbar":723,"./attributes":706,"./calc":707,"./defaults":708,"./plot":710}],710:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return a.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var i="all"===n?g.hoverinfo.flags:n.split("+"),o=-1!==i.indexOf("name"),s=-1!==i.indexOf("location"),l=-1!==i.indexOf("z"),u=-1!==i.indexOf("text"),c=!o&&s;return function(t){var n=[];c?t.nameLabel=t.id:(o&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("
")}}function i(t){return function(e,r){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:r,location:e.id,z:e.z}]}}}var o=t("d3"),a=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/graph_interact"),l=t("../../components/color"),u=t("../../components/drawing"),c=t("../../components/colorscale/get_scale"),h=t("../../components/colorscale/make_scale_function"),f=t("../../lib/topojson_utils").getTopojsonFeatures,p=t("../../lib/geo_location_utils").locationToFeature,d=t("../../lib/array_to_calc_item"),m=t("../../plots/geo/constants"),g=t("./attributes"),v=e.exports={};v.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,o=i.length,a=f(t,e),s=(t.marker||{}).line||{},l=0;o>l;l++)r=p(t.locationmode,i[l],a),void 0!==r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),d(s.color,r,"mlc",l),d(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},v.plot=function(t,e,r){var a,l=t.framework,u=l.select("g.choroplethlayer"),c=l.select("g.baselayer"),h=l.select("g.baselayeroverchoropleth"),f=m.baseLayersOverChoropleth,p=u.selectAll("g.trace.choropleth").data(e,function(t){return t.uid});p.enter().append("g").attr("class","trace choropleth"),p.exit().remove(),p.each(function(e){function r(e,r){if(t.showHover){var n=t.projection(e.properties.ct);u(e),s.loneHover({x:n[0],y:n[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()}),h=c(e,r),t.graphDiv.emit("plotly_hover",h)}}function a(e,r){t.graphDiv.emit("plotly_click",c(e,r))}var l=v.calcGeoJSON(e,t.topojson),u=n(t,e),c=i(e),h=null,f=o.select(this).selectAll("path.choroplethlocation").data(l);f.enter().append("path").classed("choroplethlocation",!0).on("mouseover",r).on("click",a).on("mouseout",function(){s.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",h)}).on("mousedown",function(){s.loneUnhover(t.hoverContainer)}).on("mouseup",r),f.exit().remove()}),h.selectAll("*").remove();for(var d=0;dr;r++)e=h[r],p[r]=e[0]*(t.zmax-t.zmin)+t.zmin,d[r]=e[1];var m=n.extent([t.zmin,t.zmax,o.start,o.start+l*(u-1)]),g=m[t.zminr;r++)e=h[r],p[r]=(e[0]*(u+c-1)-c/2)*l+a,d[r]=e[1];var y=n.scale.linear().interpolate(n.interpolateRgb).domain(p).range(d);return y}},{"../../components/colorscale/get_scale":510,d3:90}],718:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,o=r[0].x,s=r[0].y,u=n.contours,c=n.uid,h=e.x(),f=e.y(),g=t._fullLayout,x="contour"+c,b=i(u,e,r[0]);if(n.visible!==!0)return g._paper.selectAll("."+x+",.hm"+c).remove(),void g._infolayer.selectAll(".cb"+c).remove();"heatmap"===u.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=u.start-u.size/2,n._input.zmax=n.zmax=n.zmin+b.length*u.size),M(t,e,[r])):g._paper.selectAll(".hm"+c).remove(),a(b),l(b);var _=h.c2p(o[0],!0),w=h.c2p(o[o.length-1],!0),A=f.c2p(s[0],!0),k=f.c2p(s[s.length-1],!0),T=[[_,k],[w,k],[w,A],[_,A]],E=p(e,r,x);d(E,T,u),m(E,b,T,u),v(E,b,u),y(E,e,r[0],T)}function i(t,e,r){for(var n=t.size||1,i=[],o=t.start;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function a(t){var e,r,n,i,a,s,l,u,c,h=t[0].z,f=h.length,p=h[0].length,d=2===f||2===p;for(r=0;f-1>r;r++)for(i=[],0===r&&(i=i.concat(A)),r===f-2&&(i=i.concat(k)),e=0;p-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(T)),e===p-2&&(n=n.concat(E)),a=e+","+r,s=[[h[r][e],h[r][e+1]],[h[r+1][e],h[r+1][e+1]]],c=0;ci;i++){if(s>20?(s=L[s][(l[0]||l[1])<0?0:1],t.crossings[a]=z[s]):delete t.crossings[a],l=S[s],!l){_.log("Found bad marching index:",s,e,t.level);break}if(p.push(f(t,e,l)),e[0]+=l[0],e[1]+=l[1],c(p[p.length-1],p[p.length-2])&&p.pop(),a=e.join(","),a===o&&l.join(",")===d||r&&(l[0]&&(e[0]<0||e[0]>g-2)||l[1]&&(e[1]<0||e[1]>m-2)))break;s=t.crossings[a]}1e4===i&&_.log("Infinite loop in contour?");var v,y,x,b,w,M,A,k=c(p[0],p[p.length-1]),T=0,E=.2*t.smoothing,I=[],P=0;for(i=1;i=P;i--)if(v=I[i],C>v){for(x=0,y=i-1;y>=P&&v+I[y]x&&v+I[x]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&_.log("Infinite loop in contour?")}}function u(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==A.indexOf(t)?i=1:-1!==T.indexOf(t)?n=1:-1!==k.indexOf(t)?i=-1:n=-1,[n,i]}function c(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function h(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function f(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),o=t.z[i][n],a=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-o)/(t.z[i][n+1]-o);return[a.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-o)/(t.z[i+1][n]-o);return[a.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}function p(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function d(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function m(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var o=i.selectAll("path").data("fill"===n.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=g(t,r);e?b.select(this).attr("d",e).style("stroke","none"):b.select(this).remove()})}function g(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function o(t){return Math.abs(t[0]-e[2][0])<.01}for(var a,s,l,u,c,h,f=t.edgepaths.length||t.z[0][0]l;l++){if(!a){_.log("Missing end?",p,t);break}for(r(a)&&!o(a)?s=e[1]:i(a)?s=e[0]:n(a)?s=e[3]:o(a)&&(s=e[2]),c=0;c=0&&(s=g,u=c):Math.abs(a[1]-s[1])<.01?Math.abs(a[1]-g[1])<.01&&(g[0]-a[0])*(s[0]-g[0])>=0&&(s=g,u=c):_.log("endpt to newendpt is not vert. or horz.",a,s,g)}if(a=s,u>=0)break;f+="L"+s}if(u===t.edgepaths.length){_.log("unclosed perimeter path");break}p=u,m=-1===d.indexOf(p),m&&(p=d[0],f+="Z")}for(p=0;pe;e++)s.push(1);for(e=0;o>e;e++)i.push(s.slice());for(e=0;ea;a++)for(n=i(l,a),c[a]=new Array(n),s=0;n>s;s++)c[a][s]=e(o(l,a,s));return c}function i(t,e,r,n,i,o){var a,s,l,u=[],c=f.traceIs(t,"contour"),h=f.traceIs(t,"histogram"),p=f.traceIs(t,"gl2d"),d=Array.isArray(e)&&e.length>1;if(d&&!h&&"category"!==o.type){e=e.map(o.d2c);var m=e.length;if(!(i>=m))return c?e.slice(0,i):e.slice(0,i+1);if(c||p)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;m>l;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[m-1]-.5*e[m-2])}if(i>m){var g=u[u.length-1],v=g-u[u.length-2];for(l=m;i>l;l++)g+=v,u.push(g)}}else for(s=n||1,a=h||"category"===o.type?r||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r),l=c||p?0:-.5;i>l;l++)u.push(a+s*l);return u}function o(t){return.5-.25*Math.min(1,.5*t)}function a(t,e,r){var n,i,a=1;if(Array.isArray(r))for(n=0;nn&&a>y;n++)a=l(t,e,o(a));return a>y&&c.log("interp2d didn't converge quickly",a),t}function s(t){var e,r,n,i,o,a,s,l,u=[],c={},h=[],f=t[0],p=[],d=[0,0,0],m=v(t);for(r=0;rn;n++)void 0===p[n]&&(a=(void 0!==p[n-1]?1:0)+(void 0!==p[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==f[n]?1:0),a?(0===r&&a++,0===n&&a++,r===t.length-1&&a++,n===p.length-1&&a++,4>a&&(c[[r,n]]=[r,n,a]),u.push([r,n,a])):h.push([r,n]));for(;h.length;){for(s={},l=!1,o=h.length-1;o>=0;o--)i=h[o],r=i[0],n=i[1],a=((c[[r-1,n]]||d)[2]+(c[[r+1,n]]||d)[2]+(c[[r,n-1]]||d)[2]+(c[[r,n+1]]||d)[2])/20,a&&(s[i]=[r,n,a],h.splice(o,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}function l(t,e,r){var n,i,o,a,s,l,u,c,h,f,p,d,m,g=0;for(a=0;as;s++)l=x[s],u=t[i+l[0]],u&&(c=u[o+l[1]],void 0!==c&&(0===f?d=m=c:(d=Math.min(d,c),m=Math.max(m,c)),h++,f+=c));if(0===h)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=f/h,void 0===p?4>h&&(g=1):(t[i][o]=(1+r)*t[i][o]-r*p,m>d&&(g=Math.max(g,Math.abs(t[i][o]-p)/(m-d))))}return g}var u=t("fast-isnumeric"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../../plots/plots"),p=t("../histogram2d/calc"),d=t("../../components/colorscale/calc"),m=t("./has_columns"),g=t("./convert_column_xyz"),v=t("./max_row_length");e.exports=function(t,e){function r(t){S=e._input.zsmooth=e.zsmooth=!1,c.notifier("cannot fast-zsmooth: "+t)}var o,l,u,y,x,b,_,w,M=h.getFromId(t,e.xaxis||"x"),A=h.getFromId(t,e.yaxis||"y"),k=f.traceIs(e,"contour"),T=f.traceIs(e,"histogram"),E=f.traceIs(e,"gl2d"),S=k?"best":e.zsmooth;if(M._minDtick=0,A._minDtick=0,T){var L=p(t,e);o=L.x,l=L.x0,u=L.dx,y=L.y,x=L.y0,b=L.dy,_=L.z}else m(e)&&g(e,M,A),o=e.x?M.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],l=e.x0||0,u=e.dx||1,x=e.y0||0,b=e.dy||1,_=n(e),(k||e.connectgaps)&&(e._emptypoints=s(_),e._interpz=a(_,e._emptypoints,e._interpz));if("fast"===S)if("log"===M.type||"log"===A.type)r("log axis found");else if(!T){if(o.length){var z=(o[o.length-1]-o[0])/(o.length-1),I=Math.abs(z/100);for(w=0;wI){r("x scale is not linear");break}}if(y.length&&"fast"===S){var P=(y[y.length-1]-y[0])/(y.length-1),C=Math.abs(P/100);for(w=0;wC){r("y scale is not linear");break}}}var R=v(_),D="scaled"===e.xtype?"":e.x,O=i(e,D,l,u,R,M),j="scaled"===e.ytype?"":e.y,F=i(e,j,x,b,_.length,A);E||(h.expand(M,O),h.expand(A,F));var N={x:O,y:F,z:_};if(d(e,_,"","z"),k&&e.contours&&"heatmap"===e.contours.coloring){var B="contour"===e.type?"heatmap":"histogram2d";N.xfill=i(B,D,l,u,R,M),N.yfill=i(B,j,x,b,_.length,A)}return[N]};var y=.01,x=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":505,"../../lib":583,"../../plots/cartesian/axes":607,"../../plots/plots":663,"../histogram2d/calc":734,"./convert_column_xyz":724,"./has_columns":726, -"./max_row_length":729,"fast-isnumeric":99}],723:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u="cb"+r.uid,c=s(r.colorscale),h=r.zmin,f=r.zmax;if(i(h)||(h=o.aggNums(Math.min,null,r.z)),i(f)||(f=o.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+u).remove(),!r.showscale)return void a.autoMargin(t,u);var p=e[0].t.cb=l(t,u);p.fillcolor(n.scale.linear().domain(c.map(function(t){return h+t[0]*(f-h)})).range(c.map(function(t){return t[1]}))).filllevels({start:h,end:f,size:(f-h)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":501,"../../components/colorscale/get_scale":510,"../../lib":583,"../../plots/plots":663,d3:90,"fast-isnumeric":99}],724:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,o=t.x.slice(),a=t.y.slice(),s=t.z,l=t.text,u=Math.min(o.length,a.length,s.length),c=void 0!==l&&!Array.isArray(l[0]);for(ui;i++)o[i]=e.d2c(o[i]),a[i]=r.d2c(a[i]);var h,f,p,d=n.distinctVals(o),m=d.vals,g=n.distinctVals(a),v=g.vals,y=n.init2dArray(v.length,m.length);for(c&&(p=n.init2dArray(v.length,m.length)),i=0;u>i;i++)h=n.findBin(o[i]+d.minDiff/2,m),f=n.findBin(a[i]+g.minDiff/2,v),y[f][h]=s[i],c&&(p[f][h]=l[i]);t.x=m,t.y=v,t.z=y,c&&(t.text=p)}},{"../../lib":583}],725:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),o=t("./xyz_defaults"),a=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=o(t,e,u);return c?(u("text"),u("zsmooth"),u("connectgaps",i(e)&&e.zsmooth!==!1),void a(t,e,l,u,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":721,"./has_columns":726,"./xyz_defaults":732}],726:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],727:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib"),o=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,r,a,s){if(!(t.distancec||c>=y[0].length||0>h||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>o||n.inbox(r-v[0],r-v[v.length-1])>o)return;if(s){var M;for(b=[2*g[0]-g[1]],M=1;M0;)_=g.c2p(z[k]),k--;for(b>_&&(w=_,_=b,b=w,O=!0),k=0;void 0===M&&k0;)A=v.c2p(I[k]),k--;if(M>A&&(w=M,M=A,A=w,j=!0),P&&(z=r[0].xfill,I=r[0].yfill),"fast"!==C){var F="best"===C?0:.5;b=Math.max(-F*g._length,b),_=Math.min((1+F)*g._length,_),M=Math.max(-F*v._length,M),A=Math.min((1+F)*v._length,A)}var N=Math.round(_-b),B=Math.round(A-M),U=0>=N||0>=B,V=e.plot.select(".imagelayer").selectAll("g.hm."+x).data(U?[]:[0]);if(V.enter().append("g").classed("hm",!0).classed(x,!0),V.exit().remove(),!U){var q,G;"fast"===C?(q=D,G=R):(q=N,G=B);var H=document.createElement("canvas");H.width=q,H.height=G;var X,Y,W=H.getContext("2d"),Z=i.scale.linear().domain(L.map(function(t){return t[0]})).range(L.map(function(t){var e=o(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===C?(X=O?function(t){return D-1-t}:a.identity,Y=j?function(t){return R-1-t}:a.identity):(X=function(t){return a.constrain(Math.round(g.c2p(z[t])-b),0,N)},Y=function(t){return a.constrain(Math.round(v.c2p(I[t])-M),0,B)});var Q,K,$,J,tt,et,rt=Y(0),nt=[rt,rt],it=O?0:1,ot=j?0:1,at=0,st=0,lt=0,ut=0;if(C){var ct=0,ht=new Uint8Array(N*B*4);if("best"===C){var ft,pt,dt,mt=new Array(z.length),gt=new Array(I.length),vt=new Array(N);for(k=0;kk;k++)vt[k]=n(k,mt);for(K=0;B>K;K++)for(ft=n(K,gt),pt=T[ft.bin0],dt=T[ft.bin1],k=0;N>k;k++,ct+=4)et=p(pt,dt,vt[k],ft),f(ht,ct,et)}else for(K=0;R>K;K++)for(tt=T[K],nt=Y(K),k=0;N>k;k++)et=h(tt[k],1),ct=4*(nt*N+X(k)),f(ht,ct,et);var yt=W.createImageData(N,B);yt.data.set(ht),W.putImageData(yt,0,0)}else for(K=0;R>K;K++)if(tt=T[K],nt.reverse(),nt[ot]=Y(K+1),nt[0]!==nt[1]&&void 0!==nt[0]&&void 0!==nt[1])for($=X(0),Q=[$,$],k=0;D>k;k++)Q.reverse(),Q[it]=X(k+1),Q[0]!==Q[1]&&void 0!==Q[0]&&void 0!==Q[1]&&(J=tt[k],et=h(J,(Q[1]-Q[0])*(nt[1]-nt[0])),W.fillStyle="rgba("+et.join(",")+")",W.fillRect(Q[0],nt[0],Q[1]-Q[0],nt[1]-nt[0]));st=Math.round(st/at),lt=Math.round(lt/at),ut=Math.round(ut/at);var xt=o("rgb("+st+","+lt+","+ut+")");t._hmpixcount=(t._hmpixcount||0)+at,t._hmlumcount=(t._hmlumcount||0)+at*xt.getLuminance();var bt=V.selectAll("image").data(r);bt.enter().append("svg:image").attr({xmlns:u.svg,preserveAspectRatio:"none"}),bt.attr({height:B,width:N,x:b,y:M,"xlink:href":H.toDataURL("image/png")}),bt.exit().remove()}}var i=t("d3"),o=t("tinycolor2"),a=t("../../lib"),s=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),u=t("../../constants/xmlns_namespaces"),c=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i0&&(n=!0);for(var s=0;sv&&d.splice(v,d.length-v),g.length>v&&g.splice(v,g.length-v),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(d,p,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(g,m,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),h=[];var y,x,b=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,M="string"==typeof e.xbins.size?[]:e.ybins,A=0,k=[],T=e.histnorm,E=e.histfunc,S=-1!==T.indexOf("density"),L="max"===E||"min"===E,z=L?null:0,I=o.count,P=a[T],C=!1,R=[],D=[],O="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";O&&"count"!==E&&(C="avg"===E,I=o[E]);var j=e.xbins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6;for(f=j.start;F>f;f=i.tickIncrement(f,j.size))b.push(z),Array.isArray(w)&&w.push(f),C&&_.push(0);Array.isArray(w)&&w.push(f);var N=b.length;for(r=e.xbins.start,l=(f-r)/N,r+=l/2,j=e.ybins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6,f=j.start;F>f;f=i.tickIncrement(f,j.size))h.push(b.concat()),Array.isArray(M)&&M.push(f),C&&k.push(_.concat());Array.isArray(M)&&M.push(f);var B=h.length;for(u=e.ybins.start,c=(f-u)/B,u+=c/2,S&&(R=b.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/l}),D=h.map(function(t,e){return Array.isArray(M)?1/(M[e+1]-M[e]):1/c})),f=0;v>f;f++)y=n.findBin(d[f],w),x=n.findBin(g[f],M),y>=0&&N>y&&x>=0&&B>x&&(A+=I(y,f,h[x],O,k[x]));if(C)for(x=0;B>x;x++)A+=s(h[x],k[x]);if(P)for(x=0;B>x;x++)P(h[x],A,R,D[x]);return{x:d,x0:r,dx:l,y:g,y0:u,dy:c,z:h}}},{"../../lib":583,"../../plots/cartesian/axes":607,"../histogram/average":742,"../histogram/bin_functions":744,"../histogram/norm_functions":748}],735:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),o=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r){function s(r,i){return n.coerce(t,e,a,r,i)}i(t,e,s),s("zsmooth"),o(t,e,r,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":733,"./sample_defaults":737}],736:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../heatmap/calc":722,"../heatmap/colorbar":723,"../heatmap/hover":727,"../heatmap/plot":730,"../heatmap/style":731,"./attributes":733,"./defaults":735}],737:[function(t,e,r){"use strict";var n=t("../histogram/bin_defaults");e.exports=function(t,e,r){var i=r("x"),o=r("y");if(!(i&&i.length&&o&&o.length))return void(e.visible=!1);var a=r("z")||r("marker.color");a&&r("histfunc");var s=["x","y"];n(t,e,r,s)}},{"../histogram/bin_defaults":743}],738:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),o=t("../../components/colorscale/attributes"),a=t("../../lib/extend").extendFlat;e.exports=a({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line,_nestedModules:{colorbar:"Colorbar"}},o)},{"../../components/colorscale/attributes":504,"../../lib/extend":578,"../contour/attributes":711,"../histogram2d/attributes":733}],739:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),o=t("../contour/style_defaults"),a=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}i(t,e,l);var u=n.coerce2(t,e,a,"contours.start"),c=n.coerce2(t,e,a,"contours.end"),h=l("autocontour",!(u&&c));l(h?"ncontours":"contours.size"),o(t,e,l,s)}},{"../../lib":583,"../contour/style_defaults":720,"../histogram2d/sample_defaults":737,"./attributes":738}],740:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot"),n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../contour/calc":712,"../contour/colorbar":713,"../contour/hover":715,"../contour/plot":718,"../contour/style":719,"./attributes":738,"./defaults":739}],741:[function(t,e,r){"use strict";function n(t){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var i=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:i.text,orientation:i.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:n("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:n("y"),marker:i.marker,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:i._deprecated.bardir}}},{"../bar/attributes":685}],742:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,i=0;r>i;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],743:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){var e=r(t+"bins.start"),n=r(t+"bins.end"),i=r("autobin"+t,!(e&&n));r(i?"nbins"+t:t+"bins.size")}),e}},{}],744:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var o=i[e];return n(o)?(o=Number(o),r[t]+=o,o):0},avg:function(t,e,r,i,o){var a=i[e];return n(a)&&(a=Number(a),r[t]+=a,o[t]++),0},min:function(t,e,r,i){var o=i[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]>o)return r[t]=o,o-r[t]}return 0},max:function(t,e,r,i){var o=i[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]r&&u.length<5e3;)m=o.tickIncrement(r,x.size),u.push((r+m)/2),c.push(L),b&&_.push(r),E&&w.push(1/(m-r)),P&&M.push(0),r=m;var C=c.length;for(r=0;r=0&&C>v&&(A+=z(v,r,c,y,M));P&&(A=l(c,M)),I&&I(c,A,w);var R=Math.min(u.length,c.length),D=[],O=0,j=R-1;for(r=0;R>r;r++)if(c[r]){O=r;break}for(r=R-1;r>O;r--)if(c[r]){j=r;break}for(r=O;j>=r;r++)n(u[r])&&n(c[r])&&D.push({p:u[r],s:c[r],b:0});return D}}},{"../../lib":583,"../../plots/cartesian/axes":607,"./average":742,"./bin_functions":744,"./norm_functions":748,"fast-isnumeric":99}],746:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),o=t("./bin_defaults"),a=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=c("x"),f=c("y");c("text");var p=c("orientation",f&&!h?"h":"v"),d=e["v"===p?"x":"y"];if(!d||!d.length)return void(e.visible=!1);var m=e["h"===p?"x":"y"];m&&c("histfunc");var g="h"===p?["y"]:["x"];o(t,e,c,g),a(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":498,"../../components/errorbars/defaults":526,"../../lib":583,"../bar/style_defaults":695,"./attributes":741,"./bin_defaults":743}],747:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../bar/hover":688,"../bar/layout_attributes":690,"../bar/layout_defaults":691,"../bar/plot":692,"../bar/set_positions":693,"../bar/style":694,"../scatter/colorbar":774,"./attributes":741,"./calc":745,"./defaults":746}],748:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;r>i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var o=0;i>o;o++)t[o]*=r[o]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var o=0;i>o;o++)t[o]*=r[o]/e}}},{}],749:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},i.contours.x.show,{}),color:o({},i.contours.x.color),width:o({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lightposition:{x:o({},i.lightposition.x,{dflt:1e5}),y:o({},i.lightposition.y,{dflt:1e5}),z:o({},i.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":504,"../../lib/extend":578,"../surface/attributes":817}],750:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function o(t){return t.map(p)}function a(t,e,r){for(var n=new Array(t.length),i=0;i0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var d={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:p(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",d.vertexIntensity=t.intensity,d.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],d.vertexColors=o(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],d.cellColors=o(t.facecolor)):(this.color=t.color,d.meshColor=p(t.color)),this.mesh.update(d)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":595,"alpha-shape":27,"convex-hull":79,"delaunay-triangulate":91,"gl-mesh3d":167,tinycolor2:461}],751:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,a){function s(r,i){return n.coerce(t,e,o,r,i)}function l(t){var e=t.map(function(t){var e=s(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=l(["x","y","z"]),c=l(["i","j","k"]);return u?(c&&c.forEach(function(t){for(var e=0;el||(u=d[r],void 0!==u&&""!==u||(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=o(e.marker.colors[r]),c.isValid()?(c=a.addOpacity(c,c.getAlpha()),v[u]||(v[u]=c)):v[u]?c=v[u]:(c=!1,x=!0),h=-1!==_.indexOf(u),h||(b+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),x)for(r=0;r")}return m};var l},{"../../components/color":498,"./helpers":757,"fast-isnumeric":99,tinycolor2:461}],756:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,o){function a(r,o){return n.coerce(t,e,i,r,o)}var s=n.coerceFont,l=a("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=a("labels");Array.isArray(u)||(a("label0"),a("dlabel"));var c=a("marker.line.width");c&&a("marker.line.color");var h=a("marker.colors");Array.isArray(h)||(e.marker.colors=[]),a("scalegroup");var f=a("text"),p=a("textinfo",Array.isArray(f)?"text+percent":"percent");if(a("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),p&&"none"!==p){var d=a("textposition"),m=Array.isArray(d)||"auto"===d,g=m||"inside"===d,v=m||"outside"===d;if(g||v){var y=s(a,"textfont",o.font);g&&s(a,"insidetextfont",y),v&&s(a,"outsidetextfont",y)}}a("domain.x"),a("domain.y"),a("hole"),a("sort"),a("direction"),a("rotation"),a("pull")}},{"../../lib":583,"./attributes":753}],757:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":583}],758:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":753,"./base_plot":754,"./calc":755,"./defaults":756,"./layout_attributes":759,"./layout_defaults":760,"./plot":761,"./style":762,"./style_one":763}],759:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],760:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,o){return n.coerce(t,e,i,r,o)}r("hiddenlabels")}},{"../../lib":583,"./layout_attributes":759}],761:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,a=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=o+1/(2*Math.tan(a)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(o*o+s/2)+o)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/o,d=p+1/(2*Math.tan(a)),m=r.r*Math.min(1/(Math.sqrt(d*d+.5)+d),s/(Math.sqrt(p*p+s/2)+p)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function o(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,o=t.height/2;return 0>r&&(i*=-1),0>n&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(o)*(i>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function a(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,o,s,f,p,m=r.labelExtraY+(a?r.yLabelMax:r.yLabelMin),g=a?t.yLabelMin:t.yLabelMax,v=a?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),x=m-g;if(x*h>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(i=0;i=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*h>0?(s=o.cyFinal+u(o.px0[1],o.px1[1]),x=s-g-t.labelExtraY,x*h>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-d.indexOf(t)), -f=o.cxFinal+l(o.px0[0],o.px1[0]),p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,p*c>0&&(t.labelExtraX+=p)))}var o,a,s,l,u,c,h,f,p,d,m,g,v;for(a=0;2>a;a++)for(s=a?r:n,u=a?Math.max:Math.min,h=a?1:-1,o=0;2>o;o++){for(l=o?Math.max:Math.min,c=o?1:-1,f=t[a][o],f.sort(s),p=t[1-a][o],d=p.concat(f),g=[],m=0;mc&&(c=s.pull[o]);a.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),a.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,a.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===p.indexOf(s.scalegroup)&&p.push(s.scalegroup)}for(o=0;oh.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../plots/cartesian/graph_interact"),f=t("../../components/color"),p=t("../../components/drawing"),d=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=0,y=(g.depth||0)*u.r*Math.sin(v)/2,x=g.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=u.r*Math.cos(v),M=s.selectAll("g.part").data(g.tilt?["top","sides"]:["top"]);M.enter().append("g").attr("class",function(t){return t+" part"}),M.exit().remove(),M.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(a){function s(e){var n=t._fullLayout,o=t._fullData[g.index],s=o.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&s){var l=i(a,u),c=M+a.pxmid[0]*(1-l),f=A+a.pxmid[1]*(1-l),p=r.separators,d=[];-1!==s.indexOf("label")&&d.push(a.label),o.text&&o.text[a.i]&&-1!==s.indexOf("text")&&d.push(o.text[a.i]),-1!==s.indexOf("value")&&d.push(m.formatPieValue(a.v,p)),-1!==s.indexOf("percent")&&d.push(m.formatPiePercent(a.v/u.vTotal,p)),h.loneHover({x0:c-l*u.r,x1:c+l*u.r,y:f,text:d.join("
"),name:-1!==s.indexOf("name")?o.name:void 0,color:a.color,idealAlign:a.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),h.hover(t,e,"pie"),E=!0}}function f(e){t.emit("plotly_unhover",{points:[e]}),E&&(h.loneUnhover(r._hoverlayer.node()),E=!1)}function y(){t._hoverdata=[a],a.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,h.click(t,{target:!0})}function b(t,e,r,n){return"a"+n*u.r+","+n*w+" "+x+" "+a.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(a.hidden)return void c.select(this).selectAll("path,g").remove();l[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var M=u.cx+_[0],A=u.cy+_[1],k=c.select(this),T=k.selectAll("path.surface").data([a]),E=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",s).on("mouseout",f).on("click",y).on("contextmenu",y),g.pull){var S=+(Array.isArray(g.pull)?g.pull[a.i]:g.pull)||0;S>0&&(M+=S*a.pxmid[0],A+=S*a.pxmid[1])}a.cxFinal=M,a.cyFinal=A;var L=g.hole;if(a.v===u.vTotal){var z="M"+(M+a.px0[0])+","+(A+a.px0[1])+b(a.px0,a.pxmid,!0,1)+b(a.pxmid,a.px0,!0,1)+"Z";L?T.attr("d","M"+(M+L*a.px0[0])+","+(A+L*a.px0[1])+b(a.px0,a.pxmid,!1,L)+b(a.pxmid,a.px0,!1,L)+"Z"+z):T.attr("d",z)}else{var I=b(a.px0,a.px1,!0,1);if(L){var P=1-L;T.attr("d","M"+(M+L*a.px1[0])+","+(A+L*a.px1[1])+b(a.px1,a.px0,!1,L)+"l"+P*a.px0[0]+","+P*a.px0[1]+I+"Z")}else T.attr("d","M"+M+","+A+"l"+a.px0[0]+","+a.px0[1]+I+"Z")}var C=Array.isArray(g.textposition)?g.textposition[a.i]:g.textposition,R=k.selectAll("g.slicetext").data(a.text&&"none"!==C?[0]:[]);R.enter().append("g").classed("slicetext",!0),R.exit().remove(),R.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(a.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(p.font,"outside"===C?g.outsidetextfont:g.insidetextfont).call(d.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=p.bBox(t.node());"outside"===C?e=o(r,a):(e=n(r,a,u),"auto"===C&&e.scale<1&&(t.call(p.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(t.attr({"data-bb":""}),r=p.bBox(t.node())),e=o(r,a)));var i=M+a.pxmid[0]*e.rCenter+(e.x||0),s=A+a.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(a.yLabelMin=s-r.height/2,a.yLabelMid=s,a.yLabelMax=s+r.height/2,a.labelExtraX=0,a.labelExtraY=0,v=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),v&&a(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],o="M"+n+","+i,a=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+a):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+a}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+a;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":498,"../../components/drawing":521,"../../lib/svg_text_utils":596,"../../plots/cartesian/graph_interact":614,"./helpers":757,d3:90}],762:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":763,d3:90}],763:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(n.stroke,i)}},{"../../components/color":498}],764:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),o=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=i.line,u=i.marker,c=u.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:s({},i.text,{}),mode:s({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:s({},{width:l.width,dash:l.dash,showscale:{valType:"boolean",dflt:!1}},o("line")),marker:s({},{symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:s({},u.size,{dflt:8}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:s({},u.opacity,{arrayOk:!1}),showscale:u.showscale,line:s({},{width:s({},c.width,{arrayOk:!1})},o("marker.line"))},o("marker")),textposition:s({},i.textposition,{dflt:"top center"}),textfont:i.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../constants/gl_markers":569,"../../lib/extend":578,"../scatter/attributes":771}],765:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r),i(e),r}},{"../scatter/arrays_to_calcdata":770,"../scatter/colorscale_calc":775}],766:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=a(e),i=new Array(t.length),o=0;os;s++){for(var l=[[0,0,0],[0,0,0]],u=0;3>u;u++)if(r[u])for(var c=0;2>c;c++)l[c][u]=r[u][s][c];a[s]=l}return a}var a=t("../../components/errorbars/compute_error");e.exports=o},{"../../components/errorbars/compute_error":525}],767:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,o=(r+2)%3,a=[],s=[];for(n=0;ni;i++){var o=t[i];o&&o.copy_zstyle!==!1&&(o=t[2]),o&&(e[i]=o.width/2,r[i]=x(o.color),n=o.thickness)}return{capSize:e,color:r,lineWidth:n}}function a(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var o=null;if(Array.isArray(t)){o=[];for(var a=0;e>a;a++)void 0===t[a]?o[a]=n:o[a]=r(t[a],i)}else o=r(t,y.identity);return o}function c(t,e){var r,n,i,c,h,f,p=[],d=t.fullSceneLayout,m=t.dataScale,g=d.xaxis,v=d.yaxis,w=d.zaxis,M=e.marker,k=e.line,T=e.x||[],E=e.y||[],S=e.z||[],L=T.length;for(n=0;L>n;n++)i=g.d2l(T[n])*m[0],c=v.d2l(E[n])*m[1],h=w.d2l(S[n])*m[2],p[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;L>n;n++)f[n]=e.text;if(r={position:p,mode:e.mode,text:f},"line"in e&&(r.lineColor=b(k,1,L),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var z=_(e);r.scatterColor=b(M,1,L),r.scatterSize=u(M.size,L,s,20,z),r.scatterMarker=u(M.symbol,L,l,"\u25cf"),r.scatterLineWidth=M.line.width,r.scatterLineColor=b(M.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=a(e.textposition),r.textColor=b(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var I=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[I[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=A(e,m);var C=o([e.error_x,e.error_y,e.error_z]);return r.errorColor=C.color,r.errorLineWidth=C.lineWidth,r.errorCapSize=C.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=x(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var p=t("gl-line3d"),d=t("gl-scatter3d"),m=t("gl-error3d"),g=t("gl-mesh3d"),v=t("delaunay-triangulate"),y=t("../../lib"),x=t("../../lib/str2rgbarray"),b=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),M=t("../../constants/gl_markers"),A=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,o,a=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:a,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=p(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:a,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=d(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),o={gl:a,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(o):(this.textMarkers=d(o),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=a,this.delaunayMesh=g(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":568,"../../constants/gl_markers":569,"../../lib":583,"../../lib/gl_format_color":581,"../../lib/str2rgbarray":595,"../scatter/make_bubble_size_func":785,"./calc_errors":766,"delaunay-triangulate":91,"gl-error3d":127,"gl-line3d":134,"gl-mesh3d":167,"gl-scatter3d":187}],768:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),o=r("y"),a=r("z");return i&&o&&a&&(n=Math.min(i.length,o.length,a.length),n=0&&f("surfacecolor",d||m);for(var g=["x","y","z"],v=0;3>v;++v){var y="projection."+g[v];f(y+".show")&&(f(y+".opacity"),f(y+".scale"))}u(t,e,r,{axis:"z"}),u(t,e,r,{axis:"y",inherit:"z"}),u(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":526,"../../lib":583,"../scatter/line_defaults":782,"../scatter/marker_defaults":786,"../scatter/subtypes":790,"../scatter/text_defaults":791,"./attributes":764}],769:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":569,"../../plots/gl3d":643,"../scatter/colorbar":774,"./attributes":764,"./calc":765,"./convert":767,"./defaults":768}],770:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var i=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw")}}},{"../../lib":583}],771:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/drawing"),o=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:o({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:o({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../components/drawing":521,"../../lib/extend":578,"./constants":776}],772:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./subtypes"),s=t("./colorscale_calc");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||"x"),h=i.getFromId(t,e.yaxis||"y"),f=c.makeCalcdata(e,"x"),p=h.makeCalcdata(e,"y"),d=Math.min(f.length,p.length);c._minDtick=0,h._minDtick=0,f.length>d&&f.splice(d,f.length-d),p.length>d&&p.splice(d,p.length-d);var m={padded:!0},g={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var v={type:"linear"};i.setConvert(v),l=v.makeCalcdata(e.marker,"size"),l.length>d&&l.splice(d,l.length-d)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},m.ppad=g.ppad=Array.isArray(l)?l.map(y):y(l)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||f[0]===f[d-1]&&p[0]===p[d-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(a.hasMarkers(e)||a.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||f[0]===f[d-1]&&p[0]===p[d-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,i.expand(c,f,m),i.expand(h,p,g);var b=new Array(d);for(u=0;d>u;u++)b[u]=n(f[u])&&n(p[u])?{x:f[u],y:p[u]}:{x:!1,y:!1};return void 0!==typeof l&&o.mergeArray(l,b,"ms"),t.firstscatter=!1,b}},{"../../lib":583,"../../plots/cartesian/axes":607,"./colorscale_calc":775,"./subtypes":790,"fast-isnumeric":99}],773:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i,o;for(e=0;e=0;i--)if(o=t[i],"scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}},{}],774:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===u||!u.showscale)return void a.autoMargin(t,c);var h=s(u.colorscale),f=u.color,p=u.cmin,d=u.cmax;i(p)||(p=o.aggNums(Math.min,null,f)),i(d)||(d=o.aggNums(Math.max,null,f));var m=e[0].t.cb=l(t,c);m.fillcolor(n.scale.linear().domain(h.map(function(t){return p+t[0]*(d-p)})).range(h.map(function(t){return t[1]}))).filllevels({start:p,end:d,size:(d-p)/254}).options(u.colorbar)()}},{"../../components/colorbar/draw":501,"../../components/colorscale/get_scale":510,"../../lib":583,"../../plots/plots":663,d3:90,"fast-isnumeric":99}],775:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":505,"../../components/colorscale/has_colorscale":511,"./subtypes":790}],776:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],777:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),o=t("./constants"),a=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,d){function m(r,o){return n.coerce(t,e,i,r,o)}var g=s(t,e,m),v=gU!=C>=U&&(z=S[T-1][0],I=S[T][0],L=z+(I-z)*(U-P)/(C-P),j=Math.min(j,L),F=Math.max(F,L));j=Math.max(j,0),F=Math.min(F,f._length);var V=l.defaultLine;return l.opacity(h.fillcolor)?V=h.fillcolor:l.opacity((h.line||{}).color)&&(V=h.line.color),n.extendFlat(t,{distance:o.MAXDIST+10,x0:j,x1:F,y0:U,y1:U,color:V}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":498,"../../components/errorbars":527,"../../lib":583,"../../plots/cartesian/constants":612,"../../plots/cartesian/graph_interact":614,"./get_trace_color":779}],781:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"./arrays_to_calcdata":770,"./attributes":771,"./calc":772,"./clean_data":773,"./colorbar":774,"./defaults":777,"./hover":780,"./plot":787,"./select":788,"./style":789,"./subtypes":790}],782:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,a){var s=(t.marker||{}).color;if(a("line.color",r),n(t,"line"))i(t,e,o,a,{prefix:"line.",cLetter:"c"});else{var l=(Array.isArray(s)?!1:s)||r;a("line.color",l)}a("line.width"),a("line.dash")}},{"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511}],783:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),n=M.c2p(t[e].y);return r===S||n===S?!1:[r,n]}function i(t){var e=t[0]/w._length,r=t[1]/M._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*k}function o(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var a,s,l,u,c,h,f,p,d,m,g,v,y,x,b,_,w=e.xaxis,M=e.yaxis,A=e.connectGaps,k=e.baseTolerance,T=e.linear,E=[],S=n.BADNUM,L=.2,z=new Array(t.length),I=0;for(a=0;ai(h))break;l=h,y=m[0]*d[0]+m[1]*d[1],y>g?(g=y,u=h,p=!1):v>y&&(v=y,c=h,p=!0)}if(p?(z[I++]=u,l!==c&&(z[I++]=c)):(c!==s&&(z[I++]=c),l!==u&&(z[I++]=u)),z[I++]=l,a>=t.length||!h)break;z[I++]=h,s=h}}else z[I++]=u}E.push(z.slice(0,I))}return E}},{"../../plots/cartesian/axes":607}],784:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],785:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":99}],786:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),a=t("./subtypes");e.exports=function(t,e,r,s,l){var u,c=a.isBubble(t),h=(t.line||{}).color;h&&(r=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&o(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&o(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":498,"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511,"./subtypes":790}],787:[function(t,e,r){"use strict";function n(t,e,r){var n=e.x(),o=e.y(),a=i.extent(n.range.map(n.l2c)),s=i.extent(o.range.map(o.l2c)); -r.forEach(function(t,e){var n=t[0].trace;if(u.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var o=t.filter(function(t){return t.x>=a[0]&&t.x<=a[1]&&t.y>=s[0]&&t.y<=s[1]}),l=Math.ceil(o.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var h=Math.round(c*l/3+Math.floor(c/3)*l/7.1);t.forEach(function(t){delete t.vis}),o.forEach(function(t,e){0===Math.round((e+h)%l)&&(t.vis=!0)})}}})}var i=t("d3"),o=t("../../lib"),a=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("../../lib/polygon").tester,u=t("./subtypes"),c=t("./arrays_to_calcdata"),h=t("./line_points");e.exports=function(t,e,r){function f(t){return t.filter(function(t){return t.vis})}n(t,e,r);var p=e.x(),d=e.y(),m=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);m.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),m.call(s.plot,e);var g,v,y,x,b="",_=[];m.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=n,c(t),u.hasLines(e)||"none"!==e.fill)){var o,s,f,m,w,M="",A="";g="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?n.append("path").classed("js-fill",!0):null,x&&(y=x.datum(t)),x=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(f=a.steps(r.shape),m=a.steps(r.shape.split("").reverse().join(""))):f=m="spline"===r.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?a.smoothclosed(t.slice(1),r.smoothing):a.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},w=function(t){return m(t.reverse())};var k,T=h(t,{xaxis:p,yaxis:d,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape}),E=e._polygons=new Array(T.length);for(k=0;k1&&n.append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").attr("d",o)}g?S&&z&&(v?("y"===v?S[1]=z[1]=d.c2p(0,!0):"x"===v&&(S[0]=z[0]=p.c2p(0,!0)),g.attr("d",M+"L"+z+"L"+S+"Z")):g.attr("d",M+"Z")):"tonext"===e.fill.substr(0,6)&&M&&b&&("tonext"===e.fill?y.attr("d",M+"Z"+b+"Z"):y.attr("d",M+"L"+b.substr(1)+"Z"),e._polygons=e._polygons.concat(_)),b=A,_=E}}}),m.selectAll("path:not([d])").remove(),m.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),n=u.hasMarkers(e),s=u.hasText(e);!n&&!s||e.visible!==!0?r.remove():(n&&r.selectAll("path.point").data(e.marker.maxdisplayed?f:o.identity).enter().append("path").classed("point",!0).call(a.translatePoints,p,d),s&&r.selectAll("g").data(e.marker.maxdisplayed?f:o.identity).enter().append("g").append("text").call(a.translatePoints,p,d))})}},{"../../components/drawing":521,"../../components/errorbars":527,"../../lib":583,"../../lib/polygon":589,"./arrays_to_calcdata":770,"./line_points":783,"./subtypes":790,d3:90}],788:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,o,a,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,p=f.index,d=f.marker,m=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!m){var g=Array.isArray(d.opacity)?1:d.opacity;if(e===!1)for(r=0;rn;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function o(t,e){function r(e){var r=t.mockAxis;return u.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?g.hoverinfo.flags:n.split("+"),o=-1!==i.indexOf("location")&&Array.isArray(e.locations),a=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=-1!==i.indexOf("text");return function(t){var n=[];o?n.push(t.location):a&&s?n.push("("+r(t.lon)+", "+r(t.lat)+")"):a?n.push("lon: "+r(t.lon)):s&&n.push("lat: "+r(t.lat)),l&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}function a(t){var e=Array.isArray(t.locations);return function(r,n){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:n,lon:r.lon,lat:r.lat,location:e?r.location:null}]}}}var s=t("d3"),l=t("../../plots/cartesian/graph_interact"),u=t("../../plots/cartesian/axes"),c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/array_to_calc_item"),p=t("../../components/color"),d=t("../../components/drawing"),m=t("../scatter/subtypes"),g=t("./attributes"),v=e.exports={};v.calcGeoJSON=function(t,e){var r,i,o,a,s=[],l=Array.isArray(t.locations);l?(a=t.locations,r=a.length,i=c(t,e),o=function(t,e){var r=h(t.locationmode,a[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,o=function(t,e){return[t.lon[e],t.lat[e]]});for(var u=0;r>u;u++){var f=o(t,u);if(f){var p={lon:f[0],lat:f[1],location:l?t.locations[u]:null};n(t,p,u),s.push(p)}}return s.length>0&&(s[0].trace=t),s},v.plot=function(t,e){var r=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,function(t){return t.uid});r.enter().append("g").attr("class","trace scattergeo"),r.exit().remove(),r.selectAll("*").remove(),r.each(function(t){var e=s.select(this);m.hasLines(t)&&e.selectAll("path.js-line").data([i(t)]).enter().append("path").classed("js-line",!0)}),r.each(function(e){function r(r,n){if(t.showHover){var i=t.projection([r.lon,r.lat]);f(r),l.loneHover({x:i[0],y:i[1],name:g?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()}),y=p(r,n),t.graphDiv.emit("plotly_hover",y)}}function n(e,r){t.graphDiv.emit("plotly_click",p(e,r))}var i=s.select(this),u=m.hasMarkers(e),c=m.hasText(e);if(u||c){var h=v.calcGeoJSON(e,t.topojson),f=o(t,e),p=a(e),d=e.hoverinfo,g="all"===d||-1!==d.indexOf("name"),y=null;u&&i.selectAll("path.point").data(h).enter().append("path").classed("point",!0).on("mouseover",r).on("click",n).on("mouseout",function(){l.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",y)}).on("mousedown",function(){l.loneUnhover(t.hoverContainer)}).on("mouseup",r),c&&i.selectAll("g").data(h).enter().append("g").append("text")}}),v.style(t)},v.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.each(function(t){s.select(this).selectAll("path.point").call(d.pointStyle,t),s.select(this).selectAll("text").call(d.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(p.stroke,r.color).call(d.dashLine,r.dash||"",r.width||0)})}},{"../../components/color":498,"../../components/drawing":521,"../../lib/array_to_calc_item":574,"../../lib/geo_location_utils":580,"../../lib/topojson_utils":597,"../../plots/cartesian/axes":607,"../../plots/cartesian/graph_interact":614,"../scatter/subtypes":790,"./attributes":793,d3:90}],798:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),o=t("../../constants/gl2d_dashes"),a=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(o),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,line:l({},i("marker.line"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../constants/gl2d_dashes":567,"../../constants/gl_markers":569,"../../lib/extend":578,"../scatter/attributes":771}],799:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="scattergl",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=p(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=d(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=d(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=h(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=f(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),o(t,e,r)}function o(t,e,r){for(var n=new Array(r),i=e[0],o=0;r>o;++o)n[o]=t(o>=e.length?i:e[o]);return n}function a(t,e,r){return l(L(t,r),S(e,r),r)}function s(t,e,r,n){var i=b(t,e,n);return i=Array.isArray(i[0])?i:o(g.identity,[i],n),l(i,S(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var o=0;3>o;++o)n[4*i+o]=t[i][o];n[4*i+3]=t[i][3]*e[i]}return n}function u(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("gl-scatter2d"),f=t("gl-scatter2d-fancy"),p=t("gl-line2d"),d=t("gl-error2d"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../plots/cartesian/axes"),y=t("../../components/errorbars"),x=t("../../lib/str2rgbarray"),b=t("../../lib/gl_format_color"),_=t("../scatter/subtypes"),w=t("../scatter/make_bubble_size_func"),M=t("../scatter/get_trace_color"),A=t("../../constants/gl_markers"),k=t("../../constants/gl2d_dashes"),T=["xaxis","yaxis"],E=n.prototype;E.handlePick=function(t){var e=t.pointId;return(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]),{trace:this,dataCoord:t.dataCoord,traceCoord:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},E.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return this.hasLines&&!this.connectgaps?!0:this.hasErrorX?!0:!!this.hasErrorY};var S=i.bind(null,function(t){return+t}),L=i.bind(null,x),z=i.bind(null,function(t){return A[t]||"\u25cf"});E.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=_.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=_.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=M(t,{})},E.updateFast=function(t){for(var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,o=n.length,a=new Array(o),s=new Float32Array(2*o),l=this.bounds,c=0,h=0,f=0;o>f;++f)e=n[f],r=i[f],m(e)&&m(r)&&(a[c++]=f,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=u(s,h),this.idToIndex=a,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var p;if(this.hasMarkers){this.scatterOptions.positions=s;var d=x(t.marker.color),g=x(t.marker.line.color),v=t.opacity*t.marker.opacity;d[3]*=v,this.scatterOptions.color=d,g[3]*=v,this.scatterOptions.borderColor=g,p=t.marker.size,this.scatterOptions.size=p,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,p)},E.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,o=this.bounds,a=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=a.slice(),this.yData=l.slice();var c,h,f,p,d,m,g,v,x=y.calcFromTrace(t,e.fullLayout),b=a.length,_=new Array(b),M=new Float32Array(2*b),A=new Float32Array(4*b),k=new Float32Array(4*b),T=0,E=0,L=0,I=0,P="log"===r.type?function(t){return r.d2l(t)}:function(t){return t},C="log"===n.type?function(t){return n.d2l(t)}:function(t){return t};for(c=0;b>c;++c)this.xData[c]=f=P(a[c]),this.yData[c]=p=C(l[c]),isNaN(f)||isNaN(p)||(_[T++]=c,M[E++]=f,M[E++]=p,d=A[L++]=f-x[c].xs||0,m=A[L++]=x[c].xh-f||0,A[L++]=0,A[L++]=0,k[I++]=0,k[I++]=0,g=k[I++]=p-x[c].ys||0,v=k[I++]=x[c].yh-p||0,o[0]=Math.min(o[0],f-d),o[1]=Math.min(o[1],p-g),o[2]=Math.max(o[2],f+m),o[3]=Math.max(o[3],p+v));M=u(M,E),this.idToIndex=_,this.updateLines(t,M),this.updateError("X",t,M,A),this.updateError("Y",t,M,k);var R;if(this.hasMarkers){this.scatterOptions.positions=M,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var D,O=w(t),j=t.marker,F=j.opacity,N=t.opacity,B=s(j,F,N,b),U=z(j.symbol,b),V=S(j.line.width,b),q=s(j.line,F,N,b);for(R=i(O,j.size,b),c=0;T>c;++c)for(D=_[c],this.scatterOptions.sizes[c]=4*R[D],this.scatterOptions.glyphs[c]=U[D],this.scatterOptions.borderWidths[c]=.5*V[D],h=0;4>h;++h)this.scatterOptions.colors[4*c+h]=B[4*D+h],this.scatterOptions.borderColors[4*c+h]=q[4*D+h];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(a,l,R)},E.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,o=this.xData,s=this.yData;for(n=new Float32Array(2*o.length),r=0;ra;a++)r=this.scene[T[a]],n=r._min,n||(n=[]),n.push({val:t[a],pad:o}),i=r._max,i||(i=[]),i.push({val:t[a+2],pad:o})},E.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};v.expand(n.xaxis,t,i),v.expand(n.yaxis,e,i)},E.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../components/errorbars":527,"../../constants/gl2d_dashes":567,"../../constants/gl_markers":569,"../../lib":583,"../../lib/gl_format_color":581,"../../lib/str2rgbarray":595,"../../plots/cartesian/axes":607,"../scatter/get_trace_color":779,"../scatter/make_bubble_size_func":785,"../scatter/subtypes":790,"fast-isnumeric":99,"gl-error2d":125,"gl-line2d":132,"gl-scatter2d":184,"gl-scatter2d-fancy":179}],800:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),o=t("../scatter/subtypes"),a=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,h,r,i)}var d=a(t,e,p);return d?(p("text"),p("mode",db;b++){var _=e.lon[b],w=e.lat[b];if(n(_)&&n(w)){var M={};if(x++,M.lonlat=[+_,+w],h){if(f){var A=c.color[b];M.mc=A,M.mcc=g(A)}if(p){var k=c.size[b];M.ms=k,M.mrc=v(k)}if(d){var T=c.symbol[b];M.mx="string"==typeof T?T:"circle"}}if(m){var E=e.text[b];M.tx="string"==typeof E?E:""}y.push(M)}else x>0&&(y[x-1].gapAfter=!0)}return y}},{"../../components/colorscale/has_colorscale":511,"../../components/colorscale/make_scale_function":515,"../../lib":583,"../scatter/colorscale_calc":775,"../scatter/make_bubble_size_func":785,"../scatter/subtypes":790,"fast-isnumeric":99}],804:[function(t,e,r){"use strict";function n(){return{geojson:i(),layout:{visibility:"none"},paint:{}}}function i(){return{type:"Point",coordinates:[]}}function o(t,e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var r=new Array(e.length),n=0;n0&&(n.push(i),i=[])}return n.push(i),n}function f(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:p}function p(){return""}var d=t("../../lib"),m=t("../scatter/subtypes"),g=t("../../plots/mapbox/convert_text_opts"),v="circle-color",y="circle-radius";e.exports=function(t){var e=t[0].trace,r=e.visible===!0,i="none"!==e.fill,f=m.hasLines(e),p=m.hasMarkers(e),x=m.hasText(e),b=p&&"circle"===e.marker.symbol,_=p&&"circle"!==e.marker.symbol,w=n(),M=n(),A=n(),k=n(),T={fill:w,line:M,circle:A,symbol:k};if(!r)return T;var E;if((i||f)&&(E=h(t)),i&&(w.geojson=o(t,E),w.layout.visibility="visible",d.extendFlat(w.paint,{"fill-color":e.fillcolor})),f&&(M.geojson=a(t,E),M.layout.visibility="visible",d.extendFlat(M.paint,{"line-width":e.line.width,"line-color":e.line.color,"line-opacity":e.opacity})),b){var S={};S[v]={},S[y]={},A.geojson=s(t,S),A.layout.visibility="visible",d.extendFlat(A.paint,{"circle-opacity":e.opacity*e.marker.opacity,"circle-color":u(e,S),"circle-radius":c(e,S)})}if((_||x)&&(k.geojson=l(t),d.extendFlat(k.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),_&&(d.extendFlat(k.layout,{"icon-size":e.marker.size/10}),d.extendFlat(k.paint,{"icon-opacity":e.opacity*e.marker.opacity,"icon-color":e.marker.color})),x)){var L=(e.marker||{}).size,z=g(e.textposition,L);d.extendFlat(k.layout,{"text-size":e.textfont.size,"text-anchor":z.anchor,"text-offset":z.offset}),d.extendFlat(k.paint,{"text-color":e.textfont.color,"text-opacity":e.opacity})}return T}},{"../../lib":583,"../../plots/mapbox/convert_text_opts":657,"../scatter/subtypes":790}],805:[function(t,e,r){"use strict";function n(t,e,r){var n=r("lon")||[],i=r("lat")||[],o=Math.min(n.length,i.length);return o")}var i=t("../../plots/cartesian/graph_interact"),o=t("../scatter/get_trace_color");e.exports=function(t,e,r){function a(t){var e=t.lonlat,n=Math.abs(u.c2p(e)-u.c2p([p,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],r])),o=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-o,1-3/o)}var s=t.cd,l=s[0].trace,u=t.xa,c=t.ya,h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),f=360*h,p=e-f;if(i.getClosest(s,a,t),t.index!==!1){var d=s[t.index],m=d.lonlat,g=[m[0]+f,m[1]],v=u.c2p(g),y=c.c2p(g),x=d.mrc||1;return t.x0=v-x,t.x1=v+x,t.y0=y-x,t.y1=y+x,t.color=o(l,d),t.extraText=n(l,d),[t]}}},{"../../plots/cartesian/graph_interact":614,"../scatter/get_trace_color":779}],807:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.hoverPoints=t("./hover"),n.plot=t("./plot"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/mapbox":658,"../scatter/colorbar":774,"./attributes":802,"./calc":803,"./defaults":805,"./hover":806,"./plot":808}],808:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle, -source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var o=t("./convert"),a=n.prototype;a.update=function(t){var e=this.mapbox,r=o(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint))},a.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":804}],809:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),o=t("../../components/colorscale/color_attributes"),a=t("../../lib/extend").extendFlat,s=n.marker,l=n.line,u=s.line;e.exports={a:{valType:"data_array"},b:{valType:"data_array"},c:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:l.color,width:l.width,dash:l.dash,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing},connectgaps:n.connectgaps,fill:a({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:a({},{symbol:s.symbol,opacity:s.opacity,maxdisplayed:s.maxdisplayed,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,showscale:s.showscale,line:a({},{width:u.width},o("marker".line))},o("marker")),textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron,_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../lib/extend":578,"../../plots/attributes":605,"../scatter/attributes":771}],810:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("../scatter/subtypes"),s=t("../scatter/colorscale_calc"),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,f,p,d,m=t._fullLayout[e.subplot],g=m.sum,v=e.sum||g;for(r=0;rr;r++)y=e.a[r],x=e.b[r],b=e.c[r],n(y)&&n(x)&&n(b)?(y=+y,x=+x,b=+b,_=g/(y+x+b),1!==_&&(y*=_,x*=_,b*=_),M=y,w=b-x,k[r]={x:w,y:M,a:y,b:x,c:b}):k[r]={x:!1,y:!1};var T,E;if(a.hasMarkers(e)&&(T=e.marker,E=T.size,Array.isArray(E))){var S={type:"linear"};i.setConvert(S),E=S.makeCalcdata(e.marker,"size"),E.length>A&&E.splice(A,E.length-A)}return s(e),void 0!==typeof E&&o.mergeArray(E,k,"ms"),k}},{"../../lib":583,"../../plots/cartesian/axes":607,"../scatter/colorscale_calc":775,"../scatter/subtypes":790,"fast-isnumeric":99}],811:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),o=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,h,r,i)}var d,m=p("a"),g=p("b"),v=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),v&&(d=Math.min(d,v.length))):d=v?Math.min(d,v.length):0):g&&v&&(d=Math.min(g.length,v.length)),!d)return void(e.visible=!1);m&&d"),s}}},{"../../plots/cartesian/axes":607,"../scatter/hover":780}],813:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":670,"../scatter/colorbar":774,"./attributes":809,"./calc":810,"./defaults":811,"./hover":812,"./plot":814,"./select":815,"./style":816}],814:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:r},o=new Array(e.length),a=t.graphDiv.calcdata,s=0;se){for(var r=m/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;ar;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},g.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,f=t.x,p=t.y,m=n.xaxis,g=n.yaxis,v=n.zaxis,y=r.dataScale,x=c[0].length,b=c.length,_=[u(new Float32Array(x*b),[x,b]),u(new Float32Array(x*b),[x,b]),u(new Float32Array(x*b),[x,b])],w=_[0],M=_[1],A=r.contourLevels;this.data=t,h(_[2],function(t,e){return v.d2l(c[e][t])*y[2]}),Array.isArray(f[0])?h(w,function(t,e){return m.d2l(f[e][t])*y[0]}):h(w,function(t){return m.d2l(f[t])*y[0]}),Array.isArray(p[0])?h(M,function(t,e){return g.d2l(p[e][t])*y[1]}):h(M,function(t,e){return g.d2l(p[e])*y[1]});var k={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(k.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var T=u(new Float32Array(x*b),[x,b]);h(T,function(e,r){return t.surfacecolor[r][e]}),_.push(T)}else k.intensityBounds[0]*=y[2],k.intensityBounds[1]*=y[2];this.dataScale=a(_),t.surfacecolor&&(k.intensity=_.pop()),"opacity"in t&&t.opacity<1&&(k.opacity=.25*t.opacity);var E=[!0,!0,!0],S=["x","y","z"];for(e=0;3>e;++e){var L=t.contours[S[e]];E[e]=L.highlight,k.showContour[e]=L.show||L.highlight,k.showContour[e]&&(k.contourProject[e]=[L.project.x,L.project.y,L.project.z],L.show?(this.showContour[e]=!0,k.levels[e]=A[e],o.highlightColor[e]=k.contourColor[e]=d(L.color),L.usecolormap?o.highlightTint[e]=k.contourTint[e]=0:o.highlightTint[e]=k.contourTint[e]=1,k.contourWidth[e]=L.width):this.showContour[e]=!1,L.highlight&&(k.dynamicColor[e]=d(L.highlightcolor),k.dynamicWidth[e]=L.highlightwidth))}k.coords=_,o.update(k),o.visible=t.visible,o.enableDynamic=E,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),s&&1>s&&(o.supportsTransparency=!0)},g.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":595,"gl-surface3d":202,ndarray:399,"ndarray-fill":389,"ndarray-homography":391,"ndarray-ops":393,tinycolor2:461}],821:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../lib"),o=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,a,r,n)}var u,c,h=l("z");if(!h)return void(e.visible=!1);var f=h[0].length,p=h.length;if(l("x"),l("y"),!Array.isArray(e.x))for(e.x=[],u=0;f>u;++u)e.x[u]=u;if(l("text"),!Array.isArray(e.y))for(e.y=[],u=0;p>u;++u)e.y[u]=u;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){l(t)});var d=l("surfacecolor");l("colorscale");var m=["x","y","z"];for(u=0;3>u;++u){var g="contours."+m[u],v=l(g+".show"),y=l(g+".highlight");if(v||y)for(c=0;3>c;++c)l(g+".project."+m[c]);v&&(l(g+".color"),l(g+".width"),l(g+".usecolormap")),y&&(l(g+".highlightcolor"),l(g+".highlightwidth"))}d||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,s,l,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":817}],822:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":643,"./attributes":817,"./calc":818,"./colorbar":819,"./convert":820,"./defaults":821}]},{},[12])(12)}); \ No newline at end of file +}}},{}],548:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],549:[function(t,e,r){"use strict";function n(t,e){function r(t,e){return o.coerce(n,i,l,t,e)}for(var n,i,a=t.buttons||[],s=e.buttons=[],u=0;u0);if(d){var m=i(e,r,l);c("x",m[0]),c("y",m[1]),o.noneOrAll(t,e,["x","y"]),c("xanchor"),c("yanchor"),o.coerceFont(c,"font",r.font);var g=c("bgcolor");c("activecolor",a.contrast(g,u.lightAmount,u.darkAmount)),c("bordercolor"),c("borderwidth")}}},{"../../lib":583,"../color":498,"./attributes":546,"./button_attributes":547,"./constants":548}],550:[function(t,e,r){"use strict";function n(t){for(var e=v.list(t,"x",!0),r=[],n=0;ne){var r=e;e=t,t=r}s.setAttributes(w,{"data-min":t,"data-max":e}),s.setAttributes(C,{x:t,width:e-t}),s.setAttributes(k,{width:t}),s.setAttributes(T,{x:e,width:d-e}),s.setAttributes(E,{transform:"translate("+(t-g-1)+")"}),s.setAttributes(z,{transform:"translate("+e+")"})}var h=t._fullLayout,f=h._infolayer.selectAll("g.range-slider"),p=h.xaxis.rangeslider,d=h._size.w,m=(h.height-h.margin.b-h.margin.t)*p.thickness,g=2,v=Math.floor(p.borderwidth/2),y=h.margin.l,x=h.height-m-h.margin.b,b=0,_=d,w=document.createElementNS(a,"g");s.setAttributes(w,{"class":"range-slider","data-min":b,"data-max":_,"pointer-events":"all",transform:"translate("+y+","+x+")"});var M=document.createElementNS(a,"rect"),A=p.borderwidth%2===0?p.borderwidth:p.borderwidth-1;s.setAttributes(M,{fill:p.bgcolor,stroke:p.bordercolor,"stroke-width":p.borderwidth,height:m+A,width:d+A,transform:"translate(-"+v+", -"+v+")","shape-rendering":"crispEdges"});var k=document.createElementNS(a,"rect");s.setAttributes(k,{x:0,width:b,height:m,fill:"rgba(0,0,0,0.4)"});var T=document.createElementNS(a,"rect");s.setAttributes(T,{x:_,width:d-_,height:m,fill:"rgba(0,0,0,0.4)"});var E=document.createElementNS(a,"g"),S=document.createElementNS(a,"rect"),L=document.createElementNS(a,"rect");s.setAttributes(E,{transform:"translate("+(b-g-1)+")"}),s.setAttributes(S,{width:10,height:m,x:-6,fill:"transparent",cursor:"col-resize"}),s.setAttributes(L,{width:g,height:m/2,y:m/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(E,[L,S]);var z=document.createElementNS(a,"g"),I=document.createElementNS(a,"rect"),P=document.createElementNS(a,"rect");s.setAttributes(z,{transform:"translate("+_+")"}),s.setAttributes(I,{width:10,height:m,x:-2,fill:"transparent",cursor:"col-resize"}),s.setAttributes(P,{width:g,height:m/2,y:m/4,rx:1,fill:"white",stroke:"#666","shape-rendering":"crispEdges"}),s.appendChildren(z,[P,I]);var C=document.createElementNS(a,"rect");s.setAttributes(C,{x:b,width:_-b,height:m,cursor:"ew-resize",fill:"transparent"}),w.addEventListener("mousedown",function(t){function r(t){var r,n,h=+t.clientX-o;switch(i){case C:w.style.cursor="ew-resize",r=+s+h,n=+l+h,c(r,n),u(e(r),e(n));break;case S:w.style.cursor="col-resize",r=+s+h,n=+l,c(r,n),u(e(r),e(n));break;case I:w.style.cursor="col-resize",r=+s,n=+l+h,c(r,n),u(e(r),e(n));break;default:w.style.cursor="ew-resize",r=a,n=a+h,c(r,n),u(e(r),e(n))}}function n(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n),w.style.cursor="auto"}var i=t.target,o=t.clientX,a=o-w.getBoundingClientRect().left,s=w.getAttribute("data-min"),l=w.getAttribute("data-max");window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)}),p.range||(p.range=i.getAutoRange(h.xaxis));var R=l(t,d,m);s.appendChildren(w,[M,R,k,T,C,E,z]),r(h.xaxis.range[0],h.xaxis.range[1]),f.data([0]).enter().append(function(){return p.setRange=r,w})}},{"../../constants/xmlns_namespaces":571,"../../lib":583,"../../plotly":604,"../../plots/cartesian/axes":607,"./helpers":556,"./range_plot":558}],555:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,o){function a(t,e){return n.coerce(s,l,i,t,e)}if(t[r].rangeslider){var s=n.isPlainObject(t[r].rangeslider)?t[r].rangeslider:{},l=e[r].rangeslider={};if(a("bgcolor"),a("bordercolor"),a("borderwidth"),a("thickness"),a("visible"),a("range"),l.range&&!e[r].autorange){var u=l.range,c=e[r].range;u[0]=Math.min(u[0],c[0]),u[1]=Math.max(u[1],c[1])}else e[r]._needsExpand=!0;l.visible&&o.forEach(function(t){var r=e[t]||{};r.fixedrange=!0,e[t]=r})}}},{"../../lib":583,"./attributes":553}],556:[function(t,e,r){"use strict";r.setAttributes=function(t,e){for(var r in e)t.setAttribute(r,e[r])},r.appendChildren=function(t,e){for(var r=0;rl;l++){var u=s[l],c={_fullLayout:e},h=b.coerceRef(t,n,c,u);if("path"!==a){var f=.25,p=.75;if("paper"!==h){var d=b.getFromId(c,h),m=o(d);f=m(d.range[0]+f*(d.range[1]-d.range[0])),p=m(d.range[0]+p*(d.range[1]-d.range[0]))}r(u+"0",f),r(u+"1",p)}}return"path"===a?r("path"):x.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function o(t){return"category"===t.type?t.l2c:t.l2d}function a(t,e){t.layout.shapes=e,M.supplyLayoutDefaults(t.layout,t._fullLayout),M.drawAll(t)}function s(t){delete t.layout.shapes,t._fullLayout.shapes=[],M.drawAll(t)}function l(t,e,r){for(var n=0;ne;i--)f(t,i).selectAll('[data-index="'+(i-1)+'"]').attr("data-index",i),M.draw(t,i)}function h(t,e,r,a){function s(r){var n={"data-index":e,"fill-rule":"evenodd",d:m(t,L)},i=L.line.width?L.line.color:"rgba(0,0,0,0)",o=r.append("path").attr(n).style("opacity",L.opacity).call(_.stroke,i).call(_.fill,L.fillcolor).call(w.dashLine,L.line.dash,L.line.width);z&&o.call(w.setClipUrl,"clip"+t._fullLayout._uid+z)}var l,u;f(t,e).selectAll('[data-index="'+e+'"]').remove();var c=t.layout.shapes[e];if(c){var h={xref:c.xref,yref:c.yref},d={};"string"==typeof r&&r?d[r]=a:x.isPlainObject(r)&&(d=r);var g=Object.keys(d);for(l=0;ll;l++){var M=y[l];if(void 0===d[M]&&void 0!==c[M]){var A,k=M.charAt(0),T=b.getFromId(t,b.coerceRef(h,{},t,k)),E=b.getFromId(t,b.coerceRef(c,{},t,k)),S=c[M];void 0!==d[k+"ref"]&&(T?(A=i(T)(S),S=(A-T.range[0])/(T.range[1]-T.range[0])):S=(S-E.domain[0])/(E.domain[1]-E.domain[0]),E?(A=E.range[0]+S*(E.range[1]-E.range[0]),S=o(E)(A)):S=T.domain[0]+S*(T.domain[1]-T.domain[0])),c[M]=S}}var L=n(c,t._fullLayout);t._fullLayout.shapes[e]=L;var z;if("below"!==L.layer)z=(L.xref+L.yref).replace(/paper/g,""),s(t._fullLayout._shapeUpperLayer);else if("paper"===L.xref&&"paper"===L.yref)z="",s(t._fullLayout._shapeLowerLayer);else{var I,P=t._fullLayout._plots||{},C=Object.keys(P);for(l=0,u=C.length;u>l;l++)I=P[C[l]],z=C[l],p(t,L,I)&&s(I.shapelayer)}}}function f(t,e){var r=t._fullLayout.shapes[e],n=t._fullLayout._shapeUpperLayer;return r?"below"===r.layer&&(n="paper"===r.xref&&"paper"===r.yref?t._fullLayout._shapeLowerLayer:t._fullLayout._shapeSubplotLayer):x.log("getShapeLayer: undefined shape: index",e),n}function p(t,e,r){var n=y.Axes.getFromId(t,r.id,"x")._id,i=y.Axes.getFromId(t,r.id,"y")._id,o="below"===e.layer,a=n===e.xref||i===e.yref,s=!!r.shapelayer;return o&&a&&s}function d(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}}function m(t,e){var r,n,o,a,s=e.type,l=b.getFromId(t,e.xref),u=b.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=i(l),n=function(t){return l._offset+l.l2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(o=i(u),a=function(t){return u._offset+u.l2p(o(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===s)return l&&"date"===l.type&&(n=d(n)),u&&"date"===u.type&&(a=d(a)),M.convertPath(e.path,n,a);var h=n(e.x0),f=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===s)return"M"+h+","+p+"L"+f+","+m;if("rect"===s)return"M"+h+","+p+"H"+f+"V"+m+"H"+h+"Z";var g=(h+f)/2,v=(p+m)/2,y=Math.abs(g-h),x=Math.abs(v-p),_="A"+y+","+x,w=g+y+","+v,A=g+","+(v-x);return"M"+w+_+" 0 1,1 "+A+_+" 0 0,1 "+w+"Z"}function g(t,e,r,n,i){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var a,s,l,u,c,h=1/0,f=-(1/0),p=n.match(A);for("date"===t.type&&(o=d(o)),a=0;ac&&(h=c),c>f&&(f=c)));return f>=h?[h,f]:void 0}}var v=t("fast-isnumeric"),y=t("../../plotly"),x=t("../../lib"),b=t("../../plots/cartesian/axes"),_=t("../color"),w=t("../drawing"),M=(t("../dragelement"),t("../../lib/setcursor"),e.exports={});M.layoutAttributes=t("./attributes"),M.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],o=0;os&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),x.log("Ignoring extra params in segment "+t)),i+l})},M.calcAutorange=function(t){var e,r,n,i,o,a=t._fullLayout,s=a.shapes;if(s.length&&t._fullData.length)for(e=0;ef?r=f:(c.left-=x.offsetLeft,c.right-=x.offsetLeft,c.top-=x.offsetTop,c.bottom-=x.offsetTop,x.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,a*(t[x.side]-c[o])+u))}),r=Math.min(f,r)),r>0||0>f){var p={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+p+")")}}}function d(){E=0,S=!0,L=I,M._infolayer.select("."+e).attr({"data-unformatted":L}).text(L).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 m=r.propContainer,g=r.propName,v=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,M=t._fullLayout,A=m.titlefont.family,k=m.titlefont.size,T=m.titlefont.color,E=1,S=!1,L=m.title.trim();""===L&&(E=0),L.match(/Click to enter .+ title/)&&(E=.2,S=!0),w||(w=M._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var z=w.selectAll("text").data([0]);z.enter().append("text"),z.text(L).attr("class",e),z.attr({"data-unformatted":L}).call(h);var I="Click to enter "+y+" title",P=t._context.editable;P&&(m===M?P=t._context.editableMainTitle:m===M.xaxis?P=t._context.editableAxisXTitle:m===M.yaxis?P=t._context.editableAxisYTitle:m===M.yaxis2?P=t._context.editableAxisY2Title:m===M.xaxis2&&(P=t._context.editableAxisX2Title)),P?(L||d(),z.call(c.makeEditable).on("edit",function(e){void 0!==v?o.restyle(t,g,e,v):o.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):L&&!L.match(/Click to enter .+ title/)||z.remove(),z.classed("js-placeholder",S),m._titleElement=z}},{"../../lib":583,"../../lib/svg_text_utils":596,"../../plotly":604,"../../plots/plots":663,"../color":498,"../drawing":521,d3:90,"fast-isnumeric":99}],562:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),o=t("../../lib/extend").extendFlat,a={_isLinkedToArray:!0,method:{valType:"enumerated",values:["restyle","relayout"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:!0,visible:{valType:"boolean"},active:{valType:"integer",min:-1,dflt:0},buttons:a,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:"bottom"},font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":578,"../../plots/font_attributes":625,"../color/attributes":497}],563:[function(t,e,r){"use strict";e.exports={name:"updatemenus",itemName:"updatemenu",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",buttonGroupClassName:"updatemenu-button-group",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],564:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,a,r,n)}var s=i(t,e),l=n("visible",s.length>0);l&&(n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return o.coerce(n,i,u,t,e)}for(var n,i,a=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(l.enter().append("g").classed(T.containerClassName,!0).style("cursor","pointer"),l.exit().remove(),l.exit().size()&&v(t),0!==r.length){var u=l.selectAll("g."+T.headerGroupClassName).data(r,i);u.enter().append("g").classed(T.headerGroupClassName,!0);var c=l.selectAll("g."+T.buttonGroupClassName).data([0]);c.enter().append("g").classed(T.buttonGroupClassName,!0).style("pointer-events","all"),u.enter().size()&&c.call(g).attr(T.menuIndexAttrName,"-1"),u.exit().each(function(e){y.select(this).remove(),c.call(g).attr(T.menuIndexAttrName,"-1"),b.autoMargin(t,T.autoMarginIdRoot+e._index)});for(var h=0;h",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],571:[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}},{}],572:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.16.3-d17",r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=n.register,r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":601,"./plot_api/to_image":602,"./plot_api/validate":603,"./plotly":604,"./snapshot/download":678,d3:90}],573:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],574:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],575:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),o=t("./nested_property"),a=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),/^([2-9]|[1-9][0-9]+)$/);r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r?!0:"string"!=typeof t?!1:!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var i=t.split("+"),o=0;o2)return!1;var l=a[0].split("-");if(l.length>3||3!==l.length&&a[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),a[1]?(l=a[1].split(":"),l.length>3?!1:(o=Number(l[0]),l[0].length>2||!(o>=0&&23>=o)?!1:(i+=36e5*o,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof a)return void l.error("d3 is not defined.");e||(e=0);var r=new Date(t),i=a.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var u={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},c={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},h=a.time.format.utc,f={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(h),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(h)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(h)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){c[t].forEach(function(e){f[t].D.push(h(e)),["H","I","D"].forEach(function(r){u[r].forEach(function(n){var i=f[t][r];i.push(h(e+"~"+n)),i.push(h(n+"~"+e))})})})});var p=/[a-z]*/g,d=function(t){return t.substr(0,3)},m=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,y=function(t,e){return e+"m "},x=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,_=/[ap]m/,w=/:/,M=/q([1-4])/,A=["31~mar","30~jun","30~sep","31~dec"],k=function(t,e){return A[e-1]},T=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(p,d).replace(m,"").replace(g,"~").replace(v,y).replace(M,k).trim().replace(T,"");var e,r,n=null,a=i(t),s=o(t);e=f[a][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{"../lib":583,d3:90,"fast-isnumeric":99}],577:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof jQuery&&jQuery(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var a=o._events[e];if(!a)return n;"function"==typeof a&&(a=[a]);for(var s=a.pop(),l=0;lv;v++){l=t[v];for(u in l)c=m[u],h=l[u],s&&a(h)?m[u]=h:e&&h&&(o(h)||(f=a(h)))?(f?(f=!1,p=c&&a(c)?c:[]):p=c&&o(c)?c:{},m[u]=i([p,h],e,r,s)):("undefined"!=typeof h||r)&&(m[u]=h)}return m}var o=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":584}],579:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;ry;y++)h=s(d,y),p=l(e,y),v[y]=n(h,p);else v=n(d,e);return v}var s=t("tinycolor2"),l=t("fast-isnumeric"),u=t("../components/colorscale/make_scale_function"),c=t("../components/color/attributes").defaultLine,h=t("./str2rgbarray"),f=1;e.exports=a},{"../components/color/attributes":497,"../components/colorscale/make_scale_function":515,"./str2rgbarray":595,"fast-isnumeric":99,tinycolor2:461}],582:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function o(t){return t.replace(/\<.*\>/g,"")}function a(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(r>n)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return""+a(o(n(i(t))))}var l=t("superscript-text"),u=t("../constants/string_mappings");e.exports=s},{"../constants/string_mappings":570,"superscript-text":458}],583:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var o=t("./coerce");i.valObjects=o.valObjects,i.coerce=o.coerce,i.coerce2=o.coerce2,i.coerceFont=o.coerceFont,i.validate=o.validate;var a=t("./dates");i.dateTime2ms=a.dateTime2ms,i.isDateTime=a.isDateTime,i.ms2DateTime=a.ms2DateTime,i.parseDate=a.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t("./loggers");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;or?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.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},i.identity=function(t){return t},i.randstr=function f(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,o,a=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;a===1/0;n*=2)a=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=a-Math.floor(a);for(n=0;n-1||u!==1/0&&u>=Math.pow(2,e)?f(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,o,a=t.length,s=2*a,l=2*e-1,u=new Array(l),c=new Array(a);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;a>r;r++){for(o=0,n=0;l>n;n++)i=r+n+1-e,-a>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=a&&(i=s-1-i),o+=t[i]*u[n];c[r]=o}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var o,a;t.length;)if(a=t.splice(0,1)[0],o=a(e),o&&o.then)return o.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,o=!1,a=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,a,s=3,l=Object.keys(t);for(n=0;n1?n+o[1]:"";if(i&&(o.length>1||a.length>4))for(;r.test(a);)a=a.replace(r,"$1"+i+"$2");return a+s}},{"./coerce":575,"./dates":576,"./extend":578,"./is_plain_object":584,"./loggers":585,"./matrix":586,"./nested_property":587,"./notifier":588,"./search":591,"./stats":594,d3:90}],584:[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}},{}],585:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(n.logging>1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;en;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;n>e;e++)for(o[e]=new Array(i),r=0;i>r;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,o=t.length;if(t[0].length)for(n=new Array(o),i=0;o>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var a=r.transposeRagged(e);for(n=new Array(a.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],587:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,o,a,s,l=t;for(a=0;a=0;e--){if(n=t[e],a=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?a?n[r]=void 0:n.pop():a=!0;else if("object"==typeof n&&null!==n)for(o=Object.keys(n),a=!1,r=o.length-1;r>=0;r--)u(n[o[r]])&&!i(n[o[r]],o[r])?delete n[o[r]]:a=!0;if(a)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,a,s=0,l=e.split(".");sr||r>o||a>n||n>s?!1:!e||!u(t)}function r(t,e){var r=t[0],l=t[1];if(i>r||r>o||a>l||l>s)return!1;var u,c,h,f,p,d=n.length,m=n[0][0],g=n[0][1],v=0;for(u=1;d>u;u++)if(c=m,h=g,m=n[u][0],g=n[u][1],f=Math.min(c,m),!(f>r||r>Math.max(c,m)||l>Math.max(h,g)))if(l=l&&r!==f&&v++}return v%2===1}var n=t.slice(),i=n[0][0],o=i,a=n[0][1],s=a;n.push(n[0]);for(var l=1;lo;o++)if(a=[t[o][0]-l[0],t[o][1]-l[1]],s=n(a,u),0>s||s>c||Math.abs(n(a,f))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":586}],590:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;oo.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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;rt}function i(t,e){return e>=t}function o(t,e){return t>e}function a(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("../lib");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,p=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?a:o;f>h&&p++<100;)u=Math.floor((h+f)/2),c(e[u],t)?h=u+1:f=u;return p>90&&l.log("Long binary search..."),h-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,i=e[n]-e[0]||1,o=i/(n||1)/1e4,a=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+o&&(i=Math.min(i,e[s+1]-e[s]),a.push(e[s+1]));return{vals:a,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,o=e.length-1,a=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;o>i&&a++<100;)n=u((i+o)/2),e[n]<=t?i=n+s:o=n-l;return e[i]}},{"../lib":583,"fast-isnumeric":99}],592:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],593:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":498}],594:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,o){var a,s;if(o||(o=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(o),a=0;o>a;a++)s[a]=r.aggNums(t,e,i[a]);i=s}for(a=0;o>a;a++)n(e)?n(i[a])&&(e=t(+e,+i[a])):e=i[a];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":99}],595:[function(t,e,r){"use strict";function n(t){return t=i(t),o.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),o=t("arraytools");e.exports=n},{arraytools:28,tinycolor2:461}],596:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+f.randstr([],64),o=h.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function a(t,e){for(var r=t||"",n=0;n]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),n=e&&e[2].toLowerCase(),i=m[n];if(void 0!==i){var o=e[1],a=e[3],s=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===n){if(o)return"
";if("href"!==a.substr(0,4).toLowerCase())return"";var u=a.substr(4).replace(/["']/g,"").replace(/=/,""),c=document.createElement("a");return c.href=u,-1===g.indexOf(c.protocol)?"":''}if("br"===n)return"
";if(o)return"sup"===n?'':"sub"===n?'':"";var h=""}return r.xml_entity_encode(t).replace(/");i>0;i=e.indexOf("
",i+1))n.push(i);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),i="",a=n.length-1;a>=0;a--){var s=n[a].match(/<(\/?).*>/i);if(s&&"
"!==n[a]){s[1]||(i=n[a]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,""),o+=2)});var a=e.join(""),u=a.split(/
/gi);return u.length>1&&(e=u.map(function(t,e){return''+t+""})),e.join("")}function c(t,e,r){var n,i,o,a=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},o="right"===a?function(){return l.right-n.width}:"center"===a?function(){ +return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:o()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),p=t("../constants/xmlns_namespaces"),d=t("../constants/string_mappings");h.selection.prototype.appendSVG=function(t){for(var e=['',t,""].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(f.log(r.querySelector("parsererror div").textContent),null):h.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=h.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},r.convertToTspans=function(t,e){function r(){p.empty()||(d=s.attr("class")+"-math",p.select("svg."+d).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),c=t.appendSVG(a),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),a=u(i),s=t,l=!s.attr("data-notex")&&a.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,p=h.select(s.node().parentNode);if(!p.empty()){var d=s.attr("class")?s.attr("class").split(" ")[0]:"text";d+="-math",p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var g=f.getPlotDiv(s.node());(g&&g._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};o(l[2],i,function(i,o,a){p.selectAll("svg."+d).remove(),p.selectAll("g."+d+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return r(),void t();var u=p.append("g").classed(d+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),o&&o.node()&&l.node().insertBefore(o.node().cloneNode(!0),l.node().firstChild),l.attr({"class":d,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var h=n(l,"width"),f=n(l,"height"),m=+s.attr("x")-h*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],g=parseInt(s.style("font-size"),10)||n(s,"height"),v=-g/4;"y"===d[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-h/2,v-f/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===d[0]?l.attr({x:s.attr("x"),y:v-f/2}):"a"===d[0]?l.attr({x:0,y:v}):l.attr({x:m,y:+s.attr("y")+v-f/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},g=["http:","https:","mailto:"],v=new RegExp("]*)?/?>","g"),y=Object.keys(d.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:d.entityToUnicode[t]}}),x=Object.keys(d.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+d.unicodeToEntity[t]+";"}});r.plainText=function(t){return(t||"").replace(v," ")},r.makeEditable=function(t,e,r){function n(){o(),a.style({opacity:0});var t,e=u.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(a.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=h.select(f.getPlotDiv(a.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":a.style("font-family")||"Arial","font-size":a.style("font-size")||12,color:r.fill||a.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(a.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||a.attr("data-unformatted")).call(c(a,e,r)).on("blur",function(){a.text(this.textContent).style({opacity:1});var t,e=h.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(a.node().parentNode).select(t).style({opacity:0});var r=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(a,r)}).on("focus",function(){var t=this;h.select(document).on("mouseup",function(){return h.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===h.event.which?(a.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(a,this.textContent)):(s.input.call(a,this.textContent),h.select(this).call(c(a,e,r)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(i)}r||(r={});var a=this,s=h.dispatch("edit","input","cancel"),l=h.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),r.immediate?n():u.on("click",n),h.rebind(this,s,"on")}},{"../constants/string_mappings":570,"../constants/xmlns_namespaces":571,"../lib":583,d3:90}],597:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,o=t("topojson").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return o(e,n).features}},{"../plots/geo/constants":626,topojson:463}],598:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t){Array.isArray(t._promises)&&t._promises.length>0&&R.log("Clearing previous rejected promises from queue."),t._promises=[]}function o(t,e){t._fullLayout._paperdiv.style("background","white"),C.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=R.extendFlat({},C.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=o:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function s(t,e,r){var n=z.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.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),C.micropolar.manager.fillLayout(t),"initial"===t._fullLayout.autosize&&t._context.autosizable&&(M(t,{}),t._fullLayout.autosize=r.autosize=!0),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=C.micropolar.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var o=t.framework.svg(),a=1,s=t._fullLayout.title;""!==s&&s||(a=0);var l="Click to enter title",u=function(){this.call(C.util.convertToTspans)},c=o.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(a=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:a}).on("mouseover.opacity",function(){z.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){z.select(this).transition().duration(1e3).style("opacity",0)}));var h=function(){this.call(C.util.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(h)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(h)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),j.addLinks(t),Promise.resolve()}function l(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var n=C.Axes.list({_fullLayout:t});for(e=0;ee;e++){var a=t.annotations[e];a.ref&&("paper"===a.ref?(a.xref="paper",a.yref="paper"):"data"===a.ref&&(a.xref="x",a.yref="y"),delete a.ref),u(a,"xref"),u(a,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(R.warn("Shapes must be an array."),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var l=t.shapes[e];u(l,"xref"),u(l,"yref")}var c=t.legend;c&&(c.x>3?(c.x=1.02,c.xanchor="left"):c.x<-2&&(c.x=-.02,c.xanchor="right"),c.y>3?(c.y=1.02,c.yanchor="bottom"):c.y<-2&&(c.y=-.02,c.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var h=j.getSubplotIds(t,"gl3d");for(e=0;er;++r)x[r]=g[e]+v*y[2+4*r];p.camera={eye:{x:x[0],y:x[1],z:x[2]},center:{x:g[0],y:g[1],z:g[2]},up:{x:y[1],y:y[5],z:y[9]}},delete p.cameraposition}}return N.clean(t),t}function u(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=C.Axes.cleanId(r,n))}function c(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;io&&(s=R.randstr(n),-1!==r.indexOf(s));o++);a.uid=R.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=N.defaults,u=a.error_y.color||(j.traceIs(a,"bar")?N.defaultLine:l[i%l.length]);a.error_y.color=N.addOpacity(N.rgb(u),N.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!j.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",_(a)),delete a.bardir),"histogramy"===a.type&&_(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=C.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=C.Axes.cleanId(a.yaxis,"y")),j.traceIs(a,"gl3d")&&a.scene&&(a.scene=j.subplotsRegistry.gl3d.cleanId(a.scene)),j.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(h):a.textposition&&(a.textposition=h(a.textposition))),j.traceIs(a,"2dMap")&&("YIGnBu"===a.colorscale&&(a.colorscale="YlGnBu"),"YIOrRd"===a.colorscale&&(a.colorscale="YlOrRd")),j.traceIs(a,"markerColorscale")&&a.marker){var c=a.marker;"YIGnBu"===c.colorscale&&(c.colorscale="YlGnBu"),"YIOrRd"===c.colorscale&&(c.colorscale="YlOrRd")}if("surface"===a.type&&R.isPlainObject(a.contours)){var p=["x","y","z"];for(o=0;on?o.push(i+n):o.push(n);return o}function m(t,e,r){var n,i;for(n=0;n=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function g(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]),m(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&m(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function v(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=w(t._boundingBoxMargins),l=s.left+s.right,u=s.bottom+s.top,c=o._container.node().getBoundingClientRect(),h=1-2*a.frameMargins;i=Math.round(h*(c.width-l)),n=Math.round(h*(c.height-u))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||o.height,i=parseFloat(r.width)||o.width;return Math.abs(o.width-i)>1||Math.abs(o.height-n)>1?(o.height=t.layout.height=n,o.width=t.layout.width=i):"initial"!==o.autosize&&(delete e.autosize,o.autosize=t.layout.autosize=!0),j.sanitizeMargins(o),e}function A(t){var e=z.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(M(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];z.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=R.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(Q.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0);var o=C.Axes.getSubplots(t);o.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&k(t,o),r._has("cartesian")&&T(t,o),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0);var a=r._paper.selectAll(".layer-subplot");r._imageSubplotLayer=a.selectAll(".imagelayer"),r._shapeSubplotLayer=a.selectAll(".shapelayer");var s=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var l=R.syncOrAsync([E,function(){return C.Axes.doTicks(t,"redraw")},F.init],t);return l&&l.then&&t._promises.push(l),l}function k(t,e){function r(e,r){return function(){return C.Axes.getFromId(t,e,r)}}for(var n,i,o=t._fullLayout._plots={},a=0;a0,_=C.Axes.getSubplots(t).join(""),w=Object.keys(t._fullLayout._plots||{}).join(""),M=w===_;b?t.framework===A&&!x&&M||(t.framework=A,A(t)):M?x&&A(t):(t.framework=A,A(t)),x&&C.Axes.saveRangeInitial(t);var k=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&p(t);for(var S=0;SW.range[0]?[1,2]:[2,1]);else{var Q=W.range[0],K=W.range[1];"log"===F?(0>=Q&&0>=K&&o(H+".autorange",!0),0>=Q?Q=K/1e6:0>=K&&(K=Q/1e6),o(H+".range[0]",Math.log(Q)/Math.LN10),o(H+".range[1]",Math.log(K)/Math.LN10)):(o(H+".range[0]",Math.pow(10,Q)),o(H+".range[1]",Math.pow(10,K)))}else o(H+".autorange",!0)}if("reverse"===U)X.range?X.range.reverse():(o(H+".autorange",!0),X.range=[1,0]),Y.autorange?w=!0:_=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var $=D.parts[1],J=D.parts[0],tt=m[J]||[],et=C[R.titleCase(J)],rt=tt[$]||{};2===D.parts.length&&("add"===v[I]||R.isPlainObject(v[I])?S[I]="remove":"remove"===v[I]?-1===$?(S[J]=tt,delete S[I]):S[I]=rt:R.log("???",v)),!a(rt,"x")&&!a(rt,"y")||R.containsAny(I,["color","opacity","align","dash"])||(w=!0),et.draw(t,$,D.parts.slice(2).join("."),v[I]),delete v[I]}else if("images"===D.parts[0]){var it=R.objectFromPath(I,F);R.extendDeepAll(t.layout,it),V.supplyLayoutDefaults(t.layout,t._fullLayout),V.draw(t)}else if("mapbox"===D.parts[0]&&"layers"===D.parts[1]){R.extendDeepAll(t.layout,R.objectFromPath(I,F));var ot=(t._fullLayout.mapbox||{}).layers||[];for(P=D.parts[2]+1-ot.length,d=0;P>d;d++)ot.push({});_=!0}else if("updatemenus"===D.parts[0]){R.extendDeepAll(t.layout,R.objectFromPath(I,F));var at=t._fullLayout.updatemenus||[];for(P=D.parts[2]+1-at.length,d=0;P>d;d++)at.push({});_=!0}else 0===D.parts[0].indexOf("scene")?_=!0:0===D.parts[0].indexOf("geo")?_=!0:0===D.parts[0].indexOf("ternary")?_=!0:!g._has("gl2d")||-1===I.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===I?w=!0:-1!==D.parts[0].indexOf("legend")?y=!0:-1!==I.indexOf("title")?x=!0:-1!==D.parts[0].indexOf("bgcolor")?b=!0:D.parts.length>1&&R.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?x=!0:-1!==I.indexOf(".linewidth")&&-1!==I.indexOf("axis")?x=b=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?b=!0:D.parts.length>1&&"mirror"===D.parts[1]?x=b=!0:"margin.pad"===I?x=b=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||I.match(/^(bar|box|font)/)?w=!0:-1!==["hovermode","dragmode"].indexOf(I)?A=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(I)&&(_=!0):_=!0,D.set(F)}O.add(t,nt,[t,S],nt,[t,T]),v.autosize&&(v=M(t,v)),(v.height||v.width||v.autosize)&&(w=!0);var st=Object.keys(v),lt=[j.previousPromises];if(_||w)lt.push(function(){return t.layout=void 0,w&&(t.calcdata=void 0),C.plot(t,"",m)});else if(st.length&&(j.supplyDefaults(t),g=t._fullLayout,y&<.push(function(){return q.draw(t),j.previousPromises(t)}),b&<.push(E),x&<.push(function(){return C.Axes.doTicks(t,"redraw"),L(t),j.previousPromises(t)}),A)){var ut;for(Z(t),C.Fx.supplyLayoutDefaults(t.layout,g,t._fullData),C.Fx.init(t),ut=j.getSubplotIds(g,"gl3d"),d=0;d1)};u(r.width)&&u(r.height)||s(new Error("Height and width should be pixel values."));var c=n.clone(e,{format:"png",height:r.height,width:r.width}),h=c.td;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var f=n.getRedrawFunc(h);o.plot(h,c.data,c.layout,c.config).then(f).then(l).then(function(e){t(e)}).catch(function(t){s(t)})});return s}var i=t("fast-isnumeric"),o=t("../plotly"),a=t("../lib");e.exports=n},{"../lib":583,"../plotly":604,"../snapshot":680,"fast-isnumeric":99}],603:[function(t,e,r){"use strict";function n(t,e,r,i,o,u){u=u||[];for(var c=Object.keys(t),f=0;f1&&l.push(a("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,g=r.length,v=0;g>v;v++){var y=r[v],x=["data",v];if(d(y)){var b=c[v],_=b.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&l.push(a("invisible",x)),n(y,b,w,l,x);var M=y.transforms,A=b.transforms;if(M){m(M)||l.push(a("array",x,["transforms"])),x.push("transforms");for(var k=0;ku&&c>e&&(void 0===i[r]?o[h]=T.tickText(t,e):o[h]=s(t,e,String(i[r])),h++);return h=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{x(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function a(t,e){var r=t.match(U),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),o=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return y.time.format(t.replace(U,o))(n)}return y.time.format(t)(n)}function s(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n){var i,o=e.x,s=t._tickround,l=new Date(o),u="";r&&t.hoverformat?i=a(t.hoverformat,o):t.tickformat?i=a(t.tickformat,o):(n&&(x(s)?s+=2:s={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[s]),"y"===s?i=D(l):"m"===s?i=O(l):(o!==t._tmin||r||(u="
"+D(l)),"d"===s?i=j(l):"H"===s?i=F(l):(o!==t._tmin||r||(u="
"+j(l)+", "+D(l)),i=N(l),"M"!==s&&(i+=B(l),"S"!==s&&(i+=f(v(o/1e3,1),t,"none",r).substr(1)))))),e.text=i+u}function u(t,e,r,n,i){var o=t.dtick,a=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=f(Math.pow(10,a),t,i,n);else if(x(o)||"D"===o.charAt(0)&&v(a+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(a);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=f(Math.pow(10,a),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,v(a,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(0>a?.5:.25)))}}function c(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}function f(t,e,r,n){var i=0>t,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat;if(n){var c={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};o(c),a=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var h=Math.pow(10,-a)/2;if("none"===s&&(l=0),t=Math.abs(t),h>t)t="0",i=!1;else{if(t+=h,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var f=a;0>f;f++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators)}if(l&&"hide"!==s){var d;d=0>l?"\u2212"+-l:"power"!==s?"+"+l:String(l),"e"===s||("SI"===s||"B"===s)&&(l>12||-15>l)?t+="e"+d:"E"===s?t+="E"+d:"power"===s?t+="\xd710"+d+"":"B"===s&&9===l?t+="B":"SI"!==s&&"B"!==s||(t+=V[l/3+5])}return i?"\u2212"+t:t}function p(t,e){var r,n,i=[];for(r=0;r1)for(n=1;n2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&c>0&&h/c>f&&(l=a,u=s,f=h/c);if(n===i){var d=n-1,m=n+1;r="tozero"===t.rangemode?0>n?[d,0]:[0,m]:"nonnegative"===t.rangemode?[Math.max(0,d),Math.max(0,m)]:[d,m]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),p&&r.reverse(),r},T.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=T.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange); +}},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;id&&(d=m/10),u=t.c2l(d),c=t.c2l(m),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(p=!0,a=0;a=f?p=!1:s.val>=u&&s.pad<=f&&(t._min.splice(a,1),a--);p&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(p=!0,a=0;a=c&&s.pad>=h?p=!1:s.val<=c&&s.pad<=h&&(t._max.splice(a,1),a--);p&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||t._needsExpand)&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,a,s,l,u,c,h,f,p,d,m,g=e.length,v=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),w=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(o=0;6>o;o++)i(o);for(o=g-1;o>5;o--)i(o)}},T.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-p)/h.dtick)%100<2}var o=_.aggNums(Math.min,null,t),a=_.aggNums(Math.max,null,t);if("category"===e.type)return{start:o-.5,end:a+.5,size:1};var s;if(r)s=(a-o)/r;else{var l=_.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*_.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*_.stdev(t)/Math.pow(t.length,n?.25:.4))}var h={type:"log"===e.type?"linear":e.type,range:[o,a]};T.autoTicks(h,s);var f,p=T.tickIncrement(T.tickFirst(h),h.dtick,"reverse");if("number"==typeof h.dtick){for(var d=0,m=0,g=0,v=0,y=0;ym&&(d>.3*b||i(o)||i(a))){var w=h.dtick/2;p+=o>p+w?w:-w}var M=1+Math.floor((a-p)/h.dtick);f=p+M*h.dtick}else for(f=p;a>=f;)f=T.tickIncrement(f,h.dtick);return{start:p,end:f,size:h.dtick}},T.calcTicks=function(t){if("array"===t.tickmode)return n(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=_.constrain(t._length/e,4,9)+1)),T.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),o(t),t._tmin=T.tickFirst(t);var i=t.range[1]=s:s>=l)&&(a.push(l),!(a.length>1e3));l=T.tickIncrement(l,t.dtick,i));t._tmax=a[a.length-1];for(var u=new Array(a.length),c=0;c157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,L)):e>12096e5?(e/=26298e5,t.dtick="M"+i(e,1,z)):e>432e5?(t.dtick=i(e,864e5,P),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=i(e,36e5,z):e>3e4?t.dtick=i(e,6e4,I):e>500?t.dtick=i(e,1e3,I):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,L));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,L)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,L));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},T.tickIncrement=function(t,e,r){var n=r?-1:1;if(x(e))return t+n*e;var i=e.charAt(0),o=n*Number(e.substr(1));if("M"===i){var a=new Date(t);return a.setMonth(a.getMonth()+o)}if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var s="D2"===e?R:C,l=t+.01*n,u=_.roundUp(v(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.range[1]n:n>u;)u=T.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-o)/h)*h+o)/Math.LN10;if("D"===c){var f="D2"===i?R:C,p=_.roundUp(v(n,1),f,e);return Math.floor(n)+Math.log(y.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var D=y.time.format("%Y"),O=y.time.format("%b %Y"),j=y.time.format("%b %-d"),F=y.time.format("%b %-d %Hh"),N=y.time.format("%H:%M"),B=y.time.format(":%S"),U=/%(\d?)f/g;T.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,o,a=s(t,e),f="array"===t.tickmode,p=r||f;if(f&&Array.isArray(t.ticktext)){var d=Math.abs(t.range[1]-t.range[0])/1e4;for(o=0;o1&&er&&(I=90),i(f,I)}u._lastangle=I}return l(),a(e),e+" done"}function l(){var e=.25,r=200,n=("x"===g?t._fullLayout.height:t._fullLayout.width)*e;n=Math.min(n,r),f.each(function(t){var e=y.select(this),r=k.bBox(e.node()),i="x"===g?r.height:r.width;if(i>n){var o=t.text,a=Math.round(n/(i/o.length)),s=Math.floor(a/2),l=a-s-1;o=o.substr(0,s)+"\u2026"+o.substr(-l);var u=e.select("text");u.text(o),e.insert("title","text").text(t.text)}})}function c(){var e,r,n=u._boundingBox,i=0,o=0;if("x"===u._id.charAt(0)?(e="height","2"===u._id.charAt(1)?(o=1,r="t"):r="b"):"y"===u._id.charAt(0)&&(e="width","2"===u._id.charAt(1)?(i=1,r="r"):r="l"),e&&r){var a=n[e];if(u._titleElement){var s=u._titleElement.node().getBoundingClientRect();a+=s[e]+2}var l=.5*t._fullLayout[e];a=Math.min(a,l);var c={x:i,y:o,l:0,r:0,b:0,t:0};c[r]=a,b.Plots.autoMargin(t,u._name,c)}}function h(){u._boundingBox=r.node().getBoundingClientRect()}r.style("pointer-events","all");var f=r.selectAll("g."+z).data(S,L);if(!u.showticklabels||!x(n))return f.remove(),void a(e);var d,v,M,A,T;"x"===g?(T="bottom"===B?1:-1,d=function(t){return t.dx+D*T},A=n+(R+C)*T,v=function(t){return t.dy+A+t.fontSize*("bottom"===B?1:-.5)},M=function(t){return x(t)&&0!==t&&180!==t?0>t*T?"end":"start":"middle"}):(T="right"===B?1:-1,v=function(t){return t.dy+t.fontSize/2-D*T},d=function(t){return t.dx+n+(R+C+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*T},M=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var E=0,I=0,P=[],O=f.enter().append("g").classed(z,1);O.append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(k.setPosition,d(e),v(e)).call(k.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?P.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),f.exit().remove(),f.each(function(t){E=Math.max(E,t.fontSize)}),i(f,u._lastangle||u.tickangle);var j=_.syncOrAsync([o,s,h,c]);return j&&j.then&&t._promises.push(j),j}function a(e){if(!r){var n,i,o,a,s=E.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,p=1.5,d=s.titlefont.size;if(l.size()){var m=y.select(l.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/);m&&(u.offsetLeft=+m[1],u.offsetTop=+m[2])}"x"===h?(i="free"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:E.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("top"===s.side?-10-d*(p+(s.showticklabels?1:0)):i._length+10+d*(p+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(a+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:E.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("right"===s.side?i._length+10+d*(p+(s.showticklabels?1:.5)):-10-d*(p+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),M.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:h.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:o,y:a,"text-anchor":"middle"}})}}function s(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:b.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[g]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===g}function l(e,r,i){var o=e.gridlayer,a=e.zerolinelayer,l=e["hidegrid"+g]?[]:V,c=u._gridpath||"M0,0"+("x"===g?"v":"h")+r._length,h=o.selectAll("path."+I).data(u.showgrid===!1?[]:l,L);if(h.enter().append("path").classed(I,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)m;m++){var y=u.mirrors[a._id+f[m]];"ticks"!==y&&"labels"!==y||(h[m]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=U[e];t&&x(r)&&(p+=d(r+C*i,i*u.ticklen))}),i(r,p),l(e,a,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return G.length?Promise.all(G):0},T.swap=function(t,e){for(var r=p(t,e),n=0;n2*n}function c(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,o=0;o2*n}var h=t("fast-isnumeric"),f=t("tinycolor2").mix,p=t("../../lib"),d=t("../plots"),m=t("../../components/color/attributes").lightFraction,g=t("./layout_attributes"),v=t("./tick_value_defaults"),y=t("./tick_mark_defaults"),x=t("./tick_label_defaults"),b=t("./category_order_defaults"),_=t("./set_convert"),w=t("./ordered_categories"),M=t("./clean_datum"),A=t("./axis_ids");e.exports=function(t,e,r,i){function o(r,n){return p.coerce2(t,e,g,r,n)}var a=i.letter,s=i.font||{},l="Click to enter "+(i.title||a.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=A.name2id(i.name));var u=r("type");"-"===u&&(n(e,i.data),"-"===e.type?e.type="linear":u=t.type=e.type),_(e);var c=r("color"),d=c===t.color?c:s.color;r("title",l),p.coerceFont(r,"titlefont",{family:s.family,size:Math.round(1.2*s.size),color:d});var M=2===(t.range||[]).length&&h(t.range[0])&&h(t.range[1]),k=r("autorange",!M);k&&r("rangemode");var T=r("range",[-1,"x"===a?6:4]);T[0]===T[1]&&(e.range=[T[0]-1,T[0]+1]),p.noneOrAll(t.range,e.range,[0,1]),r("fixedrange"),v(t,e,r,u),x(t,e,r,u,i),y(t,e,r,i),b(t,e,r);var E=o("linecolor",c),S=o("linewidth"),L=r("showline",!!E||!!S);L||(delete e.linecolor,delete e.linewidth),(L||e.ticks)&&r("mirror");var z=o("gridcolor",f(c,i.bgColor,m).toRgbString()),I=o("gridwidth"),P=r("showgrid",i.showGrid||!!z||!!I);P||(delete e.gridcolor,delete e.gridwidth);var C=o("zerolinecolor",c),R=o("zerolinewidth"),D=r("zeroline",i.showGrid||!!C||!!R);return D||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===u?w(a,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":497,"../../lib":583,"../plots":663,"./axis_ids":609,"./category_order_defaults":610,"./clean_datum":611,"./layout_attributes":616,"./ordered_categories":618,"./set_convert":621,"./tick_label_defaults":622,"./tick_mark_defaults":623,"./tick_value_defaults":624,"fast-isnumeric":99,tinycolor2:461}],609:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,o=[],a=0;a0;o&&(n="array");var a=r("categoryorder",n);"array"===a&&r("categoryarray"),o||"array"!==a||(e.categoryorder="trace")}}},{}],611:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return i.ms2DateTime(t);if("string"!=typeof t&&!n(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){i.error(e,t)}return t}},{"../../lib":583,"fast-isnumeric":99}],612:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50}},{}],613:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?c.ms2DateTime(n,i):"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function o(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function a(t){var e=["lasso","select"];return-1!==e.indexOf(t)}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../lib"),h=t("../../lib/svg_text_utils"),f=t("../../components/color"),p=t("../../components/drawing"),d=t("../../lib/setcursor"),m=t("../../components/dragelement"),g=t("./axes"),v=t("./select"),y=t("./constants"),x=!0;e.exports=function(t,e,r,s,b,_,w,M){function A(t,e){for(var r=0;r.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+dt+", "+mt+")").attr("d",lt+"Z"),ft=pt.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+dt+", "+mt+")").attr("d","M0,0Z"),E();for(var o=0;oi?(ct="",at.r=at.l,at.t=at.b,ft.attr("d","M0,0Z")):(at.t=0,at.b=q,ct="x",ft.attr("d","M"+(at.l-.5)+","+(ot-H-.5)+"h-3v"+(2*H+1)+"h3ZM"+(at.r+.5)+","+(ot-H-.5)+"h3v"+(2*H+1)+"h-3Z")):!K||i.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ft.transition().style("opacity",1).duration(200),ut=!0)}function L(t,e,r){var n,i,o,a=[];for(n=0;nzoom back out","long"),x=!1),s.pre=!1,t.emit("plotly_zoom",s))}function I(e,r){var i=1===(w+M).length;if(e)O();else if(2!==r||i){if(1===r&&i){var o=w?U[0]:B[0],a="s"===w||"w"===M?0:1,s=o._name+".range["+a+"]",l=n(o,a),c="left",f="middle";if(o.fixedrange)return;w?(f="n"===w?"top":"bottom","right"===o.side&&(c="right")):"e"===M&&(c="right"),et.call(h.makeEditable,null,{immediate:!0,background:F.paper_bgcolor,text:String(l),fill:o.tickfont?o.tickfont.color:"#444",horizontalAlign:c,verticalAlign:f}).on("edit",function(e){var r="category"===o.type?o.c2l(e):o.d2l(e);void 0!==r&&u.relayout(t,s,r)})}}else D()}function P(e){function r(t,e,r){if(!t.fixedrange){k(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||F._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(vt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void c.log("Did not find wheel motion attributes: ",e);var o,a=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=xt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=gt[0]+gt[2]*l,h=(s.bottom-e.clientY)/s.height,f=gt[1]+gt[3]*(1-h);if(M){for(o=0;o=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,o=0,a=0;a0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nT;T++){ +var E=o[T],S=p[E];if(S)A[T]=w.getFromId(t,S.xaxis._id),k[T]=w.getFromId(t,S.yaxis._id);else{var L=a[E]._subplot;A[T]=L.xaxis,k[T]=L.yaxis}}var z=e.hovermode||a.hovermode;if(-1===["x","y","closest"].indexOf(z)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var I,P,C,R,D,O,j,F,N,B,U,V,q=[],G=[];if(Array.isArray(e))for(z="array",C=0;CH||H>Y.width||0>X||X>Y.height)return _.unhoverRaw(t,e)}else H="xpx"in e?e.xpx:A[0]._length/2,X="ypx"in e?e.ypx:k[0]._length/2;if(I="xval"in e?n(o,e.xval):i(A,H),P="yval"in e?n(o,e.yval):i(k,X),!m(I[0])||!m(P[0]))return g.warn("Plotly.Fx.hover failed",e,t),_.unhoverRaw(t,e)}var W=1/0;for(R=0;R1||-1!==O.hoverinfo.indexOf("name")?O.name:void 0,index:!1,distance:Math.min(W,M.MAXDIST),color:x.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},V=q.length,"array"===F){var Z=e[R];"pointNumber"in Z?(U.index=Z.pointNumber,F="closest"):(F="","xval"in Z&&(N=Z.xval,F="x"),"yval"in Z&&(B=Z.yval,F=F?"closest":"y"))}else N=I[j],B=P[j];if(O._module&&O._module.hoverPoints){var Q=O._module.hoverPoints(U,N,B,F);if(Q)for(var K,$=0;$V&&(q.splice(0,V),W=q[0].distance)}if(0===q.length)return _.unhoverRaw(t,e);var J="y"===z&&G.length>1;q.sort(function(t,e){return t.distance-e.distance});var tt=x.combine(a.plot_bgcolor||x.background,a.paper_bgcolor),et={hovermode:z,rotateLabels:J,bgColor:tt,container:a._hoverlayer,outerContainer:a._paperdiv},rt=u(q,et);c(q,J?"xa":"ya"),h(rt,J);var nt=t._hoverdata,it=[];for(C=0;C128?"#000":x.background;if(t.name&&void 0===t.zLabelVal){var c=document.createElement("p");c.innerHTML=t.name,r=c.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):k&&t[i+"Label"]===m?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var h=e.select("text.nums").style("fill",u).call(b.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);h.selectAll("tspan.line").call(b.setPosition,0,0);var f=e.select("text.name"),g=0;r&&r!==n?(f.style("fill",l).text(r).call(b.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),f.selectAll("tspan.line").call(b.setPosition,0,0),g=f.node().getBoundingClientRect().width+2*P):(f.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var v,M,E=h.node().getBoundingClientRect(),S=t.xa._offset+(t.x0+t.x1)/2,L=t.ya._offset+(t.y0+t.y1)/2,z=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),R=E.width+I+P+g;t.ty0=_-E.top,t.bx=E.width+2*P,t.by=E.height+2*P,t.anchor="start",t.txwidth=E.width,t.tx2width=g,t.offset=0,t.trace&&t.trace._input&&t.trace._input.rect?t.anchor="middle":o?(t.pos=S,v=A>=L+C/2+R,M=L-C/2-R>=0,"top"!==t.idealAlign&&v||!M?v?(L+=C/2,t.anchor="start"):t.anchor="middle":(L-=C/2,t.anchor="end")):(t.pos=L,v=w>=S+z/2+R,M=S-z/2-R>=0,"left"!==t.idealAlign&&v||!M?v?(S+=z/2,t.anchor="start"):t.anchor="middle":(S-=z/2,t.anchor="end")),h.attr("text-anchor",t.anchor),g&&f.attr("text-anchor",t.anchor),e.attr("transform","translate("+S+","+L+")"+(o?"rotate("+T+")":""))}),L}function c(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>o)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=o;n=!1}if(n){var u=0;for(a=0;ae.pmax&&u++;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos>e.pmax-1&&(l.del=!0,u--);for(a=0;a=u);a++)if(l=t[a],l.pos=0;s--)t[s].dp-=o;for(a=t.length-1;a>=0&&!(0>=u);a--)l=t[a],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,o,a,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?S:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,a=0;a.01&&d.pmin===m.pmin&&d.pmax===m.pmax){for(s=p.length-1;s>=0;s--)p[s].dp+=i;for(f.push.apply(f,p),h.splice(a+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(o=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=o;n=!1}else a++}h.forEach(r)}for(a=h.length-1;a>=0;a--){var g=h[a];for(s=g.length-1;s>=0;s--){var v=g[s],y=t[v.i];y.offset=v.dp,y.del=v.del}}}function h(t,e){t.each(function(t){var r=p.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],a=o*(I+P),s=a+o*(t.txwidth+P),l=0,u=t.offset;"middle"===t.anchor&&(a-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-z,l=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*I+l)+","+(I+u)+"v"+(t.by/2-I)+"h"+n*t.bx+"v-"+t.by+"H"+(n*I+l)+"V"+(u-I)+"Z"),i.call(b.setPosition,a+l,u+t.ty0-t.by/2+P).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(b.setPosition,s+o*P+l,u+t.ty0-t.by/2+P),r.select("rect").call(b.setRect,s+(o-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function f(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],o=t._hoverdata[n];if(i.curveNumber!==o.curveNumber||String(i.pointNumber)!==String(o.pointNumber))return!0}return!1}var p=t("d3"),d=t("tinycolor2"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../lib/events"),y=t("../../lib/svg_text_utils"),x=t("../../components/color"),b=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("./axes"),M=t("./constants"),A=t("./dragbox"),k=e.exports={};k.unhover=_.unhover,k.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},k.supplyLayoutDefaults=function(t,e,r){function n(r,n){return g.coerce(t,e,k.layoutAttributes,r,n)}n("dragmode");var i;if(e._has("cartesian")){var o=e._isHoriz=k.isHoriz(r);i=o?"y":"x"}else i="closest";n("hovermode",i)},k.isHoriz=function(t){for(var e=!0,r=0;rt._lastHoverTime+M.HOVERMINTIME?(a(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){a(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},M.HOVERMINTIME))},k.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||o(e,r):"x"===t?e:r},k.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indext*e||0===t?M.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":498,"../../components/dragelement":519,"../../components/drawing":521,"../../lib":583,"../../lib/events":577,"../../lib/svg_text_utils":596,"./axes":607,"./constants":612,"./dragbox":613,d3:90,"fast-isnumeric":99,tinycolor2:461}],615:[function(t,e,r){"use strict";var n=t("../plots"),i=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=i.idRegex,r.attrRegex=i.attrRegex,r.attributes=t("./attributes"),r.plot=function(t){function e(t,e){for(var r=[],n=0;nh[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":583,"fast-isnumeric":99}],620:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),o=t("../../components/color"),a=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function p(t,e){return t-e}var d,m=i.gd._fullLayout._zoomlayer,g=i.element.getBoundingClientRect(),v=i.plotinfo.x()._offset,y=i.plotinfo.y()._offset,x=e-g.left,b=r-g.top,_=x,w=b,M="M"+x+","+b,A=i.xaxes[0]._length,k=i.yaxes[0]._length,T=i.xaxes.map(n),E=i.yaxes.map(n),S=i.xaxes.concat(i.yaxes);"lasso"===h&&(d=l([[x,b]],s.BENDPX));var L=m.selectAll("path.select-outline").data([1,2]);L.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+v+", "+y+")").attr("d",M+"Z");var z,I,P,C,R,D=m.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+v+", "+y+")").attr("d","M0,0Z"),O=[],j=i.gd,F=[];for(z=0;z0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*c*Math.abs(n-i))}return a.BADNUM}function r(t){return Math.pow(10,t)}function u(t){return i(t)?Number(t):a.BADNUM}var c=10;if(t.c2l="log"===t.type?e:u,t.l2c="log"===t.type?r:u,t.l2d=function(e){return t.c2d(t.l2c(e))},t.p2d=function(e){return t.l2d(t.p2l(e))},t.setScale=function(){var e,r=t._gd._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=l.getFromId(t._gd,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)i(t.range[e])||(t.range[e]=i(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return i(e)?n.round(t._b+t._m*e,2):a.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=u,t.d2c=function(t){return t=s(t),i(t)?Number(t):a.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return i(t)?o.ms2DateTime(t):a.BADNUM},t.d2c=function(t){return i(t)?Number(t):o.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var h=t.range.map(o.dateTime2ms);!i(t.range[0])&&i(h[0])&&(t.range[0]=h[0]),!i(t.range[1])&&i(h[1])&&(t.range[1]=h[1])}catch(f){o.error(f,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){null!==e&&void 0!==e&&-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?a.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,o;if(r in e)for(n=e[r],i=new Array(n.length),o=0;on?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),o=this.projection,a=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",a),r.selectAll("path.graticulepath").attr("d",a),n.selectAll("path.choroplethlocation").attr("d",a),n.selectAll("path.basepath").attr("d",a),i.selectAll("path.js-line").attr("d",a),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../components/color":498,"../../components/drawing":521,"../../constants/xmlns_namespaces":571,"../../lib/filter_visible":579,"../../lib/topojson_utils":597,"../../plots/cartesian/axes":607,"./constants":626,"./projections":634,"./set_scale":635,"./zoom":636,"./zoom_reset":637,d3:90,topojson:463}],628:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var a=0;a=n}function o(t,e){for(var r=e[0],n=e[1],i=!1,o=0,a=t.length,s=a-1;a>o;s=o++){var l=t[o],u=l[0],c=l[1],h=t[s],f=h[0],p=h[1];c>n^p>n&&(f-u)*(n-c)/(p-c)+u>r&&(i=!i)}return i}function a(t){return t?t/Math.sin(t):1}function s(t){return t>1?P:-1>t?-P:Math.asin(t)}function l(t){return t>1?0:-1>t?I:Math.acos(t)}function u(t,e){var r=(2+P)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>L;n++){var o=Math.cos(e);e-=i=(e+Math.sin(e)*(o+2)-r)/(2*o*(1+o))}return[2/Math.sqrt(I*(4+I))*t*(1+Math.cos(e)),2*Math.sqrt(I/(4+I))*Math.sin(e)]}function c(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?f:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function p(t,e){return[3*t/(2*I)*Math.sqrt(I*I/3-e*e),e]}function d(t,e){return[t,1.25*Math.log(Math.tan(I/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>L&&--i>0);return e/2}}function g(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var o=s(i/e);return[n/(t*Math.cos(o)),s((2*o+Math.sin(2*o))/r)]},n}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/I),i=Math.floor(n),o=n-i,a=(r=N[i])[0],s=r[1],l=(r=N[++i])[0],u=r[1],c=(r=N[Math.min(19,++i)])[0],h=r[1];return[t*(l+o*(c-a)/2+o*o*(c-2*l+a)/2),(e>0?P:-P)*(u+o*(h-s)/2+o*o*(h-2*u+s)/2)]}function x(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=a(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function _(t,e){var r=b(t,e);return[(r[0]+t/P)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},M=[],A=[],k={point:function(t,e){M.push([t,e])},result:function(){var t=M.length?M.length<2?{type:"Point",coordinates:M[0]}:{type:"MultiPoint",coordinates:M}:null;return M=[],t}},T={lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){M.length&&(A.push(M),M=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},E={polygonStart:n,lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){var t=M.length;if(t){do M.push(M[0].slice());while(++t<4);A.push(M),M=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return o(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:T,MultiLineString:T,Polygon:E,MultiPolygon:E,Sphere:E},L=1e-6,z=L*L,I=Math.PI,P=I/2,C=(Math.sqrt(I),I/180),R=180/I,D=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=0>r?-1:1,i=l[+(0>r)],o=0,a=i.length-1;a>o&&t>i[o][2][0];++o);var s=e(t-i[o][1][0],r);return s[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],a=e(t[1][0],t[1][1])[1];return o>a&&(r=o,o=a,a=r),[[n,o],[i,a]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;i>n;++n){var a=l[0][n],s=180*a[0][0]/I,u=180*a[0][1]/I,c=180*a[1][1]/I,h=180*a[2][0]/I,f=180*a[2][1]/I;r.push(o([[s+e,u+e],[s+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var n=l[1].length-1;n>=0;--n){var a=l[1][n],s=180*a[0][0]/I,u=180*a[0][1]/I,c=180*a[1][1]/I,h=180*a[2][0]/I,f=180*a[2][1]/I;r.push(o([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function o(t,e){for(var r,n,i,o=-1,a=t.length,s=t[0],l=[];++ou;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function a(t,e){return Math.abs(t[0]-e[0])n)],o=l[+(0>n)],u=0,c=i.length;c>u;++u){var h=i[u];if(h[0][0]<=t&&tL&&--i>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]},(t.geo.naturalEarth=function(){return D(v)}).raw=v;var N=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];N.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/P,n=90*r,i=Math.min(18,Math.abs(n/5)),o=Math.max(0,Math.floor(i));do{var a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],u=l-a,c=l-2*s+a,h=2*(Math.abs(r)-s)/u,f=c/u,p=h*(1-f*h*(1-2*f*h));if(p>=0||1===o){n=(e>=0?5:-5)*(p+i);var d,m=50;do i=Math.min(18,Math.abs(n)/5),o=Math.floor(i),p=i-o,a=N[o][1],s=N[o+1][1],l=N[Math.min(19,o+2)][1],n-=(d=(e>=0?P:-P)*(s+p*(l-a)/2+p*p*(l-2*s+a)/2)-e)*R;while(Math.abs(d)>z&&--m>0);break}}while(--o>=0);var g=N[o][0],v=N[o+1][0],y=N[Math.min(19,o+2)][0];return[t/(v+p*(y-g)/2+p*p*(y-2*v+g)/2),n*C]},(t.geo.robinson=function(){return D(y)}).raw=y,x.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return D(x)}).raw=x,b.invert=function(t,e){if(!(t*t+4*e*e>I*I+L)){var r=t,n=e,i=25;do{var o,a=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),p=c*c,d=h*h,m=s*s,g=1-d*u*u,v=g?l(h*u)*Math.sqrt(o=1/g):o=0,y=2*v*h*s-t,x=v*c-e,b=o*(d*m+v*h*u*p),_=o*(.5*a*f-2*v*c*s),w=.25*o*(f*s-v*c*d*a),M=o*(p*u+v*m*h),A=_*w-M*b;if(!A)break;var k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return D(b)}).raw=b,_.invert=function(t,e){var r=t,n=e,i=25;do{var o,a=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=a*a,f=Math.sin(r),p=Math.cos(r/2),d=Math.sin(r/2),m=d*d,g=1-h*p*p,v=g?l(a*p)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*a*d+r/P)-t,x=.5*(v*s+n)-e,b=.5*o*(h*m+v*a*p*c)+.5/P,_=o*(f*u/4-v*s*d),w=.125*o*(u*d-v*s*h*f),M=.5*o*(c*p+v*m*a)+.5,A=_*w-M*b,k=(x*_-y*M)/A,T=(y*w-x*b)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return D(_)}).raw=_}e.exports=n},{}],635:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,a=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,p=n.range[1]-s,d=a.range[0]+s,m=a.range[1]-s,g=n._fullRange[0]+s,v=n._fullRange[1]-s,y=a._fullRange[0]+s,x=a._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var b=p-f,_=m-d,w=[f+b/2,d+_/2],M=r._rotate;r._center=[w[0]+M[0],w[1]+M[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var a,s,l,b,_=e.scale(),w=r._translate0,M=i(f,d,p,m),A=i(g,y,v,x);l=o(e,M),a=n(l),b=o(e,A),r._fullScale=n(b),e.scale(a),l=o(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=o(e,M),t._isAlbersUsa||e.clipExtent(l),a=r.scale*a,r._scale=a,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function o(t,e){return a.geo.path().projection(t).bounds(e)}var a=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":626,d3:90}],636:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?o:e._clipAngle?s:a)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function o(t,e){function r(){_.select(this).style(A)}function n(){a.scale(_.event.scale).translate(_.event.translate),t.render()}function o(){_.select(this).style(k)}var a=t.projection,s=i(a,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",o),s}function a(t,e){function r(t){return g.invert(t)}function n(t){var e=g(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function o(){_.select(this).style(A),l=_.mouse(this),u=g.rotate(),c=g.translate(),h=u,f=r(l)}function a(){return p=_.mouse(this),n(l)?(v.scale(g.scale()),void v.translate(g.translate())):(g.scale(_.event.scale),g.translate([c[0],_.event.translate[1]]),f?r(p)&&(m=r(p),d=[h[0]+(m[0]-f[0]),u[1],u[2]],g.rotate(d),h=d):(l=p,f=r(l)),void t.render())}function s(){_.select(this).style(k)}var l,u,c,h,f,p,d,m,g=t.projection,v=i(g,e),y=2;return v.on("zoomstart",o).on("zoom",a).on("zoomend",s),v}function s(t,e){function r(t){v++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function o(t){--v||t({type:"zoomend"})}var a,s=t.projection,p={r:s.rotate(),k:s.scale()},d=i(s,e),m=b(d,"zoomstart","zoom","zoomend"),v=0,y=d.on;return d.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,o=s.translate(),v=u(e);a=l(s,t),y.call(d,"zoom",function(){var r=_.mouse(this);if(s.scale(p.k=_.event.scale),a){if(l(s,r)){s.rotate(e).translate(o);var u=l(s,r),d=h(a,u),y=g(c(v,d)),x=p.r=f(y,a,i);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=i),s.rotate(x),i=x}}else t=r,a=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(k),y.call(d,"zoom",null),o(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(d,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&v(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),o=Math.cos(e),a=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[o*s*u+i*a*l,i*s*u-o*a*l,o*a*u+i*s*l,o*s*l-i*a*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return[r*a-n*s-i*l-o*u,r*s+n*a+i*u-o*l,r*l-n*u+i*a+o*s,r*u+n*l-i*s+o*a]}function h(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),o=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*o,-r[1]*o,r[0]*o]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,o,a=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,a)*M,d=Math.sqrt(a*a+s*s);Math.abs(c)>d?(o=(c>0?90:-90)-f,i=0):(o=Math.asin(c/d)*M-f,i=Math.sqrt(d*d-c*c));var g=180-o-2*f,v=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M,x=p(r[0],r[1],o,v),b=p(r[0],r[1],g,y);return b>=x?[o,v,r[2]]:[g,y,r[2]]}function p(t,e,r,n){var i=d(r-t),o=d(n-e);return Math.sqrt(i*i+o*o)}function d(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),o=0===e?1:0,a=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[o]=t[o]*s-t[a]*l,i[a]=t[a]*s+t[o]*l,i}function g(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function v(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;i>n;++n)r+=t[n]*e[n];return r}function x(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function b(t){for(var e=0,r=arguments.length,n=[];++ep;++p){for(e=u[p],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,d=0;2>=d;d+=2)this.labelEnable[p+d]=!1,this.labels[p+d]=a(n),this.labelColor[p+d]=s(r.titlefont.color),this.labelFont[p+d]=r.titlefont.family,this.labelSize[p+d]=r.titlefont.size,this.labelPad[p+d]=this.getLabelPad(e,r),this.tickEnable[p+d]=!1,this.tickColor[p+d]=s((r.tickfont||{}).color),this.tickAngle[p+d]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[p+d]=this.getTickPad(r),this.tickMarkLength[p+d]=0,this.tickMarkWidth[p+d]=r.tickwidth||0,this.tickMarkColor[p+d]=s(r.tickcolor),this.borderLineEnable[p+d]=!1,this.borderLineColor[p+d]=s(r.linecolor),this.borderLineWidth[p+d]=r.linewidth||0;c=this.hasSharedAxis(r),o=this.hasAxisInDfltPos(e,r)&&!c,l=this.hasAxisInAltrPos(e,r)&&!c,i=r.mirror||!1,h=c?-1!==String(i).indexOf("all"):!!i,f=c?"allticks"===i:-1!==String(i).indexOf("ticks"),o?this.labelEnable[p]=!0:l&&(this.labelEnable[p+2]=!0),o?this.tickEnable[p]=r.showticklabels:l&&(this.tickEnable[p+2]=r.showticklabels),(o||h)&&(this.borderLineEnable[p]=r.showline),(l||h)&&(this.borderLineEnable[p+2]=r.showline),(o||f)&&(this.tickMarkLength[p]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[p+2]=this.getTickMarkLength(r)),this.gridLineEnable[p]=r.showgrid,this.gridLineColor[p]=s(r.gridcolor),this.gridLineWidth[p]=r.gridwidth,this.zeroLineEnable[p]=r.zeroline,this.zeroLineColor[p]=s(r.zerolinecolor),this.zeroLineWidth[p]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=o.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=o.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":582,"../../lib/str2rgbarray":595,"../../plotly":604}],640:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),o=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/, +y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"gl2d"),a=0;ar;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var o=0;oa;++a,--s)for(var l=0;r>l;++l)for(var u=0;4>u;++u){var c=i[4*(r*a+l)+u];i[4*(r*a+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),p=f.createImageData(r,n);p.data.set(i),f.putImageData(p,0,0);var d;switch(t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(o),d},v.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.calcTicks(this.xaxis),s.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;r_;++_)m[_]=Math.min(m[_],b.bounds[_]),m[_+2]=Math.max(m[_+2],b.bounds[_+2]);for(y=0;2>y;++y)m[y]>m[y+2]&&(m[y]=-1,m[y+2]=1),v=this[g[y]],v._length=h.viewBox[y+2]-h.viewBox[y],s.doAutoRange(v);h.ticks=this.computeTickMarks();var w=this.xaxis.range,M=this.yaxis.range;h.dataBox=[w[0],M[0],w[1],M[1]],h.merge(r),n.update(h),this.glplot.draw()},v.updateTraces=function(t,e){var r,n,i,o=Object.keys(this.traces);t:for(r=0;rf;++f)a=a&&l[f]===s[f],l[f]=s[f];var p=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,a?!p:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),o=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var a=i();n._active.lookAt(a,r,o,e),n._active.lookAt(a+500,r,o,[0,0,1]),n._active.flush(a)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var p=0,d=0;return a(t,function(e,r,o,a){var s="rotate"===f.keyBindingMode,l="pan"===f.keyBindingMode,c="zoom"===f.keyBindingMode,h=!!a.control,m=!!a.alt,g=!!a.shift,v=!!(1&e),y=!!(2&e),x=!!(4&e),b=1/t.clientHeight,_=b*(r-p),w=b*(o-d),M=f.flipX?1:-1,A=f.flipY?1:-1,k=i(),T=Math.PI*f.rotateSpeed;if((s&&v&&!h&&!m&&!g||v&&!h&&!m&&g)&&n.rotate(k,M*T*_,-A*T*w,0),(l&&v&&!h&&!m&&!g||y||v&&h&&!m&&!g)&&n.pan(k,-f.translateSpeed*_*u,f.translateSpeed*w*u,0),c&&v&&!h&&!m&&!g||x||v&&!h&&m&&!g){var E=-f.zoomSpeed*w/window.innerHeight*(k-n.lastT())*100;n.pan(k,0,0,u*(Math.exp(E)-1))}return p=r,d=o,!0}),s(t,function(t,e){var r=f.flipX?1:-1,o=f.flipY?1:-1,a=i();if(Math.abs(t)>Math.abs(e))n.rotate(a,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*o*e/window.innerHeight*(a-n.lastT())/100;n.pan(a,0,0,u*(Math.exp(s)-1))}},!0),f}e.exports=n;var i=t("right-now"),o=t("3d-view"),a=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":22,"mouse-change":385,"mouse-wheel":387,"right-now":431}],643:[function(t,e,r){"use strict";function n(t,e){for(var r=0;3>r;++r){var n=s[r];e[n]._gd=t}}var i=t("./scene"),o=t("../plots"),a=t("../../constants/xmlns_namespaces"),s=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t._fullData,a=o.getSubplotIds(e,"gl3d");e._paperdiv.style({width:e.width+"px",height:e.height+"px"}),t._context.setBackground(t,e.paper_bgcolor);for(var s=0;sr;++r){var n=t[u[r]];e.labels[r]=a(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":582,"../../../lib/str2rgbarray":595,arraytools:28}],648:[function(t,e,r){"use strict";function n(t,e,r,n){for(var o=r("bgcolor"),l=i.combine(o,n.paper_bgcolor),u=Object.keys(a.camera),c=0;ce;++e){var r=t[a[e]];this.enabled[e]=r.showspikes,this.colors[e]=o(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":595}],651:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),o=0;oc;++c){var h=i[s[c]];if(h._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(h._length)===1/0)u[c]=[];else{h.range[0]=r[c].lo/t.dataScale[c],h.range[1]=r[c].hi/t.dataScale[c],h._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var p=h.nticks||o.Lib.constrain(h._length/40,4,9);o.Axes.autoTicks(h,Math.abs(h.range[1]-h.range[0])/p)}for(var d=o.Axes.calcTicks(h),m=0;mc;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var m=0;2>m;++m)e.bounds[m][c]=t.glplot.bounds[m][c]}t.contourLevels=n(u)}e.exports=i;var o=t("../../../plotly"),a=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":582,"../../../plotly":604}],652:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],653:[function(t,e,r){"use strict";function n(t){function e(e,r){if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return m.tickText(n,n.c2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),o=i.width,a=i.height;n.setAttributeNS(null,"viewBox","0 0 "+o+" "+a),n.setAttributeNS(null,"width",o),n.setAttributeNS(null,"height",a),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;co;++o)l=c[T[o]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(o=0;oa;++a)f[0][a]>f[1][a]?p[a]=1:f[1][a]===f[0][a]?p[a]=1:p[a]=1/(f[1][a]-f[0][a]);for(this.dataScale=p,o=0;oo;++o){if(l=c[T[o]],u=l.type,u in b?(b[u].acc*=p[o],b[u].count+=1):b[u]={acc:p[o],count:1},l.autorange){for(y[0][o]=1/0,y[1][o]=-(1/0),a=0;ay[1][o])y[0][o]=-1,y[1][o]=1;else{var M=y[1][o]-y[0][o];y[0][o]-=M/32,y[1][o]+=M/32}}else{var A=c[T[o]].range;y[0][o]=A[0],y[1][o]=A[1]}y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),x[o]=y[1][o]-y[0][o],this.glplot.bounds[0][o]=y[0][o]*p[o],this.glplot.bounds[1][o]=y[1][o]*p[o]}var k=[1,1,1];for(o=0;3>o;++o){l=c[T[o]],u=l.type;var E=b[u];k[o]=Math.pow(E.acc,1/E.count)/p[o]}var S,L=4;if("auto"===c.aspectmode)S=Math.max.apply(null,k)/Math.min.apply(null,k)<=L?k:[1,1,1];else if("cube"===c.aspectmode)S=[1,1,1];else if("data"===c.aspectmode)S=k;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=c.aspectratio;S=[z.x,z.y,z.z]}c.aspectratio.x=h.aspectratio.x=S[0],c.aspectratio.y=h.aspectratio.y=S[1],c.aspectratio.z=h.aspectratio.z=S[2],this.glplot.aspect=S;var I=c.domain||null,P=e._size||null;if(I&&P){var C=this.container.style;C.position="absolute",C.left=P.l+I.x[0]*P.w+"px",C.top=P.t+(1-I.y[1])*P.h+"px",C.width=P.w*(I.x[1]-I.x[0])+"px",C.height=P.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.setCameraToDefault=function(){this.setCamera({eye:{x:1.25,y:1.25,z:1.25},center:{x:0,y:0,z:0},up:{x:0,y:0,z:1}})},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){var e={};e[this.id]=t,this.glplot.camera.lookAt.apply(this,l(t)),this.graphDiv.emit("plotly_relayout",e)},k.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],o=["x","y","z"];return e[i[r]]&&t[i[r]][o[n]]===e[i[r]][o[n]]}var r=this.getCamera(),n=p.nestedProperty(t,this.id+".camera"),i=n.get(),o=!1;if(void 0===i)o=!0;else for(var a=0;3>a;a++)for(var s=0;3>s;s++)if(!e(r,i,a,s)){ +o=!0;break}return o&&n.set(r),o},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,a=n-1;a>o;++o,--a)for(var s=0;r>s;++s)for(var l=0;4>l;++l){var u=i[4*(r*o+s)+l];i[4*(r*o+s)+l]=i[4*(r*a+s)+l],i[4*(r*a+s)+l]=u}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),p=f.createImageData(r,n);p.data.set(i),f.putImageData(p,0,0);var d;switch(t){case"jpeg":d=h.toDataURL("image/jpeg");break;case"webp":d=h.toDataURL("image/webp");break;default:d=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),d},e.exports=o},{"../../lib":583,"../../lib/show_no_webgl_msg":593,"../../lib/str2rgbarray":595,"../../plots/cartesian/axes":607,"../../plots/cartesian/graph_interact":614,"../../plots/plots":663,"./camera":642,"./layout/convert":647,"./layout/spikes":650,"./layout/tick_marks":651,"./project":652,"./set_convert":654,"gl-plot3d":176}],654:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),i=function(){};e.exports=function(t){n.setConvert(t),t.setScale=i}},{"../cartesian/axes":607}],655:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("./font_attributes"),o=t("../components/color/attributes"),a=n.Lib.extendFlat;e.exports={font:{family:a({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},i.size,{dflt:12}),color:a({},i.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes",images:"Images",updatemenus:"UpdateMenus",ternary:"ternary",mapbox:"mapbox"}}},{"../components/color/attributes":497,"../plotly":604,"./font_attributes":625}],656:[function(t,e,r){"use strict";e.exports={styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",controlContainerClassName:"mapboxgl-control-container",noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),mapOnErrorMsg:"Mapbox error."}},{}],657:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],o=r[1],a=Array.isArray(e)?n.mean(e):e,s=.5+a/100,l=1.5+a/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(o){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}var h;return h=u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",{anchor:h,offset:c}}},{"../../lib":583}],658:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n0}function o(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function a(t){var e,r=t.sourcetype,n=t.source,i={type:r},o="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=o?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=a(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=o(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":583,"./convert_text_opts":657}],660:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,o=t("../font_attributes"),a=t("../../traces/scatter/attributes").textposition;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:!0,sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},o,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},a,{arrayOk:!1})}}}},{"../../components/color":498,"../../lib":583,"../../traces/scatter/attributes":771,"../font_attributes":625}],661:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return o.coerce(n,i,s.layers,t,e)}for(var n,i,a=t.layers||[],l=e.layers=[],u=0;u=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var a=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,a),s.text(a.text()&&u.text()?" - ":"")},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],s=t._fullData=[],l=t.data||[];p.supplyLayoutGlobalDefaults(i,n),n._dataLength=l.length,p.supplyDataDefaults(l,s,n),n._has=p._hasPlotType.bind(n);var u=n._modules;for(e=0;eo&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>a&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),a=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;return e.margin.autoexpand!==!1&&(l.base={l:{val:0,size:i},r:{val:1,size:o},t:{val:1,size:a},b:{val:0,size:s}},Object.keys(l).forEach(function(t){var r=l[t].l||{},n=l[t].b||{},c=r.val,h=r.size,f=n.val,p=n.size;Object.keys(l).forEach(function(t){if(u(h)&&l[t].r){var r=l[t].r.val,n=l[t].r.size;if(r>c){var d=(h*r+(n-e.width)*c)/(r-c),m=(n*(1-c)+(h-e.width)*(1-r))/(r-c);d>=0&&m>=0&&d+m>i+o&&(i=d,o=m)}}if(u(p)&&l[t].t){var g=l[t].t.val,v=l[t].t.size;if(g>f){var y=(p*g+(v-e.height)*f)/(g-f),x=(v*(1-f)+(p-e.height)*(1-g))/(g-f);y>=0&&x>=0&&y+x>s+a&&(s=y,a=x)}}})})),r.l=Math.round(i),r.r=Math.round(o),r.t=Math.round(a),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:c.plot(t)},p.graphJson=function(t,e,r,n,i){function o(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=o(t[e])}return i}return Array.isArray(t)?t.map(o):t&&t.getTime?h.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var a=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l={data:(a||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(l.layout=o(s)),t.framework&&t.framework.isPolar&&(l=t.framework.getConfig()),"object"===n?l:JSON.stringify(l)}},{"../components/color":498,"../lib":583,"../plotly":604,"./attributes":605,"./font_attributes":625,"./layout_attributes":655,d3:90,"fast-isnumeric":99}],664:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":771}],665:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return o({},e,r)}var i=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,a=o({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:a,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:a}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":578,"../cartesian/layout_attributes":616}],666:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),o=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},a=n.Lib.extendDeepAll;o.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var p=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),d=!1,m=p.map(function(t,e){return d=d||"undefined"!=typeof t.groupId,t});if(d){var g=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(m),v=[],y=g.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],v.push(r),r=o.util.sumArrays(t.r,r)}),t.values});p=i.merge(y)}p.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;x=Math.max(10,x);var b,_=[h.margin.left+x,h.margin.top+x];if(d){var w=i.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(v)));b=[0,w]}else b=i.extent(o.util.flattenArray(p.map(function(t,e){return t.r})));h.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),n=i.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:b).range([0,x]),c.layout.radialAxis.domain=n.domain();var M,A=o.util.flattenArray(p.map(function(t,e){return t.t})),k="string"==typeof A[0];k&&(A=o.util.deduplicate(A),M=A.slice(),A=i.range(A.length),p=p.map(function(t,e){var r=t;return t.t=[A],d&&(r.yStack=t.yStack),r}));var T=p.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===p.length,E=null===h.needsEndSpacing?k||!T:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0,L=S?h.angularAxis.domain:i.extent(A),z=Math.abs(A[1]-A[0]);T&&!k&&(z=0);var I=L.slice();E&&k&&(I[1]+=z);var P=h.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),h.angularAxis.ticksStep&&(P=(I[1]-I[0])/P);var C=h.angularAxis.ticksStep||(I[1]-I[0])/(P*(h.minorTicks+1));M&&(C=Math.max(Math.round(C),1)),I[2]||(I[2]=C);var R=i.range.apply(this,I);if(R=R.map(function(t,e){ +return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=E?z:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var D="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",O=(new DOMParser).parseFromString(D,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=i.select(j)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var V=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=F.node().getBBox();x=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],n.range([0,x]),c.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var G=[(h.width-(h.margin.left+h.margin.right+2*x+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(G[0]=Math.max(0,G[0]),G[1]=Math.max(0,G[1]),e.select(".outer-group").attr("transform","translate("+G+")"),h.title){var H=e.select("g.title-group text").style(U).text(h.title),X=H.node().getBBox();H.attr({x:_[0]-X.width/2,y:_[1]-x-20})}var Y=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var W=Y.selectAll("circle.grid-circle").data(n.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(B),W.attr("r",n),W.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(B);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);Y.call(Q).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Y.selectAll(".domain").style(B),Y.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var K=e.select(".angular.axis-group").selectAll("g.angular-tick").data(R),$=K.enter().append("g").classed("angular-tick",!0);K.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),K.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:h.minorTickColor}),K.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(U);var J=K.select("text.axis-text").attr({x:x+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),p[0]||et){var nt=[];p.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),ot=[];it.forEach(function(t,e){"unstacked"===t.key?ot=ot.concat(t.values.map(function(t,e){return[t]})):ot.push(t.values)}),ot.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var at,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!k){var pt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;pt.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ct.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var dt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(Z).radius;dt.attr({r:r}).style({opacity:.5}),st=n.invert(o.util.getMousePos(Z).radius);var i=o.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(o.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),a=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=a){n.attr({"data-fill":a}),s=i.hsl(a).darker().toString(),n.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),p=[h.left+h.width/2-G[0]-f.left,h.top+h.height/2-G[1]-f.top];ft.config({color:s}).text(c),ft.move(p)}else a=n.style("stroke"),n.attr({"data-stroke":a}),s=i.hsl(a).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,n,s,l={data:[],layout:{}},u={},c={},h=i.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return n},f.angularScale=function(t){return s},f.svg=function(){return e},i.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},o.util.dataFromEquation=function(t,e,r){var n=e||6,o=[],a=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);o.push(e),a.push(i)});var s={t:o,r:a};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],o={};return o.x=r,o.y=n,o.pos=e,o.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+n*n),o},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,o=t.length;o>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var o=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof o&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},o.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function o(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var a=!!e[0].data.yStack,l=e.map(function(t,e){return a?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,n,o){var a=e[o].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=a.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,a){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=o(n(s));return"translate("+[r.x,r.y]+")"}})};var f=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,n,o){var a=r[2]?l[o].map(function(t,e){return[t[0],t[1]+t[2]]}):l[o];if(i.select(this).each(h.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:g.stroke(r,n,o)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:f(a),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return g.fill(r,n,o)},"fill-opacity":0,stroke:function(t,e){return g.stroke(r,n,o)},"stroke-width":function(t,e){return g["stroke-width"](r,n,o)},"stroke-dasharray":function(t,e){return g["stroke-dasharray"](r,n,o)},opacity:function(t,e){return g.opacity(r,n,o)},display:function(t,e){return g.display(r,n,o)}})}};var p=t.angularScale.range(),d=Math.abs(p[1]-p[0])/l[0].length*Math.PI/180,m=i.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var g={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},v=i.select(this).selectAll("g.layer").data(l);v.enter().append("g").attr({"class":"layer"});var y=v.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(g).each(h[t.geometryType]),y.exit().remove(),v.exit().remove()})}var e,r=[o.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),a(r[e],o.PolyChart.defaultConfig()),a(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=i.merge(n);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),p=f.selectAll("svg").data([0]),d=p.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var m=i.range(o.length),g=i.scale[c?"linear":"ordinal"]().domain(m).range(l),v=i.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var x=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return g(e)}}),b.exit().remove()}var _=i.svg.axis().scale(v).orient("right"),w=p.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},i.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},o.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(o){var a=i.hsl(n.color).l,s=a>=.5?"#aaa":"white",c=a>=.5?"black":"white",h=o||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(h);var f=n.padding,p=e.node().getBBox(),d={fill:n.color,stroke:s,"stroke-width":"2px"},m=p.width+2*f+l,g=p.height+2*f;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[n.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-g/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return a(n,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};i.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":604,"./micropolar_manager":667,d3:90}],667:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),o=t("./undo_manager"),a=e.exports={},s=n.Lib.extendDeepAll;a.framework=function(t){function e(e,o){return o&&(h=o),i.select(i.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(h),t.data=r.data,t.layout=r.layout,a.fillLayout(t),r}var r,l,u,c,h,f=new o;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},a.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),o=t.framework&&t.framework.svg&&t.framework.svg(),a={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:o};t._fullLayout=s(a,t.layout)}},{"../../plotly":604,"./undo_manager":668,d3:90}],668:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return nm;m++){var g=p[m];s=t[g]?t[g]:t[g]={},e[g]=l={},a("domain."+f,[m/d,(m+1)/d]),a("domain."+{x:"y",y:"x"}[f]),o.id=g,h(s,l,a,o)}}},{"../lib":583,"./plots":663}],670:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"ternary"),a=0;a=a&&(p.min=0,d.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),o=t("../../subplot_defaults"),a=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:a,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":498,"../../subplot_defaults":669,"./axis_defaults":673,"./layout_attributes":675}],675:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":497,"./axis_attributes":672}],676:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){o.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var o=t("d3"),a=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,p=t("../cartesian/axes"),d=t("../../lib/filter_visible"),m=t("../../components/dragelement"),g=t("../../components/titles"),v=t("../cartesian/select"),y=t("../cartesian/constants"),x=t("../cartesian/graph_interact"); +e.exports=n;var b=n.prototype;b.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},b.plot=function(t,e){var r,n=this,i=e[n.id],o=e._size;l.getPlotDiv(n.plotContainer.node())!==n.graphDiv&&(n.init(n.graphDiv._fullLayout),n.makeFramework()),n.adjustLayout(i,o);var a=n.traceHash,s={};for(r=0;r_*y?(o=y,i=o*_):(i=v,o=i/_),a=m*i/v,s=g*o/y,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-d)-o/2,l.x0=r,l.y0=n,l.w=i,l.h=o,l.sum=x,l.xaxis={type:"linear",range:[b+2*M-x,x-b-2*w],domain:[p-a/2,p+a/2],_id:"x",_gd:l.graphDiv},h(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[b,x-w-M],domain:[d-s/2,d+s/2],_id:"y",_gd:l.graphDiv},h(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],k=l.aaxis=f({},t.aaxis,{range:[b,x-w-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+o+",-"+i/2});h(k);var T=l.baxis=f({},t.baxis,{range:[x-b-M,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+o});h(T),k._counteraxis=T;var E=l.caxis=f({},t.caxis,{range:[x-b-w,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+o+","+i/2});h(E);var S="M"+r+","+(n+o)+"h"+i+"l-"+i/2+",-"+o+"Z";l.clipDef.select("path").attr("d",S),l.layers.plotbg.select("path").attr("d",S);var L="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",L);var z="translate("+r+","+(n+o)+")";l.layers.baxis.attr("transform",z),l.layers.bgrid.attr("transform",z);var I="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var C=l.layers.axlines;C.select(".aline").attr("d",k.showline?"M"+r+","+(n+o)+"l"+i/2+",-"+o:"M0,0").call(u.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),C.select(".bline").attr("d",T.showline?"M"+r+","+(n+o)+"h"+i:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),C.select(".cline").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+o:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px")},b.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,o=e.baxis,a=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,o,!0),p.doTicks(r,a,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:a,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",A="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",k="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;b.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();b=e-n.left,w=r-n.top,S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},z=S,L=O.aaxis.range[1]-S.a,I=a(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),P="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",C=!1,R=N.append("path").attr("class","zoombox").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",P),D=N.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),d()}function e(t,e){return 1-e/O.h}function r(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function n(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function o(t,i){var o=b+t,a=w+i,s=Math.max(0,Math.min(1,e(b,w),e(o,a))),l=Math.max(0,Math.min(1,r(b,w),r(o,a))),u=Math.max(0,Math.min(1,n(b,w),n(o,a))),c=(s/2+u)*O.w,h=(1-s/2-l)*O.w,f=(c+h)/2,p=h-c,d=(1-s)*O.h,m=d-p/_;p.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),D.transition().style("opacity",1).duration(200),C=!0)}function c(t,e){if(z===S)return 2===e&&g(),i(F);i(F);var r={};r[O.id+".aaxis.min"]=z.a,r[O.id+".baxis.min"]=z.b,r[O.id+".caxis.min"]=z.c,s.relayout(F,r),E&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),E=!1)}function h(){S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},z=S}function f(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m;z={a:S.a-n,b:S.b+(r+n)/2,c:S.c-(r-n)/2};var i=[z.a,z.b,z.c].sort(),o={a:i.indexOf(z.a),b:i.indexOf(z.b),c:i.indexOf(z.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),z={a:i[o.a],b:i[o.b],c:i[o.c]},e=(S.a-z.a)*O.yaxis._m,t=(S.c-z.c-S.b+z.b)*O.xaxis._m);var a="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",a),O.aaxis.range=[z.a,O.sum-z.b-z.c],O.baxis.range=[O.sum-z.a-z.c,z.b],O.caxis.range=[O.sum-z.a-z.b,z.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1)}function p(t,e){if(t){var r={};r[O.id+".aaxis.min"]=z.a,r[O.id+".baxis.min"]=z.b,r[O.id+".caxis.min"]=z.c,s.relayout(F,r)}else 2===e&&g()}function d(){O.plotContainer.selectAll(".select-outline").remove()}function g(){var t={};t[O.id+".aaxis.min"]=0,t[O.id+".baxis.min"]=0,t[O.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),s.relayout(F,t)}var b,w,S,L,z,I,P,C,R,D,O=this,j=O.layers.plotbg.select("path").node(),F=O.graphDiv,N=O.layers.zoom,B={element:j,gd:F,plotinfo:{plot:N},doubleclick:g,subplot:O.id,prepFn:function(e,r,n){B.xaxes=[O.xaxis],B.yaxes=[O.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=o,B.doneFn=c,t(e,r,n)):"pan"===i?(B.moveFn=f,B.doneFn=p,h(),d()):"select"!==i&&"lasso"!==i||v(e,r,n,B,i)}};j.onmousemove=function(t){x.hover(F,t,O.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=O.id},j.onmouseout=function(t){F._dragging||m.unhover(F,t)},j.onclick=function(t){x.click(F,t)},m.init(B)}},{"../../components/color":498,"../../components/dragelement":519,"../../components/drawing":521,"../../components/titles":561,"../../lib":583,"../../lib/extend":578,"../../lib/filter_visible":579,"../../plotly":604,"../cartesian/axes":607,"../cartesian/constants":612,"../cartesian/graph_interact":614,"../cartesian/select":620,"../cartesian/set_convert":621,d3:90,tinycolor2:461}],677:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var o=t("../plotly"),a=o.Lib.extendFlat,s=o.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),h=s({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;rl;l++)n(r[l])&&p.push({p:r[l],s:s[l],b:0});return o(e,"marker")&&a(e,e.marker.color,"marker","c"),o(e,"marker.line")&&a(e,e.marker.line.color,"marker.line","c"),p}},{"../../components/colorscale/calc":505,"../../components/colorscale/has_colorscale":511,"../../plots/cartesian/axes":607,"fast-isnumeric":99}],687:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),o=t("../scatter/xy_defaults"),a=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=o(t,e,c);return h?(c("orientation",e.x&&!e.y?"h":"v"),c("text"),a(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),void s(t,e,i.defaultLine,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/color":498,"../../components/errorbars/defaults":526,"../../lib":583,"../bar/style_defaults":695,"../scatter/xy_defaults":792,"./attributes":685}],688:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,r,a){var s,l=t.cd,u=l[0].trace,c=l[0].t,h=t.xa,f=t.ya,p="closest"===a?c.barwidth/2:c.dbar*(1-h._gd._fullLayout.bargap)/2;s="closest"!==a?function(t){return t.p}:"h"===u.orientation?function(t){return t.y}:function(t){return t.x};var d,m;"h"===u.orientation?(d=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},m=function(t){var e=s(t)-r;return n.inbox(e-p,e+p)}):(m=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},d=function(t){var r=s(t)-e;return n.inbox(r-p,r+p)});var g=n.getDistanceFunction(a,d,m);if(n.getClosest(l,g,t),t.index!==!1){var v=l[t.index],y=v.mcc||u.marker.color,x=v.mlcc||u.marker.line.color,b=v.mlw||u.marker.line.width;return o.opacity(y)?t.color=y:o.opacity(x)&&b&&(t.color=x),"h"===u.orientation?(t.x0=t.x1=h.c2p(v.x,!0),t.xLabelVal=v.s,t.y0=f.c2p(s(v)-p,!0),t.y1=f.c2p(s(v)+p,!0),t.yLabelVal=v.p):(t.y0=t.y1=f.c2p(v.y,!0),t.yLabelVal=v.s,t.x0=h.c2p(s(v)-p,!0),t.x1=h.c2p(s(v)+p,!0),t.xLabelVal=v.p),v.tx&&(t.text=v.tx),i.hoverInfo(v,u,t),[t]}}},{"../../components/color":498,"../../components/errorbars":527,"../../plots/cartesian/graph_interact":614}],689:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../scatter/colorbar":774,"./arrays_to_calcdata":684,"./attributes":685,"./calc":686,"./defaults":687,"./hover":688,"./layout_attributes":690,"./layout_defaults":691,"./plot":692,"./set_positions":693,"./style":694}],690:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],691:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return o.coerce(t,e,a,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var f,p,d,m;if("h"===s.orientation?(d=c.c2p(r.poffset+e.p,!0),m=c.c2p(r.poffset+e.p+r.barwidth,!0),f=u.c2p(e.b,!0),p=u.c2p(e.s+e.b,!0)):(f=u.c2p(r.poffset+e.p,!0),p=u.c2p(r.poffset+e.p+r.barwidth,!0),m=c.c2p(e.s+e.b,!0),d=c.c2p(e.b,!0)),!(i(f)&&i(p)&&i(d)&&i(m)&&f!==p&&d!==m))return void n.select(this).remove();var g=(e.mlw+1||s.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,v=n.round(g/2%1,2);if(!t._context.staticPlot){var y=a.opacity(e.mc||s.marker.color),x=1>y||g>.01?o:l;f=x(f,p),p=x(p,f),d=x(d,m),m=x(m,d)}n.select(this).attr("d","M"+f+","+d+"V"+m+"H"+p+"V"+d+"Z")})}),f.call(s.plot,e)}},{"../../components/color":498,"../../components/errorbars":527,"../../lib":583,"./arrays_to_calcdata":684,d3:90,"fast-isnumeric":99}],693:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,s,l=t._fullLayout,u=e.x(),c=e.y();["v","h"].forEach(function(h){function f(e){function r(t){t[d]=t.p+f}var n=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){n.push(t.p)})});var i=a.distinctVals(n),s=i.vals,u=i.minDiff,c=!1,h=[];"group"===l.barmode&&e.forEach(function(e){c||(t.calcdata[e].forEach(function(t){c||h.forEach(function(e){Math.abs(t.p-e)_&&(L=!0,k=_),_>A+C&&(L=!0,A=_))}o.expand(v,[k,A],{tozero:!0,padded:L})}else{var R=function(t){return t[m]=t.s,t.s};for(r=0;r1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,a=r.line,s=(e._input||{}).marker||{},l=o.tryColorscale(r,s,""),u=o.tryColorscale(r,s,"line.");n.select(this).selectAll("path").each(function(t){var e,o,s=(t.mlw+1||a.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",s+"px").call(i.fill,e),s&&(o="mlc"in t?t.mlcc=u(t.mlc):Array.isArray(a.color)?i.defaultLine:a.color,c.call(i.stroke,o))})}),e.call(a.style)}},{"../../components/color":498,"../../components/drawing":521,"../../components/errorbars":527,d3:90}],695:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,s){r("marker.color",a),i(t,"marker")&&o(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&o(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":498,"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511}],696:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat,a=n.marker,s=a.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:o({},a.symbol,{arrayOk:!1}),opacity:o({},a.opacity,{arrayOk:!1,dflt:1}),size:o({},a.size,{arrayOk:!1}),color:o({},a.color,{arrayOk:!1}),line:{color:o({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:o({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":497,"../../lib/extend":578,"../scatter/attributes":771}],697:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),o=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,o,a){var s;return r in e?d=o.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===o.type||n(e.name)&&-1!==["linear","log"].indexOf(o.type)||i.isDateTime(e.name)&&"date"===o.type)?e.name:t.numboxes,s=o.d2c(s),d=a.map(function(){return s})),d}function a(t,e,r,o,a){var s,l,u,c,h=o.length,f=e.length,p=[],d=[];for(s=0;h>s;++s)l=o[s],t[s]={pos:l},d[s]=l-a,p[s]=[];for(d.push(o[h-1]+a),s=0;f>s;++s)c=e[s],n(c)&&(u=i.findBin(r[s],d),u>=0&&f>u&&p[u].push(c));return p}function s(t,e){var r,n,o,a;for(a=0;a1,v=r.dPos*(1-f.boxgap)*(1-f.boxgroupgap)/(g?t.numboxes:1),y=g?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-f.boxgap):0,x=v*m.whiskerwidth;return m.visible!==!0||r.emptybox?void o.select(this).remove():("h"===m.orientation?(l=d,h=p):(l=p,h=d),r.bPos=y,r.bdPos=v,n(),o.select(this).selectAll("path.box").data(a.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=l.c2p(t.pos+y-x,!0),s=l.c2p(t.pos+y+x,!0),u=h.c2p(t.q1,!0),c=h.c2p(t.q3,!0),f=a.constrain(h.c2p(t.med,!0),Math.min(u,c)+1,Math.max(u,c)-1),p=h.c2p(m.boxpoints===!1?t.min:t.lf,!0),d=h.c2p(m.boxpoints===!1?t.max:t.uf,!0);"h"===m.orientation?o.select(this).attr("d","M"+f+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+c+"V"+r+"ZM"+u+","+e+"H"+p+"M"+c+","+e+"H"+d+(0===m.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+d+","+i+"V"+s)):o.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+u+"H"+n+"V"+c+"H"+r+"ZM"+e+","+u+"V"+p+"M"+e+","+c+"V"+d+(0===m.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+d+"H"+s))}),m.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=m}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,o,s,l,h,f="all"===m.boxpoints?t.val:t.val.filter(function(e){return et.uf}),p=(t.q3-t.q1)*c,d=[],g=0;if(m.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,p,d),void(m.boxmean&&o.select(this).selectAll("path.mean").data(a.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-v,!0),n=l.c2p(t.pos+y+v,!0),i=h.c2p(t.mean,!0),a=h.c2p(t.mean-t.sd,!0),s=h.c2p(t.mean+t.sd,!0);"h"===m.orientation?o.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==m.boxmean?"":"m0,0L"+a+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):o.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==m.boxmean?"":"m0,0L"+e+","+a+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":521,"../../lib":583,d3:90}],704:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports=function(t,e){var r,a,s,l,u=t._fullLayout,c=e.x(),h=e.y(),f=["v","h"];for(a=0;al&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,a,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===a._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":706}],709:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot").plot,n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":628,"../heatmap/colorbar":723,"./attributes":706,"./calc":707,"./defaults":708,"./plot":710}],710:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return a.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var i="all"===n?g.hoverinfo.flags:n.split("+"),o=-1!==i.indexOf("name"),s=-1!==i.indexOf("location"),l=-1!==i.indexOf("z"),u=-1!==i.indexOf("text"),c=!o&&s;return function(t){var n=[];c?t.nameLabel=t.id:(o&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("
")}}function i(t){return function(e,r){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:r,location:e.id,z:e.z}]}}}var o=t("d3"),a=t("../../plots/cartesian/axes"),s=t("../../plots/cartesian/graph_interact"),l=t("../../components/color"),u=t("../../components/drawing"),c=t("../../components/colorscale/get_scale"),h=t("../../components/colorscale/make_scale_function"),f=t("../../lib/topojson_utils").getTopojsonFeatures,p=t("../../lib/geo_location_utils").locationToFeature,d=t("../../lib/array_to_calc_item"),m=t("../../plots/geo/constants"),g=t("./attributes"),v=e.exports={};v.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,o=i.length,a=f(t,e),s=(t.marker||{}).line||{},l=0;o>l;l++)r=p(t.locationmode,i[l],a),void 0!==r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),d(s.color,r,"mlc",l),d(s.width,r,"mlw",l),n.push(r));return n.length>0&&(n[0].trace=t),n},v.plot=function(t,e,r){var a,l=t.framework,u=l.select("g.choroplethlayer"),c=l.select("g.baselayer"),h=l.select("g.baselayeroverchoropleth"),f=m.baseLayersOverChoropleth,p=u.selectAll("g.trace.choropleth").data(e,function(t){return t.uid});p.enter().append("g").attr("class","trace choropleth"),p.exit().remove(),p.each(function(e){function r(e,r){if(t.showHover){var n=t.projection(e.properties.ct);u(e),s.loneHover({x:n[0],y:n[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()}),h=c(e,r),t.graphDiv.emit("plotly_hover",h)}}function a(e,r){t.graphDiv.emit("plotly_click",c(e,r))}var l=v.calcGeoJSON(e,t.topojson),u=n(t,e),c=i(e),h=null,f=o.select(this).selectAll("path.choroplethlocation").data(l);f.enter().append("path").classed("choroplethlocation",!0).on("mouseover",r).on("click",a).on("mouseout",function(){s.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",h)}).on("mousedown",function(){s.loneUnhover(t.hoverContainer)}).on("mouseup",r),f.exit().remove()}),h.selectAll("*").remove();for(var d=0;dr;r++)e=h[r],p[r]=e[0]*(t.zmax-t.zmin)+t.zmin,d[r]=e[1];var m=n.extent([t.zmin,t.zmax,o.start,o.start+l*(u-1)]),g=m[t.zminr;r++)e=h[r],p[r]=(e[0]*(u+c-1)-c/2)*l+a,d[r]=e[1];var y=n.scale.linear().interpolate(n.interpolateRgb).domain(p).range(d);return y}},{"../../components/colorscale/get_scale":510,d3:90}],718:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,o=r[0].x,s=r[0].y,u=n.contours,c=n.uid,h=e.x(),f=e.y(),g=t._fullLayout,x="contour"+c,b=i(u,e,r[0]);if(n.visible!==!0)return g._paper.selectAll("."+x+",.hm"+c).remove(),void g._infolayer.selectAll(".cb"+c).remove();"heatmap"===u.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=u.start-u.size/2,n._input.zmax=n.zmax=n.zmin+b.length*u.size),M(t,e,[r])):g._paper.selectAll(".hm"+c).remove(),a(b),l(b);var _=h.c2p(o[0],!0),w=h.c2p(o[o.length-1],!0),A=f.c2p(s[0],!0),k=f.c2p(s[s.length-1],!0),T=[[_,k],[w,k],[w,A],[_,A]],E=p(e,r,x);d(E,T,u),m(E,b,T,u),v(E,b,u),y(E,e,r[0],T)}function i(t,e,r){for(var n=t.size||1,i=[],o=t.start;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function a(t){var e,r,n,i,a,s,l,u,c,h=t[0].z,f=h.length,p=h[0].length,d=2===f||2===p;for(r=0;f-1>r;r++)for(i=[],0===r&&(i=i.concat(A)),r===f-2&&(i=i.concat(k)),e=0;p-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(T)),e===p-2&&(n=n.concat(E)),a=e+","+r,s=[[h[r][e],h[r][e+1]],[h[r+1][e],h[r+1][e+1]]],c=0;ci;i++){if(s>20?(s=L[s][(l[0]||l[1])<0?0:1],t.crossings[a]=z[s]):delete t.crossings[a],l=S[s],!l){_.log("Found bad marching index:",s,e,t.level);break}if(p.push(f(t,e,l)),e[0]+=l[0],e[1]+=l[1],c(p[p.length-1],p[p.length-2])&&p.pop(),a=e.join(","),a===o&&l.join(",")===d||r&&(l[0]&&(e[0]<0||e[0]>g-2)||l[1]&&(e[1]<0||e[1]>m-2)))break;s=t.crossings[a]}1e4===i&&_.log("Infinite loop in contour?");var v,y,x,b,w,M,A,k=c(p[0],p[p.length-1]),T=0,E=.2*t.smoothing,I=[],P=0;for(i=1;i=P;i--)if(v=I[i],C>v){for(x=0,y=i-1;y>=P&&v+I[y]x&&v+I[x]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&_.log("Infinite loop in contour?")}}function u(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==A.indexOf(t)?i=1:-1!==T.indexOf(t)?n=1:-1!==k.indexOf(t)?i=-1:n=-1,[n,i]}function c(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function h(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function f(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),o=t.z[i][n],a=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-o)/(t.z[i][n+1]-o);return[a.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-o)/(t.z[i+1][n]-o);return[a.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}function p(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function d(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function m(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var o=i.selectAll("path").data("fill"===n.coloring?e:[]);o.enter().append("path"),o.exit().remove(),o.each(function(t){var e=g(t,r);e?b.select(this).attr("d",e).style("stroke","none"):b.select(this).remove()})}function g(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function o(t){return Math.abs(t[0]-e[2][0])<.01}for(var a,s,l,u,c,h,f=t.edgepaths.length||t.z[0][0]l;l++){if(!a){_.log("Missing end?",p,t);break}for(r(a)&&!o(a)?s=e[1]:i(a)?s=e[0]:n(a)?s=e[3]:o(a)&&(s=e[2]),c=0;c=0&&(s=g,u=c):Math.abs(a[1]-s[1])<.01?Math.abs(a[1]-g[1])<.01&&(g[0]-a[0])*(s[0]-g[0])>=0&&(s=g,u=c):_.log("endpt to newendpt is not vert. or horz.",a,s,g)}if(a=s,u>=0)break;f+="L"+s}if(u===t.edgepaths.length){_.log("unclosed perimeter path");break}p=u,m=-1===d.indexOf(p),m&&(p=d[0],f+="Z")}for(p=0;pe;e++)s.push(1);for(e=0;o>e;e++)i.push(s.slice());for(e=0;ea;a++)for(n=i(l,a),c[a]=new Array(n),s=0;n>s;s++)c[a][s]=e(o(l,a,s));return c}function i(t,e,r,n,i,o){var a,s,l,u=[],c=f.traceIs(t,"contour"),h=f.traceIs(t,"histogram"),p=f.traceIs(t,"gl2d"),d=Array.isArray(e)&&e.length>1;if(d&&!h&&"category"!==o.type){e=e.map(o.d2c);var m=e.length;if(!(i>=m))return c?e.slice(0,i):e.slice(0,i+1);if(c||p)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;m>l;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[m-1]-.5*e[m-2])}if(i>m){var g=u[u.length-1],v=g-u[u.length-2];for(l=m;i>l;l++)g+=v,u.push(g)}}else for(s=n||1,a=h||"category"===o.type?r||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r),l=c||p?0:-.5;i>l;l++)u.push(a+s*l);return u}function o(t){return.5-.25*Math.min(1,.5*t)}function a(t,e,r){var n,i,a=1;if(Array.isArray(r))for(n=0;nn&&a>y;n++)a=l(t,e,o(a));return a>y&&c.log("interp2d didn't converge quickly",a),t}function s(t){var e,r,n,i,o,a,s,l,u=[],c={},h=[],f=t[0],p=[],d=[0,0,0],m=v(t);for(r=0;rn;n++)void 0===p[n]&&(a=(void 0!==p[n-1]?1:0)+(void 0!==p[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==f[n]?1:0),a?(0===r&&a++,0===n&&a++,r===t.length-1&&a++,n===p.length-1&&a++,4>a&&(c[[r,n]]=[r,n,a]),u.push([r,n,a])):h.push([r,n]));for(;h.length;){for(s={},l=!1,o=h.length-1;o>=0;o--)i=h[o],r=i[0],n=i[1],a=((c[[r-1,n]]||d)[2]+(c[[r+1,n]]||d)[2]+(c[[r,n-1]]||d)[2]+(c[[r,n+1]]||d)[2])/20,a&&(s[i]=[r,n,a],h.splice(o,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}function l(t,e,r){var n,i,o,a,s,l,u,c,h,f,p,d,m,g=0;for(a=0;as;s++)l=x[s],u=t[i+l[0]],u&&(c=u[o+l[1]],void 0!==c&&(0===f?d=m=c:(d=Math.min(d,c),m=Math.max(m,c)),h++,f+=c));if(0===h)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=f/h,void 0===p?4>h&&(g=1):(t[i][o]=(1+r)*t[i][o]-r*p,m>d&&(g=Math.max(g,Math.abs(t[i][o]-p)/(m-d))))}return g}var u=t("fast-isnumeric"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../../plots/plots"),p=t("../histogram2d/calc"),d=t("../../components/colorscale/calc"),m=t("./has_columns"),g=t("./convert_column_xyz"),v=t("./max_row_length");e.exports=function(t,e){function r(t){S=e._input.zsmooth=e.zsmooth=!1,c.notifier("cannot fast-zsmooth: "+t)}var o,l,u,y,x,b,_,w,M=h.getFromId(t,e.xaxis||"x"),A=h.getFromId(t,e.yaxis||"y"),k=f.traceIs(e,"contour"),T=f.traceIs(e,"histogram"),E=f.traceIs(e,"gl2d"),S=k?"best":e.zsmooth;if(M._minDtick=0,A._minDtick=0,T){var L=p(t,e);o=L.x,l=L.x0,u=L.dx,y=L.y,x=L.y0,b=L.dy,_=L.z}else m(e)&&g(e,M,A),o=e.x?M.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],l=e.x0||0,u=e.dx||1,x=e.y0||0,b=e.dy||1,_=n(e),(k||e.connectgaps)&&(e._emptypoints=s(_),e._interpz=a(_,e._emptypoints,e._interpz));if("fast"===S)if("log"===M.type||"log"===A.type)r("log axis found");else if(!T){if(o.length){var z=(o[o.length-1]-o[0])/(o.length-1),I=Math.abs(z/100);for(w=0;wI){r("x scale is not linear");break}}if(y.length&&"fast"===S){var P=(y[y.length-1]-y[0])/(y.length-1),C=Math.abs(P/100);for(w=0;wC){r("y scale is not linear");break}}}var R=v(_),D="scaled"===e.xtype?"":e.x,O=i(e,D,l,u,R,M),j="scaled"===e.ytype?"":e.y,F=i(e,j,x,b,_.length,A);E||(h.expand(M,O),h.expand(A,F));var N={x:O,y:F,z:_};if(d(e,_,"","z"),k&&e.contours&&"heatmap"===e.contours.coloring){var B="contour"===e.type?"heatmap":"histogram2d";N.xfill=i(B,D,l,u,R,M),N.yfill=i(B,j,x,b,_.length,A)}return[N]};var y=.01,x=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":505,"../../lib":583,"../../plots/cartesian/axes":607,"../../plots/plots":663,"../histogram2d/calc":734,"./convert_column_xyz":724,"./has_columns":726,"./max_row_length":729,"fast-isnumeric":99}],723:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u="cb"+r.uid,c=s(r.colorscale),h=r.zmin,f=r.zmax;if(i(h)||(h=o.aggNums(Math.min,null,r.z)),i(f)||(f=o.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+u).remove(),!r.showscale)return void a.autoMargin(t,u);var p=e[0].t.cb=l(t,u);p.fillcolor(n.scale.linear().domain(c.map(function(t){return h+t[0]*(f-h)})).range(c.map(function(t){return t[1]}))).filllevels({start:h,end:f,size:(f-h)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":501,"../../components/colorscale/get_scale":510,"../../lib":583,"../../plots/plots":663,d3:90,"fast-isnumeric":99}],724:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,o=t.x.slice(),a=t.y.slice(),s=t.z,l=t.text,u=Math.min(o.length,a.length,s.length),c=void 0!==l&&!Array.isArray(l[0]);for(ui;i++)o[i]=e.d2c(o[i]),a[i]=r.d2c(a[i]);var h,f,p,d=n.distinctVals(o),m=d.vals,g=n.distinctVals(a),v=g.vals,y=n.init2dArray(v.length,m.length);for(c&&(p=n.init2dArray(v.length,m.length)),i=0;u>i;i++)h=n.findBin(o[i]+d.minDiff/2,m),f=n.findBin(a[i]+g.minDiff/2,v),y[f][h]=s[i],c&&(p[f][h]=l[i]);t.x=m,t.y=v,t.z=y,c&&(t.text=p)}},{"../../lib":583}],725:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),o=t("./xyz_defaults"),a=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=o(t,e,u);return c?(u("text"),u("zsmooth"),u("connectgaps",i(e)&&e.zsmooth!==!1),void a(t,e,l,u,{prefix:"",cLetter:"z"})):void(e.visible=!1)}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":721,"./has_columns":726,"./xyz_defaults":732}],726:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],727:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib"),o=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,r,a,s){if(!(t.distancec||c>=y[0].length||0>h||h>y.length)return}else{if(n.inbox(e-g[0],e-g[g.length-1])>o||n.inbox(r-v[0],r-v[v.length-1])>o)return;if(s){var M;for(b=[2*g[0]-g[1]],M=1;M0;)_=g.c2p(z[k]),k--;for(b>_&&(w=_,_=b,b=w,O=!0),k=0;void 0===M&&k0;)A=v.c2p(I[k]),k--;if(M>A&&(w=M,M=A,A=w,j=!0),P&&(z=r[0].xfill,I=r[0].yfill),"fast"!==C){var F="best"===C?0:.5;b=Math.max(-F*g._length,b),_=Math.min((1+F)*g._length,_),M=Math.max(-F*v._length,M),A=Math.min((1+F)*v._length,A)}var N=Math.round(_-b),B=Math.round(A-M),U=0>=N||0>=B,V=e.plot.select(".imagelayer").selectAll("g.hm."+x).data(U?[]:[0]);if(V.enter().append("g").classed("hm",!0).classed(x,!0),V.exit().remove(),!U){var q,G;"fast"===C?(q=D,G=R):(q=N,G=B);var H=document.createElement("canvas");H.width=q,H.height=G;var X,Y,W=H.getContext("2d"),Z=i.scale.linear().domain(L.map(function(t){return t[0]})).range(L.map(function(t){var e=o(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===C?(X=O?function(t){return D-1-t}:a.identity,Y=j?function(t){return R-1-t}:a.identity):(X=function(t){return a.constrain(Math.round(g.c2p(z[t])-b),0,N)},Y=function(t){return a.constrain(Math.round(v.c2p(I[t])-M),0,B)});var Q,K,$,J,tt,et,rt=Y(0),nt=[rt,rt],it=O?0:1,ot=j?0:1,at=0,st=0,lt=0,ut=0;if(C){var ct=0,ht=new Uint8Array(N*B*4);if("best"===C){var ft,pt,dt,mt=new Array(z.length),gt=new Array(I.length),vt=new Array(N);for(k=0;kk;k++)vt[k]=n(k,mt);for(K=0;B>K;K++)for(ft=n(K,gt),pt=T[ft.bin0],dt=T[ft.bin1],k=0;N>k;k++,ct+=4)et=p(pt,dt,vt[k],ft),f(ht,ct,et)}else for(K=0;R>K;K++)for(tt=T[K],nt=Y(K),k=0;N>k;k++)et=h(tt[k],1),ct=4*(nt*N+X(k)),f(ht,ct,et);var yt=W.createImageData(N,B);yt.data.set(ht),W.putImageData(yt,0,0)}else for(K=0;R>K;K++)if(tt=T[K],nt.reverse(),nt[ot]=Y(K+1),nt[0]!==nt[1]&&void 0!==nt[0]&&void 0!==nt[1])for($=X(0),Q=[$,$],k=0;D>k;k++)Q.reverse(),Q[it]=X(k+1),Q[0]!==Q[1]&&void 0!==Q[0]&&void 0!==Q[1]&&(J=tt[k],et=h(J,(Q[1]-Q[0])*(nt[1]-nt[0])),W.fillStyle="rgba("+et.join(",")+")",W.fillRect(Q[0],nt[0],Q[1]-Q[0],nt[1]-nt[0]));st=Math.round(st/at),lt=Math.round(lt/at),ut=Math.round(ut/at);var xt=o("rgb("+st+","+lt+","+ut+")");t._hmpixcount=(t._hmpixcount||0)+at,t._hmlumcount=(t._hmlumcount||0)+at*xt.getLuminance();var bt=V.selectAll("image").data(r);bt.enter().append("svg:image").attr({xmlns:u.svg,preserveAspectRatio:"none"}),bt.attr({height:B,width:N,x:b,y:M,"xlink:href":H.toDataURL("image/png")}),bt.exit().remove()}}var i=t("d3"),o=t("tinycolor2"),a=t("../../lib"),s=t("../../plots/plots"),l=t("../../components/colorscale/get_scale"),u=t("../../constants/xmlns_namespaces"),c=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i0&&(n=!0);for(var s=0;sv&&d.splice(v,d.length-v),g.length>v&&g.splice(v,g.length-v),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(d,p,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(g,m,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),h=[];var y,x,b=[],_=[],w="string"==typeof e.xbins.size?[]:e.xbins,M="string"==typeof e.xbins.size?[]:e.ybins,A=0,k=[],T=e.histnorm,E=e.histfunc,S=-1!==T.indexOf("density"),L="max"===E||"min"===E,z=L?null:0,I=o.count,P=a[T],C=!1,R=[],D=[],O="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";O&&"count"!==E&&(C="avg"===E,I=o[E]);var j=e.xbins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6;for(f=j.start;F>f;f=i.tickIncrement(f,j.size))b.push(z),Array.isArray(w)&&w.push(f),C&&_.push(0);Array.isArray(w)&&w.push(f);var N=b.length;for(r=e.xbins.start,l=(f-r)/N,r+=l/2,j=e.ybins,F=j.end+(j.start-i.tickIncrement(j.start,j.size))/1e6,f=j.start;F>f;f=i.tickIncrement(f,j.size))h.push(b.concat()),Array.isArray(M)&&M.push(f),C&&k.push(_.concat());Array.isArray(M)&&M.push(f);var B=h.length;for(u=e.ybins.start,c=(f-u)/B,u+=c/2,S&&(R=b.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/l}),D=h.map(function(t,e){return Array.isArray(M)?1/(M[e+1]-M[e]):1/c})),f=0;v>f;f++)y=n.findBin(d[f],w),x=n.findBin(g[f],M),y>=0&&N>y&&x>=0&&B>x&&(A+=I(y,f,h[x],O,k[x]));if(C)for(x=0;B>x;x++)A+=s(h[x],k[x]);if(P)for(x=0;B>x;x++)P(h[x],A,R,D[x]);return{x:d,x0:r,dx:l,y:g,y0:u,dy:c,z:h}}},{"../../lib":583,"../../plots/cartesian/axes":607,"../histogram/average":742,"../histogram/bin_functions":744,"../histogram/norm_functions":748}],735:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),o=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r){function s(r,i){return n.coerce(t,e,a,r,i)}i(t,e,s),s("zsmooth"),o(t,e,r,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":733,"./sample_defaults":737}],736:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../heatmap/calc":722,"../heatmap/colorbar":723,"../heatmap/hover":727,"../heatmap/plot":730,"../heatmap/style":731,"./attributes":733,"./defaults":735}],737:[function(t,e,r){"use strict";var n=t("../histogram/bin_defaults");e.exports=function(t,e,r){var i=r("x"),o=r("y");if(!(i&&i.length&&o&&o.length))return void(e.visible=!1);var a=r("z")||r("marker.color");a&&r("histfunc");var s=["x","y"];n(t,e,r,s)}},{"../histogram/bin_defaults":743}],738:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),o=t("../../components/colorscale/attributes"),a=t("../../lib/extend").extendFlat;e.exports=a({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line,_nestedModules:{colorbar:"Colorbar"}},o)},{"../../components/colorscale/attributes":504,"../../lib/extend":578,"../contour/attributes":711,"../histogram2d/attributes":733}],739:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),o=t("../contour/style_defaults"),a=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,a,r,i)}i(t,e,l);var u=n.coerce2(t,e,a,"contours.start"),c=n.coerce2(t,e,a,"contours.end"),h=l("autocontour",!(u&&c));l(h?"ncontours":"contours.size"),o(t,e,l,s)}},{"../../lib":583,"../contour/style_defaults":720,"../histogram2d/sample_defaults":737,"./attributes":738}],740:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot"),n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../contour/calc":712,"../contour/colorbar":713,"../contour/hover":715,"../contour/plot":718,"../contour/style":719,"./attributes":738,"./defaults":739}],741:[function(t,e,r){"use strict";function n(t){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var i=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:i.text,orientation:i.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:n("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:n("y"),marker:i.marker,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:i._deprecated.bardir}}},{"../bar/attributes":685}],742:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,i=0;r>i;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],743:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){var e=r(t+"bins.start"),n=r(t+"bins.end"),i=r("autobin"+t,!(e&&n));r(i?"nbins"+t:t+"bins.size")}),e}},{}],744:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var o=i[e];return n(o)?(o=Number(o),r[t]+=o,o):0},avg:function(t,e,r,i,o){var a=i[e];return n(a)&&(a=Number(a),r[t]+=a,o[t]++),0},min:function(t,e,r,i){var o=i[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]>o)return r[t]=o,o-r[t]}return 0},max:function(t,e,r,i){var o=i[e];if(n(o)){if(o=Number(o),!n(r[t]))return r[t]=o,o;if(r[t]r&&u.length<5e3;)m=o.tickIncrement(r,x.size),u.push((r+m)/2),c.push(L),b&&_.push(r),E&&w.push(1/(m-r)),P&&M.push(0),r=m;var C=c.length;for(r=0;r=0&&C>v&&(A+=z(v,r,c,y,M));P&&(A=l(c,M)),I&&I(c,A,w);var R=Math.min(u.length,c.length),D=[],O=0,j=R-1;for(r=0;R>r;r++)if(c[r]){O=r;break}for(r=R-1;r>O;r--)if(c[r]){j=r;break}for(r=O;j>=r;r++)n(u[r])&&n(c[r])&&D.push({p:u[r],s:c[r],b:0});return D}}},{"../../lib":583,"../../plots/cartesian/axes":607,"./average":742,"./bin_functions":744,"./norm_functions":748,"fast-isnumeric":99}],746:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),o=t("./bin_defaults"),a=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=c("x"),f=c("y");c("text");var p=c("orientation",f&&!h?"h":"v"),d=e["v"===p?"x":"y"];if(!d||!d.length)return void(e.visible=!1);var m=e["h"===p?"x":"y"];m&&c("histfunc");var g="h"===p?["y"]:["x"];o(t,e,c,g),a(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":498,"../../components/errorbars/defaults":526,"../../lib":583,"../bar/style_defaults":695,"./attributes":741,"./bin_defaults":743}],747:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"../bar/hover":688,"../bar/layout_attributes":690,"../bar/layout_defaults":691,"../bar/plot":692,"../bar/set_positions":693,"../bar/style":694,"../scatter/colorbar":774,"./attributes":741,"./calc":745,"./defaults":746}],748:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;r>i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var o=0;i>o;o++)t[o]*=r[o]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var o=0;i>o;o++)t[o]*=r[o]/e}}},{}],749:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},i.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},i.contours.x.show,{}),color:o({},i.contours.x.color),width:o({},i.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lightposition:{x:o({},i.lightposition.x,{dflt:1e5}),y:o({},i.lightposition.y,{dflt:1e5}),z:o({},i.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},i.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":504,"../../lib/extend":578,"../surface/attributes":817}],750:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function o(t){return t.map(p)}function a(t,e,r){for(var n=new Array(t.length),i=0;i0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var d={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:p(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",d.vertexIntensity=t.intensity,d.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],d.vertexColors=o(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],d.cellColors=o(t.facecolor)):(this.color=t.color,d.meshColor=p(t.color)),this.mesh.update(d)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":595,"alpha-shape":27,"convex-hull":79,"delaunay-triangulate":91,"gl-mesh3d":167,tinycolor2:461}],751:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,a){function s(r,i){return n.coerce(t,e,o,r,i)}function l(t){var e=t.map(function(t){var e=s(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=l(["x","y","z"]),c=l(["i","j","k"]);return u?(c&&c.forEach(function(t){for(var e=0;el||(u=d[r],void 0!==u&&""!==u||(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=o(e.marker.colors[r]),c.isValid()?(c=a.addOpacity(c,c.getAlpha()),v[u]||(v[u]=c)):v[u]?c=v[u]:(c=!1,x=!0),h=-1!==_.indexOf(u),h||(b+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),x)for(r=0;r")}return m};var l},{"../../components/color":498,"./helpers":757,"fast-isnumeric":99,tinycolor2:461}],756:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,o){function a(r,o){return n.coerce(t,e,i,r,o)}var s=n.coerceFont,l=a("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=a("labels");Array.isArray(u)||(a("label0"),a("dlabel"));var c=a("marker.line.width");c&&a("marker.line.color");var h=a("marker.colors");Array.isArray(h)||(e.marker.colors=[]),a("scalegroup");var f=a("text"),p=a("textinfo",Array.isArray(f)?"text+percent":"percent");if(a("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),p&&"none"!==p){var d=a("textposition"),m=Array.isArray(d)||"auto"===d,g=m||"inside"===d,v=m||"outside"===d;if(g||v){var y=s(a,"textfont",o.font);g&&s(a,"insidetextfont",y),v&&s(a,"outsidetextfont",y)}}a("domain.x"),a("domain.y"),a("hole"),a("sort"),a("direction"),a("rotation"),a("pull")}},{"../../lib":583,"./attributes":753}],757:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":583}],758:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":753,"./base_plot":754,"./calc":755,"./defaults":756,"./layout_attributes":759,"./layout_defaults":760,"./plot":761,"./style":762,"./style_one":763}],759:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],760:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,o){return n.coerce(t,e,i,r,o)}r("hiddenlabels")}},{"../../lib":583,"./layout_attributes":759}],761:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,a=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=o+1/(2*Math.tan(a)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(o*o+s/2)+o)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/o,d=p+1/(2*Math.tan(a)),m=r.r*Math.min(1/(Math.sqrt(d*d+.5)+d),s/(Math.sqrt(p*p+s/2)+p)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return u.scale<1&&v.scale>u.scale?v:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function o(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,o=t.height/2;return 0>r&&(i*=-1),0>n&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(o)*(i>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function a(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,o,s,f,p,m=r.labelExtraY+(a?r.yLabelMax:r.yLabelMin),g=a?t.yLabelMin:t.yLabelMax,v=a?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),x=m-g;if(x*h>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(i=0;i=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*h>0?(s=o.cyFinal+u(o.px0[1],o.px1[1]),x=s-g-t.labelExtraY,x*h>0&&(t.labelExtraY+=x)):(v+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-d.indexOf(t)),f=o.cxFinal+l(o.px0[0],o.px1[0]),p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,p*c>0&&(t.labelExtraX+=p)))}var o,a,s,l,u,c,h,f,p,d,m,g,v;for(a=0;2>a;a++)for(s=a?r:n,u=a?Math.max:Math.min,h=a?1:-1,o=0;2>o;o++){for(l=o?Math.max:Math.min,c=o?1:-1,f=t[a][o],f.sort(s),p=t[1-a][o],d=p.concat(f),g=[],m=0;mc&&(c=s.pull[o]);a.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),a.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,a.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===p.indexOf(s.scalegroup)&&p.push(s.scalegroup)}for(o=0;oh.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../plots/cartesian/graph_interact"),f=t("../../components/color"),p=t("../../components/drawing"),d=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],g=u.trace,v=0,y=(g.depth||0)*u.r*Math.sin(v)/2,x=g.tiltaxis||0,b=x*Math.PI/180,_=[y*Math.sin(b),y*Math.cos(b)],w=u.r*Math.cos(v),M=s.selectAll("g.part").data(g.tilt?["top","sides"]:["top"]);M.enter().append("g").attr("class",function(t){return t+" part"}),M.exit().remove(),M.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e); +s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],v=!1;s.each(function(a){function s(e){var n=t._fullLayout,o=t._fullData[g.index],s=o.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&s){var l=i(a,u),c=M+a.pxmid[0]*(1-l),f=A+a.pxmid[1]*(1-l),p=r.separators,d=[];-1!==s.indexOf("label")&&d.push(a.label),o.text&&o.text[a.i]&&-1!==s.indexOf("text")&&d.push(o.text[a.i]),-1!==s.indexOf("value")&&d.push(m.formatPieValue(a.v,p)),-1!==s.indexOf("percent")&&d.push(m.formatPiePercent(a.v/u.vTotal,p)),h.loneHover({x0:c-l*u.r,x1:c+l*u.r,y:f,text:d.join("
"),name:-1!==s.indexOf("name")?o.name:void 0,color:a.color,idealAlign:a.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),h.hover(t,e,"pie"),E=!0}}function f(e){t.emit("plotly_unhover",{points:[e]}),E&&(h.loneUnhover(r._hoverlayer.node()),E=!1)}function y(){t._hoverdata=[a],a.curveNumber=e[0].trace.index,t._hoverdata.trace=e[0].trace,h.click(t,{target:!0})}function b(t,e,r,n){return"a"+n*u.r+","+n*w+" "+x+" "+a.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(a.hidden)return void c.select(this).selectAll("path,g").remove();l[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var M=u.cx+_[0],A=u.cy+_[1],k=c.select(this),T=k.selectAll("path.surface").data([a]),E=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",s).on("mouseout",f).on("click",y).on("contextmenu",y),g.pull){var S=+(Array.isArray(g.pull)?g.pull[a.i]:g.pull)||0;S>0&&(M+=S*a.pxmid[0],A+=S*a.pxmid[1])}a.cxFinal=M,a.cyFinal=A;var L=g.hole;if(a.v===u.vTotal){var z="M"+(M+a.px0[0])+","+(A+a.px0[1])+b(a.px0,a.pxmid,!0,1)+b(a.pxmid,a.px0,!0,1)+"Z";L?T.attr("d","M"+(M+L*a.px0[0])+","+(A+L*a.px0[1])+b(a.px0,a.pxmid,!1,L)+b(a.pxmid,a.px0,!1,L)+"Z"+z):T.attr("d",z)}else{var I=b(a.px0,a.px1,!0,1);if(L){var P=1-L;T.attr("d","M"+(M+L*a.px1[0])+","+(A+L*a.px1[1])+b(a.px1,a.px0,!1,L)+"l"+P*a.px0[0]+","+P*a.px0[1]+I+"Z")}else T.attr("d","M"+M+","+A+"l"+a.px0[0]+","+a.px0[1]+I+"Z")}var C=Array.isArray(g.textposition)?g.textposition[a.i]:g.textposition,R=k.selectAll("g.slicetext").data(a.text&&"none"!==C?[0]:[]);R.enter().append("g").classed("slicetext",!0),R.exit().remove(),R.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(a.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(p.font,"outside"===C?g.outsidetextfont:g.insidetextfont).call(d.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=p.bBox(t.node());"outside"===C?e=o(r,a):(e=n(r,a,u),"auto"===C&&e.scale<1&&(t.call(p.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(t.attr({"data-bb":""}),r=p.bBox(t.node())),e=o(r,a)));var i=M+a.pxmid[0]*e.rCenter+(e.x||0),s=A+a.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(a.yLabelMin=s-r.height/2,a.yLabelMid=s,a.yLabelMax=s+r.height/2,a.labelExtraX=0,a.labelExtraY=0,v=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),v&&a(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],o="M"+n+","+i,a=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);o+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+a):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+a}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+a;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":498,"../../components/drawing":521,"../../lib/svg_text_utils":596,"../../plots/cartesian/graph_interact":614,"./helpers":757,d3:90}],762:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":763,d3:90}],763:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o,fill:e.color}).call(n.stroke,i)}},{"../../components/color":498}],764:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),o=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=i.line,u=i.marker,c=u.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:s({},i.text,{}),mode:s({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:s({},{width:l.width,dash:l.dash,showscale:{valType:"boolean",dflt:!1}},o("line")),marker:s({},{symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:s({},u.size,{dflt:8}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:s({},u.opacity,{arrayOk:!1}),showscale:u.showscale,line:s({},{width:s({},c.width,{arrayOk:!1})},o("marker.line"))},o("marker")),textposition:s({},i.textposition,{dflt:"top center"}),textfont:i.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../constants/gl_markers":569,"../../lib/extend":578,"../scatter/attributes":771}],765:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r),i(e),r}},{"../scatter/arrays_to_calcdata":770,"../scatter/colorscale_calc":775}],766:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=a(e),i=new Array(t.length),o=0;os;s++){for(var l=[[0,0,0],[0,0,0]],u=0;3>u;u++)if(r[u])for(var c=0;2>c;c++)l[c][u]=r[u][s][c];a[s]=l}return a}var a=t("../../components/errorbars/compute_error");e.exports=o},{"../../components/errorbars/compute_error":525}],767:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,o=(r+2)%3,a=[],s=[];for(n=0;ni;i++){var o=t[i];o&&o.copy_zstyle!==!1&&(o=t[2]),o&&(e[i]=o.width/2,r[i]=x(o.color),n=o.thickness)}return{capSize:e,color:r,lineWidth:n}}function a(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var o=null;if(Array.isArray(t)){o=[];for(var a=0;e>a;a++)void 0===t[a]?o[a]=n:o[a]=r(t[a],i)}else o=r(t,y.identity);return o}function c(t,e){var r,n,i,c,h,f,p=[],d=t.fullSceneLayout,m=t.dataScale,g=d.xaxis,v=d.yaxis,w=d.zaxis,M=e.marker,k=e.line,T=e.x||[],E=e.y||[],S=e.z||[],L=T.length;for(n=0;L>n;n++)i=g.d2l(T[n])*m[0],c=v.d2l(E[n])*m[1],h=w.d2l(S[n])*m[2],p[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;L>n;n++)f[n]=e.text;if(r={position:p,mode:e.mode,text:f},"line"in e&&(r.lineColor=b(k,1,L),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var z=_(e);r.scatterColor=b(M,1,L),r.scatterSize=u(M.size,L,s,20,z),r.scatterMarker=u(M.symbol,L,l,"\u25cf"),r.scatterLineWidth=M.line.width,r.scatterLineColor=b(M.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=a(e.textposition),r.textColor=b(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var I=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[I[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=A(e,m);var C=o([e.error_x,e.error_y,e.error_z]);return r.errorColor=C.color,r.errorLineWidth=C.lineWidth,r.errorCapSize=C.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=x(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var p=t("gl-line3d"),d=t("gl-scatter3d"),m=t("gl-error3d"),g=t("gl-mesh3d"),v=t("delaunay-triangulate"),y=t("../../lib"),x=t("../../lib/str2rgbarray"),b=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),M=t("../../constants/gl_markers"),A=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,o,a=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:a,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=p(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:a,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=d(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),o={gl:a,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(o):(this.textMarkers=d(o),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=a,this.delaunayMesh=g(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":568,"../../constants/gl_markers":569,"../../lib":583,"../../lib/gl_format_color":581,"../../lib/str2rgbarray":595,"../scatter/make_bubble_size_func":785,"./calc_errors":766,"delaunay-triangulate":91,"gl-error3d":127,"gl-line3d":134,"gl-mesh3d":167,"gl-scatter3d":187}],768:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),o=r("y"),a=r("z");return i&&o&&a&&(n=Math.min(i.length,o.length,a.length),n=0&&f("surfacecolor",d||m);for(var g=["x","y","z"],v=0;3>v;++v){var y="projection."+g[v];f(y+".show")&&(f(y+".opacity"),f(y+".scale"))}u(t,e,r,{axis:"z"}),u(t,e,r,{axis:"y",inherit:"z"}),u(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":526,"../../lib":583,"../scatter/line_defaults":782,"../scatter/marker_defaults":786,"../scatter/subtypes":790,"../scatter/text_defaults":791,"./attributes":764}],769:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":569,"../../plots/gl3d":643,"../scatter/colorbar":774,"./attributes":764,"./calc":765,"./convert":767,"./defaults":768}],770:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){var e=t[0].trace,r=e.marker;if(n.mergeArray(e.text,t,"tx"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var i=r.line;n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc"),n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw")}}},{"../../lib":583}],771:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/drawing"),o=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:o({},{symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},line:o({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../components/drawing":521,"../../lib/extend":578,"./constants":776}],772:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("./subtypes"),s=t("./colorscale_calc");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||"x"),h=i.getFromId(t,e.yaxis||"y"),f=c.makeCalcdata(e,"x"),p=h.makeCalcdata(e,"y"),d=Math.min(f.length,p.length);c._minDtick=0,h._minDtick=0,f.length>d&&f.splice(d,f.length-d),p.length>d&&p.splice(d,p.length-d);var m={padded:!0},g={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var v={type:"linear"};i.setConvert(v),l=v.makeCalcdata(e.marker,"size"),l.length>d&&l.splice(d,l.length-d)}var y,x=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},m.ppad=g.ppad=Array.isArray(l)?l.map(y):y(l)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||f[0]===f[d-1]&&p[0]===p[d-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(a.hasMarkers(e)||a.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||f[0]===f[d-1]&&p[0]===p[d-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,i.expand(c,f,m),i.expand(h,p,g);var b=new Array(d);for(u=0;d>u;u++)b[u]=n(f[u])&&n(p[u])?{x:f[u],y:p[u]}:{x:!1,y:!1};return void 0!==typeof l&&o.mergeArray(l,b,"ms"),t.firstscatter=!1,b}},{"../../lib":583,"../../plots/cartesian/axes":607,"./colorscale_calc":775,"./subtypes":790,"fast-isnumeric":99}],773:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i,o;for(e=0;e=0;i--)if(o=t[i],"scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}},{}],774:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),a=t("../../plots/plots"),s=t("../../components/colorscale/get_scale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,u=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===u||!u.showscale)return void a.autoMargin(t,c);var h=s(u.colorscale),f=u.color,p=u.cmin,d=u.cmax;i(p)||(p=o.aggNums(Math.min,null,f)),i(d)||(d=o.aggNums(Math.max,null,f));var m=e[0].t.cb=l(t,c);m.fillcolor(n.scale.linear().domain(h.map(function(t){return p+t[0]*(d-p)})).range(h.map(function(t){return t[1]}))).filllevels({start:p,end:d,size:(d-p)/254}).options(u.colorbar)()}},{"../../components/colorbar/draw":501,"../../components/colorscale/get_scale":510,"../../lib":583,"../../plots/plots":663,d3:90,"fast-isnumeric":99}],775:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":505,"../../components/colorscale/has_colorscale":511,"./subtypes":790}],776:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],777:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),o=t("./constants"),a=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,d){function m(r,o){return n.coerce(t,e,i,r,o)}var g=s(t,e,m),v=gv[y].x0&&ev[y].y0&&rV!=R>=V&&(I=L[E-1][0],P=L[E][0],z=I+(P-I)*(V-C)/(R-C),F=Math.min(F,z),N=Math.max(N,z));F=Math.max(F,0),N=Math.min(N,f._length);var q=l.defaultLine;return l.opacity(h.fillcolor)?q=h.fillcolor:l.opacity((h.line||{}).color)&&(q=h.line.color),n.extendFlat(t,{distance:o.MAXDIST+10,x0:F,x1:N,y0:V,y1:V,color:q}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":498,"../../components/errorbars":527,"../../lib":583,"../../plots/cartesian/constants":612,"../../plots/cartesian/graph_interact":614,"./get_trace_color":779}],781:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":615,"./arrays_to_calcdata":770,"./attributes":771,"./calc":772,"./clean_data":773,"./colorbar":774,"./defaults":777,"./hover":780,"./plot":787,"./select":788,"./style":789,"./subtypes":790}],782:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,a){var s=(t.marker||{}).color;if(a("line.color",r),n(t,"line"))i(t,e,o,a,{prefix:"line.",cLetter:"c"});else{var l=(Array.isArray(s)?!1:s)||r;a("line.color",l)}a("line.width"),a("line.dash")}},{"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511}],783:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),n=M.c2p(t[e].y);return r===S||n===S?!1:[r,n]}function i(t){var e=t[0]/w._length,r=t[1]/M._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*k}function o(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var a,s,l,u,c,h,f,p,d,m,g,v,y,x,b,_,w=e.xaxis,M=e.yaxis,A=e.connectGaps,k=e.baseTolerance,T=e.linear,E=[],S=n.BADNUM,L=.2,z=new Array(t.length),I=0;for(a=0;ai(h))break;l=h,y=m[0]*d[0]+m[1]*d[1],y>g?(g=y,u=h,p=!1):v>y&&(v=y,c=h,p=!0)}if(p?(z[I++]=u,l!==c&&(z[I++]=c)):(c!==s&&(z[I++]=c),l!==u&&(z[I++]=u)),z[I++]=l,a>=t.length||!h)break;z[I++]=h,s=h}}else z[I++]=u}E.push(z.slice(0,I))}return E}},{"../../plots/cartesian/axes":607}],784:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],785:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":99}],786:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),a=t("./subtypes");e.exports=function(t,e,r,s,l){var u,c=a.isBubble(t),h=(t.line||{}).color;h&&(r=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&o(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&o(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":498,"../../components/colorscale/defaults":508,"../../components/colorscale/has_colorscale":511,"./subtypes":790}],787:[function(t,e,r){"use strict";function n(t,e,r){var n=e.x(),o=e.y(),a=i.extent(n.range.map(n.l2c)),s=i.extent(o.range.map(o.l2c));r.forEach(function(t,e){var n=t[0].trace;if(u.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var o=t.filter(function(t){return t.x>=a[0]&&t.x<=a[1]&&t.y>=s[0]&&t.y<=s[1]}),l=Math.ceil(o.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var h=Math.round(c*l/3+Math.floor(c/3)*l/7.1);t.forEach(function(t){delete t.vis}),o.forEach(function(t,e){0===Math.round((e+h)%l)&&(t.vis=!0)})}}})}var i=t("d3"),o=t("../../lib"),a=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("../../lib/polygon").tester,u=t("./subtypes"),c=t("./arrays_to_calcdata"),h=t("./line_points");e.exports=function(t,e,r){function f(t){return t.filter(function(t){return t.vis})}n(t,e,r);var p=e.x(),d=e.y(),m=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);m.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2),m.call(s.plot,e);var g,v,y,x,b="",_=[];m.each(function(t){var e=t[0].trace,r=e.line,n=i.select(this);if(e.visible===!0&&(v=e.fill.charAt(e.fill.length-1),"x"!==v&&"y"!==v&&(v=""),t[0].node3=n,c(t),u.hasLines(e)||"none"!==e.fill)){var o,s,f,m,w,M="",A="";g="tozero"===e.fill.substr(0,6)||"toself"===e.fill||"to"===e.fill.substr(0,2)&&!b?n.append("path").classed("js-fill",!0):null,x&&(y=x.datum(t)),x=n.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(f=a.steps(r.shape),m=a.steps(r.shape.split("").reverse().join(""))):f=m="spline"===r.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?a.smoothclosed(t.slice(1),r.smoothing):a.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},w=function(t){return m(t.reverse())};var k,T=h(t,{xaxis:p,yaxis:d,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape}),E=e._polygons=new Array(T.length);for(k=0;k1&&n.append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").attr("d",o)}g?S&&z&&(v?("y"===v?S[1]=z[1]=d.c2p(0,!0):"x"===v&&(S[0]=z[0]=p.c2p(0,!0)),g.attr("d",M+"L"+z+"L"+S+"Z")):g.attr("d",M+"Z")):"tonext"===e.fill.substr(0,6)&&M&&b&&("tonext"===e.fill?y.attr("d",M+"Z"+b+"Z"):y.attr("d",M+"L"+b.substr(1)+"Z"),e._polygons=e._polygons.concat(_)),b=A,_=E}}}),m.selectAll("path:not([d])").remove(),m.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=i.select(this),n=u.hasMarkers(e),s=u.hasText(e); +!n&&!s||e.visible!==!0?r.remove():(n&&r.selectAll("path.point").data(e.marker.maxdisplayed?f:o.identity).enter().append("path").classed("point",!0).call(a.translatePoints,p,d),s&&r.selectAll("g").data(e.marker.maxdisplayed?f:o.identity).enter().append("g").append("text").call(a.translatePoints,p,d))})}},{"../../components/drawing":521,"../../components/errorbars":527,"../../lib":583,"../../lib/polygon":589,"./arrays_to_calcdata":770,"./line_points":783,"./subtypes":790,d3:90}],788:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,o,a,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,p=f.index,d=f.marker,m=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!m){var g=Array.isArray(d.opacity)?1:d.opacity;if(e===!1)for(r=0;rn;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function o(t,e){function r(e){var r=t.mockAxis;return u.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?g.hoverinfo.flags:n.split("+"),o=-1!==i.indexOf("location")&&Array.isArray(e.locations),a=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=-1!==i.indexOf("text");return function(t){var n=[];o?n.push(t.location):a&&s?n.push("("+r(t.lon)+", "+r(t.lat)+")"):a?n.push("lon: "+r(t.lon)):s&&n.push("lat: "+r(t.lat)),l&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}function a(t){var e=Array.isArray(t.locations);return function(r,n){return{points:[{data:t._input,fullData:t,curveNumber:t.index,pointNumber:n,lon:r.lon,lat:r.lat,location:e?r.location:null}]}}}var s=t("d3"),l=t("../../plots/cartesian/graph_interact"),u=t("../../plots/cartesian/axes"),c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/array_to_calc_item"),p=t("../../components/color"),d=t("../../components/drawing"),m=t("../scatter/subtypes"),g=t("./attributes"),v=e.exports={};v.calcGeoJSON=function(t,e){var r,i,o,a,s=[],l=Array.isArray(t.locations);l?(a=t.locations,r=a.length,i=c(t,e),o=function(t,e){var r=h(t.locationmode,a[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,o=function(t,e){return[t.lon[e],t.lat[e]]});for(var u=0;r>u;u++){var f=o(t,u);if(f){var p={lon:f[0],lat:f[1],location:l?t.locations[u]:null};n(t,p,u),s.push(p)}}return s.length>0&&(s[0].trace=t),s},v.plot=function(t,e){var r=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,function(t){return t.uid});r.enter().append("g").attr("class","trace scattergeo"),r.exit().remove(),r.selectAll("*").remove(),r.each(function(t){var e=s.select(this);m.hasLines(t)&&e.selectAll("path.js-line").data([i(t)]).enter().append("path").classed("js-line",!0)}),r.each(function(e){function r(r,n){if(t.showHover){var i=t.projection([r.lon,r.lat]);f(r),l.loneHover({x:i[0],y:i[1],name:g?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()}),y=p(r,n),t.graphDiv.emit("plotly_hover",y)}}function n(e,r){t.graphDiv.emit("plotly_click",p(e,r))}var i=s.select(this),u=m.hasMarkers(e),c=m.hasText(e);if(u||c){var h=v.calcGeoJSON(e,t.topojson),f=o(t,e),p=a(e),d=e.hoverinfo,g="all"===d||-1!==d.indexOf("name"),y=null;u&&i.selectAll("path.point").data(h).enter().append("path").classed("point",!0).on("mouseover",r).on("click",n).on("mouseout",function(){l.loneUnhover(t.hoverContainer),t.graphDiv.emit("plotly_unhover",y)}).on("mousedown",function(){l.loneUnhover(t.hoverContainer)}).on("mouseup",r),c&&i.selectAll("g").data(h).enter().append("g").append("text")}}),v.style(t)},v.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.each(function(t){s.select(this).selectAll("path.point").call(d.pointStyle,t),s.select(this).selectAll("text").call(d.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(p.stroke,r.color).call(d.dashLine,r.dash||"",r.width||0)})}},{"../../components/color":498,"../../components/drawing":521,"../../lib/array_to_calc_item":574,"../../lib/geo_location_utils":580,"../../lib/topojson_utils":597,"../../plots/cartesian/axes":607,"../../plots/cartesian/graph_interact":614,"../scatter/subtypes":790,"./attributes":793,d3:90}],798:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),o=t("../../constants/gl2d_dashes"),a=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(o),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,line:l({},i("marker.line"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../constants/gl2d_dashes":567,"../../constants/gl_markers":569,"../../lib/extend":578,"../scatter/attributes":771}],799:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="scattergl",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=p(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=d(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array(0),errors:new Float32Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=d(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=h(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=f(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),o(t,e,r)}function o(t,e,r){for(var n=new Array(r),i=e[0],o=0;r>o;++o)n[o]=t(o>=e.length?i:e[o]);return n}function a(t,e,r){return l(L(t,r),S(e,r),r)}function s(t,e,r,n){var i=b(t,e,n);return i=Array.isArray(i[0])?i:o(g.identity,[i],n),l(i,S(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var o=0;3>o;++o)n[4*i+o]=t[i][o];n[4*i+3]=t[i][3]*e[i]}return n}function u(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("gl-scatter2d"),f=t("gl-scatter2d-fancy"),p=t("gl-line2d"),d=t("gl-error2d"),m=t("fast-isnumeric"),g=t("../../lib"),v=t("../../plots/cartesian/axes"),y=t("../../components/errorbars"),x=t("../../lib/str2rgbarray"),b=t("../../lib/gl_format_color"),_=t("../scatter/subtypes"),w=t("../scatter/make_bubble_size_func"),M=t("../scatter/get_trace_color"),A=t("../../constants/gl_markers"),k=t("../../constants/gl2d_dashes"),T=["xaxis","yaxis"],E=n.prototype;E.handlePick=function(t){var e=t.pointId;return(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]),{trace:this,dataCoord:t.dataCoord,traceCoord:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},E.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return this.hasLines&&!this.connectgaps?!0:this.hasErrorX?!0:!!this.hasErrorY};var S=i.bind(null,function(t){return+t}),L=i.bind(null,x),z=i.bind(null,function(t){return A[t]||"\u25cf"});E.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=_.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=_.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=M(t,{})},E.updateFast=function(t){for(var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,o=n.length,a=new Array(o),s=new Float32Array(2*o),l=this.bounds,c=0,h=0,f=0;o>f;++f)e=n[f],r=i[f],m(e)&&m(r)&&(a[c++]=f,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=u(s,h),this.idToIndex=a,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var p;if(this.hasMarkers){this.scatterOptions.positions=s;var d=x(t.marker.color),g=x(t.marker.line.color),v=t.opacity*t.marker.opacity;d[3]*=v,this.scatterOptions.color=d,g[3]*=v,this.scatterOptions.borderColor=g,p=t.marker.size,this.scatterOptions.size=p,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,p)},E.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,o=this.bounds,a=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=a.slice(),this.yData=l.slice();var c,h,f,p,d,m,g,v,x=y.calcFromTrace(t,e.fullLayout),b=a.length,_=new Array(b),M=new Float32Array(2*b),A=new Float32Array(4*b),k=new Float32Array(4*b),T=0,E=0,L=0,I=0,P="log"===r.type?function(t){return r.d2l(t)}:function(t){return t},C="log"===n.type?function(t){return n.d2l(t)}:function(t){return t};for(c=0;b>c;++c)this.xData[c]=f=P(a[c]),this.yData[c]=p=C(l[c]),isNaN(f)||isNaN(p)||(_[T++]=c,M[E++]=f,M[E++]=p,d=A[L++]=f-x[c].xs||0,m=A[L++]=x[c].xh-f||0,A[L++]=0,A[L++]=0,k[I++]=0,k[I++]=0,g=k[I++]=p-x[c].ys||0,v=k[I++]=x[c].yh-p||0,o[0]=Math.min(o[0],f-d),o[1]=Math.min(o[1],p-g),o[2]=Math.max(o[2],f+m),o[3]=Math.max(o[3],p+v));M=u(M,E),this.idToIndex=_,this.updateLines(t,M),this.updateError("X",t,M,A),this.updateError("Y",t,M,k);var R;if(this.hasMarkers){this.scatterOptions.positions=M,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var D,O=w(t),j=t.marker,F=j.opacity,N=t.opacity,B=s(j,F,N,b),U=z(j.symbol,b),V=S(j.line.width,b),q=s(j.line,F,N,b);for(R=i(O,j.size,b),c=0;T>c;++c)for(D=_[c],this.scatterOptions.sizes[c]=4*R[D],this.scatterOptions.glyphs[c]=U[D],this.scatterOptions.borderWidths[c]=.5*V[D],h=0;4>h;++h)this.scatterOptions.colors[4*c+h]=B[4*D+h],this.scatterOptions.borderColors[4*c+h]=q[4*D+h];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(a,l,R)},E.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,o=this.xData,s=this.yData;for(n=new Float32Array(2*o.length),r=0;ra;a++)r=this.scene[T[a]],n=r._min,n||(n=[]),n.push({val:t[a],pad:o}),i=r._max,i||(i=[]),i.push({val:t[a+2],pad:o})},E.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};v.expand(n.xaxis,t,i),v.expand(n.yaxis,e,i)},E.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../components/errorbars":527,"../../constants/gl2d_dashes":567,"../../constants/gl_markers":569,"../../lib":583,"../../lib/gl_format_color":581,"../../lib/str2rgbarray":595,"../../plots/cartesian/axes":607,"../scatter/get_trace_color":779,"../scatter/make_bubble_size_func":785,"../scatter/subtypes":790,"fast-isnumeric":99,"gl-error2d":125,"gl-line2d":132,"gl-scatter2d":184,"gl-scatter2d-fancy":179}],800:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),o=t("../scatter/subtypes"),a=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,h,r,i)}var d=a(t,e,p);return d?(p("text"),p("mode",db;b++){var _=e.lon[b],w=e.lat[b];if(n(_)&&n(w)){var M={};if(x++,M.lonlat=[+_,+w],h){if(f){var A=c.color[b];M.mc=A,M.mcc=g(A)}if(p){var k=c.size[b];M.ms=k,M.mrc=v(k)}if(d){var T=c.symbol[b];M.mx="string"==typeof T?T:"circle"}}if(m){var E=e.text[b];M.tx="string"==typeof E?E:""}y.push(M)}else x>0&&(y[x-1].gapAfter=!0)}return y}},{"../../components/colorscale/has_colorscale":511,"../../components/colorscale/make_scale_function":515,"../../lib":583,"../scatter/colorscale_calc":775,"../scatter/make_bubble_size_func":785,"../scatter/subtypes":790,"fast-isnumeric":99}],804:[function(t,e,r){"use strict";function n(){return{geojson:i(),layout:{visibility:"none"},paint:{}}}function i(){return{type:"Point",coordinates:[]}}function o(t,e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var r=new Array(e.length),n=0;n0&&(n.push(i),i=[])}return n.push(i),n}function f(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:p}function p(){return""}var d=t("../../lib"),m=t("../scatter/subtypes"),g=t("../../plots/mapbox/convert_text_opts"),v="circle-color",y="circle-radius";e.exports=function(t){var e=t[0].trace,r=e.visible===!0,i="none"!==e.fill,f=m.hasLines(e),p=m.hasMarkers(e),x=m.hasText(e),b=p&&"circle"===e.marker.symbol,_=p&&"circle"!==e.marker.symbol,w=n(),M=n(),A=n(),k=n(),T={fill:w,line:M,circle:A,symbol:k};if(!r)return T;var E;if((i||f)&&(E=h(t)),i&&(w.geojson=o(t,E),w.layout.visibility="visible",d.extendFlat(w.paint,{"fill-color":e.fillcolor})),f&&(M.geojson=a(t,E),M.layout.visibility="visible",d.extendFlat(M.paint,{"line-width":e.line.width,"line-color":e.line.color,"line-opacity":e.opacity})),b){var S={};S[v]={},S[y]={},A.geojson=s(t,S),A.layout.visibility="visible",d.extendFlat(A.paint,{"circle-opacity":e.opacity*e.marker.opacity,"circle-color":u(e,S),"circle-radius":c(e,S)})}if((_||x)&&(k.geojson=l(t),d.extendFlat(k.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),_&&(d.extendFlat(k.layout,{"icon-size":e.marker.size/10}),d.extendFlat(k.paint,{"icon-opacity":e.opacity*e.marker.opacity,"icon-color":e.marker.color})),x)){var L=(e.marker||{}).size,z=g(e.textposition,L);d.extendFlat(k.layout,{"text-size":e.textfont.size,"text-anchor":z.anchor,"text-offset":z.offset}),d.extendFlat(k.paint,{"text-color":e.textfont.color,"text-opacity":e.opacity})}return T}},{"../../lib":583,"../../plots/mapbox/convert_text_opts":657,"../scatter/subtypes":790}],805:[function(t,e,r){"use strict";function n(t,e,r){var n=r("lon")||[],i=r("lat")||[],o=Math.min(n.length,i.length);return o")}var i=t("../../plots/cartesian/graph_interact"),o=t("../scatter/get_trace_color");e.exports=function(t,e,r){function a(t){var e=t.lonlat,n=Math.abs(u.c2p(e)-u.c2p([p,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],r])),o=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-o,1-3/o)}var s=t.cd,l=s[0].trace,u=t.xa,c=t.ya,h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),f=360*h,p=e-f;if(i.getClosest(s,a,t),t.index!==!1){var d=s[t.index],m=d.lonlat,g=[m[0]+f,m[1]],v=u.c2p(g),y=c.c2p(g),x=d.mrc||1;return t.x0=v-x,t.x1=v+x,t.y0=y-x,t.y1=y+x,t.color=o(l,d),t.extraText=n(l,d),[t]}}},{"../../plots/cartesian/graph_interact":614,"../scatter/get_trace_color":779}],807:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.hoverPoints=t("./hover"),n.plot=t("./plot"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/mapbox":658,"../scatter/colorbar":774,"./attributes":802,"./calc":803,"./defaults":805,"./hover":806,"./plot":808}],808:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var o=t("./convert"),a=n.prototype;a.update=function(t){var e=this.mapbox,r=o(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint))},a.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":804}],809:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),o=t("../../components/colorscale/color_attributes"),a=t("../../lib/extend").extendFlat,s=n.marker,l=n.line,u=s.line;e.exports={a:{valType:"data_array"},b:{valType:"data_array"},c:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:l.color,width:l.width,dash:l.dash,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing},connectgaps:n.connectgaps,fill:a({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:a({},{symbol:s.symbol,opacity:s.opacity,maxdisplayed:s.maxdisplayed,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,showscale:s.showscale,line:a({},{width:u.width},o("marker".line))},o("marker")),textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron,_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../components/colorscale/color_attributes":506,"../../lib/extend":578,"../../plots/attributes":605,"../scatter/attributes":771}],810:[function(t,e,r){"use strict"; +var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),a=t("../scatter/subtypes"),s=t("../scatter/colorscale_calc"),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,f,p,d,m=t._fullLayout[e.subplot],g=m.sum,v=e.sum||g;for(r=0;rr;r++)y=e.a[r],x=e.b[r],b=e.c[r],n(y)&&n(x)&&n(b)?(y=+y,x=+x,b=+b,_=g/(y+x+b),1!==_&&(y*=_,x*=_,b*=_),M=y,w=b-x,k[r]={x:w,y:M,a:y,b:x,c:b}):k[r]={x:!1,y:!1};var T,E;if(a.hasMarkers(e)&&(T=e.marker,E=T.size,Array.isArray(E))){var S={type:"linear"};i.setConvert(S),E=S.makeCalcdata(e.marker,"size"),E.length>A&&E.splice(A,E.length-A)}return s(e),void 0!==typeof E&&o.mergeArray(E,k,"ms"),k}},{"../../lib":583,"../../plots/cartesian/axes":607,"../scatter/colorscale_calc":775,"../scatter/subtypes":790,"fast-isnumeric":99}],811:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),o=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,h,r,i)}var d,m=p("a"),g=p("b"),v=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),v&&(d=Math.min(d,v.length))):d=v?Math.min(d,v.length):0):g&&v&&(d=Math.min(g.length,v.length)),!d)return void(e.visible=!1);m&&d"),s}}},{"../../plots/cartesian/axes":607,"../scatter/hover":780}],813:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":670,"../scatter/colorbar":774,"./attributes":809,"./calc":810,"./defaults":811,"./hover":812,"./plot":814,"./select":815,"./style":816}],814:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={x:function(){return t.xaxis},y:function(){return t.yaxis},plot:r},o=new Array(e.length),a=t.graphDiv.calcdata,s=0;se){for(var r=m/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;ar;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},g.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,f=t.x,p=t.y,m=n.xaxis,g=n.yaxis,v=n.zaxis,y=r.dataScale,x=c[0].length,b=c.length,_=[u(new Float32Array(x*b),[x,b]),u(new Float32Array(x*b),[x,b]),u(new Float32Array(x*b),[x,b])],w=_[0],M=_[1],A=r.contourLevels;this.data=t,h(_[2],function(t,e){return v.d2l(c[e][t])*y[2]}),Array.isArray(f[0])?h(w,function(t,e){return m.d2l(f[e][t])*y[0]}):h(w,function(t){return m.d2l(f[t])*y[0]}),Array.isArray(p[0])?h(M,function(t,e){return g.d2l(p[e][t])*y[1]}):h(M,function(t,e){return g.d2l(p[e])*y[1]});var k={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};if(k.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var T=u(new Float32Array(x*b),[x,b]);h(T,function(e,r){return t.surfacecolor[r][e]}),_.push(T)}else k.intensityBounds[0]*=y[2],k.intensityBounds[1]*=y[2];this.dataScale=a(_),t.surfacecolor&&(k.intensity=_.pop()),"opacity"in t&&t.opacity<1&&(k.opacity=.25*t.opacity);var E=[!0,!0,!0],S=["x","y","z"];for(e=0;3>e;++e){var L=t.contours[S[e]];E[e]=L.highlight,k.showContour[e]=L.show||L.highlight,k.showContour[e]&&(k.contourProject[e]=[L.project.x,L.project.y,L.project.z],L.show?(this.showContour[e]=!0,k.levels[e]=A[e],o.highlightColor[e]=k.contourColor[e]=d(L.color),L.usecolormap?o.highlightTint[e]=k.contourTint[e]=0:o.highlightTint[e]=k.contourTint[e]=1,k.contourWidth[e]=L.width):this.showContour[e]=!1,L.highlight&&(k.dynamicColor[e]=d(L.highlightcolor),k.dynamicWidth[e]=L.highlightwidth))}k.coords=_,o.update(k),o.visible=t.visible,o.enableDynamic=E,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),s&&1>s&&(o.supportsTransparency=!0)},g.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":595,"gl-surface3d":202,ndarray:399,"ndarray-fill":389,"ndarray-homography":391,"ndarray-ops":393,tinycolor2:461}],821:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../lib"),o=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,a,r,n)}var u,c,h=l("z");if(!h)return void(e.visible=!1);var f=h[0].length,p=h.length;if(l("x"),l("y"),!Array.isArray(e.x))for(e.x=[],u=0;f>u;++u)e.x[u]=u;if(l("text"),!Array.isArray(e.y))for(e.y=[],u=0;p>u;++u)e.y[u]=u;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){l(t)});var d=l("surfacecolor");l("colorscale");var m=["x","y","z"];for(u=0;3>u;++u){var g="contours."+m[u],v=l(g+".show"),y=l(g+".highlight");if(v||y)for(c=0;3>c;++c)l(g+".project."+m[c]);v&&(l(g+".color"),l(g+".width"),l(g+".usecolormap")),y&&(l(g+".highlightcolor"),l(g+".highlightwidth"))}d||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,s,l,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":508,"../../lib":583,"./attributes":817}],822:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":643,"./attributes":817,"./calc":818,"./colorbar":819,"./convert":820,"./defaults":821}]},{},[12])(12)}); \ No newline at end of file diff --git a/package.json b/package.json index cf2288c8e41..3d1f1145c5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plotly.js", - "version": "1.16.3-d16", + "version": "1.16.3-d17", "description": "The open source javascript graphing library that powers plotly", "license": "MIT", "main": "./lib/index.js", diff --git a/src/assets/geo_assets.js b/src/assets/geo_assets.js index 1191900d1f7..38aee709906 100644 --- a/src/assets/geo_assets.js +++ b/src/assets/geo_assets.js @@ -12,6 +12,6 @@ var saneTopojson = require('sane-topojson'); // package version injected by `npm run preprocess` -exports.version = '1.16.3-d16'; +exports.version = '1.16.3-d17'; exports.topojson = saneTopojson; diff --git a/src/core.js b/src/core.js index 5eef1a6e4c2..7bfca07a443 100644 --- a/src/core.js +++ b/src/core.js @@ -15,7 +15,7 @@ var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.16.3-d16'; +exports.version = '1.16.3-d17'; // plot api exports.plot = Plotly.plot;