diff --git a/dist_ion/plotly-ion.js b/dist_ion/plotly-ion.js index a3392dfce0f..e11bc09185f 100644 --- a/dist_ion/plotly-ion.js +++ b/dist_ion/plotly-ion.js @@ -32823,7 +32823,7 @@ exports.svgAttrs = { var Plotly = require('./plotly'); // package version injected by `npm run preprocess` -exports.version = '1.33.1-ion40'; +exports.version = '1.33.1-ion41'; // inject promise polyfill require('es6-promise').polyfill(); @@ -57698,12 +57698,12 @@ plots.autoMargin = function(gd, id, o) { if(fullLayout.margin.autoexpand !== false) { if(!o) delete fullLayout._pushmargin[id]; else { - var pad = o.pad === undefined ? 25 : o.pad; + var pad = o.pad === undefined ? 26 : o.pad; // if the item is too big, just give it enough automargin to // make sure you can still grab it and bring it back if(o.l + o.r > fullLayout.width * 0.45) o.l = o.r = 0; - if(o.b + o.t > fullLayout.height * 0.38) o.b = o.t = 0; + if(o.b + o.t > fullLayout.height * 0.4) o.b = o.t = 0; fullLayout._pushmargin[id] = { l: {val: o.x, size: o.l + pad}, diff --git a/dist_ion/plotly-ion.min.js b/dist_ion/plotly-ion.min.js index 06b8e4a0dff..0f12a0c3d48 100644 --- a/dist_ion/plotly-ion.min.js +++ b/dist_ion/plotly-ion.min.js @@ -1 +1 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,n,r){function a(i,l){if(!n[i]){if(!e[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[i]={exports:{}};e[i][0].call(u.exports,function(t){return a(e[i][1][t]||t)},u,u.exports,t,e,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;ie?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)<0?r=o+1:a=o}return r},right:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)>0?a=o:r=o+1}return r}}}t.ascending=d,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++ar&&(n=r)}else{for(;++a=r){n=r;break}for(;++ar&&(n=r)}return n},t.max=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++an&&(n=r)}else{for(;++a=r){n=r;break}for(;++an&&(n=r)}return n},t.extent=function(t,e){var n,r,a,o=-1,i=t.length;if(1===arguments.length){for(;++o=r){n=a=r;break}for(;++or&&(n=r),a=r){n=a=r;break}for(;++or&&(n=r),a1)return i/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function y(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,n){return d(t(e),n)}:t)},t.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,a,o=n-e;o;)a=Math.random()*o--|0,r=t[o+e],t[o+e]=t[a+e],t[a+e]=r;return t},t.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},t.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],a=new Array(n<0?0:n);e=0;)for(e=(r=t[a]).length;--e>=0;)n[--i]=r[e];return n};var m=Math.abs;function x(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var r,a=[],o=function(t){var e=1;for(;t*e%1;)e*=10;return e}(m(n)),i=-1;if(t*=o,e*=o,(n*=o)<0)for(;(r=t+n*++i)>e;)a.push(r/o);else for(;(r=t+n*++i)=a.length)return n?n.call(r,o):e?o.sort(e):o;for(var s,c,u,f,d=-1,p=o.length,h=a[l++],g=new b;++d=a.length)return e;var r=[],i=o[n++];return e.forEach(function(e,a){r.push({key:e,values:t(a,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}(i(t.map,e,0),0)},r.key=function(t){return a.push(t),r},r.sortKeys=function(t){return o[a.length-1]=t,r},r.sortValues=function(t){return e=t,r},r.rollup=function(t){return n=t,r},r},t.set=function(t){var e=new P;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},t.event=null,t.requote=function(t){return t.replace(q,"\\$&")};var q=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};function V(t){return H(t,X),t}var U=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var n=t.matches||t[D(t,"matchesSelector")];return(Y=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(U=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,n,r,a,o=[];t=Z(t);for(var i=-1,l=this.length;++i=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(n)?{space:Q[n],local:t}:t}},X.attr=function(e,n){if(arguments.length<2){if("string"==typeof e){var r=this.node();return(e=t.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(n in e)this.each($(n,e[n]));return this}return this.each($(e,n))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=et(t)).length,a=-1;if(e=n.classList){for(;++a=0;)(n=r[a])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},X.sort=function(t){t=function(t){arguments.length||(t=d);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}.apply(this,arguments);for(var e=-1,n=this.length;++e0&&(e=e.slice(0,i));var s=ht.get(e);function c(){var t=this[o];t&&(this.removeEventListener(e,t,t.$),delete this[o])}return s&&(e=s,l=vt),i?n?function(){var t=l(n,r(arguments));c.call(this),this.addEventListener(e,this[o]=t,t.$=a),t._=n}:c:n?N:function(){var n,r=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(n=a.match(r)){var o=this[a];this.removeEventListener(n[1],o,o.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,n,r,a,o,i=[],l=-1,s=this.length;++l=r&&(r=e+1);!(i=l[r])&&++r0?1:t<0?-1:0}function zt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function Dt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function Et(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Nt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var n,r,a=t[0],o=t[1],i=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-o,d=u*u+f*f;if(d0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map(function(t){return(t-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function C(t){v++||t({type:"zoomstart"})}function S(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(t){--v||(t({type:"zoomend"}),n=null)}function O(){var e=this,n=_.of(e,arguments),r=0,a=t.select(i(e)).on(m,function(){r=1,T(t.mouse(e),o),S(n)}).on(x,function(){a.on(m,null).on(x,null),l(r),P(n)}),o=k(t.mouse(e)),l=xt(e);pl.call(e),C(n)}function z(){var e,n=this,r=_.of(n,arguments),a={},o=0,i=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+i,c="touchend"+i,u=[],f=t.select(n),p=xt(n);function h(){var r=t.touches(n);return e=d.k,r.forEach(function(t){t.identifier in a&&(a[t.identifier]=k(t))}),r}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,m),u.push(e);for(var r=t.event.changedTouches,i=0,f=r.length;i1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];o=b*b+_*_}}function v(){var i,s,c,u,f=t.touches(n);pl.call(n);for(var d=0,p=f.length;d360?t-=360:t<0&&(t+=360),t<60?r+(a-r)*t/60:t<180?a:t<240?r+(a-r)*(240-t)/60:r}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=2*(n=n<0?0:n>1?1:n)-(a=n<=.5?n*(1+e):n+e-n*e),new oe(o(t+120),o(t),o(t-120))}function Gt(e,n,r){return this instanceof Gt?(this.h=+e,this.c=+n,void(this.l=+r)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Zt?e.l:(e=de((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,n,r)}Vt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,this.l/t)},Vt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,t*this.l)},Vt.rgb=function(){return Ut(this.h,this.s,this.l)},t.hcl=Gt;var Yt=Gt.prototype=new qt;function Xt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(n,Math.cos(t*=St)*e,Math.sin(t)*e)}function Zt(t,e,n){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Gt?Xt(t.h,t.c,t.l):de((t=oe(t)).r,t.g,t.b):new Zt(t,e,n)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?t:1)))},Yt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Zt;var Wt=18,Jt=.95047,Qt=1,$t=1.08883,Kt=Zt.prototype=new qt;function te(t,e,n){var r=(t+16)/116,a=r+e/500,o=r-n/200;return new oe(ae(3.2404542*(a=ne(a)*Jt)-1.5371385*(r=ne(r)*Qt)-.4985314*(o=ne(o)*$t)),ae(-.969266*a+1.8760108*r+.041556*o),ae(.0556434*a-.2040259*r+1.0572252*o))}function ee(t,e,n){return t>0?new Gt(Math.atan2(n,e)*Pt,Math.sqrt(e*e+n*n),t):new Gt(NaN,NaN,t)}function ne(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function re(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function oe(t,e,n){return this instanceof oe?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof oe?new oe(t.r,t.g,t.b):ue(""+t,oe,Ut):new oe(t,e,n)}function ie(t){return new oe(t>>16,t>>8&255,255&t)}function le(t){return ie(t)+""}Kt.brighter=function(t){return new Zt(Math.min(100,this.l+Wt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Zt(Math.max(0,this.l-Wt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=oe;var se=oe.prototype=new qt;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,n){var r,a,o,i=0,l=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(o=ge.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function fe(t,e,n){var r,a,o=Math.min(t/=255,e/=255,n/=255),i=Math.max(t,e,n),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),r=t==i?(e-n)/l+(e0&&s<1?0:r),new Ht(r,a,s)}function de(t,e,n){var r=re((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(n=pe(n)))/Jt),a=re((.2126729*t+.7151522*e+.072175*n)/Qt);return Zt(116*a-16,500*(r-a),200*(a-re((.0193339*t+.119192*e+.9503041*n)/$t)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,a=30;return e||n||r?(e&&e=200&&e<300||304===e){try{t=a.call(i,c)}catch(t){return void l.error.call(i,t)}l.load.call(i,t)}else l.error.call(i,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var n=t.event;t.event=e;try{l.progress.call(i,c)}finally{t.event=n}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",i):n},i.responseType=function(t){return arguments.length?(u=t,i):u},i.response=function(t){return a=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(r(arguments)))}}),i.send=function(t,r,a){if(2===arguments.length&&"function"==typeof r&&(a=r,r=null),c.open(t,e,!0),null==n||"accept"in s||(s.accept=n+",*/*"),c.setRequestHeader)for(var o in s)c.setRequestHeader(o,s[o]);return null!=n&&c.overrideMimeType&&c.overrideMimeType(n),null!=u&&(c.responseType=u),null!=a&&i.on("error",a).on("load",function(t){a(null,t)}),l.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},t.rebind(i,l,"on"),null==o?i:i.get(function(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}(o))}ge.forEach(function(t,e){ge.set(t,ie(e))}),t.functor=ve,t.xhr=ye(O),t.dsv=function(t,e){var n=new RegExp('["'+t+"\n]"),r=t.charCodeAt(0);function a(t,n,r){arguments.length<3&&(r=n,n=null);var a=me(t,e,null==n?o:i(n),r);return a.row=function(t){return arguments.length?a.response(null==(n=t)?o:i(t)):n},a}function o(t){return a.parse(t.responseText)}function i(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return n.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var n;return a.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,n){return e(a(t),n)}:a})},a.parseRows=function(t,e){var n,a,o={},i={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return i;if(a)return a=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,ke(Te))}function Ae(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=xe,n=1/0;e;)e.c?(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}});function Pe(e){var n=e.decimal,r=e.thousands,a=e.grouping,o=e.currency,i=a&&r?function(t,e){for(var n=t.length,o=[],i=0,l=a[0],s=0;n>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(n-=l,n+l)),!((s+=l+1)>e));)l=a[i=(i+1)%a.length];return o.reverse().join(r)}:O;return function(e){var r=Oe.exec(e),a=r[1]||" ",l=r[2]||">",s=r[3]||"-",c=r[4]||"",u=r[5],f=+r[6],d=r[7],p=r[8],h=r[9],g=1,v="",y="",m=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,y="%",h="f";break;case"p":g=100,y="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":m=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=o[0],y=o[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=ze.get(h)||De;var b=u&&d;return function(e){var r=y;if(m&&e%1)return"";var o=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),r=c.symbol+y}else e*=g;var _,w,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var M=x?e.lastIndexOf("e"):-1;M<0?(_=e,w=""):(_=e.substring(0,M),w=e.substring(M))}else _=e.substring(0,k),w=n+e.substring(k+1);!u&&d&&(_=i(_,1/0));var T=v.length+_.length+w.length+(b?0:o.length),A=T"===l?A+o+e:"^"===l?A.substring(0,T>>=1)+o+e+A.substring(T):o+(b?e:A+e))+r}}}t.formatPrefix=function(e,n){var r=0;return(e=+e)&&(e<0&&(e*=-1),n&&(e=t.round(e,Ce(e,n))),r=1+Math.floor(1e-12+Math.log(e)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Se[8+r/3]};var Oe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ze=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,n){return(e=t.round(e,Ce(e,n))).toFixed(Math.max(0,Math.min(20,Ce(e*(1+1e-15),n))))}});function De(t){return t+""}var Ee=t.time={},Ne=Date;function Re(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Re.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ie.setUTCDate.apply(this._,arguments)},setDay:function(){Ie.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ie.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ie.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ie.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ie.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ie.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ie.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ie.setTime.apply(this._,arguments)}};var Ie=Date.prototype;function Fe(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n1)for(;i=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=w[i in qe?e.charAt(l++):i])||(r=o(t,n,r))<0)return-1}else if(a!=n.charCodeAt(r++))return-1}return r}u.utc=function(t){var e=u(t);function n(t){try{var n=new(Ne=Re);return n._=t,e(n)}finally{Ne=Date}}return n.parse=function(t){try{Ne=Re;var n=e.parse(t);return n&&n._}finally{Ne=Date}},n.toString=e.toString,n},u.multi=u.utc.multi=cn;var d=t.map(),p=Ge(i),h=Ye(i),g=Ge(l),v=Ye(l),y=Ge(s),m=Ye(s),x=Ge(c),b=Ye(c);o.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return l[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(n),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Ee.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Ee.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Ee.mondayOfYear(t),e,2)},x:u(r),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ln,"%":function(){return"%"}},w={a:function(t,e,n){g.lastIndex=0;var r=g.exec(e.slice(n));return r?(t.w=v.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){p.lastIndex=0;var r=p.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){y.lastIndex=0;var r=y.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,n){return f(t,_.c.toString(),e,n)},d:tn,e:tn,H:nn,I:nn,j:en,L:on,m:Ke,M:rn,p:function(t,e,n){var r=d.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)},S:an,U:Ze,w:Xe,W:We,x:function(t,e,n){return f(t,_.x.toString(),e,n)},X:function(t,e,n){return f(t,_.X.toString(),e,n)},y:Qe,Y:Je,Z:$e,"%":sn};return u}Ee.year=Fe(function(t){return(t=Ee.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ee.years=Ee.year.range,Ee.years.utc=Ee.year.utc.range,Ee.day=Fe(function(t){var e=new Ne(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ee.days=Ee.day.range,Ee.days.utc=Ee.day.utc.range,Ee.dayOfYear=function(t){var e=Ee.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=Ee[t]=Fe(function(t){return(t=Ee.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Ee.year(t).getDay();return Math.floor((Ee.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Ee[t+"s"]=n.range,Ee[t+"s"].utc=n.utc.range,Ee[t+"OfYear"]=function(t){var n=Ee.year(t).getDay();return Math.floor((Ee.dayOfYear(t)+(n+e)%7)/7)}}),Ee.week=Ee.sunday,Ee.weeks=Ee.sunday.range,Ee.weeks.utc=Ee.sunday.utc.range,Ee.weekOfYear=Ee.sundayOfYear;var qe={"-":"",_:" ",0:"0"},He=/^\s*\d+/,Ve=/^%/;function Ue(t,e,n){var r=t<0?"-":"",a=(r?-t:t)+"",o=a.length;return r+(o68?1900:2e3),n+a[0].length):-1}function $e(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Ke(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function an(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function on(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ln(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=m(e)/60|0,a=m(e)%60;return n+Ue(r,"0",2)+Ue(a,"0",2)}function sn(t,e,n){Ve.lastIndex=0;var r=Ve.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n=0?1:-1,l=i*o,s=Math.cos(e),c=Math.sin(e),u=a*c,f=r*s+u*Math.cos(l),d=u*i*Math.sin(l);On.add(Math.atan2(d,f)),n=t,r=s,a=c}zn.point=function(i,l){zn.point=o,n=(t=i)*St,r=Math.cos(l=(e=l)*St/2+Tt/4),a=Math.sin(l)},zn.lineEnd=function(){o(t,e)}}function En(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function Nn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Rn(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 In(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function jn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Bn(t){return[Math.atan2(t[1],t[0]),Et(t[2])]}function qn(t,e){return m(t[0]-e[0])kt?a=90:c<-kt&&(n=-90),f[0]=e,f[1]=r}};function p(t,o){u.push(f=[e=t,r=t]),oa&&(a=o)}function h(t,i){var l=En([t*St,i*St]);if(s){var c=Rn(s,l),u=Rn([c[1],-c[0],0],c);jn(u),u=Bn(u);var f=t-o,d=f>0?1:-1,h=u[0]*Pt*d,g=m(f)>180;if(g^(d*oa&&(a=v);else if(g^(d*o<(h=(h+360)%360-180)&&ha&&(a=i);g?t_(e,r)&&(r=t):_(t,r)>_(e,r)&&(e=t):r>=e?(tr&&(r=t)):t>o?_(e,t)>_(e,r)&&(r=t):_(t,r)>_(e,r)&&(e=t)}else p(t,i);s=l,o=t}function g(){d.point=h}function v(){f[0]=e,f[1]=r,d.point=p,s=null}function y(t,e){if(s){var n=t-o;c+=m(n)>180?n+(n>0?360:-360):n}else i=t,l=e;zn.point(t,e),h(t,e)}function x(){zn.lineStart()}function b(){y(i,l),zn.lineEnd(),m(c)>kt&&(e=-(r=180)),f[0]=e,f[1]=r,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(i=0,l[c=l.length-1]);i<=c;g=p,++i)p=l[i],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],r=g[1])}return u=f=null,e===1/0||n===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,n],[r,a]]}}(),t.geo.centroid=function(e){bn=_n=wn=kn=Mn=Tn=An=Ln=Cn=Sn=Pn=0,t.geo.stream(e,Hn);var n=Cn,r=Sn,a=Pn,o=n*n+r*r+a*a;return o=0;--l)a.point((f=u[l])[0],f[1]);else r(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function Qn(t){if(e=t.length){for(var e,n,r=0,a=t[0];++r=0?1:-1,k=w*_,M=k>Tt,T=h*x;if(On.add(Math.atan2(T*w*Math.sin(k),g*b+T*Math.cos(k))),o+=M?_+w*At:_,M^d>=n^y>=n){var A=Rn(En(f),En(t));jn(A);var L=Rn(a,A);jn(L);var C=(M^_>=0?-1:1)*Et(L[2]);(r>C||r===C&&(A[0]||A[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=y,h=x,g=b,f=t}}return(o<-kt||o0){for(x||(i.polygonStart(),x=!0),i.lineStart();++o1&&2&e&&n.push(n.pop().concat(n.shift())),l.push(n.filter(tr))}return u}}function tr(t){return t.length>1}function er(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:N,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function nr(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var rr=Kn(Wn,function(t){var e,n=NaN,r=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?Tt:-Tt,s=m(o-n);m(s-Tt)0?Ct:-Ct),t.point(a,r),t.lineEnd(),t.lineStart(),t.point(l,r),t.point(o,r),e=0):a!==l&&s>=Tt&&(m(n-a)kt?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+r)/2}(n,r,o,i),t.point(a,r),t.lineEnd(),t.lineStart(),t.point(l,r),e=0),t.point(n=o,r=i),a=l},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var a;if(null==t)a=n*Ct,r.point(-Tt,a),r.point(0,a),r.point(Tt,a),r.point(Tt,0),r.point(Tt,-a),r.point(0,-a),r.point(-Tt,-a),r.point(-Tt,0),r.point(-Tt,a);else if(m(t[0]-e[0])>kt){var o=t[0]0)){if(o/=d,d<0){if(o0){if(o>f)return;o>u&&(u=o)}if(o=n-s,d||!(o<0)){if(o/=d,d<0){if(o>f)return;o>u&&(u=o)}else if(d>0){if(o0)){if(o/=p,p<0){if(o0){if(o>f)return;o>u&&(u=o)}if(o=r-c,p||!(o<0)){if(o/=p,p<0){if(o>f)return;o>u&&(u=o)}else if(p>0){if(o0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var or=1e9;function ir(e,n,r,a){return function(s){var c,u,f,d,p,h,g,v,y,m,x,b=s,_=er(),w=ar(e,n,r,a),k={point:A,lineStart:function(){k.point=L,u&&u.push(f=[]);m=!0,y=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&y&&_.rejoin(),c.push(_.buffer()));k.point=A,y&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var n=function(t){for(var e=0,n=u.length,r=t[1],a=0;ar&&zt(c,o,t)>0&&++e:o[1]<=r&&zt(c,o,t)<0&&--e,c=o;return 0!==e}([e,a]),r=x&&n,o=c.length;(r||o)&&(s.polygonStart(),r&&(s.lineStart(),M(null,null,1,s),s.lineEnd()),o&&Jn(c,i,n,M,s),s.polygonEnd()),c=u=f=null}};function M(t,i,s,c){var u=0,f=0;if(null==t||(u=o(t,s))!==(f=o(i,s))||l(t,i)<0^s>0)do{c.point(0===u||3===u?e:r,u>1?a:n)}while((u=(u+s+4)%4)!==f);else c.point(i[0],i[1])}function T(t,o){return e<=t&&t<=r&&n<=o&&o<=a}function A(t,e){T(t,e)&&s.point(t,e)}function L(t,e){var n=T(t=Math.max(-or,Math.min(or,t)),e=Math.max(-or,Math.min(or,e)));if(u&&f.push([t,e]),m)d=t,p=e,h=n,m=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&y)s.point(t,e);else{var r={a:{x:g,y:v},b:{x:t,y:e}};w(r)?(y||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),x=!1):n&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,y=n}return k};function o(t,a){return m(t[0]-e)0?0:3:m(t[0]-r)0?2:1:m(t[1]-n)0?1:0:a>0?3:2}function i(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}}function lr(t){var e=0,n=Tt/3,r=Or(t),a=r(e,n);return a.parallels=function(t){return arguments.length?r(e=t[0]*Tt/180,n=t[1]*Tt/180):[e/Tt*180,n/Tt*180]},a}function sr(t,e){var n=Math.sin(t),r=(n+Math.sin(e))/2,a=1+n*(2*r-n),o=Math.sqrt(a)/r;function i(t,e){var n=Math.sqrt(a-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),o-n*Math.cos(t)]}return i.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/r,Et((a-(t*t+n*n)*r*r)/(2*r))]},i}t.geo.clipExtent=function(){var t,e,n,r,a,o,i={stream:function(t){return a&&(a.valid=!1),(a=o(t)).valid=!0,a},extent:function(l){return arguments.length?(o=ir(t=+l[0][0],e=+l[0][1],n=+l[1][0],r=+l[1][1]),a&&(a.valid=!1,a=null),i):[[t,e],[n,r]]}};return i.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return lr(sr)}).raw=sr,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,n,r,a,o=t.geo.albers(),i=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};function c(t){var o=t[0],i=t[1];return e=null,n(o,i),e||(r(o,i),e)||a(o,i),e}return c.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,a=(t[1]-n[1])/e;return(a>=.12&&a<.234&&r>=-.425&&r<-.214?i:a>=.166&&a<.234&&r>=-.214&&r<-.115?l:o).invert(t)},c.stream=function(t){var e=o.stream(t),n=i.stream(t),r=l.stream(t);return{point:function(t,a){e.point(t,a),n.point(t,a),r.point(t,a)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},c.precision=function(t){return arguments.length?(o.precision(t),i.precision(t),l.precision(t),c):o.precision()},c.scale=function(t){return arguments.length?(o.scale(t),i.scale(.35*t),l.scale(t),c.translate(o.translate())):o.scale()},c.translate=function(t){if(!arguments.length)return o.translate();var e=o.scale(),u=+t[0],f=+t[1];return n=o.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,r=i.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var cr,ur,fr,dr,pr,hr,gr={point:N,lineStart:N,lineEnd:N,polygonStart:function(){ur=0,gr.lineStart=vr},polygonEnd:function(){gr.lineStart=gr.lineEnd=gr.point=N,cr+=m(ur/2)}};function vr(){var t,e,n,r;function a(t,e){ur+=r*t-n*e,n=t,r=e}gr.point=function(o,i){gr.point=a,t=n=o,e=r=i},gr.lineEnd=function(){a(t,e)}}var yr={point:function(t,e){tpr&&(pr=t);ehr&&(hr=e)},lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N};function mr(){var t=xr(4.5),e=[],n={point:r,lineStart:function(){n.point=a},lineEnd:i,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=i,n.point=r},pointRadius:function(e){return t=xr(e),n},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function r(n,r){e.push("M",n,",",r,t)}function a(t,r){e.push("M",t,",",r),n.point=o}function o(t,n){e.push("L",t,",",n)}function i(){n.point=r}function l(){e.push("Z")}return n}function xr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var br,_r={point:wr,lineStart:kr,lineEnd:Mr,polygonStart:function(){_r.lineStart=Tr},polygonEnd:function(){_r.point=wr,_r.lineStart=kr,_r.lineEnd=Mr}};function wr(t,e){wn+=t,kn+=e,++Mn}function kr(){var t,e;function n(n,r){var a=n-t,o=r-e,i=Math.sqrt(a*a+o*o);Tn+=i*(t+n)/2,An+=i*(e+r)/2,Ln+=i,wr(t=n,e=r)}_r.point=function(r,a){_r.point=n,wr(t=r,e=a)}}function Mr(){_r.point=wr}function Tr(){var t,e,n,r;function a(t,e){var a=t-n,o=e-r,i=Math.sqrt(a*a+o*o);Tn+=i*(n+t)/2,An+=i*(r+e)/2,Ln+=i,Cn+=(i=r*t-n*e)*(n+t),Sn+=i*(r+e),Pn+=3*i,wr(n=t,r=e)}_r.point=function(o,i){_r.point=a,wr(t=n=o,e=r=i)},_r.lineEnd=function(){a(t,e)}}function Ar(t){var e=4.5,n={point:r,lineStart:function(){n.point=a},lineEnd:i,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=i,n.point=r},pointRadius:function(t){return e=t,n},result:N};function r(n,r){t.moveTo(n+e,r),t.arc(n,r,e,0,At)}function a(e,r){t.moveTo(e,r),n.point=o}function o(e,n){t.lineTo(e,n)}function i(){n.point=r}function l(){t.closePath()}return n}function Lr(t){var e=.5,n=Math.cos(30*St),r=16;function a(e){return(r?function(e){var n,a,i,l,s,c,u,f,d,p,h,g,v={point:y,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){f=NaN,v.point=x,e.lineStart()}function x(n,a){var i=En([n,a]),l=t(n,a);o(f,d,u,p,h,g,f=l[0],d=l[1],u=n,p=i[0],h=i[1],g=i[2],r,e),e.point(f,d)}function b(){v.point=y,e.lineEnd()}function _(){m(),v.point=w,v.lineEnd=k}function w(t,e){x(n=t,e),a=f,i=d,l=p,s=h,c=g,v.point=x}function k(){o(f,d,u,p,h,g,a,i,n,l,s,c,r,e),v.lineEnd=b,b()}return v}:function(e){return Sr(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})})(e)}function o(r,a,i,l,s,c,u,f,d,p,h,g,v,y){var x=u-r,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=l+p,k=s+h,M=c+g,T=Math.sqrt(w*w+k*k+M*M),A=Math.asin(M/=T),L=m(m(M)-1)e||m((x*O+b*z)/_-.5)>.3||l*p+s*h+c*g0&&16,a):Math.sqrt(e)},a}function Cr(t){this.stream=t}function Sr(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Pr(t){return Or(function(){return t})()}function Or(e){var n,r,a,o,i,l,s=Lr(function(t,e){return[(t=n(t,e))[0]*c+o,i-t[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,y=rr,x=O,b=null,_=null;function w(t){return[(t=a(t[0]*St,t[1]*St))[0]*c+o,i-t[1]*c]}function k(t){return(t=a.invert((t[0]-o)/c,(i-t[1])/c))&&[t[0]*Pt,t[1]*Pt]}function M(){a=Zn(r=Nr(h,g,v),n);var t=n(d,p);return o=u-t[0]*c,i=f+t[1]*c,T()}function T(){return l&&(l.valid=!1,l=null),w}return w.stream=function(t){return l&&(l.valid=!1),(l=zr(y(r,s(x(t))))).valid=!0,l},w.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,rr):function(t){var e=Math.cos(t),n=e>0,r=m(e)>kt;return Kn(a,function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=n?g?0:i(f,d):g?i(f+(f<0?Tt:-Tt),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=o(e,h),(qn(e,p)||qn(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=o(h,e),t.point(p[0],p[1])):(p=o(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(r&&e&&n^g){var y;v&l||!(y=o(h,e,!0))||(u=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&qn(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}},jr(t,6*St),n?[0,-t]:[-Tt,t-Tt]);function a(t,n){return Math.cos(t)*Math.cos(n)>e}function o(t,n,r){var a=[1,0,0],o=Rn(En(t),En(n)),i=Nn(o,o),l=o[0],s=i-l*l;if(!s)return!r&&t;var c=e*i/s,u=-e*l/s,f=Rn(a,o),d=Fn(a,c);In(d,Fn(o,u));var p=f,h=Nn(d,p),g=Nn(p,p),v=h*h-g*(Nn(d,d)-1);if(!(v<0)){var y=Math.sqrt(v),x=Fn(p,(-h-y)/g);if(In(x,d),x=Bn(x),!r)return x;var b,_=t[0],w=n[0],k=t[1],M=n[1];w<_&&(b=_,_=w,w=b);var T=w-_,A=m(T-Tt)0^x[1]<(m(x[0]-_)Tt^(_<=x[0]&&x[0]<=w)){var L=Fn(p,(-h+y)/g);return In(L,d),[x,Bn(L)]}}}function i(e,r){var a=n?t:Tt-t,o=0;return e<-a?o|=1:e>a&&(o|=2),r<-a?o|=4:r>a&&(o|=8),o}}((b=+t)*St),T()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?ir(t[0][0],t[0][1],t[1][0],t[1][1]):O,T()):_},w.scale=function(t){return arguments.length?(c=+t,M()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],M()):[u,f]},w.center=function(t){return arguments.length?(d=t[0]%360*St,p=t[1]%360*St,M()):[d*Pt,p*Pt]},w.rotate=function(t){return arguments.length?(h=t[0]%360*St,g=t[1]%360*St,v=t.length>2?t[2]%360*St:0,M()):[h*Pt,g*Pt,v*Pt]},t.rebind(w,s,"precision"),function(){return n=e.apply(this,arguments),w.invert=n.invert&&k,M()}}function zr(t){return Sr(t,function(e,n){t.point(e*St,n*St)})}function Dr(t,e){return[t,e]}function Er(t,e){return[t>Tt?t-At:t<-Tt?t+At:t,e]}function Nr(t,e,n){return t?e||n?Zn(Ir(t),Fr(e,n)):Ir(t):e||n?Fr(e,n):Er}function Rr(t){return function(e,n){return[(e+=t)>Tt?e-At:e<-Tt?e+At:e,n]}}function Ir(t){var e=Rr(t);return e.invert=Rr(-t),e}function Fr(t,e){var n=Math.cos(t),r=Math.sin(t),a=Math.cos(e),o=Math.sin(e);function i(t,e){var i=Math.cos(e),l=Math.cos(t)*i,s=Math.sin(t)*i,c=Math.sin(e),u=c*n+l*r;return[Math.atan2(s*a-u*o,l*n-c*r),Et(u*a+s*o)]}return i.invert=function(t,e){var i=Math.cos(e),l=Math.cos(t)*i,s=Math.sin(t)*i,c=Math.sin(e),u=c*a-s*o;return[Math.atan2(s*a+c*o,l*n+u*r),Et(u*n-l*r)]},i}function jr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=Br(n,a),o=Br(n,o),(i>0?ao)&&(a+=i*At)):(a=t+i*At,o=t-.5*s);for(var c,u=a;i>0?u>o:u2?t[2]*St:0),e.invert=function(e){return(e=t.invert(e[0]*St,e[1]*St))[0]*=Pt,e[1]*=Pt,e},e},Er.invert=Dr,t.geo.circle=function(){var t,e,n=[0,0],r=6;function a(){var t="function"==typeof n?n.apply(this,arguments):n,r=Nr(-t[0]*St,-t[1]*St,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=r(t,e)),t[0]*=Pt,t[1]*=Pt}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(n=t,a):n},a.angle=function(n){return arguments.length?(e=jr((t=+n)*St,r*St),a):t},a.precision=function(n){return arguments.length?(e=jr(t*St,(r=+n)*St),a):r},a.angle(90)},t.geo.distance=function(t,e){var n,r=(e[0]-t[0])*St,a=t[1]*St,o=e[1]*St,i=Math.sin(r),l=Math.cos(r),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*i)*n+(n=c*u-s*f*l)*n),s*u+c*f*l)},t.geo.graticule=function(){var e,n,r,a,o,i,l,s,c,u,f,d,p=10,h=p,g=90,v=360,y=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,r,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(n/p)*p,e,p).filter(function(t){return m(t%g)>kt}).map(c)).concat(t.range(Math.ceil(i/h)*h,o,h).filter(function(t){return m(t%v)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(r).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],r=+t[1][0],s=+t[0][1],l=+t[1][1],a>r&&(t=a,a=r,r=t),s>l&&(t=s,s=l,l=t),x.precision(y)):[[a,s],[r,l]]},x.minorExtent=function(t){return arguments.length?(n=+t[0][0],e=+t[1][0],i=+t[0][1],o=+t[1][1],n>e&&(t=n,n=e,e=t),i>o&&(t=i,i=o,o=t),x.precision(y)):[[n,i],[e,o]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(y=+t,c=qr(i,o,90),u=Hr(n,e,y),f=qr(s,l,90),d=Hr(a,r,y),x):y},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,n,r=Vr,a=Ur;function o(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||a.apply(this,arguments)]}}return o.distance=function(){return t.geo.distance(e||r.apply(this,arguments),n||a.apply(this,arguments))},o.source=function(t){return arguments.length?(r=t,e="function"==typeof t?null:t,o):r},o.target=function(t){return arguments.length?(a=t,n="function"==typeof t?null:t,o):a},o.precision=function(){return arguments.length?o:0},o},t.geo.interpolate=function(t,e){return n=t[0]*St,r=t[1]*St,a=e[0]*St,o=e[1]*St,i=Math.cos(r),l=Math.sin(r),s=Math.cos(o),c=Math.sin(o),u=i*Math.cos(n),f=i*Math.sin(n),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(Rt(o-r)+i*s*Rt(a-n))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,n=Math.sin(h-t)*g,r=n*u+e*d,a=n*f+e*p,o=n*l+e*c;return[Math.atan2(a,r)*Pt,Math.atan2(o,Math.sqrt(r*r+a*a))*Pt]}:function(){return[n*Pt,r*Pt]}).distance=h,v;var n,r,a,o,i,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return br=0,t.geo.stream(e,Gr),br};var Gr={sphere:N,point:N,lineStart:function(){var t,e,n;function r(r,a){var o=Math.sin(a*=St),i=Math.cos(a),l=m((r*=St)-t),s=Math.cos(l);br+=Math.atan2(Math.sqrt((l=i*Math.sin(l))*l+(l=n*o-e*i*s)*l),e*o+n*i*s),t=r,e=o,n=i}Gr.point=function(a,o){t=a*St,e=Math.sin(o*=St),n=Math.cos(o),Gr.point=r},Gr.lineEnd=function(){Gr.point=Gr.lineEnd=N}},lineEnd:N,polygonStart:N,polygonEnd:N};function Yr(t,e){function n(e,n){var r=Math.cos(e),a=Math.cos(n),o=t(r*a);return[o*a*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),a=e(r),o=Math.sin(a),i=Math.cos(a);return[Math.atan2(t*o,r*i),Math.asin(r&&n*o/r)]},n}var Xr=Yr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Pr(Xr)}).raw=Xr;var Zr=Yr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},O);function Wr(t,e){var n=Math.cos(t),r=function(t){return Math.tan(Tt/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(r(e)/r(t)),o=n*Math.pow(r(t),a)/a;if(!a)return $r;function i(t,e){o>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var n=o/Math.pow(r(e),a);return[n*Math.sin(a*t),o-n*Math.cos(a*t)]}return i.invert=function(t,e){var n=o-e,r=Ot(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(o/r,1/a))-Ct]},i}function Jr(t,e){var n=Math.cos(t),r=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/r+t;if(m(r)1&&zt(t[n[r-2]],t[n[r-1]],t[a])<=0;)--r;n[r++]=a}return n.slice(0,r)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Pr(ea)}).raw=ea,na.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=Kr(na),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90])}).raw=na,t.geom={},t.geom.hull=function(t){var e=ra,n=aa;if(arguments.length)return r(t);function r(t){if(t.length<3)return[];var r,a=ve(e),o=ve(n),i=t.length,l=[],s=[];for(r=0;r=0;--r)p.push(t[l[c[r]][2]]);for(r=+f;rkt)l=l.L;else{if(!((a=o-Ma(l,i))>kt)){r>-kt?(e=l.P,n=l):a>-kt?(e=l,n=l.N):e=n=l;break}if(!l.R){e=l;break}l=l.R}var s=xa(t);if(pa.insert(e,s),e||n){if(e===n)return Sa(e),n=xa(e.site),pa.insert(s,n),s.edge=n.edge=za(e.site,s.site),Ca(e),void Ca(n);if(n){Sa(e),Sa(n);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=n.site,g=h.x-u,v=h.y-f,y=2*(d*v-p*g),m=d*d+p*p,x=g*g+v*v,b={x:(v*m-p*x)/y+u,y:(d*x-g*m)/y+f};Da(n.edge,c,h,b),s.edge=za(c,t,null,b),n.edge=za(t,h,null,b),Ca(e),Ca(n)}else s.edge=za(e.site,s.site)}}function ka(t,e){var n=t.site,r=n.x,a=n.y,o=a-e;if(!o)return r;var i=t.P;if(!i)return-1/0;var l=(n=i.site).x,s=n.y,c=s-e;if(!c)return l;var u=l-r,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+r:(r+l)/2}function Ma(t,e){var n=t.N;if(n)return ka(n,e);var r=t.site;return r.y===e?r.x:1/0}function Ta(t){this.site=t,this.edges=[]}function Aa(t,e){return e.angle-t.angle}function La(){Ra(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ca(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,a=t.site,o=n.site;if(r!==o){var i=a.x,l=a.y,s=r.x-i,c=r.y-l,u=o.x-i,f=2*(s*(v=o.y-l)-c*u);if(!(f>=-Mt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,y=ya.pop()||new La;y.arc=t,y.site=a,y.x=h+i,y.y=v+Math.sqrt(h*h+g*g),y.cy=v,t.circle=y;for(var m=null,x=ga._;x;)if(y.y=l)return;if(d>h){if(o){if(o.y>=c)return}else o={x:v,y:s};n={x:v,y:c}}else{if(o){if(o.y1)if(d>h){if(o){if(o.y>=c)return}else o={x:(s-a)/r,y:s};n={x:(c-a)/r,y:c}}else{if(o){if(o.y=l)return}else o={x:i,y:r*i+a};n={x:l,y:r*l+a}}else{if(o){if(o.xkt||m(a-n)>kt)&&(l.splice(i,0,new Ea((y=o.site,x=u,b=m(r-f)kt?{x:f,y:m(e-f)kt?{x:m(n-h)kt?{x:d,y:m(e-d)kt?{x:m(n-p)=n&&c.x<=a&&c.y>=r&&c.y<=i?[[n,i],[a,i],[a,r],[n,r]]:[]).point=t[l]}),e}function l(t){return t.map(function(t,e){return{x:Math.round(r(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}})}return i.links=function(t){return Ba(l(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},i.triangles=function(t){var e=[];return Ba(l(t)).cells.forEach(function(n,r){for(var a,o,i,l,s=n.site,c=n.edges.sort(Aa),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++uo&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,s.push({i:i,x:Xa(n,r)})),o=Ja.lastIndex;return og&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;fg&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function M(t,e,n,r,a,o,i,l){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(m(s-n)+m(c-r)<.01)T(t,e,n,r,a,o,i,l);else{var u=t.point;t.x=t.y=t.point=null,T(t,u,s,c,a,o,i,l),T(t,e,n,r,a,o,i,l)}else t.x=n,t.y=r,t.point=e}else T(t,e,n,r,a,o,i,l)}function T(t,e,n,r,a,o,i,l){var s=.5*(a+i),c=.5*(o+l),u=n>=s,f=r>=c,d=f<<1|u;t.leaf=!1,u?a=s:i=s,f?o=c:l=c,M(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,n,r,a,o,i,l)}w>k?v=h+w:g=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(A,t,+y(t,++f),+x(t,f),p,h,g,v)}};if(A.visit=function(t){!function t(e,n,r,a,o,i){if(!e(n,r,a,o,i)){var l=.5*(r+o),s=.5*(a+i),c=n.nodes;c[0]&&t(e,c[0],r,a,l,s),c[1]&&t(e,c[1],l,a,o,s),c[2]&&t(e,c[2],r,s,l,i),c[3]&&t(e,c[3],l,s,o,i)}}(t,A,p,h,g,v)},A.find=function(t){return function(t,e,n,r,a,o,i){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>o||f>i||d=_)<<1|e>=b,k=w+4;w=0&&!(r=t.interpolators[a](e,n)););return r}function $a(t,e){var n,r=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(n=0;n=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function lo(t){return 1-Math.cos(t*Ct)}function so(t){return Math.pow(2,10*(t-1))}function co(t){return 1-Math.sqrt(1-t*t)}function uo(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function fo(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function po(t){var e,n,r,a=[t.a,t.b],o=[t.c,t.d],i=go(a),l=ho(a,o),s=go(((e=o)[0]+=(r=-l)*(n=a)[0],e[1]+=r*n[1],e))||0;a[0]*o[1]=0?t.slice(0,r):t,o=r>=0?t.slice(r+1):"in";return a=to.get(a)||Ka,o=eo.get(o)||O,e=o(a.apply(null,n.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,n){e=t.hcl(e),n=t.hcl(n);var r=e.h,a=e.c,o=e.l,i=n.h-r,l=n.c-a,s=n.l-o;isNaN(l)&&(l=0,a=isNaN(a)?n.c:a);isNaN(i)?(i=0,r=isNaN(r)?n.h:r):i>180?i-=360:i<-180&&(i+=360);return function(t){return Xt(r+i*t,a+l*t,o+s*t)+""}},t.interpolateHsl=function(e,n){e=t.hsl(e),n=t.hsl(n);var r=e.h,a=e.s,o=e.l,i=n.h-r,l=n.s-a,s=n.l-o;isNaN(l)&&(l=0,a=isNaN(a)?n.s:a);isNaN(i)?(i=0,r=isNaN(r)?n.h:r):i>180?i-=360:i<-180&&(i+=360);return function(t){return Ut(r+i*t,a+l*t,o+s*t)+""}},t.interpolateLab=function(e,n){e=t.lab(e),n=t.lab(n);var r=e.l,a=e.a,o=e.b,i=n.l-r,l=n.a-a,s=n.b-o;return function(t){return te(r+i*t,a+l*t,o+s*t)+""}},t.interpolateRound=fo,t.transform=function(e){var n=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate()}return new po(e?e.matrix:vo)})(e)},po.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vo={a:1,b:0,c:0,d:1,e:0,f:0};function yo(t){return t.length?t.pop()+",":""}function mo(e,n){var r=[],a=[];return e=t.transform(e),n=t.transform(n),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var a=n.push("translate(",null,",",null,")");r.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else(e[0]||e[1])&&n.push("translate("+e+")")}(e.translate,n.translate,r,a),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(yo(n)+"rotate(",null,")")-2,x:Xa(t,e)})):e&&n.push(yo(n)+"rotate("+e+")")}(e.rotate,n.rotate,r,a),function(t,e,n,r){t!==e?r.push({i:n.push(yo(n)+"skewX(",null,")")-2,x:Xa(t,e)}):e&&n.push(yo(n)+"skewX("+e+")")}(e.skew,n.skew,r,a),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var a=n.push(yo(n)+"scale(",null,",",null,")");r.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(yo(n)+"scale("+e+")")}(e.scale,n.scale,r,a),e=n=null,function(t){for(var e,n=-1,o=a.length;++n0?r=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:r=0})):t>0&&(s.start({type:"start",alpha:r=t}),e=Me(l.tick)),l):r},l.start=function(){var t,e,n,r=y.length,s=m.length,u=c[0],h=c[1];for(t=0;t=0;)n.push(a[r])}function zo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++i=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return zo(a,function(e){var r,a;t&&(r=e.children)&&r.sort(t),n&&(a=e.parent)&&(a.value+=e.value)}),l}return r.sort=function(e){return arguments.length?(t=e,r):t},r.children=function(t){return arguments.length?(e=t,r):e},r.value=function(t){return arguments.length?(n=t,r):n},r.revalue=function(t){return n&&(Oo(t,function(t){t.children&&(t.value=0)}),zo(t,function(t){var e;t.children||(t.value=+n.call(r,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},r},t.layout.partition=function(){var e=t.layout.hierarchy(),n=[1,1];function r(t,r){var a=e.call(this,t,r);return function t(e,n,r,a){var o=e.children;if(e.x=n,e.y=e.depth*a,e.dx=r,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(r=e.value?r/e.value:0;++cl&&(l=r),i.push(r)}for(n=0;na&&(r=n,a=e);return r}function Yo(t){return t.reduce(Xo,0)}function Xo(t,e){return t+e[1]}function Zo(t,e){return Wo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Wo(t,e){for(var n=-1,r=+t[0],a=(t[1]-r)/e,o=[];++n<=e;)o[n]=a*n+r;return o}function Jo(e){return[t.min(e),t.max(e)]}function Qo(t,e){return t.value-e.value}function $o(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Ko(t,e){t._pack_next=e,e._pack_prev=t}function ti(t,e){var n=e.x-t.x,r=e.y-t.y,a=t.r+e.r;return.999*a*a>n*n+r*r}function ei(t){if((e=t.children)&&(s=e.length)){var e,n,r,a,o,i,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(ni),(n=e[0]).x=-n.r,n.y=0,x(n),s>1&&((r=e[1]).x=r.r,r.y=0,x(r),s>2))for(ai(n,r,a=e[2]),x(a),$o(n,a),n._pack_prev=a,$o(a,r),r=n._pack_next,o=3;o0)for(i=-1;++i=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(o[i]));return c}return o.value=function(t){return arguments.length?(n=t,o):n},o.range=function(t){return arguments.length?(r=ve(t),o):r},o.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Wo(e,t)}:ve(t),o):a},o.frequency=function(t){return arguments.length?(e=!!t,o):e},o},t.layout.pack=function(){var e,n=t.layout.hierarchy().sort(Qo),r=0,a=[1,1];function o(t,o){var i=n.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,zo(l,function(t){t.r=+u(t.value)}),zo(l,ei),r){var f=r*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;zo(l,function(t){t.r+=f}),zo(l,ei),zo(l,function(t){t.r-=f})}return function t(e,n,r,a){var o=e.children;e.x=n+=a*e.x;e.y=r+=a*e.y;e.r*=a;if(o)for(var i=-1,l=o.length;++ip.x&&(p=t),t.depth>h.depth&&(h=t)});var g=n(d,p)/2-d.x,v=r[0]/(p.x+n(p,d)/2+g),y=r[1]/(h.depth||1);Oo(u,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function i(t){var e=t.children,r=t.parent.children,a=t.i?r[t.i-1]:null;if(e.length){!function(t){var e,n=0,r=0,a=t.children,o=a.length;for(;--o>=0;)(e=a[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var o=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+n(t._,a._),t.m=t.z-o):t.z=o}else a&&(t.z=a.z+n(t._,a._));t.parent.A=function(t,e,r){if(e){for(var a,o=t,i=t,l=e,s=o.parent.children[0],c=o.m,u=i.m,f=l.m,d=s.m;l=li(l),o=ii(o),l&&o;)s=ii(s),(i=li(i)).a=t,(a=l.z+f-o.z-c+n(l._,o._))>0&&(si(ci(l,t,r),t,a),c+=a,u+=a),f+=l.m,c+=o.m,d+=s.m,u+=i.m;l&&!li(i)&&(i.t=l,i.m+=f-u),o&&!ii(s)&&(s.t=o,s.m+=c-d,r=t)}return r}(t,a,t.parent.A||r[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=r[0],t.y=t.depth*r[1]}return o.separation=function(t){return arguments.length?(n=t,o):n},o.size=function(t){return arguments.length?(a=null==(r=t)?s:null,o):a?null:r},o.nodeSize=function(t){return arguments.length?(a=null==(r=t)?null:s,o):a?r:null},Po(o,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),n=oi,r=[1,1],a=!1;function o(o,i){var l,s=e.call(this,o,i),c=s[0],u=0;zo(c,function(e){var r=e.children;r&&r.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(r),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(r)):(e.x=l?u+=n(e,l):0,e.y=0,l=e)});var f=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(c),d=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(c),p=f.x-n(f,d)/2,h=d.x+n(d,f)/2;return zo(c,a?function(t){t.x=(t.x-c.x)*r[0],t.y=(c.y-t.y)*r[1]}:function(t){t.x=(t.x-p)/(h-p)*r[0],t.y=(1-(c.y?t.y/c.y:1))*r[1]}),s}return o.separation=function(t){return arguments.length?(n=t,o):n},o.size=function(t){return arguments.length?(a=null==(r=t),o):a?null:r},o.nodeSize=function(t){return arguments.length?(a=null!=(r=t),o):a?r:null},Po(o,e)},t.layout.treemap=function(){var e,n=t.layout.hierarchy(),r=Math.round,a=[1,1],o=null,i=ui,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var n,r,a=-1,o=t.length;++a0;)l.push(n=c[a-1]),l.area+=n.area,"squarify"!==s||(r=p(l,g))<=d?(c.pop(),d=r):(l.area-=l.pop().area,h(l,g,o,!1),g=Math.min(o.dx,o.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,o,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var n,r=i(t),a=e.slice(),o=[];for(u(a,r.dx*r.dy/t.value),o.area=0;n=a.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!a.length),o.length=o.area=0);e.forEach(d)}}function p(t,e){for(var n,r=t.area,a=0,o=1/0,i=-1,l=t.length;++ia&&(a=n));return e*=e,(r*=r)?Math.max(e*a*c/r,r/(e*o*c)):1/0}function h(t,e,n,a){var o,i=-1,l=t.length,s=n.x,c=n.y,u=e?r(t.area/e):0;if(e==n.dx){for((a||u>n.dy)&&(u=n.dy);++in.dx)&&(u=n.dx);++i1);return t+e*n*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var n=t.random.irwinHall(e);return function(){return n()/e}},irwinHall:function(t){return function(){for(var e=0,n=0;n2?mi:hi,l=a?bo:xo;return o=t(e,n,l,r),i=t(n,e,l,Qa),s}function s(t){return o(t)}s.invert=function(t){return i(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e};s.range=function(t){return arguments.length?(n=t,l()):n};s.rangeRound=function(t){return s.range(t).interpolate(fo)};s.clamp=function(t){return arguments.length?(a=t,l()):a};s.interpolate=function(t){return arguments.length?(r=t,l()):r};s.ticks=function(t){return wi(e,t)};s.tickFormat=function(t,n){return ki(e,t,n)};s.nice=function(t){return bi(e,t),l()};s.copy=function(){return t(e,n,r,a)};return l()}([0,1],[0,1],Qa,!1)};var Mi={s:1,g:1,p:1,r:1,e:1};function Ti(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(n,r,a,o){function i(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function l(t){return a?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return n(i(t))}s.invert=function(t){return l(n.invert(t))};s.domain=function(t){return arguments.length?(a=t[0]>=0,n.domain((o=t.map(Number)).map(i)),s):o};s.base=function(t){return arguments.length?(r=+t,n.domain(o.map(i)),s):r};s.nice=function(){var t=gi(o.map(i),a?Math:Li);return n.domain(t),o=t.map(l),s};s.ticks=function(){var t=di(o),e=[],n=t[0],s=t[1],c=Math.floor(i(n)),u=Math.ceil(i(s)),f=r%1?2:r;if(isFinite(u-c)){if(a){for(;c0;d--)e.push(l(c)*d);for(c=0;e[c]s;u--);e=e.slice(c,u)}return e};s.tickFormat=function(e,n){if(!arguments.length)return Ai;arguments.length<2?n=Ai:"function"!=typeof n&&(n=t.format(n));var a=Math.max(1,r*e/s.ticks().length);return function(t){var e=t/l(Math.round(i(t)));return e*r0?a[t-1]:n[0],tf?0:1;if(c=Lt)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,y,m,x,b,_,w,k,M,T,A=0,L=0,C=[];if((y=(+i.apply(this,arguments)||0)/2)&&(v=r===Ei?Math.sqrt(l*l+c*c):+r.apply(this,arguments),p||(L*=-1),c&&(L=Et(v/c*Math.sin(y))),l&&(A=Et(v/l*Math.sin(y)))),c){m=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=Tt?0:1;if(L&&Bi(m,x,b,_)===p^S){var P=(u+f)/2;m=c*Math.cos(P),x=c*Math.sin(P),b=_=null}}else m=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),M=l*Math.cos(u+A),T=l*Math.sin(u+A);var O=Math.abs(u-f+2*A)<=Tt?0:1;if(A&&Bi(w,k,M,T)===1-p^O){var z=(u+f)/2;w=l*Math.cos(z),k=l*Math.sin(z),M=T=null}}else w=k=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+n.apply(this,arguments)))>.001){g=l0?0:1}function qi(t,e,n,r,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?r:-r)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,y=p-f,m=v*v+y*y,x=n-r,b=u*p-d*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-v*_)/m,k=(-b*v-y*_)/m,M=(b*y+v*_)/m,T=(-b*v+y*_)/m,A=w-h,L=k-g,C=M-h,S=T-g;return A*A+L*L>C*C+S*S&&(w=M,k=T),[[w-s,k-c],[w*n/x,k*n/x]]}function Hi(t){var e=ra,n=aa,r=Wn,a=Ui,o=a.key,i=.7;function l(o){var l,s=[],c=[],u=-1,f=o.length,d=ve(e),p=ve(n);function h(){s.push("M",a(t(c),i))}for(;++u1&&a.push("H",r[0]);return a.join("")},"step-before":Yi,"step-after":Xi,basis:Ji,"basis-open":function(t){if(t.length<4)return Ui(t);var e,n=[],r=-1,a=t.length,o=[0],i=[0];for(;++r<3;)e=t[r],o.push(e[0]),i.push(e[1]);n.push(Qi(tl,o)+","+Qi(tl,i)),--r;for(;++r9&&(a=3*e/Math.sqrt(a),i[l]=a*n,i[l+1]=a*r));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}(t))}});function Ui(t){return t.length>1?t.join("L"):t+"Z"}function Gi(t){return t.join("L")+"Z"}function Yi(t){for(var e=0,n=t.length,r=t[0],a=[r[0],",",r[1]];++e1){l=e[1],o=t[s],s++,r+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;cTt)+",1 "+e}function s(t,e,n,r){return"Q 0,0 "+r}return o.radius=function(t){return arguments.length?(n=ve(t),o):n},o.source=function(e){return arguments.length?(t=ve(e),o):t},o.target=function(t){return arguments.length?(e=ve(t),o):e},o.startAngle=function(t){return arguments.length?(r=ve(t),o):r},o.endAngle=function(t){return arguments.length?(a=ve(t),o):a},o},t.svg.diagonal=function(){var t=Vr,e=Ur,n=il;function r(r,a){var o=t.call(this,r,a),i=e.call(this,r,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return"M"+(s=s.map(n))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return r.source=function(e){return arguments.length?(t=ve(e),r):t},r.target=function(t){return arguments.length?(e=ve(t),r):e},r.projection=function(t){return arguments.length?(n=t,r):n},r},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),n=il,r=e.projection;return e.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Ct;return[n*Math.cos(r),n*Math.sin(r)]}}(n=t)):n},e},t.svg.symbol=function(){var t=sl,e=ll;function n(n,r){return(ul.get(t.call(this,n,r))||cl)(e.call(this,n,r))}return n.type=function(e){return arguments.length?(t=ve(e),n):t},n.size=function(t){return arguments.length?(e=ve(t),n):e},n};var ul=t.map({circle:cl,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*dl)),n=e*dl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/fl),n=e*fl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/fl),n=e*fl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});t.svg.symbolTypes=ul.keys();var fl=Math.sqrt(3),dl=Math.tan(30*St);X.transition=function(t){for(var e,n,r=vl||++xl,a=wl(t),o=[],i=yl||{time:Date.now(),ease:io,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(t,i);if(o>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[r]:delete t[n],1}f||(o=a.time,i=Me(function(t){var e=f.delay;if(i.t=e+o,e<=t)return d(t-e);i.c=d},0,o),f=u[r]={tween:new b,time:o,timer:i,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}ml.call=X.call,ml.empty=X.empty,ml.node=X.node,ml.size=X.size,t.transition=function(e,n){return e&&e.transition?vl?e.transition(n):e:t.selection().transition(e)},t.transition.prototype=ml,ml.select=function(t){var e,n,r,a=this.id,o=this.namespace,i=[];t=Z(t);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,y=this,m=t.select(t.event.target),x=r.of(y,arguments),b=t.select(y),_=m.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&o,M=m.classed("extent"),T=xt(y),A=t.mouse(y),L=t.select(i(y)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(f=null,A[0]-=l[1],A[1]-=s[1],M=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(A[0]+=l[1],A[1]+=s[1],M=0,F())});if(t.event.changedTouches?L.on("touchmove.brush",P).on("touchend.brush",z):L.on("mousemove.brush",P).on("mouseup.brush",z),b.interrupt().selectAll("*").interrupt(),M)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var C=+/w$/.test(_),S=+/^n/.test(_);v=[l[1-C]-A[0],s[1-S]-A[1]],A[0]=l[C],A[1]=s[S]}else t.event.altKey&&(f=A.slice());function P(){var e=t.mouse(y),n=!1;v&&(e[0]+=v[0],e[1]+=v[1]),M||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]1?{floor:function(e){for(;l(e=t.floor(e));)e=Nl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Nl(+e+1);return e}}:t))},a.ticks=function(t,e){var n=di(a.domain()),r=null==t?o(n,10):"number"==typeof t?o(n,t):!t.range&&[{range:t},e];return r&&(t=r[0],e=r[1]),t.range(n[0],Nl(+n[1]+1),e<1?1:e)},a.tickFormat=function(){return r},a.copy=function(){return El(e.copy(),n,r)},xi(a,e)}function Nl(t){return new Date(t)}Pl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Dl:zl,Dl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Dl.toString=zl.toString,Ee.second=Fe(function(t){return new Ne(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Ee.seconds=Ee.second.range,Ee.seconds.utc=Ee.second.utc.range,Ee.minute=Fe(function(t){return new Ne(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Ee.minutes=Ee.minute.range,Ee.minutes.utc=Ee.minute.utc.range,Ee.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new Ne(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Ee.hours=Ee.hour.range,Ee.hours.utc=Ee.hour.utc.range,Ee.month=Fe(function(t){return(t=Ee.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Ee.months=Ee.month.range,Ee.months.utc=Ee.month.utc.range;var Rl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Il=[[Ee.second,1],[Ee.second,5],[Ee.second,15],[Ee.second,30],[Ee.minute,1],[Ee.minute,5],[Ee.minute,15],[Ee.minute,30],[Ee.hour,1],[Ee.hour,3],[Ee.hour,6],[Ee.hour,12],[Ee.day,1],[Ee.day,2],[Ee.week,1],[Ee.month,1],[Ee.month,3],[Ee.year,1]],Fl=Pl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Wn]]),jl={range:function(e,n,r){return t.range(Math.ceil(e/r)*r,+n,r).map(Nl)},floor:O,ceil:O};Il.year=Ee.year,Ee.scale=function(){return El(t.scale.linear(),Il,Fl)};var Bl=Il.map(function(t){return[t[0].utc,t[1]]}),ql=Ol.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Wn]]);function Hl(t){return JSON.parse(t.responseText)}function Vl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Bl.year=Ee.year.utc,Ee.scale.utc=function(){return El(t.scale.linear(),Bl,ql)},t.text=ye(function(t){return t.responseText}),t.json=function(t,e){return me(t,"application/json",Hl,e)},t.html=function(t,e){return me(t,"text/html",Vl,e)},t.xml=ye(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],14:[function(t,e,n){(function(r,a){!function(t,r){"object"==typeof n&&void 0!==e?e.exports=r():t.ES6Promise=r()}(this,function(){"use strict";function e(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,l=void 0,s=function(t,e){g[o]=t,g[o+1]=e,2===(o+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==r&&"[object process]"==={}.toString.call(r),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!a(e))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var n,r,i,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=(n=this._events[t]).length,r=-1,n===e||a(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(l=i;l-- >0;)if(n[l]===e||n[l].listener&&n[l].listener===e){r=l;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(a(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],16:[function(t,e,n){"use strict";var r=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":20}],17:[function(t,e,n){e.exports=function(t,e){var n=e[0],r=e[1],a=e[2],o=e[3],i=n+n,l=r+r,s=a+a,c=n*i,u=r*i,f=r*l,d=a*i,p=a*l,h=a*s,g=o*i,v=o*l,y=o*s;return t[0]=1-f-h,t[1]=u+y,t[2]=d-v,t[3]=0,t[4]=u-y,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],18:[function(t,e,n){(function(n){"use strict";var r,a=t("is-browser");r="function"==typeof n.matchMedia?!n.matchMedia("(hover: none)").matches:a,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":19}],19:[function(t,e,n){e.exports=!0},{}],20:[function(t,e,n){"use strict";e.exports=function(t){for(var e,n=t.length,r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],21:[function(t,e,n){var r={left:0,top:0};e.exports=function(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var a=t.clientX||0,o=t.clientY||0,i=(l=e,l===window||l===document||l===document.body?r:l.getBoundingClientRect());var l;return n[0]=a-i.left,n[1]=o-i.top,n}},{}],22:[function(t,e,n){var r,a=t("./lib/build-log"),o=t("./lib/epsilon"),i=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=o();function d(t,e,n){var a=r.segments(t),o=r.segments(e),i=n(r.combine(a,o));return r.polygon(i)}r={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=i(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:i(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(r,t)},polygonToGeoJSON:function(t){return c.fromPolygon(r,f,t)},union:function(t,e){return d(t,e,r.selectUnion)},intersect:function(t,e){return d(t,e,r.selectIntersect)},difference:function(t,e){return d(t,e,r.selectDifference)},differenceRev:function(t,e){return d(t,e,r.selectDifferenceRev)},xor:function(t,e){return d(t,e,r.selectXor)}},"object"==typeof window&&(window.PolyBool=r),e.exports=r},{"./lib/build-log":23,"./lib/epsilon":24,"./lib/geojson":25,"./lib/intersecter":26,"./lib/segment-chainer":28,"./lib/segment-selector":29}],23:[function(t,e,n){e.exports=function(){var t,e=0,n=!1;function r(e,n){return t.list.push({type:e,data:n?JSON.parse(JSON.stringify(n)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return r("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return r("div_seg",{seg:t,pt:e}),r("chop",{seg:t,pt:e})},statusRemove:function(t){return r("pop_seg",{seg:t})},segmentUpdate:function(t){return r("seg_update",{seg:t})},segmentNew:function(t,e){return r("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return r("rem_seg",{seg:t})},tempStatus:function(t,e,n){return r("temp_status",{seg:t,above:e,below:n})},rewind:function(t){return r("rewind",{seg:t})},status:function(t,e,n){return r("status",{seg:t,above:e,below:n})},vert:function(e){return e===n?t:(n=e,r("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),r("log",{txt:t})},reset:function(){return r("reset")},selected:function(t){return r("selected",{segs:t})},chainStart:function(t){return r("chain_start",{seg:t})},chainRemoveHead:function(t,e){return r("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return r("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return r("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return r("chain_match",{index:t})},chainClose:function(t){return r("chain_close",{index:t})},chainAddHead:function(t,e){return r("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return r("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return r("chain_con",{index1:t,index2:e})},chainReverse:function(t){return r("chain_rev",{index:t})},chainJoin:function(t,e){return r("chain_join",{index1:t,index2:e})},done:function(){return r("done")}}}},{}],24:[function(t,e,n){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,n,r){var a=n[0],o=n[1],i=r[0],l=r[1],s=e[0];return(i-a)*(e[1]-o)-(l-o)*(s-a)>=-t},pointBetween:function(e,n,r){var a=e[1]-n[1],o=r[0]-n[0],i=e[0]-n[0],l=r[1]-n[1],s=i*o+a*l;return!(s-t)},pointsSameX:function(e,n){return Math.abs(e[0]-n[0])t!=i-a>t&&(o-c)*(a-u)/(i-u)+c-r>t&&(l=!l),o=c,i=u}return l}};return e}},{}],25:[function(t,e,n){var r={toPolygon:function(t,e){function n(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function n(e){var n=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[n]})}for(var r=n(e[0]),a=1;a0})}function u(t,r){var a=t.seg,o=r.seg,i=a.start,l=a.end,c=o.start,u=o.end;n&&n.checkIntersection(a,o);var f=e.linesIntersect(i,l,c,u);if(!1===f){if(!e.pointsCollinear(i,l,c))return!1;if(e.pointsSame(i,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(i,c),p=e.pointsSame(l,u);if(d&&p)return r;var h=!d&&e.pointBetween(i,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(r,l):s(t,u),r;h&&(p||(g?s(r,l):s(t,u)),s(r,i))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(r,i):0===f.alongA?s(r,f.pt):1===f.alongA&&s(r,l));return!1}for(var f=[];!o.isEmpty();){var d=o.getHead();if(n&&n.vert(d.pt[0]),d.isStart){n&&n.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}n&&n.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var y,m,x=v();if(x)t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,n&&n.segmentUpdate(x.seg),d.other.remove(),d.remove();if(o.getHead()!==d){n&&n.rewind(d.seg);continue}t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=m?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(y=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?i:a,d.seg.otherFill={above:y,below:y}),n&&n.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(r.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),n&&n.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}o.getHead().remove()}return n&&n.done(),f}return t?{addRegion:function(t){for(var r,a,o,i=t[t.length-1],s=0;s1)for(var n=1;n1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=P(t,360),e=P(e,100),n=P(n,100),0===e)r=a=o=n;else{var l=n<.5?n*(1+e):n+e-n*e,s=2*n-l;r=i(s,l,t+1/3),a=i(s,l,t),o=i(s,l,t-1/3)}return{r:255*r,g:255*a,b:255*o}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(o=e.a));var p,h,g;return o=S(o),{ok:f,format:e.format||d,r:i(255,l(a.r,0)),g:i(255,l(a.g,0)),b:i(255,l(a.b,0)),a:o}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=o(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,n){t=P(t,255),e=P(e,255),n=P(n,255);var r,a,o=l(t,e,n),s=i(t,e,n),c=(o+s)/2;if(o==s)r=a=0;else{var u=o-s;switch(a=c>.5?u/(2-o-s):u/(o+s),o){case t:r=(e-n)/u+(e>1)+720)%360;--e;)r.h=(r.h+a)%360,o.push(c(r));return o}function A(t,e){e=e||6;for(var n=c(t).toHsv(),r=n.h,a=n.s,o=n.v,i=[],l=1/e;e--;)i.push(c({h:r,s:a,v:o})),o=(o+l)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,n,r,a=this.toRgb();return e=a.r/255,n=a.g/255,r=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,a){var i=[D(o(t).toString(16)),D(o(e).toString(16)),D(o(n).toString(16)),D(N(r))];if(a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*P(this._r,255))+"%",g:o(100*P(this._g,255))+"%",b:o(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%)":"rgba("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);n="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:E(t[r]));t=n}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,n){n=0===n?0:n||50;var r=c(t).toRgb(),a=c(e).toRgb(),o=n/100;return c({r:(a.r-r.r)*o+r.r,g:(a.g-r.g)*o+r.g,b:(a.b-r.b)*o+r.b,a:(a.a-r.a)*o+r.a})},c.readability=function(e,n){var r=c(e),a=c(n);return(t.max(r.getLuminance(),a.getLuminance())+.05)/(t.min(r.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,n){var r,a,o=c.readability(t,e);switch(a=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},c.mostReadable=function(t,e,n){var r,a,o,i,l=null,s=0;a=(n=n||{}).includeFallbackColors,o=n.level,i=n.size;for(var u=0;us&&(s=r,l=c(e[u]));return c.isReadable(t,l,{level:o,size:i})||!a?l:(n.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],n))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=c.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(L);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function P(e,n){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=i(n,l(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),t.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function O(t){return i(1,l(0,t))}function z(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function N(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var I,F,j,B=(F="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",j="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],32:[function(t,e,n){var r;r=this,function(t){"use strict";var e=function(t){return t},n=function(t){if(null==(n=t.transform))return e;var n,r,a,o=n.scale[0],i=n.scale[1],l=n.translate[0],s=n.translate[1];return function(t,e){return e||(r=a=0),t[0]=(r+=t[0])*o+l,t[1]=(a+=t[1])*i+s,t}},r=function(t){var e=t.bbox;function r(t){s[0]=t[0],s[1]=t[1],l(s),s[0]f&&(f=s[0]),s[1]d&&(d=s[1])}function a(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(a);break;case"Point":r(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(r)}}if(!e){var o,i,l=n(t),s=new Array(2),c=1/0,u=c,f=-c,d=-c;for(i in t.arcs.forEach(function(t){for(var e=-1,n=t.length;++ef&&(f=s[0]),s[1]d&&(d=s[1])}),t.objects)a(t.objects[i]);e=t.bbox=[c,u,f,d]}return e},a=function(t,e){for(var n,r=t.length,a=r-e;a<--r;)n=t[a],t[a++]=t[r],t[r]=n};function o(t,e){var n=e.id,r=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==n&&null==r?{type:"Feature",properties:a,geometry:o}:null==r?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:r,properties:a,geometry:o}}function i(t,e){var r=n(t),o=t.arcs;function i(t,e){e.length&&e.pop();for(var n=o[t<0?~t:t],i=0,l=n.length;i1)r=function(t,e,n){var r,a=[],o=[];function i(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function l(t){t.forEach(i)}function s(t){t.forEach(l)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":l(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}}(e),o.forEach(null==n?function(t){a.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&a.push(t[0].i)}),a}(0,e,n);else for(a=0,r=new Array(o=t.arcs.length);a1)for(var o,i,c=1,u=s(a[0]);cu&&(i=a[0],a[0]=a[c],a[c]=i,u=o);return a})}}var u=function(t,e){for(var n=0,r=t.length;n>>1;t[a]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var n,a=r(t),o=a[0],i=(a[2]-o)/(e-1)||1,l=a[1],s=(a[3]-l)/(e-1)||1;function c(t){t[0]=Math.round((t[0]-o)/i),t[1]=Math.round((t[1]-l)/s)}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":c(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(c)}}for(n in t.arcs.forEach(function(t){for(var e,n,r,a=1,c=1,u=t.length,f=t[0],d=f[0]=Math.round((f[0]-o)/i),p=f[1]=Math.round((f[1]-l)/s);a1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s.pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*n[0],e.yaxis.r2l(s.y)*n[1],e.zaxis.r2l(s.z)*n[2]]),r(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":251,"../annotations/draw":46}],37:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var n=r.subplotsRegistry.gl3d;if(!n)return;for(var o=n.attrRegex,i=Object.keys(t),l=0;l0||n.explicitOff.length>0},onClick:function(t,e){var n,o=a(t,e),i=o.on,l=o.off.concat(o.explicitOff),s={};if(!i.length&&!l.length)return;for(n=0;n2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}e._w=N,e._h=I;for(var q=!1,H=["x","y"],V=0;V1)&&(Q===J?((it=$.r2fraction(e["a"+W]))<0||it>1)&&(q=!0):q=!0,q))continue;U=$._offset+$.r2p(e[W]),X=.5}else"x"===W?(Y=e[W],U=x.l+x.w*Y):(Y=1-e[W],U=x.t+x.h*Y),X=e.showarrow?.5:Y;if(e.showarrow){ot.head=U;var lt=e["a"+W];Z=tt*B(.5,e.xanchor)-et*B(.5,e.yanchor),Q===J?(ot.tail=$._offset+$.r2p(lt),G=Z):(ot.tail=U+lt,G=Z+lt),ot.text=ot.tail+Z;var st=m["x"===W?"width":"height"];if("paper"===J&&(ot.head=i.constrain(ot.head,1,st-1)),"pixel"===Q){var ct=-Math.max(ot.tail-3,ot.text),ut=Math.min(ot.tail+3,ot.text)-st;ct>0?(ot.tail+=ct,ot.text+=ct):ut>0&&(ot.tail-=ut,ot.text-=ut)}ot.tail+=at,ot.head+=at}else G=Z=nt*B(X,rt),ot.text=U+Z;ot.text+=at,Z+=at,G+=at,e["_"+W+"padplus"]=nt/2+G,e["_"+W+"padminus"]=nt/2-G,e["_"+W+"size"]=nt,e["_"+W+"shift"]=Z}if(q)C.remove();else{var ft=0,dt=0;if("left"!==e.align&&(ft=(N-L)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(I-P)*("middle"===e.valign?.5:1)),u)r.select("svg").attr({x:O+ft-1,y:O+dt}).call(c.setClipUrl,D?_:null);else{var pt=O+dt-v.top,ht=O+ft-v.left;R.call(f.positionText,ht,pt).call(c.setClipUrl,D?_:null)}E.select("rect").call(c.setRect,O,O,N,I),z.call(c.setRect,S/2,S/2,F-S,j-S),C.call(c.setTranslate,Math.round(w.x.text-F/2),Math.round(w.y.text-j/2)),T.attr({transform:"rotate("+k+","+w.x.text+","+w.y.text+")"});var gt,vt,yt=function(n,r){M.selectAll(".annotation-arrow-g").remove();var u=w.x.head,f=w.y.head,d=w.x.tail+n,v=w.y.tail+r,m=w.x.text+n,_=w.y.text+r,A=i.rotationXYMatrix(k,m,_),L=i.apply2DTransform(A),S=i.apply2DTransform2(A),P=+z.attr("width"),O=+z.attr("height"),D=m-.5*P,E=D+P,N=_-.5*O,R=N+O,I=[[D,N,D,R],[D,R,E,R],[E,R,E,N],[E,N,D,N]].map(S);if(!I.reduce(function(t,e){return t^!!i.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){I.forEach(function(t){var e=i.segmentsIntersect(d,v,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,v=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,q=M.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),H=q.append("path").attr("d","M"+d+","+v+"L"+u+","+f).style("stroke-width",F+"px").call(s.stroke,s.rgb(j));if(h(H,B,e),b.annotationPosition&&H.node().parentNode&&!o){var V=u,U=f;if(e.standoff){var G=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-v,2));V+=e.standoff*(d-u)/G,U+=e.standoff*(v-f)/G}var Y,X,Z,W=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(v-U),transform:"translate("+V+","+U+")"}).style("stroke-width",F+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:W.node(),gd:t,prepFn:function(){var t=c.getTranslate(C);X=t.x,Z=t.y,Y={},l&&l.autorange&&(Y[l._name+".autorange"]=!0),g&&g.autorange&&(Y[g._name+".autorange"]=!0)},moveFn:function(t,n){var r=L(X,Z),a=r[0]+t,o=r[1]+n;C.call(c.setTranslate,a,o),Y[y+".x"]=l?l.p2r(l.r2p(e.x)+t):e.x+t/x.w,Y[y+".y"]=g?g.p2r(g.r2p(e.y)+n):e.y-n/x.h,e.axref===e.xref&&(Y[y+".ax"]=l.p2r(l.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[y+".ay"]=g.p2r(g.r2p(e.ay)+n)),q.attr("transform","translate("+t+","+n+")"),T.attr({transform:"rotate("+k+","+a+","+o+")"})},doneFn:function(){a.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&yt(0,0),A)p.init({element:C.node(),gd:t,prepFn:function(){vt=T.attr("transform"),gt={}},moveFn:function(t,n){var r="pointer";if(e.showarrow)e.axref===e.xref?gt[y+".ax"]=l.p2r(l.r2p(e.ax)+t):gt[y+".ax"]=e.ax+t,e.ayref===e.yref?gt[y+".ay"]=g.p2r(g.r2p(e.ay)+n):gt[y+".ay"]=e.ay+n,yt(t,n);else{if(o)return;if(l)gt[y+".x"]=e.x+t/l._m;else{var a=e._xsize/x.w,i=e.x+(e._xshift-e.xshift)/x.w-a/2;gt[y+".x"]=p.align(i+t/x.w,a,0,1,e.xanchor)}if(g)gt[y+".y"]=e.y+n/g._m;else{var s=e._ysize/x.h,c=e.y-(e._yshift+e.yshift)/x.h-s/2;gt[y+".y"]=p.align(c-n/x.h,s,0,1,e.yanchor)}l&&g||(r=p.getCursor(l?.5:gt[y+".x"],g?.5:gt[y+".y"],e.xanchor,e.yanchor))}T.attr({transform:"translate("+t+","+n+")"+vt}),d(C,r)},doneFn:function(){d(C),a.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var n=0;n=0,v=e.indexOf("end")>=0,y=f.backoff*p+n.standoff,m=d.backoff*h+n.startstandoff;if("line"===u.nodeName){i={x:+t.attr("x1"),y:+t.attr("y1")},l={x:+t.attr("x2"),y:+t.attr("y2")};var x=i.x-l.x,b=i.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,y&&m&&y+m>Math.sqrt(x*x+b*b))return void O();if(y){if(y*y>x*x+b*b)return void O();var _=y*Math.cos(s),w=y*Math.sin(s);l.x+=_,l.y+=w,t.attr({x2:l.x,y2:l.y})}if(m){if(m*m>x*x+b*b)return void O();var k=m*Math.cos(s),M=m*Math.sin(s);i.x-=k,i.y-=M,t.attr({x1:i.x,y1:i.y})}}else if("path"===u.nodeName){var T=u.getTotalLength(),A="";if(T=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 o?"rgba("+l+", "+r[3]+")":"rgb("+l+")"}o.overrideColorDefaults=function(t){if(void 0===t)return o.defaults;o.defaults=t},o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(r(t))},o.opacity=function(t){return t?r(t).getAlpha():0},o.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},o.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var a=r(e||s).toRgb(),o=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},i={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 r(i).toRgbString()},o.contrast=function(t,e,n){var a=r(t);return 1!==a.getAlpha()&&(a=r(o.combine(t,s))),(a.isDark()?e?a.lighten(e):s:n?a.darken(n):l).toString()},o.stroke=function(t,e){var n=r(e);t.style({stroke:o.tinyRGB(n),"stroke-opacity":n.getAlpha()})},o.fill=function(t,e){var n=r(e);t.style({fill:o.tinyRGB(n),"fill-opacity":n.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,n,r,a,i=Object.keys(t);for(e=0;e0?A>=D:A<=D));L++)A>N&&A0?A>=D:A<=D));L++)A>C[0]&&A1){var at=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));et*=at*u.roundUp(rt/at,[2,5,10]),(Math.abs(n.levels.start)/n.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+Y,W+V-Y],K.setScale();var ot=_._infolayer.selectAll("g."+e).data([0]);ot.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=r.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var it=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");K._axislayer=ot.select(".cbaxis");var lt=0;if(-1!==["top","bottom"].indexOf(n.titleside)){var st,ct=T.l+(n.x+U)*T.w,ut=K.titlefont.size;st="top"===n.titleside?(1-(W+V-Y))*T.h+T.t+3+.75*ut:(1-(W+Y))*T.h+T.t-3-.25*ut,vt(K._id+"title",{attributes:{x:ct,y:st,"text-anchor":"start"}})}var ft,dt,pt,ht=u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(n.titleside)){var e=ot.select(".cbtitle"),o=e.select("text"),i=[-n.outlinewidth/2,n.outlinewidth/2],l=e.select(".h"+K._id+"title-math-group").node(),c=15.6;if(o.node()&&(c=parseInt(o.node().style.fontSize,10)*y),l?(lt=p.bBox(l).height)>c&&(i[1]-=(lt-c)/2):o.node()&&!o.classed(w.jsPlaceholder)&&(lt=p.bBox(o.node()).height),lt){if(lt+=5,"top"===n.titleside)K.domain[1]-=lt/T.h,i[1]*=-1;else{K.domain[0]+=lt/T.h;var f=v.lineCount(o);i[1]+=(1-f)*c}e.attr("transform","translate("+i+")"),K.setScale()}}ot.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(T.h*(1-K.domain[1]))+")"),K._axislayer.attr("transform","translate(0,"+Math.round(-T.t)+")");var d=ot.select(".cbfills").selectAll("rect.cbfill").data(P);d.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),d.exit().remove(),d.each(function(t,e){var n=[0===e?C[0]:(P[e]+P[e-1])/2,e===P.length-1?C[1]:(P[e]+P[e+1])/2].map(K.c2p).map(Math.round);e!==P.length-1&&(n[1]+=n[1]>n[0]?1:-1);var o=z(t).replace("e-",""),i=a(o).toHexString();r.select(this).attr({x:X,width:Math.max(B,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:i})});var h=ot.select(".cblines").selectAll("path.cbline").data(n.line.color&&n.line.width?S:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){r.select(this).attr("d","M"+X+","+(Math.round(K.c2p(t))+n.line.width/2%1)+"h"+B).call(p.lineGroupStyle,n.line.width,O(t),n.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=X+B+(n.outlinewidth||0)/2-("outside"===n.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(-1===["top","bottom"].indexOf(n.titleside)){var e=K.titlefont.size,a=K._offset+K._length/2,o=T.l+(K.position||0)*T.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));vt("h"+K._id+"title",{avoid:{selection:r.select(t).selectAll("g."+K._id+"tick"),side:n.titleside,offsetLeft:T.l,offsetTop:0,maxShift:_.width},attributes:{x:o,y:a,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},i.previousPromises,function(){var r=B+n.outlinewidth/2+p.bBox(K._axislayer.node()).width;if((I=it.select("text")).node()&&!I.classed(w.jsPlaceholder)){var a,o=it.select(".h"+K._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(n.titleside)?p.bBox(o).width:p.bBox(it.node()).right-X-T.l,r=Math.max(r,a)}var l=2*n.xpad+r+n.borderwidth+n.outlinewidth/2,s=J-Q;ot.select(".cbbg").attr({x:X-n.xpad-(n.borderwidth+n.outlinewidth)/2,y:Q-G,width:Math.max(l,2),height:Math.max(s+2*G,2)}).call(h.fill,n.bgcolor).call(h.stroke,n.bordercolor).style({"stroke-width":n.borderwidth}),ot.selectAll(".cboutline").attr({x:X,y:Q+n.ypad+("top"===n.titleside?lt:0),width:Math.max(B,2),height:Math.max(s-2*n.ypad-lt,2)}).call(h.stroke,n.outlinecolor).style({fill:"None","stroke-width":n.outlinewidth});var c=({center:.5,right:1}[n.xanchor]||0)*l;ot.attr("transform","translate("+(T.l-c)+","+T.t+")"),i.autoMargin(t,e,{x:n.x,y:n.y,l:l*({right:1,center:.5}[n.xanchor]||0),r:l*({left:1,center:.5}[n.xanchor]||0),t:s*({bottom:1,middle:.5}[n.yanchor]||0),b:s*({top:1,middle:.5}[n.yanchor]||0)})}],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.edits.colorbarPosition)c.init({element:ot.node(),gd:t,prepFn:function(){ft=ot.attr("transform"),d(ot)},moveFn:function(t,e){ot.attr("transform",ft+" translate("+t+","+e+")"),dt=c.align(Z+t/T.w,q,0,1,n.xanchor),pt=c.align(W-e/T.h,V,0,1,n.yanchor);var r=c.getCursor(dt,pt,n.xanchor,n.yanchor);d(ot,r)},doneFn:function(){d(ot),void 0!==dt&&void 0!==pt&&o.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},M().index)}});return ht}function gt(t,e){return u.coerce($,K,b,t,e)}function vt(e,n){var r,a=M();r=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:r,traceIndex:a.index,placeholder:_._dfltTitle.colorbar,containerGroup:ot.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,n||{}))}_._infolayer.selectAll("g."+e).remove()}function M(){var n,r,a=e.substr(2);for(n=0;n=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":169,"./flip_scale":62,"./scales":69}],58:[function(t,e,n){"use strict";var r=t("./attributes"),a=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,n){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:a({},r.colorscale,{}),cauto:a({},r.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:a({},r.zmax,{editType:e||r.zmax.editType,impliedEdits:{cauto:!1}}),cmin:a({},r.zmin,{editType:e||r.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:a({},r.autocolorscale,{dflt:!1===n?n:r.autocolorscale.dflt}),reversescale:a({},r.reversescale,{})}}},{"../../lib/extend":161,"./attributes":56,"./scales.js":69}],59:[function(t,e,n){"use strict";var r=t("./scales");e.exports=r.RdBu},{"./scales":69}],60:[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,d=u.prefix,p=u.cLetter,h=d.slice(0,d.length-1),g=d?a.nestedProperty(t,h).get()||{}:t,v=d?a.nestedProperty(e,h).get()||{}:e,y=g[p+"min"],m=g[p+"max"],x=g.colorscale;c(d+p+"auto",!(r(y)&&r(m)&&y=0;a--,o++)e=t[a],r[o]=[1-e[0],e[1]];return r}},{}],63:[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){if(e||(e=a),!t)return e;function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return"string"==typeof t&&(n(),"string"==typeof t&&n()),o(t)?t:e}},{"./default_scale":59,"./is_valid_scale_array":67,"./scales":69}],64:[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;s4/3-l?i:l}},{}],71:[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":169}],72:[function(t,e,n){"use strict";var r=t("mouse-event-offset"),a=t("../../plotly"),o=t("../../lib"),i=t("../../plots/cartesian/constants"),l=t("../../constants/interactions"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");s.unhover=c.wrapped,s.unhoverRaw=c.raw;var u=o.eventListenerOptionsSupported();function f(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.init=function(t){var e,n,r,c,d,p,h,g=t.gd,v=1,y=l.DBLCLICKDELAY,m=t.element;g._mouseDownTime||(g._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=_,u?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=_,m.addEventListener("touchstart",_,{passive:!1})):m.ontouchstart=_;var x=t.clampFn||function(t,e,n){return Math.abs(t)y&&(v=Math.max(v-1,1)),g.childElementCount)if(g._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(v,d),!h){var n;try{n=new MouseEvent("click",e)}catch(t){var r=f(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,r[0],r[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&a.plot(t)}(g),g._dragged=!1,b()?void 0:o.pauseEvent(e)}g._dragged=!1}}},{"../../constants/interactions":149,"../../lib":169,"../../plotly":208,"../../plots/cartesian/constants":218,"./align":70,"./cursor":71,"./unhover":73,"mouse-event-offset":21}],73:[function(t,e,n){"use strict";var r=t("../../lib/events"),a=t("../../lib/throttle"),o=t("../../lib/get_graph_div"),i=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,n){(t=o(t))._fullLayout&&a.clear(t._fullLayout._uid+i.HOVERID),l.raw(t,e,n)},l.raw=function(t,e){var n=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":160,"../../lib/get_graph_div":167,"../../lib/throttle":191,"../fx/constants":87}],74:[function(t,e,n){"use strict";n.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],75:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("tinycolor2"),i=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,h=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,n,r){c.isPlainObject(e)&&(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)},v.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},v.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},v.setRect=function(t,e,n,r,a){t.call(v.setPosition,e,n).call(v.setSize,r,a)},v.translatePoint=function(t,e,n,r){var o=n.c2p(t.x),i=r.c2p(t.y);return!!(a(o)&&a(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",o).attr("y",i):e.attr("transform","translate("+o+","+i+")"),!0)},v.translatePoints=function(t,e,n){t.each(function(t){var a=r.select(this);v.translatePoint(t,a,e,n)})},v.hideOutsideRangePoint=function(t,e,n,r,a,o){e.attr("display",n.isPtWithinRange(t,a)&&r.isPtWithinRange(t,o)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,a=e.yaxis;t.each(function(e){var o=e[0].trace,i=o.xcalendar,l=o.ycalendar;t.selectAll(".point,.textpoint").each(function(t){v.hideOutsideRangePoint(t,r.select(this),n,a,i,l)})})}},v.crispRound=function(t,e,n){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},v.singleLineStyle=function(t,e,n,r,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=n||o.width||0,s=a||o.dash||"";l.stroke(e,r||o.color),v.dashLine(e,s,i)},v.lineGroupStyle=function(t,e,n,a){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},i=e||o.width||0,s=a||o.dash||"";r.select(this).call(l.stroke,n||o.color).call(v.dashLine,s,i)})},v.dashLine=function(t,e,n){n=+n||0,e=v.dashStyle(e,n),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},v.dashStyle=function(t,e){e=+e||1;var n=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=n+"px,"+n+"px":"dash"===t?t=3*n+"px,"+3*n+"px":"longdash"===t?t=5*n+"px,"+5*n+"px":"dashdot"===t?t=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===t&&(t=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t},v.singleFillStyle=function(t){var e=(((r.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=r.select(this);try{n.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),n.remove()}})};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var m=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var n=t%100;return v.symbolFuncs[n](e)+(t>=200?x:"")}v.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=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=m||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,n,a,i,s){var u=e._fullLayout._defs.select(".gradients").selectAll("#"+n).data([a+i+s],c.identity);u.exit().remove(),u.enter().append("radial"===a?"radialGradient":"linearGradient").each(function(){var t=r.select(this);"horizontal"===a?t.attr(_):"vertical"===a&&t.attr(w),t.attr("id",n);var e=o(i),c=o(s);t.append("stop").attr({offset:"0%","stop-color":l.tinyRGB(c),"stop-opacity":c.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+n+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,n,r,a,o){var s=n.marker;!function(t,e,n,r,a,o,s,c){if(i.traceIs(n,"symbols")){var u=g(n);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:h.isBubble(n)?u(t.ms):(o.size||6)/2,t.mrc=e;var r=v.symbolNumber(t.mx||o.symbol)||0;return t.om=r%200>=100,b(r,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var f,d,p,y=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,f=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?l.defaultLine:s.color,Array.isArray(o.color)&&(f=l.defaultLine,y=!0),f="mc"in t?t.mcc=r(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var m=o.gradient,x=t.mgt;if(x?y=!0:x=m&&m.type,x&&"none"!==x){var _=t.mgc;_?y=!0:_=m.color;var w="g"+c._fullLayout._uid+"-"+n.uid;y&&(w+="-"+t.i),e.call(v.gradient,c,w,x,f,_)}else e.call(l.fill,f);p&&e.call(l.stroke,d)}}(t,e,n,r,a,s,s.line,o)},v.pointStyle=function(t,e,n){if(t.size()){var a=e.marker,o=v.tryColorscale(a,""),i=v.tryColorscale(a,"line");t.each(function(t){v.singlePointStyle(t,r.select(this),e,o,i,n)})}},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=e.selected||{},a=e.unselected||{},o=e.marker||{},s=n.marker||{},c=a.marker||{},u=o.opacity,f=s.opacity,d=c.opacity,h=void 0!==f,g=void 0!==d;t.each(function(t){var e,n=r.select(this),a=t.mo,o=void 0!==a;(o||h||g)&&(t.selected?h&&(e=f):e=g?d:p*(o?a:u)),void 0!==e&&n.style("opacity",e)});var y=s.color,m=c.color;(y||m)&&t.each(function(t){var e,n=r.select(this);t.selected?y&&(e=y):m&&(e=m),e&&l.fill(n,e)});var x=s.size,_=c.size,w=void 0!==x,k=void 0!==_;i.traceIs(e,"symbols")&&(w||k)&&t.each(function(t){var e,n=r.select(this),a=t.mrc,i=t.mx||o.symbol||0;e=t.selected?w?x/2:a:k?_/2:a,n.attr("d",b(v.symbolNumber(i),e)),t.mrc2=e})}},v.tryColorscale=function(t,e){var n=e?c.nestedProperty(t,e).get():t,r=n.colorscale,a=n.color;return r&&Array.isArray(a)?s.makeColorScaleFunc(s.extractScale(r,n.cmin,n.cmax)):c.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};function M(t,e,n,a){var o=r.select(t.node().parentNode),i=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(t)-1)*d+1,f=k[l]*s,p=.75*n+k[i]*s+(k[i]-1)*c*n/2;t.attr("text-anchor",l),o.attr("transform","translate("+f+","+p+")")}function T(t,e){var n=t.ts||e.textfont.size;return a(n)&&n>0?n:0}v.textPointStyle=function(t,e,n){t.each(function(t){var a=r.select(this),o=c.extractOption(t,e,"tx","text");if(o){var i=t.tp||e.textposition,l=T(t,e);a.call(v.font,t.tf||e.textfont.family,l,t.tc||e.textfont.color).text(o).call(u.convertToTspans,n).call(M,i,l,t.mrc)}else a.remove()})},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=e.selected||{},a=e.unselected||{};t.each(function(t){var o,i=r.select(this),s=t.tc||e.textfont.color,c=t.tp||e.textposition,u=T(t,e),f=(n.textfont||{}).color,d=(a.textfont||{}).color;t.selected?f&&(o=f):d?o=d:f||(o=l.addOpacity(s,p)),o&&l.fill(i,o),M(i,c,u,t.mrc2||t.mrc)})}};var A=.5;function L(t,e,n,a){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,A/2),u=Math.pow(l*l+s*s,A/2),f=(u*u*o-c*c*l)*a,d=(u*u*i-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[r.round(e[0]+(p&&f/p),2),r.round(e[1]+(p&&d/p),2)],[r.round(e[0]-(h&&f/h),2),r.round(e[1]-(h&&d/h),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,r="M"+t[0],a=[];for(n=1;n=1e4&&(v.savedBBoxes={},P=0),n&&(v.savedBBoxes[n]=y),P++,c.extendFlat({},y)},v.setClipUrl=function(t,e){if(e){var n="#"+e,a=r.select("base");a.size()&&a.attr("href")&&(n=window.location.href.split("#")[0]+n),t.attr("clip-path","url("+n+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,n){var r=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[r]("transform")||"";return e=e||0,n=n||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o=(o+=" translate("+e+", "+n+")").trim(),t[a]("transform",o),o},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,n){var r=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[r]("transform")||"";return e=e||1,n=n||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o=(o+=" scale("+e+", "+n+")").trim(),t[a]("transform",o),o},v.setPointGroupScale=function(t,e,n){var r,a,o;return n=n||1,a=1===(e=e||1)&&1===n?"":" scale("+e+","+n+")",o=/\s*sc.*/,t.each(function(){r=(this.getAttribute("transform")||"").replace(o,""),r=(r+=a).trim(),this.setAttribute("transform",r)}),a};var z=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,n){t.each(function(){var t,a=r.select(this),o=a.select("text");if(o.node()){var i=parseFloat(o.attr("x")||0),l=parseFloat(o.attr("y")||0),s=(a.attr("transform")||"").match(z);t=1===e&&1===n?[]:["translate("+i+","+l+")","scale("+e+","+n+")","translate("+-i+","+-l+")"],s&&t.push(s),a.attr("transform",t.join(" "))}})}},{"../../constants/alignment":148,"../../constants/interactions":149,"../../constants/xmlns_namespaces":152,"../../lib":169,"../../lib/svg_text_utils":190,"../../registry":262,"../../traces/scatter/make_bubble_size_func":347,"../../traces/scatter/subtypes":352,"../color":50,"../colorscale":65,"./symbol_defs":76,d3:13,"fast-isnumeric":16,tinycolor2:31}],76:[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);return"M-"+e+","+r.round(t/2,2)+"H"+e+"L0,-"+r.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+r.round(t/2,2)+"H"+e+"L0,"+r.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M"+r.round(t/2,2)+",-"+e+"V"+e+"L-"+r.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+r.round(t/2,2)+",-"+e+"V"+e+"L"+r.round(t,2)+",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(-.309*t,2);return"M"+e+","+o+"L"+n+","+r.round(.809*t,2)+"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(-.309*e,2),c=r.round(.118*e,2),u=r.round(.809*e,2);return"M"+n+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+r.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:13}],77:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],78:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../registry"),o=t("../../plots/cartesian/axes"),i=t("./compute_error");function l(t,e,n,a){var l=e["error_"+a]||{},s=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var c=i(l),u=0;u0;t.each(function(t){var u,f=t[0].trace,d=f.error_x||{},p=f.error_y||{};f.ids&&(u=function(t){return t.id});var h=i.hasMarkers(f)&&f.marker.maxdisplayed>0;p.visible||d.visible||(t=[]);var g=r.select(this).selectAll("g.errorbar").data(t,u);if(g.exit().remove(),t.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(n.duration).style("opacity",1),o.setClipUrl(g,e.layerClipId),g.each(function(t){var e=r.select(this),o=function(t,e,n){var r={x:e.c2p(t.x),y:n.c2p(t.y)};void 0!==t.yh&&(r.yh=n.c2p(t.yh),r.ys=n.c2p(t.ys),a(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),a(r.xs)||(r.noXS=!0,r.xs=e.c2p(t.xs,!0)));return r}(t,l,s);if(!h||t.vis){var i;if(p.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var u=p.width;i="M"+(o.x-u)+","+o.yh+"h"+2*u+"m-"+u+",0V"+o.ys,o.noYS||(i+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(n.duration).ease(n.easing)),f.attr("d",i)}if(d.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(d.copy_ystyle?p:d).width;i="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(i+="m0,-"+g+"v"+2*g);var v=e.select("path.xerror");!v.size()?v=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(v=v.transition().duration(n.duration).ease(n.easing)),v.attr("d",i)}}})}})}},{"../../traces/scatter/subtypes":352,"../drawing":75,d3:13,"fast-isnumeric":16}],83:[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":50,d3:13}],84:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:r({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":240}],85:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../registry");function o(t,e,n,a){a=a||r.identity,Array.isArray(t)&&(e[0][n]=a(t))}e.exports=function(t){var e=t.calcdata,n=t._fullLayout;function i(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},n)}}for(var l=0;l=0&&n.index-1&&i.length>m&&(i=m>3?i.substr(0,m-3)+"...":i.substr(0,m))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),l+=(l?"z: ":"")+t.zLabel):D&&t[c+"Label"]===L?l=t[("x"===c?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),""===l&&(""===i&&e.remove(),l=i);var _=e.select("text.nums").call(u.font,t.fontFamily||x,t.fontSize||b,t.fontColor||v).text(l).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,n),M=e.select("text.name"),T=0;i&&i!==l?(M.call(u.font,t.fontFamily||x,t.fontSize||b,g).text(i).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,n),T=M.node().getBoundingClientRect().width+2*k):(M.remove(),e.select("rect").remove()),e.select("path").style({fill:g,stroke:v});var A,C,S=_.node().getBoundingClientRect(),E=t.xa._offset+(t.x0+t.x1)/2,N=t.ya._offset+(t.y0+t.y1)/2,R=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),F=S.width+w+k+T;t.ty0=P-S.top,t.bx=S.width+2*k,t.by=S.height+2*k,t.anchor="start",t.txwidth=S.width,t.tx2width=T,t.offset=0,o&&"closest"===c&&a&&a.offsetX&&a.offsetY&&(E=a.offsetX,N=a.offsetY),d?(t.pos=E,A=N+I/2+F<=z,C=N-I/2-F>=0,"top"!==t.idealAlign&&A||!C?A?(N+=I/2,t.anchor="start"):t.anchor="middle":(N-=I/2,t.anchor="end")):(t.pos=N,A=E+R/2+F<=O,C=E-R/2-F>=0,"left"!==t.idealAlign&&A||!C?A?(E+=R/2,t.anchor="start"):t.anchor="middle":(E-=R/2,t.anchor="end")),_.attr("text-anchor",t.anchor),T&&M.attr("text-anchor",t.anchor),e.attr("transform","translate("+E+","+N+")"+(d?"rotate("+y+")":""))}),R}function T(t,e){t.each(function(t){var n=r.select(this);if(t.del)n.remove();else{var a="end"===t.anchor?-1:1,o=n.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],l=i*(w+k),c=l+i*(t.txwidth+k),f=0,d=t.offset;"middle"===t.anchor&&(l-=t.tx2width/2,c-=t.tx2width/2),e&&(d*=-_,f=t.offset*b),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"+(a*w+f)+","+(w+d)+"v"+(t.by/2-w)+"h"+a*t.bx+"v-"+t.by+"H"+(a*w+f)+"V"+(d-w)+"Z"),o.call(s.positionText,l+f,d+t.ty0-t.by/2+k),t.tx2width&&(n.select("text.name").call(s.positionText,c+i*k+f,d+t.ty0-t.by/2+k),n.select("rect").call(u.setRect,c+(i-1)*t.tx2width/2+f,d-t.by/2-1,t.tx2width,t.by+2))}})}function A(t,e,n){var r=t.index,a=t.trace||{},o=t.cd[0],l=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return i.castOption(o,r,t)||i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(l,a,t,e)};function c(e,n,r){var a=s(n,r);a&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("color","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal,null,n),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal,null,n),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function L(t,e){var n,r,a=e.container,i=e.fullLayout,l=e.event,s=!!t.hLinePoint,c=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),c||s){var d=f.combine(i.plot_bgcolor,i.paper_bgcolor);if(s){var p,h,g=t.hLinePoint;n=g&&g.xa,"cursor"===(r=g&&g.ya).spikesnap?(p=l.pointerX,h=l.pointerY):(p=n._offset+(g.x0+g.x1)/2,h=r._offset+(g.y0+g.y1)/2);var v,y,m=o.readability(g.color,d)<1.5?f.contrast(d):g.color,x=r.spikemode,b=r.spikethickness,_=r.spikecolor||m,w=r._boundingBox,k=(w.left+w.right)/2tt.width||$<0||$>tt.height)return d.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(D="xval"in e?g.flat(s,e.xval):g.p2c(_,Q),E="yval"in e?g.flat(s,e.yval):g.p2c(w,$),!a(D[0])||!a(E[0]))return i.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var et=1/0;for(R=0;RG&&(Z.splice(0,G),et=Z[0].distance),u._has("cartesian")&&0!==X&&0===Z.length){U.distance=X,U.index=!1;var it=F._module.hoverPoints(U,H,V,"closest",u._hoverlayer);if(it){var lt,st=it.filter(function(t){return t.xa.showspikes});if(st.length){var ct=st[0];a(ct.x0)&&a(ct.y0)&&(lt=pt(ct),(!J.vLinePoint||J.vLinePoint.distance>lt.distance)&&(J.vLinePoint=lt))}var ut=it.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];a(ft.x0)&&a(ft.y0)&&(lt=pt(ft),(!J.hLinePoint||J.hLinePoint.distance>lt.distance)&&(J.hLinePoint=lt))}}}}function dt(t,e){if(!t.length)return null;var n=t.map(function(t,e){var n=t.xa,r=t.ya,a=n.c2p(H),o=r.c2p(V),i=function(t){var e=t.kink,n=(t.x1+t.x0)/2-a,r=(t.y1+t.y0)/2-o;return Math.max(Math.sqrt(n*n+r*r)-e,1-3/e)}(t);return{distance:i,index:e}});return n=n.filter(function(t){return t.distance<=e}).sort(function(t,e){return t.distance-e.distance}),n.length?t[n[0].index]:null}function pt(t){return t?{xa:t.xa,ya:t.ya,x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1,distance:t.distance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var ht={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},gt=t._spikepoints,vt={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(t._spikepoints=vt,u._has("cartesian")&&0!==X&&0!==Z.length){var yt=Z.filter(function(t){return t.ya.showspikes}),mt=dt(yt,X);J.hLinePoint=pt(mt);var xt=Z.filter(function(t){return t.xa.showspikes}),bt=dt(xt,X);J.vLinePoint=pt(bt)}if(0===Z.length){var _t=d.unhoverRaw(t,e);return!u._has("cartesian")||null===J.hLinePoint&&null===J.vLinePoint||C(gt)&&L(J,ht),_t}u._has("cartesian")&&C(gt)&&L(J,ht);Z.sort(function(t,e){return t.distance-e.distance});var wt=t._hoverdata,kt=[];for(N=0;N1,At=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Lt={hovermode:z,rotateLabels:Tt,bgColor:At,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Ct=M(Z,Lt,t,e,t.layout.hoverFollowsMouse);if(function(t,e,n){var r,a,o,i,l,s,c,u=0,f=t.map(function(t,r){var a=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===a._id.charAt(0)?x:1)/2,pmin:0,pmax:"x"===a._id.charAt(0)?n.width:n.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function d(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(!(o<.01)){if(a<-.01){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&&!(c<=0);i--)(s=t[i]).pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)(s=t[i]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(;!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(p.push.apply(p,h),f.splice(i+1,1),c=0,l=p.length-1;l>=0;l--)c+=p[l].dp;for(o=c/p.length,l=p.length-1;l>=0;l--)p[l].dp-=o;r=!1}else i++}f.forEach(d)}for(i=f.length-1;i>=0;i--){var y=f[i];for(l=y.length-1;l>=0;l--){var m=y[l],b=t[m.i];b.offset=m.dp,b.del=m.del}}}(Z,Tt?"xa":"ya",u),T(Ct,Tt),e.target&&e.target.tagName){var St=h.getComponentMethod("annotations","hasClickToShow")(t,kt);c(r.select(e.target),St?"pointer":"")}if(!e.target||o||!function(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}(t,e,wt))return;wt&&t.emit("plotly_unhover",{event:e,points:wt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:D,yvals:E})}(t,e,n,o)})},n.loneHover=function(t,e){var n={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},a=r.select(e.container),o=e.outerContainer?r.select(e.outerContainer):a,i={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o,hoverdistance:v.MAXDIST},l=M([n],i,e.gd);return T(l,i.rotateLabels),l.node()}},{"../../lib":169,"../../lib/events":160,"../../lib/override_cursor":180,"../../lib/svg_text_utils":190,"../../plots/cartesian/axes":213,"../../registry":262,"../color":50,"../dragelement":72,"../drawing":75,"./constants":87,"./helpers":89,d3:13,"fast-isnumeric":16,tinycolor2:31}],91:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n,a){n("hoverlabel.bgcolor",(a=a||{}).bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),r.coerceFont(n,"hoverlabel.font",a.font)}},{"../../lib":169}],92:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../dragelement"),i=t("./helpers"),l=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:i.getDistanceFunction,getClosest:i.getClosest,inbox:i.inbox,quadrature:i.quadrature,appendArrayPointValue:i.appendArrayPointValue,castHoverOption:function(t,e,n){return a.castOption(t,e,"hoverlabel."+n)},castHoverinfo:function(t,e,n){return a.castOption(t,n,"hoverinfo",function(n){return a.coerceHoverinfo({hoverinfo:n},{_module:t._module},e)})},hover:t("./hover").hover,unhover:o.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:r.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":169,"../dragelement":72,"./attributes":84,"./calc":85,"./click":86,"./constants":87,"./defaults":88,"./helpers":89,"./hover":90,"./layout_attributes":93,"./layout_defaults":94,"./layout_global_defaults":95,d3:13}],93:[function(t,e,n){"use strict";var r=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=r.HOVERFONT,a.size.dflt=r.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":240,"./constants":87}],94:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n){function o(n,o){return r.coerce(t,e,a,n,o)}var i;o("dragmode"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,n=0;n=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}},{}],102:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped","natural","normal"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":240,"../color/attributes":49}],103:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],104:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,n){for(var s,c,u,f,d=t.legend||{},p=e.legend={},h=0,g="normal",v=0;v1)){if(m("bgcolor",e.paper_bgcolor),m("bordercolor"),m("borderwidth"),a.coerceFont(m,"font",e.font),m("orientation"),"h"===p.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")}m("traceorder",g),l.isGrouped(e.legend)&&m("tracegroupgap"),m("x",s),m("xanchor",u),m("y",c),m("yanchor",f),a.noneOrAll(d,p,["x","y"])}}},{"../../lib":169,"../../plots/layout_attributes":252,"../../registry":262,"./attributes":102,"./helpers":108}],105:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../registry"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/interactions"),g=t("../../constants/alignment").LINE_SPACING,v=t("./get_legend_data"),y=t("./style"),m=t("./helpers"),x=t("./anchor_utils"),b=h.DBLCLICKDELAY;function _(t,e){var n=t.data()[0][0],r=e._fullLayout,i=n.trace,s=l.traceIs(i,"pie"),u=i.index,d=s?n.label:i.name,p=d,h=t.selectAll("text.legendtext").data([0]),v=h.enter();function y(n){f.convertToTspans(n,e,function(){!function(t,e){var n=t.data()[0][0];if(!n.trace.showlegend)return void t.remove();var r,a,o=t.select("g[class*=math-group]"),i=o.node(),l=e._fullLayout.legend.font.size*g;if(i){var s=c.bBox(i);r=s.height,a=s.width,c.setTranslate(o,0,r/4)}else{var u=t.select(".legendtext"),d=f.lineCount(u),p=u.node();r=l*d,a=p?c.bBox(p).width:0;var h=l*(.3+(1-d)/2);f.positionText(u,40,h)}r=Math.max(r,16)+3,n.height=r,n.width=a}(t,e)},!0)}v.append("title").text(d),v.append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.legend.font).text(p),e._context.edits.legendText&&!s?h.call(f.makeEditable,{gd:e}).call(y).on("edit",function(t){this.text(t).call(y);var r,i=t;this.text()||(t=" ");var s=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(s.type))c[(r=n.trace.transforms)[r.length-1].direction+".name"]=t;else if(l.hasTransform(s,"groupby")){var f=l.getTransformIndices(s,"groupby"),d=f[f.length-1],p=o.keyedContainer(s,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),c=p.constructUpdate()}else c.name=t;return a.restyle(e,c,u)}):h.call(y)}function w(t,e){var n,r=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){(n=(new Date).getTime())-e._legendMouseDownTimeb&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){d(t,e,r)},b):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,d(t,e,r))}})}function k(t,e,n){var a=t._fullLayout,o=a.legend,i=o.borderwidth,l=m.isGrouped(o),s=0;if(o.width=0,o.height=0,m.isVertical(o))l&&e.each(function(t,e){c.setTranslate(this,0,e*o.tracegroupgap)}),n.each(function(t){var e=t[0],n=e.height,r=e.width;c.setTranslate(this,i,5+i+o.height+n/2),o.height+=n,o.width=Math.max(o.width,r)}),o.width+=45+2*i,o.height+=10+2*i,l&&(o.height+=(o._lgroupsLength-1)*o.tracegroupgap),s=40;else if(l){for(var u=[o.width],f=e.data(),d=0,p=f.length;di+w-k,n.each(function(t){var e=t[0],n=v?40+t[0].width:b;i+_+k+n>a.width-(a.margin.r+a.margin.l)&&(_=0,y+=x,o.height=o.height+x,x=0),c.setTranslate(this,i+_,5+i+e.height/2+y),o.width+=k+n,o.height=Math.max(o.height,e.height),_+=k+n,x=Math.max(e.height,x)}),o.width+=2*i,o.height+=10+2*i}o.width=Math.ceil(o.width),o.height=Math.ceil(o.height),n.each(function(e){var n=e[0];r.select(this).select(".legendtoggle").call(c.setRect,0,-n.height/2,(t._context.edits.legendText?0:o.width)+s,n.height)})}function M(t){var e=t._fullLayout.legend,n="left";x.isRightAnchor(e)?n="right":x.isCenterAnchor(e)&&(n="center");var r="top";x.isBottomAnchor(e)?r="bottom":x.isMiddleAnchor(e)&&(r="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:e.height*({top:1,middle:.5}[r]||0),t:e.height*({bottom:1,middle:.5}[r]||0)})}e.exports=function(t){var e=t._fullLayout,n="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var f=e.legend,h=e.showlegend&&v(t.calcdata,f),g=e.hiddenlabels||[];if(!e.showlegend||!h.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+n).remove(),void i.autoMargin(t,"legend");var m=e._infolayer.selectAll("g.legend").data([0]);m.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=e._topdefs.selectAll("#"+n).data([0]);T.enter().append("clipPath").attr("id",n).append("rect");var A=m.selectAll("rect.bg").data([0]);A.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),A.call(u.stroke,f.bordercolor),A.call(u.fill,f.bgcolor),A.style("stroke-width",f.borderwidth+"px");var L=m.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=m.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:2,ry:2,width:0,height:0}).call(u.fill,"#808BA4");var S=L.selectAll("g.groups").data(h);S.enter().append("g").attr("class","groups"),S.exit().remove();var P=S.selectAll("g.traces").data(o.identity);P.enter().append("g").attr("class","traces"),P.exit().remove(),P.call(y,t).style("opacity",function(t){var e=t[0].trace;return l.traceIs(e,"pie")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){r.select(this).call(_,t).call(w,t)});var O=0!==m.enter().size();O&&(k(t,S,P),M(t));var z=e.width,D=e.height;if(k(t,S,P),"v"===f.orientation&&f.width>150&&(f.width=150),"v"===f.orientation&&e._hasPie&&1===t.data.length&&(f.width=Math.max(.37*e.width,70)),"v"===f.orientation&&f.width>.45*e.width&&!e._hasPie||"v"===f.orientation&&f.width>.5*e.width&&e._hasPie||"h"===f.orientation&&f.height>.38*e.height||"left"!==f.xanchor&&"right"!==f.xanchor&&"v"===f.orientation&&f.height>.4*e.height)return e._infolayer.selectAll(".legend").remove(),void e._topdefs.select("#"+n).remove();f.height>D?function(t){var e=t._fullLayout.legend,n="left";x.isRightAnchor(e)?n="right":x.isCenterAnchor(e)&&(n="center");i.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:0,t:0})}(t):M(t);var E=e._size,N=E.l+E.w*f.x,R=E.t+E.h*(1-f.y);x.isRightAnchor(f)?N-=f.width:x.isCenterAnchor(f)&&(N-=f.width/2),x.isBottomAnchor(f)?R-=f.height:x.isMiddleAnchor(f)&&(R-=f.height/2);var I=f.width;E.w;N+I>z&&(N=z-I),N<0&&(N=0),I=Math.min(z-N,f.width);var F=f.height,j=E.h;F>j?(R=E.t,F=j):(R+F>D&&(R=D-F),R<0&&(R=0),F=Math.min(D-R,f.height)),c.setTranslate(m,N,R);var B,q,H,V,U,G,Y=F-p.scrollBarHeight-2*p.scrollBarMargin,X=f.height-F;if(f.height<=F||t._context.staticPlot)A.attr({width:I-f.borderwidth,height:F-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),c.setTranslate(L,0,0),T.select("rect").attr({width:I-2*f.borderwidth,height:F-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth}),L.call(c.setClipUrl,n);else{B=p.scrollBarMargin,q=L.attr("data-scroll")||0,A.attr({width:I-2*f.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:F-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),T.select("rect").attr({width:I-2*f.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:F-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth-q}),L.call(c.setClipUrl,n),O&&W(B,q),m.on("wheel",null),m.on("wheel",function(){q=o.constrain(L.attr("data-scroll")-r.event.deltaY/Y*X,-X,0),W(B=p.scrollBarMargin-q/X*Y,q),0!==q&&q!==-X&&r.event.preventDefault()}),C.on("drag",null),L.on("drag",null);var Z=r.behavior.drag().on("drag",function(t){B=o.constrain(r.event.y-p.scrollBarHeight/2,p.scrollBarMargin,p.scrollBarMargin+Y),q=-(B-p.scrollBarMargin)/Y*X});C.call(Z),L.call(Z)}if(t._context.edits.legendPosition)m.classed("cursor-move",!0),s.init({element:m.node(),gd:t,prepFn:function(){var t=c.getTranslate(m);U=t.x,G=t.y},moveFn:function(t,e){var n=U+t,r=G+e;c.setTranslate(m,n,r),H=s.align(n,0,E.l,E.l+E.w,f.xanchor),V=s.align(r,0,E.t+E.h,E.t,f.yanchor)},doneFn:function(){void 0!==H&&void 0!==V&&a.relayout(t,{"legend.x":H,"legend.y":V})},clickFn:function(n,r){var a=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom});a.size()>0&&(1===n?m._clickTimeout=setTimeout(function(){d(a,t,n)},b):2===n&&(m._clickTimeout&&clearTimeout(m._clickTimeout),d(a,t,n)))}})}function W(t,e){L.attr("data-scroll",e).call(c.setTranslate,0,e),C.call(c.setRect,I,t,p.scrollBarWidth,p.scrollBarHeight),T.select("rect").attr({y:f.borderwidth-e})}}},{"../../constants/alignment":148,"../../constants/interactions":149,"../../lib":169,"../../lib/svg_text_utils":190,"../../plotly":208,"../../plots/plots":254,"../../registry":262,"../color":50,"../dragelement":72,"../drawing":75,"./anchor_utils":101,"./constants":103,"./get_legend_data":106,"./handle_click":107,"./helpers":108,"./style":110,d3:13}],106:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var n,o,i={},l=[],s=!1,c={},u=0;function f(t,n){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,i[t]=[[n]]):i[t].push([n]);else{var r="~~i"+u;l.push(r),i[r]=[[n]],u++}}for(n=0;nt[0]&&t[0].label?t[0].label.localeCompare(e[0].label,void 0,{numeric:!0}):t[0]&&t[0].trace&&t[0].trace.name?t[0].trace.name.localeCompare(e[0].trace.name,void 0,{numeric:!0}):void 0),m}},{"../../registry":262,"./helpers":108}],107:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("../../lib"),o=t("../../registry"),i=!0;e.exports=function(t,e,n){if(!e._dragged&&!e._editing){var l,s,c,u,f,d=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],p=t.data()[0][0],h=e._fullData,g=p.trace,v=g.legendgroup,y={},m=[],x=[],b=[];if(1===n&&i&&e.data&&e._context.showTips?(a.notifier(a._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,o.traceIs(g,"pie")){var _=p.label,w=d.indexOf(_);1===n?-1===w?d.push(_):d.splice(w,1):2===n&&(d=[],e.calcdata[0].forEach(function(t){_!==t.label&&d.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===d.length&&-1===w&&(d=[])),r.relayout(e,"hiddenlabels",d)}else{var k,M=v&&v.length,T=[],A=-1;if(M)for(l=0;ln[1])return n[1]}return a}function h(t){return t[0]}if(u||f||d){var g={},v={};u&&(g.mc=p("marker.color",h),g.mo=p("marker.opacity",o.mean,[.2,1]),g.ms=p("marker.size",o.mean,[2,16]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",o.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(v.line={width:p("line.width",h,[0,10])}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),n=[o.minExtend(l,g)],a=o.minExtend(c,v)}var y=r.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(u?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(i.pointStyle,a,e),u&&(n[0].mrc=3);var x=y.selectAll("g.pointtext").data(f?n:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(i.textPointStyle,a,e)})}},{"../../lib":169,"../../registry":262,"../../traces/pie/style_one":328,"../../traces/scatter/subtypes":352,"../color":50,"../drawing":75,d3:13}],111:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("../../plots/plots"),o=t("../../plots/cartesian/axis_ids"),i=t("../../lib"),l=t("../../snapshot/download"),s=t("../../../build/ploticon"),c=i._,u=e.exports={};function f(t,e){var n,a,i=e.currentTarget,l=i.getAttribute("data-attr"),s=i.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=o.list(t,null,!0),d="on";if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1)return x(["resetViews","toggleHover"]),s(m,n);f&&(x(["zoom3d","pan3d","orbitRotation","tableRotation"]),x(["resetCameraDefault3d","resetCameraLastSave3d"]),x(["hoverClosest3d"]));var b=function(t){for(var e=r.list({_fullLayout:t},null,!0),n=0;n0)){var h=function(t,e,n){for(var r=n.filter(function(n){return e[n].anchor===t._id}),a=0,o=0;op&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,n=r.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var i=0;ic&&(t="X"),t});return a>c&&(u=u.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),o+u})}(e.path,o,c);var h=o(e.x0),g=o(e.x1),v=c(e.y0),y=c(e.y1);if("line"===u)return"M"+h+","+v+"L"+g+","+y;if("rect"===u)return"M"+h+","+v+"H"+g+"V"+y+"H"+h+"Z";var m=(h+g)/2,x=(v+y)/2,b=Math.abs(m-h),_=Math.abs(x-v),w="A"+b+","+_,k=m+b+","+x;return"M"+k+w+" 0 1,1 "+(m+","+(x-_))+w+" 0 0,1 "+k+"Z"}e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var n=0;n0)&&(a("active"),a("x"),a("y"),r.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("len"),a("lenmode"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),r.coerceFont(a,"font",n.font),a("currentvalue.visible")&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),r.coerceFont(a,"currentvalue.font",e.font)),a("transition.duration"),a("transition.easing"),a("bgcolor"),a("activebgcolor"),a("bordercolor"),a("borderwidth"),a("ticklen"),a("tickwidth"),a("tickcolor"),a("minorticklen"))}e.exports=function(t,e){a(t,e,{name:i,handleItemDefaults:s})}},{"../../lib":169,"../../plots/array_container_defaults":210,"./attributes":136,"./constants":137}],139:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plots/plots"),o=t("../color"),i=t("../drawing"),l=t("../../lib/svg_text_utils"),s=t("../legend/anchor_utils"),c=t("./constants"),u=t("../../constants/alignment").LINE_SPACING;function f(t){return t._index}function d(t,e){var n=i.tester.selectAll("g."+c.labelGroupClass).data(e.steps);n.enter().append("g").classed(c.labelGroupClass,!0);var o=0,u=0;n.each(function(t){var n=g(r.select(this),{step:t},e).node();if(n){var a=i.bBox(n);u=Math.max(u,a.height),o=Math.max(o,a.width)}}),n.remove(),e.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var f=t._fullLayout._size;e.lx=f.l+f.w*e.x,e.ly=f.t+f.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(f.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*c.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var d=(e.inputAreaLength-2*c.stepInset)/(e.steps.length-1),h=o+c.labelPadding;if(e.labelStride=Math.max(1,Math.ceil(h/d)),e.labelHeight=u,e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentValueMaxLines=1,e.currentvalue.visible){var v=i.tester.append("g");n.each(function(t){var n=p(v,e,t.label),r=n.node()&&i.bBox(n.node())||{width:0,height:0},a=l.lineCount(n);e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(r.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(r.height)),e.currentValueMaxLines=Math.max(e.currentValueMaxLines,a)}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,v.remove()}e.height=e.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var y="left";s.isRightAnchor(e)&&(e.lx-=e.outerLength,y="right"),s.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,y="center");var m="top";s.isBottomAnchor(e)&&(e.ly-=e.height,m="bottom"),s.isMiddleAnchor(e)&&(e.ly-=e.height/2,m="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),a.autoMargin(t,c.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[y]||0),r:e.outerLength*({left:1,center:.5}[y]||0),b:e.height*({top:1,middle:.5}[m]||0),t:e.height*({bottom:1,middle:.5}[m]||0)})}function p(t,e,n){if(e.currentvalue.visible){var r,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-c.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":r=.5*e.inputAreaLength,a="middle";break;default:r=c.currentValueInset,a="left"}o.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var s=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof n)s+=n;else s+=e.steps[e.active].label;e.currentvalue.suffix&&(s+=e.currentvalue.suffix),o.call(i.font,e.currentvalue.font).text(s).call(l.convertToTspans,e.gd);var f=l.lineCount(o),d=(e.currentValueMaxLines+1-f)*e.currentvalue.font.size*u;return l.positionText(o,r,d),o}}function h(t,e,n){var r=t.selectAll("rect."+c.gripRectClass).data([0]);r.enter().append("rect").classed(c.gripRectClass,!0).call(x,e,t,n).style("pointer-events","all"),r.attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(o.stroke,n.bordercolor).call(o.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function g(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(i.font,n.font).text(e.step.label).call(l.convertToTspans,n.gd),r}function v(t,e){var n=t.selectAll("g."+c.labelsClass).data([0]);n.enter().append("g").classed(c.labelsClass,!0);var a=n.selectAll("g."+c.labelGroupClass).data(e.labelSteps);a.enter().append("g").classed(c.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var n=r.select(this);n.call(g,t,e),i.setTranslate(n,w(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*u+c.labelOffset+e.currentValueTotalHeight)})}function y(t,e,n,r,a){var o=Math.round(r*(n.steps.length-1));o!==n.active&&m(t,e,n,o,!0,a)}function m(t,e,n,r,o,i){var l=n.active;n._input.active=n.active=r;var s=n.steps[n.active];e.call(_,n,n.active/(n.steps.length-1),i),e.call(p,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:o,previousActive:l}),s&&s.method&&o&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=o,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:o,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&a.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function x(t,e,n){var a=n.node(),i=r.select(e);function l(){return n.data()[0]}t.on("mousedown",function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=n.select("."+c.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),s.call(o.fill,t.activebgcolor);var u=k(t,r.mouse(a)[0]);y(e,n,t,u,!0),t._dragging=!0,i.on("mousemove",function(){var t=l(),o=k(t,r.mouse(a)[0]);y(e,n,t,o,!1)}),i.on("mouseup",function(){var t=l();t._dragging=!1,s.call(o.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function b(t,e){var n=t.selectAll("rect."+c.tickRectClass).data(e.steps);n.enter().append("rect").classed(c.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var a=n%e.labelStride==0,l=r.select(this);l.attr({height:a?e.ticklen:e.minorticklen}).call(o.fill,e.tickcolor),i.setTranslate(l,w(e,n/(e.steps.length-1))-.5*e.tickwidth,(a?c.tickOffset:c.minorTickOffset)+e.currentValueTotalHeight)})}function _(t,e,n,r){var a=t.select("rect."+c.gripRectClass),o=w(e,n);if(!e._invokingCommand){var i=a;r&&e.transition.duration>0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*c.gripWidth)+","+e.currentValueTotalHeight+")")}}function w(t,e){return t.inputAreaStart+c.stepInset+(t.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function k(t,e){return Math.min(1,Math.max(0,(e-c.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*c.stepInset-2*t.inputAreaStart)))}function M(t,e,n){var r=t.selectAll("rect."+c.railTouchRectClass).data([0]);r.enter().append("rect").classed(c.railTouchRectClass,!0).call(x,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+n.ticklen+n.labelHeight)}).call(o.fill,n.bgcolor).attr("opacity",0),i.setTranslate(r,0,n.currentValueTotalHeight)}function T(t,e){var n=t.selectAll("rect."+c.railRectClass).data([0]);n.enter().append("rect").classed(c.railRectClass,!0);var r=e.inputAreaLength-2*c.railInset;n.attr({width:r,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(o.stroke,e.bordercolor).call(o.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),i.setTranslate(n,c.railInset,.5*(e.inputAreaWidth-c.railWidth)+e.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,n=function(t,e){for(var n=t[c.name],r=[],a=0;a0?[0]:[]);if(o.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),o.exit().remove(),o.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r=n.steps.length&&(n.active=0);e.call(p,n).call(T,n).call(v,n).call(b,n).call(M,t,n).call(h,t,n),i.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(_,n,n.active/(n.steps.length-1),!1),e.call(p,n)}(t,r.select(this),e)}})}}},{"../../constants/alignment":148,"../../lib/svg_text_utils":190,"../../plots/plots":254,"../color":50,"../drawing":75,"../legend/anchor_utils":101,"./constants":137,d3:13}],140:[function(t,e,n){"use strict";var r=t("./constants");e.exports={moduleType:"component",name:r.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":136,"./constants":137,"./defaults":138,"./draw":139}],141:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),d=e.exports={},p=/ [XY][0-9]* /;d.draw=function(t,e,n){var d,h=n.propContainer,g=n.propName,v=n.placeholder,y=n.traceIndex,m=n.avoid||{},x=n.attributes,b=n.transform,_=n.containerGroup,w=t._fullLayout,k=h.titlefont||{},M=k.family,T=k.size,A=k.color,L=1,C=!1,S=(h.title||"").trim();"title"===g?d="titleText":-1!==g.indexOf("axis")?d="axisTitleText":g.indexOf(!0)&&(d="colorbarTitleText");var P=t._context.edits[d];h===w?P=t._context.editableMainTitle:h===w.xaxis?P=t._context.editableAxisXTitle:h===w.yaxis?P=t._context.editableAxisYTitle:h===w.yaxis2?P=t._context.editableAxisY2Title:h===w.xaxis2&&(P=t._context.editableAxisX2Title),""===S?L=0:S.replace(p," % ")===v.replace(p," % ")&&(L=.2,C=!0,P||(S=""));var O=S||P;_||(_=w._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var z=_.selectAll("text").data(O?[0]:[]);if(z.enter().append("text"),z.text(S).attr("class",e),z.exit().remove(),!O)return _;function D(t){l.syncOrAsync([E,N],t)}function E(e){var n;return b?(n="",b.rotate&&(n+="rotate("+[b.rotate,x.x,x.y]+")"),b.offset&&(n+="translate(0, "+b.offset+")")):n=null,e.attr("transform",n),e.style({"font-family":M,"font-size":r.round(T,2)+"px",fill:c.rgb(A),opacity:L*c.opacity(A),"font-weight":i.fontWeight}).attr(x).call(u.convertToTspans,t),i.previousPromises(t)}function N(t){var e=r.select(t.node().parentNode);if(m&&m.selection&&m.side&&S){e.attr("transform",null);var n=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[m.side],i=-1!==["left","top"].indexOf(m.side)?-1:1,c=a(m.pad)?m.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},d=m.maxShift||(f[m.side]-u[m.side])*("left"===m.side||"top"===m.side?-1:1);if(d<0)n=d;else{var p=m.offsetLeft||0,h=m.offsetTop||0;u.left-=p,u.right-=p,u.top-=h,u.bottom-=h,m.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(n=Math.max(n,i*(t[m.side]-u[o])+c))}),n=Math.min(d,n)}if(n>0||d<0){var g={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[m.side];e.attr("transform","translate("+g+")")}}}return z.call(D),P&&(S?z.on(".opacity",null):(L=0,C=!0,z.text(v).on("mouseover.opacity",function(){r.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.restyle(t,g,e,y):o.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(D)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)})),z.classed("js-placeholder",C),h._titleElement=z,_}},{"../../constants/interactions":149,"../../lib":169,"../../lib/svg_text_utils":190,"../../plotly":208,"../../plots/plots":254,"../color":50,"../drawing":75,d3:13,"fast-isnumeric":16}],142:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes");e.exports=i({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:o({},l,{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":161,"../../plot_api/edit_types":197,"../../plots/font_attributes":240,"../../plots/pad_attributes":253,"../color/attributes":49}],143:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],144:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),i=t("./constants").name,l=o.buttons;function s(t,e,n){function a(n,a){return r.coerce(t,e,o,n,a)}var i=function(t,e){var n,a,o=t.buttons||[],i=e.buttons=[];function s(t,e){return r.coerce(n,a,l,t,e)}for(var c=0;c0)&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),r.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),r.coerceFont(a,"font",n.font),a("bgcolor",n.paper_bgcolor),a("bordercolor"),a("borderwidth"))}e.exports=function(t,e){a(t,e,{name:i,handleItemDefaults:s})}},{"../../lib":169,"../../plots/array_container_defaults":210,"./attributes":142,"./constants":143}],145:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plots/plots"),o=t("../color"),i=t("../drawing"),l=t("../../lib/svg_text_utils"),s=t("../legend/anchor_utils"),c=t("../../constants/alignment").LINE_SPACING,u=t("./constants"),f=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function h(t,e,n,r,a,o,i,l){e._input.active=e.active=i,"buttons"===e.type?v(t,r,null,null,e):"dropdown"===e.type&&(a.attr(u.menuIndexAttrName,"-1"),g(t,r,a,o,e),l||v(t,r,a,o,e))}function g(t,e,n,r,a){var o=e.selectAll("g."+u.headerClassName).data([0]);o.enter().append("g").classed(u.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||u.blankHeaderOpts,c={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};o.call(y,a,s,t).call(M,a,c,f);var d=e.selectAll("text."+u.headerArrowClassName).data([0]);d.enter().append("text").classed(u.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(i.font,a.font).text(u.arrowSymbol[a.direction]),d.attr({x:a.headerWidth-u.arrowOffsetX+a.pad.l,y:a.headerHeight/2+u.textOffsetY+a.pad.t}),o.on("click",function(){n.call(T),n.attr(u.menuIndexAttrName,p(n,a)?-1:String(a._index)),v(t,e,n,r,a)}),o.on("mouseover",function(){o.call(_)}),o.on("mouseout",function(){o.call(w,a)}),i.setTranslate(e,a.lx,a.ly)}function v(t,e,n,o,i){n||(n=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(u.menuIndexAttrName)}(n)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?u.dropdownButtonClassName:u.buttonClassName,c=n.selectAll("g."+s).data(l),f=c.enter().append("g").classed(s,!0),d=c.exit();"dropdown"===i.type?(f.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,g=0,v=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(v?g=i.headerHeight+u.gapButtonHeader:p=i.headerWidth+u.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(g=-u.gapButtonHeader+u.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(p=-u.gapButtonHeader+u.gapButton-i.openWidth);var m={x:i.lx+p+i.pad.l,y:i.ly+g+i.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},x={l:m.x+i.borderwidth,t:m.y+i.borderwidth};c.each(function(l,s){var u=r.select(this);u.call(y,i,l,t).call(M,i,m),u.on("click",function(){r.event.defaultPrevented||(h(t,i,0,e,n,o,s),l.execute&&a.executeAPICommand(t,l.method,l.args),t.emit("plotly_buttonclicked",{menu:i,button:l,active:i.active}))}),u.on("mouseover",function(){u.call(_)}),u.on("mouseout",function(){u.call(w,i),c.call(b,i)})}),c.call(b,i),v?(x.w=Math.max(i.openWidth,i.headerWidth),x.h=m.y-x.t):(x.w=m.x-x.l,x.h=Math.max(i.openHeight,i.headerHeight)),x.direction=i.direction,o&&(c.size()?function(t,e,n,r,a,o){var i,l,s,c=a.direction,f="up"===c||"down"===c,d=a.active;if(f)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;rw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,C=v+y;C+A>c&&(C=c-A);var S=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=S.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:C,width:T,height:A}),this._hbarXMin=L+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=y>k,O=l.barWidth+2*l.barPad,z=l.barLength+2*l.barPad,D=h+g,E=v;D+O>s&&(D=s-O);var N=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:D,y:E,width:O,height:z}),this._vbarYMin=E+z/2,this._vbarTranslateMax=k-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,I=u-.5,F=P?f+O+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,q=i._topdefs.selectAll("#"+R).data(M||P?[0]:[]);if(q.exit().remove(),q.enter().append("clipPath").attr("id",R).append("rect"),M||P?(this._clipRect=q.select("rect").attr({x:Math.floor(I),y:Math.floor(j),width:Math.ceil(F)-Math.floor(I),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),M||P){var H=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),P&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,n)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,a=n+this._hbarTranslateMax;t=(i.constrain(r.event.x,n,a)-n)/(a-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,l=o+this._vbarTranslateMax;e=(i.constrain(r.event.y,o,l)-o)/(l-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=i.constrain(t||0,0,n),e=i.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/n;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/r;this.vbar.call(o.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":169,"../color":50,"../drawing":75,d3:13}],148:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.2,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],149:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],150:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],151:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],152:[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}},{}],153:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.33.1-ion40",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,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=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.register([t("./locale-en"),t("./locale-en-us")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3");var a=t("./components/color");n.colorDefaults=a.overrideColorDefaults;var o=t("./lib/dates");n.dateTime2ms=o.dateTime2ms},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":48,"./components/annotations3d":37,"./components/color":50,"./components/fx":92,"./components/images":100,"./components/legend":109,"./components/rangeselector":121,"./components/rangeslider":127,"./components/shapes":134,"./components/sliders":140,"./components/updatemenus":146,"./fonts/mathjax_config":154,"./lib/dates":158,"./lib/queue":183,"./locale-en":195,"./locale-en-us":194,"./plot_api/plot_schema":202,"./plot_api/register":203,"./plot_api/set_plot_config":204,"./plot_api/to_image":206,"./plot_api/validate":207,"./plotly":208,"./snapshot":267,"./snapshot/download":264,"./traces/scatter":342,d3:13,"es6-promise":14}],154:[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},{}],155:[function(t,e,n){"use strict";var r=Math.PI;n.deg2rad=function(t){return t/180*r},n.rad2deg=function(t){return t/r*180},n.wrap360=function(t){var e=t%360;return e<0?e+360:e},n.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],156:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):a}},{"../constants/numerical":150,"fast-isnumeric":16}],157:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../plots/attributes"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;n.valObjectMeta={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)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ra.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;!0!==r.strict&&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)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every(function(t){return 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)?e.set(u(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){"string"==typeof t&&s(n).test(t)?e.set(t):e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!s(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"==typeof t)if(-1===(r.extras||[]).indexOf(t)){for(var a=t.split("+"),o=0;o=r&&t<=a?t:u;if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var o=_(e),i=t.charAt(0);!o||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var l=o&&"chinese"===e.substr(0,7),s=t.match(l?x:m);if(!s)return u;var c=s[1],y=s[3]||"1",w=Number(s[5]||1),k=Number(s[7]||0),M=Number(s[9]||0),T=Number(s[11]||0);if(o){if(2===c.length)return u;var A;c=Number(c);try{var L=v.getComponentMethod("calendars","getCal")(e);if(l){var C="i"===y.charAt(y.length-1);y=parseInt(y,10),A=L.newDate(c,L.toMonthIndex(c,y,C),w)}else A=L.newDate(c,Number(y),w)}catch(t){return u}return A?(A.toJD()-g)*f+k*d+M*p+T*h:u}c=2===c.length?(Number(c)+2e3-b)%100+b:Number(c),y-=1;var S=new Date(Date.UTC(2e3,y,w,k,M));return S.setUTCFullYear(c),S.getUTCMonth()!==y?u:S.getUTCDate()!==w?u:S.getTime()+T*h},r=n.MIN_MS=n.dateTime2ms("-9999"),a=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==u};var k=90*f,M=3*d,T=5*p;function A(t,e,n,r,a){if((e||n||r||a)&&(t+=" "+w(e,2)+":"+w(n,2),(r||a)&&(t+=":"+w(r,2),a))){for(var o=4;a%10==0;)o-=1,a/=10;t+="."+w(a,o)}return t}n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=r&&t<=a))return u;e||(e=0);var o,i,l,c,m,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(n)){var L=Math.floor(w/f)+g,C=Math.floor(s(t,f));try{o=v.getComponentMethod("calendars","getCal")(n).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){o=y("G%Y-%m-%d")(new Date(w))}if("-"===o.charAt(0))for(;o.length<11;)o="-0"+o.substr(1);else for(;o.length<10;)o="0"+o;i=e=r+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),n=new Date(Math.round(t-e/10));return A(o.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,r){if(n.isJSDate(t)||"number"==typeof t){if(_(r))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,r))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;var C=[59,59.9,59.99,59.999,59.9999];function S(t,e){var n=s(t+.05,f),r=w(Math.floor(n/d),2)+":"+w(s(Math.floor(n/p),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+a}return r}function P(t){return t.formatDate("yyyy")}n.formatDate=function(t,e,n,r,a){var o,i;if(a=_(a)&&a,e)return function(t,e,n,r){t=t.replace(L,function(t){var n=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(n).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(_(r))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return n(t)(a)}(e,t,r,a);if(a)try{var l=Math.floor((t+.05)/f)+g,s=v.getComponentMethod("calendars","getCal")(a).fromJD(l);"y"===n?i=P(s):"m"===n?i=function(t){return t.formatDate("M yyyy")}(s):"d"===n?(o=P(s),i=function(t){return t.formatDate("M d")}(s)):(o=function(t){return t.formatDate("M d, yyyy")}(s),i=S(t,n))}catch(t){return"Invalid"}else{var c=new Date(Math.floor(t+.05));"y"===n?i=r("%Y")(c):"m"===n?i=r("%b %Y")(c):"d"===n?(o=r("%Y")(c),i=r("%b %-d")(c)):(o=r("%b %-d, %Y")(c),i=S(t,n))}return i+(o?"\n"+o:"")};var O=3*f;n.incrementMonth=function(t,e,n){n=_(n)&&n;var r=s(t,f);if(t=Math.round(t-r),n)try{var a=Math.round(t/f)+g,o=v.getComponentMethod("calendars","getCal")(n),i=o.fromJD(a);return e%12?o.add(i,e,"m"):o.add(i,e/12,"y"),(i.toJD()-g)*f+r}catch(e){l.error("invalid ms "+t+" in calendar "+n)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+r-O},n.findExactDates=function(t,e){for(var n,r,a=0,o=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u0&&(n.push(a),a=[])}return a.length>0&&n.push(a),n},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,n,r,a){var o=r*t+a*e;if(o<0)return r*r+a*a;if(o>n){var i=r-t,l=a-e;return i*i+l*l}var s=r*e-a*t;return s*s/n}n.segmentsIntersect=l,n.segmentDistance=function(t,e,n,r,a,o,i,c){if(l(t,e,n,r,a,o,i,c))return 0;var u=n-t,f=r-e,d=i-a,p=c-o,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,o-e),s(u,f,h,i-t,c-e),s(d,p,g,t-a,e-o),s(d,p,g,n-a,r-o));return Math.sqrt(v)},n.getTextLocation=function(t,e,n,l){if(t===a&&l===o||(r={},a=t,o=l),r[n])return r[n];var s=t.getPointAtLength(i(n-l/2,e)),c=t.getPointAtLength(i(n+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(i(n,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return r[n]=d,d},n.clearLocationCache=function(){a=null},n.getVisibleSegment=function(t,e,n){var r,a,o=e.left,i=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var n=t.getPointAtLength(e);0===e?r=n:e===u&&(a=n);var c=n.xi?n.x-i:0,f=n.ys?n.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+n)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+n))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(r.x-a.x)<.1&&Math.abs(r.y-a.y)<.1}},n.findPointOnPath=function(t,e,n,r){for(var a,o,i,l=(r=r||{}).pathLength||t.getTotalLength(),s=r.tolerance||.001,c=r.iterationLimit||30,u=t.getPointAtLength(0)[n]>t.getPointAtLength(l)[n]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return o}},{"./mod":176}],167:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],168:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],169:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../constants/numerical"),i=o.FP_SAFE,l=o.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./angles");s.deg2rad=h.deg2rad,s.rad2deg=h.rad2deg,s.wrap360=h.wrap360,s.wrap180=h.wrap180;var g=t("./geometry2d");s.segmentsIntersect=g.segmentsIntersect,s.segmentDistance=g.segmentDistance,s.getTextLocation=g.getTextLocation,s.clearLocationCache=g.clearLocationCache,s.getVisibleSegment=g.getVisibleSegment,s.findPointOnPath=g.findPointOnPath;var v=t("./extend");s.extendFlat=v.extendFlat,s.extendDeep=v.extendDeep,s.extendDeepAll=v.extendDeepAll,s.extendDeepNoArrays=v.extendDeepNoArrays;var y=t("./loggers");s.log=y.log,s.warn=y.warn,s.error=y.error;var m=t("./regex");s.counterRegex=m.counter;var x=t("./throttle");s.throttle=x.throttle,s.throttleDone=x.done,s.clearThrottle=x.clear,s.getGraphDiv=t("./get_graph_div"),s._=t("./localize"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t))<-i||t>i?l:a(t)?Number(t):l:l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var a=0;an?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},s.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},s.simpleMap=function(t,e,n,r){for(var a=t.length,o=new Array(a),i=0;i-1||c!==1/0&&c>=Math.pow(2,n)?t(e,n,r):l},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={optionList:[],_newoption:function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)}};return n["_"+e]=t,n},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;n=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},s.syncOrAsync=function(t,e,n){var r;function a(){return s.syncOrAsync(t,e,n)}for(;t.length;)if((r=(0,t.splice(0,1)[0])(e))&&r.then)return r.then(a).then(void 0,s.promiseError);return n&&n(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,n){if(t){var r,a=!1,o=!0;for(r=0;r=0&&o%1==0){var h=r?r[p]:p,g=n?n[h]:h;f(g)&&(t[g].selected=1)}}},s.getTargetArray=function(t,e){var n=e.target;if("string"==typeof n&&n){var r=s.nestedProperty(t,n).get();return!!Array.isArray(r)&&r}return!!Array.isArray(n)&&n},s.minExtend=function(t,e){var n={};"object"!=typeof e&&(e={});var r,a,o,i=Object.keys(t);for(r=0;r1?a+i[1]:"";if(o&&(i.length>1||l.length>4||n))for(;r.test(l);)l=l.replace(r,"$1"+o+"$2");return l+s};var w=/%{([^\s%{}]*)}/g,k=/^\w*$/;s.templateString=function(t,e){var n={};return t.replace(w,function(t,r){return k.test(r)?e[r]||"":(n[r]=n[r]||s.nestedProperty(e,r).get,n[r]()||"")})};s.subplotSort=function(t,e){for(var n=Math.min(t.length,e.length)+1,r=0,a=0,o=0;o=48&&i<=57,c=l>=48&&l<=57;if(s&&(r=10*r+i-48),c&&(a=10*a+l-48),!s||!c){if(r!==a)return r-a;if(i!==l)return i-l}}return a-r},s.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":150,"./angles":155,"./clean_number":156,"./coerce":157,"./dates":158,"./ensure_array":159,"./extend":161,"./filter_unique":162,"./filter_visible":163,"./geometry2d":166,"./get_graph_div":167,"./identity":168,"./is_array":170,"./is_plain_object":171,"./keyed_container":172,"./localize":173,"./loggers":174,"./matrix":175,"./mod":176,"./nested_property":177,"./noop":178,"./notifier":179,"./push_unique":182,"./regex":184,"./relative_attr":185,"./relink_private":186,"./search":187,"./stats":189,"./throttle":191,"./to_log_range":192,d3:13,"fast-isnumeric":16}],170:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],171:[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}},{}],172:[function(t,e,n){"use strict";var r=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,n,o){var i,l;n=n||"name",o=o||"value";var s={};l=e&&e.length?r(t,e).get():t,e=e||"",l=l||[];var c={};for(i=0;i2)return s[e]=2|s[e],f.set(t,null);if(u){for(i=e;i1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],o=t[e][1],l=!1,a(r))for(n=r.length-1;n>=0;n--)u(r[n],d(o,n))?l?r[n]=void 0:r.pop():l=!0;else if("object"==typeof r&&null!==r)for(i=Object.keys(r),l=!1,n=i.length-1;n>=0;n--)u(r[i[n]],d(o,i[n]))?delete r[i[n]]:l=!0;if(l)return}}(c)):l[e[i]]=r}}function d(t,e){var n=e;return r(e)?n="["+e+"]":t&&(n="."+e),t+n}function p(t,e,n,r){var o,i=a(n),l=!0,s=n,c=r.replace("-1",0),d=!i&&u(n,c),p=e[0];for(o=0;o/g),i=0;ii||o===a||os||e&&c(t))}:function(t,e){var o=t[0],c=t[1];if(o===a||oi||c===a||cs)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(r(i,d))>a)return!0;return!1};o.filter=function(t,e){var n=[t[0]],r=0,a=0;function o(o){t.push(o);var l=n.length,s=r;n.splice(a+1);for(var c=s+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:n}}},{"../constants/numerical":150,"./matrix":175}],182:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,n;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function s(t,e){return t>=e}n.findBin=function(t,e,n){if(r(e.start))return n?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?n?o:i:n?s:l,t+=1e-9*h*(n?-1:1)*(h>=0?1:-1);f90&&a.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;le[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;at.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":16}],190:[function(t,e,n){"use strict";var r=t("d3"),a=t("../lib"),o=t("../constants/xmlns_namespaces"),i=t("../constants/string_mappings"),l=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,i,y){var S=t.text(),P=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&S.match(c),O=r.select(t.node().parentNode);if(!O.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),P?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n=parseInt(t.node().style.fontSize,10),o={fontSize:n};!function(t,e,n){var o="math-output-"+a.randstr([],64),i=r.select("body").append("div").attr({id:o}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((l=t,l.replace(u,"\\lt ").replace(f,"\\gt ")));var l;MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=r.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())a.log("There was an error in the tex syntax.",t),n();else{var o=i.select("svg").node().getBoundingClientRect();n(i.select(".MathJax_SVG"),e,o)}i.remove()})}(P[2],o,function(r,a,o){O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove();var l=r&&r.select("svg");if(!l||!l.node())return D(),void e();var c=O.append("g").classed(z+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:z,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";l.select("g").attr({fill:u,stroke:u});var f=s(l,"width"),d=s(l,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],h=-(n||s(t,"height"))/4;"y"===z[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),l.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?l.attr({x:t.attr("x"),y:h-d/2}):"a"===z[0]?l.attr({x:0,y:h}):l.attr({x:p,y:+t.attr("y")+h-d/2}),i&&i.call(t,c),e(c)})})):D(e,y),t}function D(e,s){O.empty()||(z=t.attr("class")+"-math",O.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e,n,i){e=(s=e,function(t,e){if(!t)return"";for(var n=0;n1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),c=f[f.length-1].node}else a.log("Ignoring unexpected end tag .",e)}w.test(e)?S():(c=t,f=[{node:t}]);var D=e,E=17;n._fullLayout._hasPie&&n._fullLayout.legend&&"v"===n._fullLayout.legend.orientation&&n._fullLayout.width>170&&1===n.data.length&&(E=5+Math.floor((n._fullLayout.width-170)/22));if(i&&e.indexOf("
")<0&&e.length>E){var N=E,R=!1;for(let t=E;t>N-11&&t>0;t--)if(" "===e.charAt(t)){N=t,R=!0;break}(D=R?D.substr(0,N)+"
"+D.substr(N+1):D.substr(0,N)+"
"+D.substr(N)).length-4>2*E&&(D=D.substr(0,2*E+4-3)+"...")}for(var I=D.split(b),F=0;F|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g="\u200b",v=["http:","https:","mailto:","",void 0,":"],y=new RegExp("]*)?/?>","g"),m=Object.keys(i.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:i.entityToUnicode[t]}}),x=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=//i,k=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,M=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function L(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}var C=/(^|;)\s*color:/;function S(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}}n.plainText=function(t){return(t||"").replace(y," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){var t=r.select(this);function a(e,n){return void 0===n?null===(n=t.attr(e))&&(t.attr(e,0),n=0):t.attr(e,n),n}var o=a("x",e),i=a("y",n);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:o,y:i})})},n.makeEditable=function(t,e){var n=e.gd,a=e.delegate,o=r.dispatch("edit","input","cancel"),i=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){var a,l,c,u;a=r.select(n).select(".svg-container"),l=a.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12),l.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(S(t,a,e)).on("blur",function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=r.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&r.select(t.node().parentNode).select(e).style({opacity:0});var i=this.textContent;r.select(this).transition().duration(0).remove(),r.select(document).on("mouseup",null),o.edit.call(t,i)}).on("focus",function(){var t=this;n._editing=!0,r.select(document).on("mouseup",function(){if(r.event.target===t)return!1;document.activeElement===l.node()&&l.node().blur()})}).on("keyup",function(){27===r.event.which?(n._editing=!1,t.style({opacity:1}),r.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),r.select(this).call(S(t,a,e)))}).on("keydown",function(){13===r.event.which&&this.blur()}).call(s),t.style({opacity:0});var f,d=i.attr("class");(f=d?"."+d.split(" ")[0]+"-math-group":"[class*=-math-group]")&&r.select(t.node().parentNode).select(f).style({opacity:0})}function s(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}return e.immediate?l():i.on("click",l),r.rebind(t,o,"on")}},{"../constants/alignment":148,"../constants/string_mappings":151,"../constants/xmlns_namespaces":152,"../lib":169,d3:13}],191:[function(t,e,n){"use strict";var r={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}n.throttle=function(t,e,n){var o=r[t],i=Date.now();if(!o){for(var l in r)r[l].tso.ts+e?s():o.timer=setTimeout(function(){s(),o.timer=null},e)},n.done=function(t){var e=r[t];return e&&e.timer?new Promise(function(t){var n=e.onDone;e.onDone=function(){n&&n(),t(),e.onDone=null}}):Promise.resolve()},n.clear=function(t){if(t)a(r[t]),delete r[t];else for(var e in r)n.clear(e)}},{}],192:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{"fast-isnumeric":16}],193:[function(t,e,n){"use strict";var r=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,o=t("topojson-client").feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return t+e+".json"},r.getTopojsonFeatures=function(t,e){var n=a[t.locationmode],r=e.objects[n];return o(e,r).features}},{"../plots/geo/constants":242,"topojson-client":32}],194:[function(t,e,n){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],195:[function(t,e,n){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""]}}},{}],196:[function(t,e,n){"use strict";var r=t("../registry");e.exports=function(t){for(var e,n,a=r.layoutArrayContainers,o=r.layoutArrayRegexes,i=t.split("[")[0],l=0;l0&&i.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var r=(l.subplotsRegistry.cartesian||{}).attrRegex,o=(l.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(A.x=1.02,A.xanchor="left"):A.x<-2&&(A.x=-.02,A.xanchor="right"),A.y>3?(A.y=1.02,A.yanchor="bottom"):A.y<-2&&(A.y=-.02,A.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t},n.cleanData=function(t,e){for(var r=[],a=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s0)return t.substr(0,e)}n.hasParent=function(t,e){for(var n=v(e);n;){if(n in t)return!0;n=v(n)}return!1};var y=["x","y","z"];n.clearAxisTypes=function(t,e,n){for(var r=0;r1&&i.warn("Full array edits are incompatible with other edits",f);var m=n[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return i.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,T,A=Object.keys(n).map(Number).sort(l),L=e.get(),C=L||[],S=r(y,f).get(),P=[],O=-1,z=C.length;for(x=0;xC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?P.push(_):T?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===O&&(O=_);else for(b=0;b=0;x--)C.splice(P[x],1),S&&S.splice(P[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==o){var D;if(-1===O)D=A;else{for(z=Math.max(C.length,z),D=[],x=0;x=O);x++)D.push(_);for(x=O;x=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||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+n+" must be unique.")}}function D(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&z(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function E(t,e,n,r,o,i){!function(t,e,n,r){var a=l.isPlainObject(r);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!l.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===n)throw new Error("indices must be an integer or array of integers");for(var o in z(t,n,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==n.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in r)||!Array.isArray(r[o])||r[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,r);for(var s,c,u,f=function(t,e,n,r){var o,i,s,c,u,f=l.isPlainObject(r),d=[];for(var p in Array.isArray(n)||(n=[n]),n=O(n,t.data.length-1),e)for(var h=0;h=0&&uY.range[0]?[1,2]:[2,1]);else{var W=Y.range[0],J=Y.range[1];X?(W<=0&&J<=0&&T(j+".autorange",!0),W<=0?W=J/1e6:J<=0&&(J=W/1e6),T(j+".range[0]",Math.log(W)/Math.LN10),T(j+".range[1]",Math.log(J)/Math.LN10)):(T(j+".range[0]",Math.pow(10,W)),T(j+".range[1]",Math.pow(10,J)))}else T(j+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,D,T),u.getComponentMethod("images","convertCoords")(t,q,D,T)}else T(j+".autorange",!0),T(j+".range",null);l.nestedProperty(s,j+"._inputRange").set(null)}else if(I.match(M.AX_NAME_PATTERN)){var Q=l.nestedProperty(s,O).get(),$=(D||{}).type;$&&"-"!==$||($="linear"),u.getComponentMethod("annotations","convertCoords")(t,Q,$,T),u.getComponentMethod("images","convertCoords")(t,Q,$,T)}var K=b.containerArrayMatch(O);if(K){n=K.array,r=K.index;var tt=K.property,et=(l.nestedProperty(o,n)||[])[r]||{},nt=et,rt=V||{editType:"calc"},at=-1!==rt.editType.indexOf("calcIfAutorange");""===r?(at?m.calc=!0:k.update(m,rt),at=!1):""===tt&&(nt=D,b.isAddVal(D)?w[O]=null:b.isRemoveVal(D)?(w[O]=et,nt=et):l.warn("unrecognized full object value",e)),at&&(A(nt,"x")||A(nt,"y"))?m.calc=!0:k.update(m,rt),h[n]||(h[n]={});var ot=h[n][r];ot||(ot=h[n][r]={}),ot[tt]=D,delete e[O]}else"reverse"===I?(B.range?B.range.reverse():(T(j+".autorange",!0),B.range=[1,0]),q.autorange?m.calc=!0:m.plot=!0):((!s._has("gl2d")&&!s._has("regl")||"dragmode"!==O||"lasso"!==D&&"select"!==D||"lasso"===H||"select"===H)&&V?k.update(m,V):m.calc=!0,z.set(D))}}for(n in h){b.applyContainerArrayChanges(t,l.nestedProperty(o,n),h[n],m)||(m.plot=!0)}var it=s._axisConstraintGroups||[];for(L in S)for(r=0;r=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var n=0;return function(){if(t&&++n===e)return t()}}return void 0===r._frameWaitingCnt&&(r._frameWaitingCnt=0),new Promise(function(o,u){function f(){r._currentFrame&&r._currentFrame.onComplete&&r._currentFrame.onComplete();var e=r._currentFrame=r._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,r._lastFrameAt=Date.now(),r._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(r._animationRaf),r._animationRaf=null}function p(){t.emit("plotly_animating"),r._lastFrameAt=-1/0,r._timeToNext=0,r._runningTransitions=0,r._currentFrame=null;var e=function(){r._animationRaf=window.requestAnimationFrame(e),Date.now()-r._lastFrameAt>r._timeToNext&&f()};e()}var h,g,v=0;function y(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var m=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&l.isPlainObject(e))m.push({type:"object",data:y(l.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&MM)&&T.push(g);m=T}}m.length>0?function(e){if(0!==e.length){for(var a=0;a=0;r--)if(l.isPlainObject(e[r])){var g=(f[e[r].name]||{}).name,v=e[r].name;g&&v&&"number"==typeof v&&f[g]&&(s++,l.warn('addFrames: overwriting frame "'+f[g].name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),s>5&&l.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:d.supplyFrameDefaults(e[r]),index:n&&void 0!==n[r]&&null!==n[r]?n[r]:p+r})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;r--){if("number"==typeof(a=h[r].frame).name&&l.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;f[a.name="frame "+t._transitionData._counter++];);if(f[a.name]){for(o=0;o=0;n--)r=e[n],o.push({type:"delete",index:r}),i.unshift({type:"insert",index:r,value:a[r]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,i],p=[t,o];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,o)},i.purge=function(t){var e=(t=l.getGraphDiv(t))._fullLayout||{},n=t._fullData||[];return d.cleanPlot([],{},n,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":50,"../components/drawing":75,"../components/errorbars":81,"../constants/xmlns_namespaces":152,"../lib":169,"../lib/events":160,"../lib/queue":183,"../lib/svg_text_utils":190,"../plotly":208,"../plots/cartesian/axis_ids":216,"../plots/cartesian/constants":218,"../plots/cartesian/constraints":220,"../plots/cartesian/graph_interact":222,"../plots/plots":254,"../plots/polar/legacy":257,"../registry":262,"./edit_types":197,"./helpers":198,"./manage_arrays":199,"./plot_schema":202,"./subroutines":205,d3:13,"fast-isnumeric":16,"has-hover":18}],201:[function(t,e,n){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},editableMainTitle:!0,editableAxisXTitle:!0,editableAxisX2Title:!0,editableAxisYTitle:!0,editableAxisY2Title:!0,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!1,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],202:[function(t,e,n){"use strict";var r=t("../registry"),a=t("../lib"),o=t("../plots/attributes"),i=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("../plots/polar/legacy/area_attributes"),u=t("../plots/polar/legacy/axis_attributes"),f=t("./edit_types"),d=a.extendFlat,p=a.extendDeepAll,h="_isSubplotObj",g="_isLinkedToArray",v=[h,g,"_arrayAttrRegexps","_deprecated"];function y(t,e,n){if(!t)return!1;if(t._isLinkedToArray)if(m(e[n]))n++;else if(n=t.items.length)return!1;t=t.items[o]}}return t}function m(t){return t===Math.round(t)&&t>=0}function x(){var t,e,n={};for(t in p(n,i),r.subplotsRegistry){if((e=r.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)w(n,e,"xaxis"),w(n,e,"yaxis");else w(n,e,"subplot"===e.attr?e.name:e.attr)}for(t in n=function(t){return d(t,{radialaxis:u.radialaxis,angularaxis:u.angularaxis}),d(t,u.layout),t}(n),r.componentsRegistry){var a=(e=r.componentsRegistry[t]).schema;if(a&&(a.subplots||a.layout)){var o=a.subplots;if(o&&o.xaxis&&!o.yaxis)for(var l in o.xaxis)delete n.yaxis[l]}else e.layoutAttributes&&k(n,e.layoutAttributes,e.name)}return{layoutAttributes:_(n)}}function b(){var t={frames:a.extendDeepAll({},l)};return _(t),t.frames}function _(t){return function(t){n.crawl(t,function(t,e,r){n.isValObject(t)?"data_array"===t.valType?(t.role="data",r[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(r[e+"src"]={valType:"string",editType:"none"}):a.isPlainObject(t)&&(t.role="object")})}(t),function(t){n.crawl(t,function(t,e,n){if(!t)return;var r=t[g];if(!r)return;delete t[g],n[e]={items:{}},n[e].items[r]=t,n[e].role="object"})}(t),t}function w(t,e,n){var r=a.nestedProperty(t,n),o=p({},e.layoutAttributes);o[h]=!0,r.set(o)}function k(t,e,n){var r=a.nestedProperty(t,n);r.set(p(r.get()||{},e))}n.IS_SUBPLOT_OBJ=h,n.IS_LINKED_TO_ARRAY=g,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=v,n.get=function(){var t={};r.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,n;"area"===t?(e={attributes:c},n={}):(e=r.modules[t]._module,n=e.basePlotModule);var a={type:null};p(a,o),p(a,e.attributes),n.attributes&&p(a,n.attributes);a.type=t;var i={meta:e.meta||{},attributes:_(a)};if(e.layoutAttributes){var l={};p(l,e.layoutAttributes),i.layoutAttributes=_(l)}return i}(e)});var e={};return Object.keys(r.transformsRegistry).forEach(function(t){e[t]=function(t){var e=r.transformsRegistry[t],n=p({},e.attributes);return Object.keys(r.componentsRegistry).forEach(function(e){var a=r.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach(function(e){k(n,a.schema.transforms[t][e],e)})}),{attributes:_(n)}}(t)}),{defs:{valObjects:a.valObjectMeta,metaKeys:v.concat(["description","role","editType","impliedEdits"]),editType:{traces:f.traces,layout:f.layout},impliedEdits:{}},traces:t,layout:x(),transforms:e,frames:b(),animation:_(s)}},n.crawl=function(t,e,r,o){var i=r||0;o=o||"",Object.keys(t).forEach(function(r){var l=t[r];if(-1===v.indexOf(r)){var s=(o?o+".":"")+r;e(l,r,t,i,s),n.isValObject(l)||a.isPlainObject(l)&&"impliedEdits"!==r&&n.crawl(l,e,i+1,s)}})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){var e=[],r=[];function i(n,o,i,l){if(r=r.slice(0,l).concat([o]),n&&("data_array"===n.valType||!0===n.arrayOk)&&!("colorbar"===r[l-1]&&("ticktext"===o||"tickvals"===o))){var s=function(t){return t.join(".")}(r),c=a.nestedProperty(t,s).get();Array.isArray(c)&&e.push(s)}}if(n.crawl(o,i),t._module&&t._module.attributes&&n.crawl(t._module.attributes,i),t.transforms)for(var l=t.transforms,s=0;s=t.transforms.length)return!1;a=(n=(r.transformsRegistry[t.transforms[s].type]||{}).attributes)&&n[e[2]],l=3}else if("area"===t.type)a=c[i];else{var u=t._module;if(u||(u=(r.modules[t.type||o.type.dflt]||{})._module),!u)return!1;if(!(a=(n=u.attributes)&&n[i])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[i])}a||(a=o[i])}return y(a,e,l)},n.getLayoutValObject=function(t,e){return y(function(t,e){var n,a,o,l,s=t._basePlotModules;if(s){var c;for(n=0;n=t[1]||a[1]<=t[0])&&o[0]e[0])return!0}return!1}(n,r,w)?(_.push(t),w.push([n,r])):a=[0];var i=e.plotgroup.selectAll(".bg").data(a);i.enter().append("rect").classed("bg",!0),i.exit().remove(),i.each(function(){e.bg=i;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var k=o._bgLayer.selectAll(".bg").data(_);return k.enter().append("rect").classed("bg",!0),k.exit().remove(),k.each(function(t){o._plots[t].bg=r.select(this)}),b.each(function(t){var n=o._plots[t],r=n.xaxis,a=n.yaxis;n.bg&&d&&n.bg.call(c.setRect,r._offset-l,a._offset-l,r._length+2*l,a._length+2*l).call(s.fill,o.plot_bgcolor).style("stroke-width",0),n.clipId="clip"+o._uid+t+"plot";var i,f,h=o._clips.selectAll("#"+n.clipId).data([0]);for(h.enter().append("clipPath").attr({class:"plotclip",id:n.clipId}).append("rect"),h.selectAll("rect").attr({width:r._length,height:a._length}),c.setTranslate(n.plot,r._offset,a._offset),n._hasClipOnAxisFalse?(i=null,f=n.clipId):(i=n.clipId,f=null),c.setClipUrl(n.plot,i),e=0;e1&&p.push(d("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=n.length,y=0;y2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},k.getAutoRange=function(t){var e,n=[],r=t._min[0].val,a=t._max[0].val;for(e=1;e0&&f>0&&d/f>p&&(c=i,u=s,p=d/f);if(r===a){var v=r-1,y=r+1;n="tozero"===t.rangemode?r<0?[v,0]:[0,y]:"nonnegative"===t.rangemode?[Math.max(0,v),Math.max(0,y)]:[v,y]}else p&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(c.val>=0&&(c={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(c.val-p*c.pad<0&&(c={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),p=(u.val-c.val)/(t._length-c.pad-u.pad)),n=[c.val-p*c.pad,u.val+p*u.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(),l.simpleMap(n,t.l2r||Number)},k.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=k.getAutoRange(t),t._r=t.range.slice(),t._rl=l.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},k.saveRangeInitial=function(t,e){for(var n=k.list(t,"",!0),r=!1,a=0;a0?n.ppadplus:n.ppadminus)||n.ppad||0),_=M((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),w=M(n.vpadplus||n.vpad),k=M(n.vpadminus||n.vpad);for(r=0;r<6;r++)T(r);for(r=y-1;r>5;r--)T(r)}function M(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function T(n){if(s=e[n],a(s)){if(f=b(n)+m,d=_(n)+m,g=s-k(n),v=s+w(n),"log"===t.type&&g=d?h=!1:i.val>=c&&i.pad<=d&&(t._min.splice(o,1),o--);h&&t._min.push({val:c,pad:x&&0===c?0:d})}if(r(u)){for(h=!0,o=0;o=u&&i.pad>=f?h=!1:i.val<=u&&i.pad<=f&&(t._max.splice(o,1),o--);h&&t._max.push({val:u,pad:x&&0===u?0:f})}}function r(t){return a(t)&&Math.abs(t).3*d||u(r)||u(o))){var p=n.dtick/2;t+=t+p.8){var i=Number(n.substr(1));o.exactYears>.8&&i%12==0?t=k.tickIncrement(t,"M6","reverse")+1.5*v:o.exactMonths>.8?t=k.tickIncrement(t,"M1","reverse")+15.5*v:t-=v/2;var s=k.tickIncrement(t,n);if(s<=r)return s}return t}(y,t,s.dtick,c,o)),h=y,g=0;h<=u;)h=k.tickIncrement(h,s.dtick,!1,o),g++;return{start:e.c2r(y,0,o),end:e.c2r(h,0,o),size:s.dtick,_count:g}},k.calcTicks=function(t,e){var n=l.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,a=t.nticks;a||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/r):(r="y"===t._id.charAt(0)?40:80,a=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),k.autoTicks(t,Math.abs(n[1]-n[0])/a),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),I(t),"array"===t.tickmode)return function(t){var e,n,r=t.tickvals,a=t.ticktext,o=new Array(r.length),i=l.simpleMap(t.range,t.r2l),s=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(s,c),f=Math.max(s,c),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(n=0;nu&&e=s:f<=s)&&!(i.length>u||f===c);f=k.tickIncrement(f,t.dtick,o,t.calendar))c=f,i.push(f);"angular"===t._id&&360===Math.abs(n[1]-n[0])&&i.pop(),t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;p10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=v&&o<=10||e>=15*v)t._tickround="d";else if(e>=m&&o<=16||e>=y)t._tickround="M";else if(e>=x&&o<=19||e>=m)t._tickround="S";else{var i=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(o,i)-20}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(B(t.exponentformat)&&!q(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function F(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}k.autoTicks=function(t,e){var n;function r(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar);var o=2*e;o>h?(e/=h,n=r(10),t.dtick="M"+12*R(e,n,S)):o>g?(e/=g,t.dtick="M"+R(e,1,P)):o>v?(t.dtick=R(e,v,z),t.tick0=l.dateTick0(t.calendar,!0)):o>y?t.dtick=R(e,y,P):o>m?t.dtick=R(e,m,O):o>x?t.dtick=R(e,x,O):(n=r(10),t.dtick=R(e,n,S))}else if("log"===t.type){t.tick0=0;var i=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var s=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/s,n=r(10),t.dtick="L"+R(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))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=R(e,n,N)):(t.tick0=0,n=r(10),t.dtick=R(e,n,S));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},k.tickIncrement=function(t,e,n,o){var i=n?-1:1;if(a(e))return t+i*e;var s=e.charAt(0),c=i*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,o);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?E:D,f=t+.01*i,d=l.roundUp(l.mod(f,1),u,n);return Math.floor(f)+Math.log(r.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},k.tickFirst=function(t){var e=t.r2l||Number,n=l.simpleMap(t.range,e),o=n[1]"+s,t._prevDateHead=s));e.text=c}(t,s,n,u):"log"===t.type?function(t,e,n,r,o){var i=t.dtick,s=e.x,c=t.tickformat;"never"===o&&(o="");!r||"string"==typeof i&&"L"===i.charAt(0)||(i="L3");if(c||"string"==typeof i&&"L"===i.charAt(0))e.text=H(Math.pow(10,s),t,o,r);else if(a(i)||"D"===i.charAt(0)&&l.mod(s+.01,1)<.1){var u=Math.round(s);-1!==["e","E","power"].indexOf(t.exponentformat)||B(t.exponentformat)&&q(u)?(e.text=0===u?1:1===u?"10":u>1?"10"+u+"":"10"+b+-u+"",e.fontSize*=1.25):(e.text=H(Math.pow(10,s),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,s,0,u,o):"category"===t.type?function(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n="");e.text=String(n)}(t,s):"angular"===t._id?function(t,e,n,r,a){if("radians"!==t.thetaunit||n)e.text=H(e.x,t,a,r);else{var o=e.x/180;if(0===o)e.text="0";else{var i=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var n=function(t){var n=1;for(;!e(Math.round(t*n)/n,t);)n*=10;return n}(t),r=t*n,a=Math.abs(function t(n,r){return e(r,0)?n:t(r,n%r)}(r,n));return[Math.round(r/a),Math.round(n/a)]}(o);if(i[1]>=100)e.text=H(l.deg2rad(e.x),t,a,r);else{var s=e.x<0;1===i[1]?1===i[0]?e.text="\u03c0":e.text=i[0]+"\u03c0":e.text=["",i[0],"","\u2044","",i[1],"","\u03c0"].join(""),s&&(e.text=b+e.text)}}}}(t,s,n,u,o):function(t,e,n,r,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=H(e.x,t,a,r)}(t,s,0,u,o),t.tickprefix&&!h(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!h(t.showticksuffix)&&(s.text+=t.ticksuffix),"x"===t._id&&r&&r.layout.xaxis.formatCallback?s.text=r.layout.xaxis.formatCallback(s.text,s.x):"y"===t._id&&r&&r.layout.yaxis.formatCallback?s.text=r.layout.yaxis.formatCallback(s.text,s.x):"x2"===t._id&&r&&r.layout.xaxis2&&r.layout.xaxis2.formatCallback?s.text=r.layout.xaxis2.formatCallback(s.text,s.x):"y2"===t._id&&r&&r.layout.yaxis2&&r.layout.yaxis2.formatCallback&&(s.text=r.layout.yaxis2.formatCallback(s.text,s.x)),s},k.hoverLabelText=function(t,e,n,r){if(n&&n!==_&&n!==e)return k.hoverLabelText(t,e,null,r)+" - "+k.hoverLabelText(t,n,null,r);var a="log"===t.type&&e<=0,o=k.tickText(t,t.c2l(a?-e:e),"hover",r).text;return a?0===e?"0":b+o:o};var j=["f","p","n","\u03bc","m","","k","M","G","T"];function B(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function H(t,e,n,r){var o=t<0,i=e._tickround,s=n||e.exponentformat||"B",c=e._tickexponent,u=k.getTickFormat(e),f=e.separatethousands;if(r){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};I(d),i=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,b);var p,h=Math.pow(10,-i)/2;if("none"===s&&(c=0),(t=Math.abs(t))"+p+"":"B"===s&&9===c?t+="B":B(s)&&(t+=j[c/3+5]));return o?b+t:t}function V(t,e){for(var n=0;n=0,o=c(t,e[1])<=0;return(n||a)&&(r||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(r))){n=t.tickformatstops[e];break}break;case"log":for(e=0;e1&&eo+1){var i=t.text,l=Math.round(o/(a/i.length)),s=Math.floor(l/2),c=l-s-1;i=i.substr(0,s)+"\u2026"+i.substr(-c);var u=e.select("text");u.text(i),e.insert("title","text").text(t.text)}})),Q(),e+" done"},P,function(){var e,n,r,a,i,l=d._boundingBox,s=0,c=0;if("x"===d._id.charAt(0)?(e="height",a="r","2"===d._id.charAt(1)?(c=1,n="t"):n="b"):"y"===d._id.charAt(0)&&(e="width","2"===d._id.charAt(1)?(s=1,n="r"):n="l"),e&&n){r=l[e],d._titleElement&&(r+=d._titleElement.node().getBoundingClientRect()[e]+2);var u=.5*t._fullLayout[e];r=Math.min(r,u);var f={x:s,y:c,l:0,r:0,b:0,t:0};if(f[n]=r,"r"===a&&(0===d._lastangle&&(i=d._lastLabelWidth/2),i>0)){var p={x:1.01,y:0,l:0,r:i,b:0,t:0};o.autoMargin(t,"xaxis_on_r",p)}o.autoMargin(t,d._name,f)}}]);return O&&O.then&&t._promises.push(O),O}function Q(){if(!n){var a,o,i,l,s=T.getFromId(t,e),u=r.select(t).selectAll("g."+e+"tick"),d={selection:u,side:s.side},h=e.charAt(0),g=t._fullLayout._size,v=s.titlefont.size;if(u.size()){var y=f.getTranslate(u.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}var m=10+1.5*v+(s.linewidth?s.linewidth-1:0);"x"===h?(o="free"===s.anchor?{_offset:g.t+(1-(s.position||0))*g.h,_length:0}:T.getFromId(t,s.anchor),i=s._offset+s._length/2,l="top"===s.side?-m-v*(s.showticklabels?1:0):o._length+m+v*(s.showticklabels?1.5:.5),l+=o._offset,s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(l+=(p.height-p.margin.b-p.margin.t)*s.rangeslider.thickness+s._boundingBox.height),d.side||(d.side="bottom")):(o="free"===s.anchor?{_offset:g.l+(s.position||0)*g.w,_length:0}:T.getFromId(t,s.anchor),l=s._offset+s._length/2,i="right"===s.side?o._length+m+v*(s.showticklabels?1:.5):-m-v*(s.showticklabels?.5:0),i+=o._offset,a={rotate:"-90",offset:0},d.side||(d.side="left")),c.draw(t,e+"title",{propContainer:s,propName:s._name+".title",placeholder:p._dfltTitle[h],avoid:d,transform:a,attributes:{x:i,y:l,"text-anchor":"middle"}})}}function $(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!i.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[M])||t.fill&&t.fill.charAt(t.fill.length-1)===M)}function K(n,a,o){var i=n.gridlayer.selectAll("."+e),s=n.zerolinelayer,c=n["hidegrid"+M]?[]:q,f=d._gridpath||("x"===M?"M0,"+a._offset+"v":"M"+a._offset+",0h")+a._length,p=i.selectAll("path."+P).data(!1===d.showgrid?[]:c,C);if(p.enter().append("path").classed(P,1).classed("crisp",1).attr("d",f).each(function(t){d.zeroline&&("linear"===d.type||"-"===d.type)&&Math.abs(t.x)1)for(r=1;r2*i}(t,e)?"date":function(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,i=0,l=0;l2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;er?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":262,"./constants":218}],217:[function(t,e,n){"use strict";e.exports=function(t,e,n){if("category"===e.type){var r,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],218:[function(t,e,n){"use strict";var r=t("../../lib").counterRegex;e.exports={idRegex:{x:r("x"),y:r("y")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":169}],219:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./axis_ids").id2name;e.exports=function(t,e,n,o,i){var l=i._axisConstraintGroups,s=e._id,c=s.charAt(0);if(!e.fixedrange&&(n("constrain"),r.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,n,r){var o,i,l,s,c=r[a(e)].type,u=[];for(i=0;io*y)||_)for(n=0;nO&&DS&&(S=D);f/=(S-C)/(2*P),C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=T=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function O(t,e,n,r,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",a+"Z")}function z(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function D(t){t.selectAll(".select-outline").remove()}function E(t,e,n,r,a,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),N(t,e,a,o)}function N(t,e,n,r){n||(t.transition().style("fill",r>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function I(t){M&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),M=!1)}function F(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,w)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function B(t,e){if(k){var n=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(n,t._onwheel),t._onwheel=e,t.addEventListener(n,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}e.exports={makeDragBox:function(t,e,n,c,d,k,M,T){var N,q,H,V,U,G,Y,X,Z,W,J,Q,$,K=t._fullLayout,tt=t._fullLayout._zoomlayer,et=M+T==="nsew",nt=1===(M+T).length;function rt(){q=[e.xaxis],H=[e.yaxis];var n=q[0],r=H[0];G=n._length,Y=r._length;var a,o,i=K._axisConstraintGroups,s=[n._id],c=[r._id];N=[e].concat(M&&T?e.overlays:[]);for(var u=1;uw||i>w?(dt="xy",o/G>i/Y?(i=o*Y/G,lt>a?st.t=lt-i:st.b=lt+i):(o=i*G/Y,it>r?st.l=it-o:st.r=it+o),ht.attr("d",j(st))):l():!Z||i0&&(t.emit("plotly_zoom",a),a.userHandled||(Tt(),I(t),a.pre=!1,t.emit("plotly_zoom",a)))}var xt=[0,0,G,Y],bt=null,_t=b.REDRAWDELAY,wt=e.mainplot?K._plots[e.mainplot]:e;function kt(e,n){if(!t._transitioningWithDuration){if(rt(),"ew"===X||"ns"===Z)return X&&S(q,e),Z&&S(H,n),At([X?-e:0,Z?-n:0,G,Y]),void Mt(Z,X);if(J&&X&&Z){var r="w"===X==("n"===Z)?1:-1,a=(e/G+r*n/Y)/2;e=a*G,n=r*a*Y}"w"===X?e=s(q,0,e):"e"===X?e=s(q,1,-e):X||(e=0),"n"===Z?n=s(H,1,n):"s"===Z?n=s(H,0,-n):Z||(n=0);var o="w"===X?e:0,i="n"===Z?n:0;if(J){var l;if(!X&&1===Z.length){for(l=0;l rect").call(u.setTranslate,a,o).call(u.setScale,n,r);var P=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(u.setTranslate,C,S).call(u.setScale,1/n,1/r),P.selectAll(".point").call(u.setPointGroupScale,n,r),P.selectAll(".textpoint").call(u.setTextPointsScale,n,r),P.call(u.hideOutsideRangePoints,m)}}}return M.length*T.length!=1&&B(at,function(e){if(t._context.scrollZoom||K._enablescrollzoom){if(t._transitioningWithDuration)return l.pauseEvent(e);var n=t.querySelector(".plotly");if(rt(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(bt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var a,o=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=wt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-i.left)/i.width,c=(i.bottom-e.clientY)/i.height;if(T||J){for(T||(s=.5),a=0;au[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":169,"fast-isnumeric":16}],230:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=a[0]+(a[1]-a[0])*n;t.range=t._input.range=[t.l2r(o+(a[0]-o)*e),t.l2r(o+(a[1]-o)*e)]}},{"../../constants/alignment":148}],231:[function(t,e,n){"use strict";var r=t("polybooljs"),a=t("../../lib/polygon"),o=t("../../lib/throttle"),i=t("../../components/color"),l=t("../../components/fx/helpers").makeEventData,s=t("../../components/fx"),c=t("./axes"),u=t("./constants"),f=a.filter,d=a.tester,p=a.multitester,h=u.MINSELECT;function g(t){return t._id}function v(t,e,n){var r,a,o;if(n){var i=n.points||[];for(r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&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 d}function y(e,n,r){var o=s(e,r||t.calendar);if(o===d){if(!a(e))return d;o=s(new Date(+e))}return o}function m(e,n,r){return l(e,n,r||t.calendar)}function x(e){return t._categories[Math.round(e)]}function b(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(a(e))return+e}function _(e){return a(e)?r.round(t._b+t._m*e,2):d}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?v:c,t.l2c="log"===t.type?g:c,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(v(t,e))}:_,t.p2c="log"===t.type?function(t){return g(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=i,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(i(e))},t.p2d=t.p2r=w,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return v(i(t),e)},t.r2d=t.r2c=function(t){return g(i(t))},t.d2c=t.r2l=i,t.c2d=t.l2r=c,t.c2r=v,t.l2d=g,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return g(w(t))},t.r2p=function(e){return t.l2p(i(e))},t.p2r=w,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=y,t.c2d=t.c2r=t.l2d=t.l2r=m,t.d2p=t.r2p=function(e,n,r){return t.l2p(y(e,0,r))},t.p2d=t.p2r=function(t,e,n){return m(w(t),e,n)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!=e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return d},t.r2d=t.c2d=t.l2d=x,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var n=b(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return x(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var i,l,s=o.nestedProperty(t,e).get();if(l=(l="date"===t.type?o.dfltRange(t.calendar):"y"===n?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX).slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),i=0;i<2;i++)if("date"===t.type){if(!o.isDateTime(s[i],t.calendar)){t[e]=l;break}if(t.r2l(s[0])===t.r2l(s[1])){var c=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(c-1e3),s[1]=t.l2r(c+1e3);break}}else{if(!a(s[i])){if(!a(s[1-i])){t[e]=l;break}s[i]=s[1-i]*(i?10:.1)}if(s[i]<-f?s[i]=-f:s[i]>f&&(s[i]=f),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else o.nestedProperty(t,e).set(l)},t.setScale=function(r){var a=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var o=h.getFromId({_fullLayout:e},t.overlaying);t.domain=o.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===n?(t._offset=a.t+(1-t.domain[1])*a.h,t._length=a.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=a.l+t.domain[0]*a.w,t._length=a.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,n){var r,a,o,i="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=t.r2l(t.range[0])&&a<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:r.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:r.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":150,"../../lib":169,"./axis_ids":216,"./constants":218,d3:13,"fast-isnumeric":16}],233:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n,o,i){var l=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(n){return t[n]===t[e[0]]})||1===e.length)return t[e[0]]}(t);if(n("tickprefix")&&n("showtickprefix",l),n("ticksuffix",i.tickSuffixDflt)&&n("showticksuffix",l),n("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;if(r.coerceFont(n,"tickfont",{family:s.family,size:s.size,color:c}),n("tickangle"),"category"!==o){var u=n("tickformat");!function(t,e){var n,o,i=t.tickformatstops,l=e.tickformatstops=[];if(!Array.isArray(i))return;function s(t,e){return r.coerce(n,o,a.tickformatstops,t,e)}for(var c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);((d=r(d)?Number(d):0)<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===i?a.dateTick0(e.calendar):0,h=n("tick0",p);"date"===i?e.tick0=a.cleanDate(h,p):r(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{void 0===n("tickvals")?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":150,"../../lib":169,"fast-isnumeric":16}],236:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,n,c){var u=t._fullLayout,f=[];var d,p,h,g,v=function(t){var e,n,r,a,o={};for(e in t)if((n=e.split("."))[0].match(s)){var i=e.charAt(0),l=n[0];if(r=u[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=r._length,f.push(i),o[i]=a}return o}(e),y=Object.keys(v),m=function(t,e,n){var r,a,o,i=t._plots,l=[];for(r in i){var s=i[r];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=n[c]?n[c].to:f,o=n[u]?n[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(u,y,v);if(!m.length)return function(){function e(e,n,r){for(var a=0;a rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,n._offset).call(i.setScale,1,1);var r=t.plot.selectAll(".scatterlayer .trace");r.selectAll(".point").call(i.setPointGroupScale,1,1),r.selectAll(".textpoint").call(i.setTextPointsScale,1,1),r.call(i.hideOutsideRangePoints,t)}function b(e,n){var r,a,s,c=v[e.xaxis._id],f=v[e.yaxis._id],d=[];if(c){a=(r=t._fullLayout[c.axisName])._r,s=c.to,d[0]=(a[0]*(1-n)+n*s[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var p=a[1]-a[0],h=s[1]-s[0];r.range[0]=a[0]*(1-n)+n*s[0],r.range[1]=a[1]*(1-n)+n*s[1],d[2]=e.xaxis._length*(1-n+n*h/p)}else d[0]=0,d[2]=e.xaxis._length;if(f){a=(r=t._fullLayout[f.axisName])._r,s=f.to,d[1]=(a[1]*(1-n)+n*s[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var g=a[1]-a[0],y=s[1]-s[0];r.range[0]=a[0]*(1-n)+n*s[0],r.range[1]=a[1]*(1-n)+n*s[1],d[3]=e.yaxis._length*(1-n+n*y/g)}else d[1]=0,d[3]=e.yaxis._length;!function(e,n){var r,a=[];for(a=[e._id,n._id],r=0;r rect").call(i.setTranslate,M,T).call(i.setScale,1/w,1/k),e.plot.call(i.setTranslate,C,S).call(i.setScale,w,k).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/w,1/k),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/w,1/k)}c&&(d=c());var _=r.ease(n.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(g),g=null,function(){for(var e={},n=0;nn.duration?(function(){for(var e={},n=0;n0?".":"")+o;a.isPlainObject(i)?s(i,e,l,r+1):e(l,o,i)}})}n.manageCommandObserver=function(t,e,r,i){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=n.hasSimpleAPICommandBindings(t,r,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){o(t,c,l.cache),l.check=function(){if(s){var e=o(t,c,l.cache);return e.changed&&i&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(i({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fa*Math.PI/180}return!1},n.getPath=function(){return r.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),o&&n.clipExtent(null);var i=n.getBounds(e),l=Math.min(r/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+t[0][0]+(r-l*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(a-l*(i[1][1]+i[0][1]))/2;return o&&n.clipExtent(o),n.scale(150*l).translate([s,c])},n.precision(h.precision),a&&n.clipAngle(a-h.clipPad);return n}(e);u.center([c.lon-s.lon,c.lat-s.lat]).rotate([-s.lon,-s.lat,s.roll]).parallels(l.parallels);var f=[[n.l+n.w*i.x[0],n.t+n.h*(1-i.y[1])],[n.l+n.w*i.x[1],n.t+n.h*(1-i.y[0])]],d=e.lonaxis,p=e.lataxis,g=function(t,e){var n=h.clipPad,r=t[0]+n,a=t[1]-n,o=e[0]+n,i=e[1]-n;r>0&&a<0&&(a+=360);var l=(a-r)/4;return{type:"Polygon",coordinates:[[[r,o],[r,i],[r+l,i],[r+2*l,i],[r+3*l,i],[a,i],[a,o],[a-l,o],[a-2*l,o],[a-3*l,o],[r,o]]]}}(d.range,p.range);u.fitExtent(f,g);var v=this.bounds=u.getBounds(g),y=this.fitScale=u.scale(),m=u.translate();if(!isFinite(v[0][0])||!isFinite(v[0][1])||!isFinite(v[1][0])||!isFinite(v[1][1])||isNaN(m[0])||isNaN(m[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k0&&k<0&&(k+=360);var M,T,A,L=(w+k)/2;if(!c){var C=u?l.projRotate:[L,0,0];M=n("projection.rotation.lon",C[0]),n("projection.rotation.lat",C[1]),n("projection.rotation.roll",C[2]),n("showcoastlines",!u)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean")&&n("oceancolor")}(c?(T=-96.6,A=38.7):(T=u?L:M,A=(_[0]+_[1])/2),n("center.lon",T),n("center.lat",A),f)&&n("projection.parallels",l.projParallels||[0,60]);n("projection.scale"),n("showland")&&n("landcolor"),n("showlakes")&&n("lakecolor"),n("showrivers")&&(n("rivercolor"),n("riverwidth")),n("showcountries",u&&"usa"!==o)&&(n("countrycolor"),n("countrywidth")),("usa"===o||"north america"===o&&50===r)&&(n("showsubunits",!0),n("subunitcolor"),n("subunitwidth")),u||n("showframe",!0)&&(n("framecolor"),n("framewidth")),n("bgcolor")}e.exports=function(t,e,n){r(t,e,n,{type:"geo",attributes:o,handleDefaults:l,partition:"y"})}},{"../../subplot_defaults":261,"../constants":242,"./layout_attributes":247}],247:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("../../domain_attributes"),o=t("../constants"),i=t("../../../plot_api/edit_types").overrideAll,l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=i({domain:a({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(o.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(o.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:o.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:o.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:o.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:o.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")},{"../../../components/color/attributes":49,"../../../plot_api/edit_types":197,"../../domain_attributes":239,"../constants":242}],248:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,e)}}function n(e,r){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,r)})};if(!c.hasOwnProperty(e.type))return null;var a=c[e.type];return t.geo.stream(e,r(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&r.hasOwnProperty(t.type)?r[t.type]:n)(t,a)};var r={Feature:e,FeatureCollection:function(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,n)})}}},a=[],o=[],i={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},l={lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(o.push(a),a=[])},result:function(){var t=o.length?o.length<2?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o}:null;return o=[],t}},s={polygonStart:u,lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);o.push(a),a=[]}},polygonEnd:u,result:function(){if(!o.length)return null;var t=[],e=[];return o.forEach(function(n){!function(t){if((e=t.length)<4)return!1;for(var e,n=0,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++nr^p>r&&n<(d-c)*(r-u)/(p-u)+c&&(a=!a)}return a}(t[0],n))return t.push(e),!0})||t.push([e])}),o=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:i,MultiPoint:i,LineString:l,MultiLineString:l,Polygon:s,MultiPolygon:s,Sphere:s};function u(){}var f=1e-6,d=f*f,p=Math.PI,h=p/2,g=(Math.sqrt(p),p/180),v=180/p;function y(t){return t>1?h:t<-1?-h:Math.asin(t)}function m(t){return t>1?0:t<-1?p:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var n=(2+h)*Math.sin(e);e/=2;for(var r=0,a=1/0;r<10&&Math.abs(a)>f;r++){var o=Math.cos(e);e-=a=(e+Math.sin(e)*(o+2)-n)/(2*o*(1+o))}return[2/Math.sqrt(p*(4+p))*t*(1+Math.cos(e)),2*Math.sqrt(p/(4+p))*Math.sin(e)]}t.geo.interrupt=function(e){var n,r=[[[[-p,0],[0,h],[p,0]]],[[[-p,0],[0,-h],[p,0]]]];function a(t,n){for(var a=n<0?-1:1,o=r[+(n<0)],i=0,l=o.length-1;io[i][2][0];++i);var s=e(t-o[i][1][0],n);return s[0]+=e(o[i][1][0],a*n>a*o[i][0][1]?o[i][0][1]:n)[0],s}e.invert&&(a.invert=function(t,o){for(var i=n[+(o<0)],l=r[+(o<0)],c=0,u=i.length;c=0;--a){var i=r[1][a],s=180*i[0][0]/p,c=180*i[0][1]/p,u=180*i[1][1]/p,f=180*i[2][0]/p,d=180*i[2][1]/p;n.push(l([[f-e,d-e],[f-e,u+e],[s+e,u+e],[s+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(n)]}}(),s)},a},o.lobes=function(t){return arguments.length?(r=t.map(function(t){return t.map(function(t){return[[t[0][0]*p/180,t[0][1]*p/180],[t[1][0]*p/180,t[1][1]*p/180],[t[2][0]*p/180,t[2][1]*p/180]]})}),n=r.map(function(t){return t.map(function(t){var n,r=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],i=e(t[1][0],t[1][1])[1];return o>i&&(n=o,o=i,i=n),[[r,o],[a,i]]})}),o):r.map(function(t){return t.map(function(t){return[[180*t[0][0]/p,180*t[0][1]/p],[180*t[1][0]/p,180*t[1][1]/p],[180*t[2][0]/p,180*t[2][1]/p]]})})},o},_.invert=function(t,e){var n=.5*e*Math.sqrt((4+p)/p),r=y(n),a=Math.cos(r);return[t/(2/Math.sqrt(p*(4+p))*(1+a)),y((r+n*(a+2))/(2+h))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return M;function n(n,r){var a=w(n/e,r);return a[0]*=t,a}return n.invert=function(n,r){var a=w.invert(n/t,r);return a[0]*=e,a},n}function M(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function T(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function A(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function L(t){return function(e){var n,r=t*Math.sin(e),a=30;do{e-=n=(e+Math.sin(e)-r)/(1+Math.cos(e))}while(Math.abs(n)>f&&--a>0);return e/2}}M.invert=function(t,e){var n=2*y(e/2);return[t*Math.cos(n/2)/Math.cos(n),n]},(t.geo.hammer=function(){var t=2,e=b(k),n=e(t);return n.coefficient=function(n){return arguments.length?e(t=+n):t},n}).raw=k,T.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(T)}).raw=T,A.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(A)}).raw=A,L(p);var C=function(t,e,n){var r=L(n);function a(n,a){return[t*n*Math.cos(a=r(a)),e*Math.sin(a)]}return a.invert=function(r,a){var o=y(a/e);return[r/(t*Math.cos(o)),y((2*o+Math.sin(2*o))/n)]},a}(Math.SQRT2/h,Math.SQRT2,p);function S(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}(t.geo.mollweide=function(){return x(C)}).raw=C,S.invert=function(t,e){var n,r=e,a=25;do{var o=r*r,i=o*o;r-=n=(r*(1.007226+o*(.015085+i*(.028874*o-.044475-.005916*i)))-e)/(1.007226+o*(.045255+i*(.259866*o-.311325-.005916*11*i)))}while(Math.abs(n)>f&&--a>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},(t.geo.naturalEarth=function(){return x(S)}).raw=S;var P=[[.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]];function O(t,e){var n,r=Math.min(18,36*Math.abs(e)/p),a=Math.floor(r),o=r-a,i=(n=P[a])[0],l=n[1],s=(n=P[++a])[0],c=n[1],u=(n=P[Math.min(19,++a)])[0],f=n[1];return[t*(s+o*(u-i)/2+o*o*(u-2*s+i)/2),(e>0?h:-h)*(c+o*(f-l)/2+o*o*(f-2*c+l)/2)]}function z(t,e){return[t*Math.cos(e),e]}function D(t,e){var n,r=Math.cos(e),a=(n=m(r*Math.cos(t/=2)))?n/Math.sin(n):1;return[2*r*Math.sin(t)*a,Math.sin(e)*a]}function E(t,e){var n=D(t,e);return[(n[0]+t/h)/2,(n[1]+e)/2]}P.forEach(function(t){t[1]*=1.0144}),O.invert=function(t,e){var n=e/h,r=90*n,a=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(a));do{var i=P[o][1],l=P[o+1][1],s=P[Math.min(19,o+2)][1],c=s-i,u=s-2*l+i,f=2*(Math.abs(n)-l)/c,p=u/c,y=f*(1-p*f*(1-2*p*f));if(y>=0||1===o){r=(e>=0?5:-5)*(y+a);var m,x=50;do{y=(a=Math.min(18,Math.abs(r)/5))-(o=Math.floor(a)),i=P[o][1],l=P[o+1][1],s=P[Math.min(19,o+2)][1],r-=(m=(e>=0?h:-h)*(l+y*(s-i)/2+y*y*(s-2*l+i)/2)-e)*v}while(Math.abs(m)>d&&--x>0);break}}while(--o>=0);var b=P[o][0],_=P[o+1][0],w=P[Math.min(19,o+2)][0];return[t/(_+y*(w-b)/2+y*y*(w-2*_+b)/2),r*g]},(t.geo.robinson=function(){return x(O)}).raw=O,z.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(z)}).raw=z,D.invert=function(t,e){if(!(t*t+4*e*e>p*p+f)){var n=t,r=e,a=25;do{var o,i=Math.sin(n),l=Math.sin(n/2),s=Math.cos(n/2),c=Math.sin(r),u=Math.cos(r),d=Math.sin(2*r),h=c*c,g=u*u,v=l*l,y=1-g*s*s,x=y?m(u*s)*Math.sqrt(o=1/y):o=0,b=2*x*u*l-t,_=x*c-e,w=o*(g*v+x*u*s*h),k=o*(.5*i*d-2*x*c*l),M=.25*o*(d*l-x*c*g*i),T=o*(h*s+x*v*u),A=k*M-T*w;if(!A)break;var L=(_*k-b*T)/A,C=(b*M-_*w)/A;n-=L,r-=C}while((Math.abs(L)>f||Math.abs(C)>f)&&--a>0);return[n,r]}},(t.geo.aitoff=function(){return x(D)}).raw=D,E.invert=function(t,e){var n=t,r=e,a=25;do{var o,i=Math.cos(r),l=Math.sin(r),s=Math.sin(2*r),c=l*l,u=i*i,d=Math.sin(n),p=Math.cos(n/2),g=Math.sin(n/2),v=g*g,y=1-u*p*p,x=y?m(i*p)*Math.sqrt(o=1/y):o=0,b=.5*(2*x*i*g+n/h)-t,_=.5*(x*l+r)-e,w=.5*o*(u*v+x*i*p*c)+.5/h,k=o*(d*s/4-x*l*g),M=.125*o*(s*g-x*l*u*d),T=.5*o*(c*p+x*v*i)+.5,A=k*M-T*w,L=(_*k-b*T)/A,C=(b*M-_*w)/A;n-=L,r-=C}while((Math.abs(L)>f||Math.abs(C)>f)&&--a>0);return[n,r]},(t.geo.winkel3=function(){return x(E)}).raw=E}},{}],249:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=Math.PI/180,i=180/Math.PI,l={cursor:"pointer"},s={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,n){var r=t.id,o=t.graphDiv,i=o.layout[r],l=o._fullLayout[r],s={};function c(t,e){var n=a.nestedProperty(l,t);n.get()!==e&&(n.set(e),a.nestedProperty(i,t).set(e),s[r+"."+t]=e)}n(c),c("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",s)}function f(t,e){var n=c(0,e),a=e.scale();function o(n){var r=e.invert(t.midPt);n("center.lon",r[0]),n("center.lat",r[1])}return n.on("zoomstart",function(){r.select(this).style(l)}).on("zoom",function(){var o=Math.max(a,r.event.scale);n.scale(o),e.scale(o).translate(r.event.translate),t.render()}).on("zoomend",function(){r.select(this).style(s),u(t,e,o)}),n}function d(t,e){var n,a,o,i,f,d,p,h,g=c(0,e),v=e.scale(),y=2;function m(t){return e.invert(t)}function x(n){var r=e.rotate(),a=e.invert(t.midPt);n("projection.rotation.lon",-r[0]),n("center.lon",a[0]),n("center.lat",a[1])}return g.on("zoomstart",function(){r.select(this).style(l),n=r.mouse(this),a=e.rotate(),o=e.translate(),i=a,f=m(n)}).on("zoom",function(){if(d=r.mouse(this),s=e(m(l=n)),Math.abs(s[0]-l[0])>y||Math.abs(s[1]-l[1])>y)return g.scale(e.scale()),void g.translate(e.translate());var l,s;e.scale(Math.max(v,r.event.scale));var c=e.scale()*Math.PI,u=o[0]-c/2,x=c/2,b=Math.min(Math.max(r.event.translate[1],u),x);e.translate([o[0],b]),g.translate([o[0],b]),f?m(d)&&(h=m(d),p=[i[0]+(h[0]-f[0]),a[1],a[2]],e.rotate(p),i=p):f=m(n=d),t.render()}).on("zoomend",function(){r.select(this).style(s),u(t,e,x)}),g}function p(t,e){var n,a={r:e.rotate(),k:e.scale()},f=c(0,e),d=function(t){var e=0,n=arguments.length,a=[];for(;++eh?(o=(f>0?90:-90)-p,a=0):(o=Math.asin(f/h)*i-p,a=Math.sqrt(h*h-f*f));var v=180-o-2*p,m=(Math.atan2(d,u)-Math.atan2(c,a))*i,x=(Math.atan2(d,u)-Math.atan2(c,-a))*i,b=g(n[0],n[1],o,m),_=g(n[0],n[1],v,x);return b<=_?[o,m,n[2]]:[v,x,n[2]]}(k,n,C);isFinite(M[0])&&isFinite(M[1])&&isFinite(M[2])||(M=C),e.rotate(M),C=M}}else n=h(e,A=b);d.of(this,arguments)({type:"zoom"})}),T=d.of(this,arguments),p++||T({type:"zoomstart"})}).on("zoomend",function(){var n;r.select(this).style(s),v.call(f,"zoom",null),n=d.of(this,arguments),--p||n({type:"zoomend"}),u(t,e,x)}).on("zoom.redraw",function(){t.render()}),r.rebind(f,d,"on")}function h(t,e){var n=t.invert(e);return n&&isFinite(n[0])&&isFinite(n[1])&&function(t){var e=t[0]*o,n=t[1]*o,r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}(n)}function g(t,e,n,r){var a=v(n-t),o=v(r-e);return Math.sqrt(a*a+o*o)}function v(t){return(t%360+540)%360-180}function y(t,e,n){var r=n*o,a=t.slice(),i=0===e?1:0,l=2===e?1:2,s=Math.cos(r),c=Math.sin(r);return a[i]=t[i]*s-t[l]*c,a[l]=t[l]*s+t[i]*c,a}function m(t,e){for(var n=0,r=0,a=t.length;r=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"),s=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var n=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)n.on("click",function(){p.sendDataToCloud(t)});else{var r=window.location.pathname.split("/"),a=window.location.search;n.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+r[2].split(".")[0]+"/"+r[1]+a})}}(t,i),l.text(i.text()&&s.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),a=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),a.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,n=t._fullLayout||{},a=t._fullLayout={},o=t.layout||{},i=t._fullData||[],f=t._fullData=[],d=t.data||[];t._transitionData||p.createTransitionData(t),a._dfltTitle={plot:u(t,"Click to enter Plot title"),x:u(t,"Click to enter X axis title"),y:u(t,"Click to enter Y axis title"),colorbar:u(t,"Click to enter Colorscale title"),annotation:u(t,"new text")},a._traceWord=u(t,"trace");var h=function(t){var e=t._context.locale;var n=!1,r={};function a(t){for(var e=!0,a=0;a=0)return!0}return!1},p.cleanPlot=function(t,e,n,r){var a,o,i=r._basePlotModules||[];for(a=0;a0){var u=function(t){var e,n={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(n.left+=t[e].left||0,n.right+=t[e].right||0,n.bottom+=t[e].bottom||0,n.top+=t[e].top||0);return n}(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(h*(g.width-f)),o=Math.round(h*(g.height-d))}else{var v=s?window.getComputedStyle(t):{};r=parseFloat(v.width)||n.width,o=parseFloat(v.height)||n.height}var y=p.layoutAttributes.width.min,m=p.layoutAttributes.height.min;r1,b=!e.height&&Math.abs(n.height-o)>1;(b||x)&&(x&&(n.width=r),b&&(n.height=o)),t._initialAutoSize||(t._initialAutoSize={width:r,height:o}),p.sanitizeMargins(n)},p.supplyLayoutModuleDefaults=function(t,e,n,r){var a,o,i,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(a in s)(i=s[a]).includeBasePlot&&i.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),o=0;o.45*r.width&&(n.l=n.r=0),n.b+n.t>.38*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];r._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),i=Math.max(e.margin.l||0,0),l=Math.max(e.margin.r||0,0),s=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var f in u.base={l:{val:0,size:i},r:{val:1,size:l},t:{val:1,size:s},b:{val:0,size:c}},u){var d=u[f].l||{},p=u[f].b||{},h=d.val,g=d.size,v=p.val,y=p.size;for(var m in u){if(a(g)&&u[m].r){var x=u[m].r.val,b=u[m].r.size;if(x>h){var _=(g*x+(b-e.width)*h)/(x-h),w=(b*(1-h)+(g-e.width)*(1-x))/(x-h);_>=0&&w>=0&&_+w>i+l&&(i=_,l=w)}}if(a(y)&&u[m].t){var k=u[m].t.val,M=u[m].t.size;if(k>v){var T=(y*k+(M-e.height)*v)/(k-v),A=(M*(1-v)+(y-e.height)*(1-k))/(k-v);T>=0&&A>=0&&T+A>c+s&&(c=T,s=A)}}}}if(n.l=Math.round(i),n.r=Math.round(l),n.t=Math.round(s),n.b=Math.round(c),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,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,n,r,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=a?t._fullData:t.data,i=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function s(t){if("function"==typeof t)return null;if(c.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("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!c.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;a[e]=s(t[e])}return a}return Array.isArray(t)?t.map(s):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var u={data:(o||[]).map(function(t){var n=s(t);return e&&delete n.fit,n})};return e||(u.layout=s(i)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=s(l)),"object"===r?u:JSON.stringify(u)},p.modifyFrames=function(t,e){var n,r,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){h=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var r,l,s=0,u=0;function f(){return s++,function(){var n;u++,h||u!==s||(n=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return o.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(n)))}}var p=t._fullLayout._basePlotModules,g=!1;if(n)for(l=0;l=0;o--)if(b[o].enabled){n._indexToPoints=b[o]._indexToPoints;break}r&&r.calc&&(x=r.calc(t,n))}Array.isArray(x)&&x[0]||(x=[{x:d,y:d}]),x[0].t||(x[0].t={}),x[0].trace=n,p[a]=x}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,n,r){var a,o=e.traceHash,i={};for(a=0;a=0?d.angularAxis.domain:r.extent(k),C=Math.abs(k[1]-k[0]);T&&!M&&(C=0);var S=L.slice();A&&M&&(S[1]+=C);var P=d.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),d.angularAxis.ticksStep&&(P=(S[1]-S[0])/P);var O=d.angularAxis.ticksStep||(S[1]-S[0])/(P*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var z=r.range.apply(this,S);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=r.scale.linear().domain(S.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?C:0,void 0===(t=r.select(this).select("svg.chart-root"))||t.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));t=r.select(E)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var N,R=t.select(".chart-group"),I={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){N=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var n=i.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});i.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},i.Legend.defaultConfig().legendConfig,{container:N,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=N.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],n.range([0,x]),u.layout.radialAxis.domain=n.domain(),N.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else N=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var q=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(q[0]=Math.max(0,q[0]),q[1]=Math.max(0,q[1]),t.select(".outer-group").attr("transform","translate("+q+")"),d.title){var H=t.select("g.title-group text").style(F).text(d.title),V=H.node().getBBox();H.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var U=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(n.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(I),G.attr("r",n),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(I);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var Z=r.svg.axis().scale(n).ticks(5).tickSize(5);U.call(Z).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(I),U.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(I),J.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(F);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:o+"em",transform:function(t,e){var n=X(t),r=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(F);d.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var $=r.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));N.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=l,r.container=tt.filter(function(t,n){return n==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,et.push({data:t,geometryConfig:r})});var nt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),rt=[];nt.forEach(function(t,e){"unstacked"===t.key?rt=rt.concat(t.values.map(function(t,e){return[t]})):rt.push(t.values)}),rt.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 a(i[n].defaultConfig(),t)});i[n]().config(r)()})}var at,ot,it=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=i.tooltipPanel().config({container:lt,fontSize:8})(),ct=i.tooltipPanel().config({container:lt,fontSize:8})(),ut=i.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var n=i.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-d.orientation)%360;at=l.invert(r);var a=i.util.convertToCartesian(x+12,n+180);st.text(i.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var dt=it.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var r=i.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=n.invert(i.util.getMousePos(Y).radius);var a=i.util.convertToCartesian(r,d.radialAxis.orientation);ct.text(i.util.round(ot)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,n){var a=r.select(this),o=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),o&&"none"!==o){a.attr({"data-fill":o}),l=r.hsl(o).darker().toString(),a.style({fill:l,opacity:1});var c={t:i.util.round(e[0]),r:i.util.round(e[1])};M&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-q[0]-d.left,f.top+f.height/2-q[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else o=this.style.stroke||"black",a.attr({"data-stroke":o}),l=r.hsl(o).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var n=r.select(this),a=n.attr("data-fill");a?n.style({fill:a,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})})}(c),this},d.config=function(t){if(!arguments.length)return s;var e=i.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],i.Axis.defaultConfig().data[0]),a(s.data[e],t)}),a(s.layout,i.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return n},d.angularScale=function(t){return l},d.svg=function(){return t},r.rebind(d,f,"on"),d},i.Axis.defaultConfig=function(t,e){return{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:r.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}}},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},i.util._extend=function(t,e){for(var n in t)e[n]=t[n]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},i.util.dataFromEquation=function(t,e,n){var a=e||6,o=[],i=[];r.range(0,360+a,a).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},i.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},i.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=i.util.ensureArray(t[e],n)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},i.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},i.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},i.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],a=e[1],o={};return o.x=n,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+a*a),o},i.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;a0)){var s=r.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,n){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(n,a,o)},"fill-opacity":0,stroke:function(t,e){return h.stroke(n,a,o)},"stroke-width":function(t,e){return h["stroke-width"](n,a,o)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](n,a,o)},opacity:function(t,e){return h.opacity(n,a,o)},display:function(t,e){return h.display(n,a,o)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/i[0].length*Math.PI/180,p=r.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(t){return e.radialScale(s+(t[2]||0))}).outerRadius(function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,n,a){r.select(this).attr({class:"mark arc",d:p,transform:function(t,n){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={fill:function(e,n,r){return t[r].data.color},stroke:function(e,n,r){return t[r].data.strokeColor},"stroke-width":function(e,n,r){return t[r].data.strokeSize+"px"},"stroke-dasharray":function(e,r,a){return n[t[a].data.strokeDash]},opacity:function(e,n,r){return t[r].data.opacity},display:function(e,n,r){return void 0===t[r].data.visible||t[r].data.visible?"block":"none"}},g=r.select(this).selectAll("g.layer").data(i);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()})}return o.config=function(e){return arguments.length?(e.forEach(function(e,n){t[n]||(t[n]={}),a(t[n],i.PolyChart.defaultConfig()),a(t[n],e)}),this):t},o.getColorScale=function(){},r.rebind(o,e,"on"),o},i.PolyChart.defaultConfig=function(){return{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:r.scale.category20()}}},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},i.Legend=function(){var t=i.Legend.defaultConfig(),e=r.dispatch("hover");function n(){var e=t.legendConfig,o=t.data.map(function(t,n){return[].concat(t).map(function(t,r){var o=a({},e.elements[n]);return o.name=t,o.color=[].concat(e.elements[n].color)[r],o})}),i=r.merge(o);i=i.filter(function(t,n){return e.elements[n]&&(e.elements[n].visibleInLegend||void 0===e.elements[n].visibleInLegend)}),e.reverseOrder&&(i=i.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=r.select(l));var s=i.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof i[0]:e.isContinuous,f=u?e.height:c*i.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.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 h=r.range(i.length),g=r.scale[u?"linear":"ordinal"]().domain(h).range(s),v=r.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var y=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var m=d.select(".legend-marks").selectAll("path.legend-mark").data(i);m.enter().append("path").classed("legend-mark",!0),m.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var n,a,o,i=t.symbol;return o=3*(a=c),"line"===(n=i)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(n)?r.svg.symbol().type(n).size(o)():r.svg.symbol().type("square").size(o)()},fill:function(t,e){return g(e)}}),m.exit().remove()}var x=r.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return i[e].name}),n}return n.config=function(e){return arguments.length?(a(t,e),this):t},r.rebind(n,e,"on"),n},i.Legend.defaultConfig=function(t,e){return{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}}},i.tooltipPanel=function(){var t,e,n,o={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=10,c=function(){var r=(t=o.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:o.padding+s,dy:.3*+o.fontSize}),c};return c.text=function(a){var i=r.hsl(o.color).l,l=i>=.5?"#aaa":"white",u=i>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":o.fontSize+"px"}).text(f);var d=o.padding,p=e.node().getBBox(),h={fill:o.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return n.attr({d:"M"+[[s,-v/2],[s,-v/4],[o.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(o,t),c},c},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={convert:function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=a({},t);return[[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"]]].forEach(function(t,n){i.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(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 o=i.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=o.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var l=a({},t.layout);if([[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"]]].forEach(function(t,n){i.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==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&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};r.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}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}};return t}},{"../../../constants/alignment":148,"../../../lib":169,d3:13}],259:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../../lib"),o=t("../../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,n,a,o,u,f=new l;function d(n,l){return l&&(u=l),r.select(r.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,n):n,a||(a=i.Axis()),o=i.adapter.plotly().convert(e),a.config(o).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return i.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,r,a=this,o=i.util.cloneJson(e);t=o,r=n,f.add({undo:function(){r&&a(r)},redo:function(){a(t)}}),n=i.util.cloneJson(o)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:n,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../../components/color":50,"../../../lib":169,"./micropolar":258,"./undo_manager":260,d3:13}],260:[function(t,e,n){"use strict";e.exports=function(){var t,e=[],n=-1,r=!1;function a(t,e){return t?(r=!0,t[e](),r=!1,this):this}return{add:function(t){return r?this:(e.splice(n+1,e.length-n),e.push(t),n=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var r=e[n];return r?(a(r,"undo"),n-=1,t&&t(r.undo),this):this},redo:function(){var r=e[n+1];return r?(a(r,"redo"),n+=1,t&&t(r.redo),this):this},clear:function(){e=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1&&(u[d[n]].title="");for(n=0;n")?"":e.html(t).text()});return e.remove(),n}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":50,"../components/drawing":75,"../constants/xmlns_namespaces":152,"../lib":169,d3:13}],271:[function(t,e,n){"use strict";var r=t("../../lib").mergeArray;e.exports=function(t,e){for(var n=0;no))return e}return void 0!==n?n:t.dflt}function k(t,e,n){return o(e).isValid()?e:void 0!==n?n:t.dflt}e.exports=function(t,e,n){var o=e.xaxis,f=e.yaxis,w=t._fullLayout,k=e.plot.select(".barlayer").selectAll("g.trace.bars").data(n);k.enter().append("g").attr("class","trace bars"),k.each(function(t){t[0].node3=r.select(this)}),k.append("g").attr("class","points").each(function(e){var n=r.select(this),u=e[0].t,k=e[0].trace,M=u.poffset,T=Array.isArray(M);n.selectAll("g.point").data(i.identity).enter().append("g").classed("point",!0).each(function(n,i){var u,A,L,C,S=n.p+(T?M[i]:M),P=S+n.w,O=n.b,z=O+n.s;if("h"===k.orientation?(L=f.c2p(S,!0),C=f.c2p(P,!0),u=o.c2p(O,!0),A=o.c2p(z,!0),n.ct=[A,(L+C)/2]):(u=o.c2p(S,!0),A=o.c2p(P,!0),L=f.c2p(O,!0),C=f.c2p(z,!0),n.ct=[(u+A)/2,C]),a(u)&&a(A)&&a(L)&&a(C)&&u!==A&&L!==C){var D=(n.mlw+1||k.marker.line.width+1||(n.trace?n.trace.marker.line.width:0)+1)-1,E=r.round(D/2%1,2);if(!t._context.staticPlot){var N=s.opacity(n.mc||k.marker.color)<1||D>.01?I:function(t,e){return Math.abs(t-e)>=2?I(t):t>e?Math.ceil(t):Math.floor(t)};u=N(u,A),A=N(A,u),L=N(L,C),C=N(C,L)}var R=r.select(this);R.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+u+","+L+"V"+C+"H"+A+"V"+L+"Z"),function(t,e,n,r,a,o,i,s){var u;function f(e,n,r){var a=e.append("text").text(n).attr({class:"bartext bartext-"+u,transform:"","text-anchor":"middle","data-notex":1}).call(c.font,r).call(l.convertToTspans,t);return a}var w=n[0].trace,k=w.orientation,M=function(t,e){var n=b(t.text,e);return _(d,n)}(w,r);if(!M)return;if("none"===(u=function(t,e){var n=b(t.textposition,e);return function(t,e,n){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==n?n:t.dflt}(p,n)}(w,r)))return;var T,A,L,C,S,P,O=function(t,e,n){return x(h,t.textfont,e,n)}(w,r,t._fullLayout.font),z=function(t,e,n){return x(g,t.insidetextfont,e,n)}(w,r,O),D=function(t,e,n){return x(v,t.outsidetextfont,e,n)}(w,r,O),E=t._fullLayout.barmode,N="relative"===E,R="stack"===E||N,I=n[r],F=!R||I._outmost,j=Math.abs(o-a)-2*y,B=Math.abs(s-i)-2*y;"outside"===u&&(F||(u="inside"));if("auto"===u)if(F){u="inside",T=f(e,M,z),A=c.bBox(T.node()),L=A.width,C=A.height;var q=L>0&&C>0,H=L<=j&&C<=B,V=L<=B&&C<=j,U="h"===k?j>=L*(B/C):B>=C*(j/L);q&&(H||V||U)?u="inside":(u="outside",T.remove(),T=null)}else u="inside";if(!T&&(T=f(e,M,"outside"===u?D:z),A=c.bBox(T.node()),L=A.width,C=A.height,L<=0||C<=0))return void T.remove();"outside"===u?(P="both"===w.constraintext||"outside"===w.constraintext,S=function(t,e,n,r,a,o,i){var l,s="h"===o?Math.abs(r-n):Math.abs(e-t);s>2*y&&(l=y);var c=1;i&&(c="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width));var u,f,d,p,h=(a.left+a.right)/2,g=(a.top+a.bottom)/2;u=c*a.width,f=c*a.height,"h"===o?en?(d=(t+e)/2,p=r+l+f/2):(d=(t+e)/2,p=r-l-f/2);return m(h,g,d,p,c,!1)}(a,o,i,s,A,k,P)):(P="both"===w.constraintext||"inside"===w.constraintext,S=function(t,e,n,r,a,o,i){var l,s,c,u,f,d,p,h=a.width,g=a.height,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=Math.abs(e-t),_=Math.abs(r-n);b>2*y&&_>2*y?(b-=2*(f=y),_-=2*f):f=0;h<=b&&g<=_?(d=!1,p=1):h<=_&&g<=b?(d=!0,p=1):hn?(c=(t+e)/2,u=r-f-s/2):(c=(t+e)/2,u=r+f+s/2);return m(v,x,c,u,p,d)}(a,o,i,s,A,k,P));T.attr("transform",S)}(t,R,e,i,u,A,L,C)}else r.select(this).remove();function I(t){return 0===w.bargap&&0===w.bargroupgap?r.round(Math.round(t)-E,2):t}})}),k.call(u.plot,e)}},{"../../components/color":50,"../../components/drawing":75,"../../components/errorbars":81,"../../lib":169,"../../lib/svg_text_utils":190,"./attributes":272,d3:13,"fast-isnumeric":16,tinycolor2:31}],280:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r=t.cd,a=t.xaxis,o=t.yaxis,i=[];if(!1===e)for(n=0;nf+c||!r(u))&&(p=!0,h(d,t))}for(var v=0;v1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),n.selectAll("g.points").each(function(e){var n=r.select(this),o=n.selectAll("path"),i=n.selectAll("text"),l=e[0].trace;a.pointStyle(o,l,t),a.selectedPointStyle(o,l),i.each(function(t){var e,n=r.select(this);function o(n){var r=e[n];return Array.isArray(r)?r[t.i]:r}n.classed("bartext-inside")?e=l.insidetextfont:n.classed("bartext-outside")&&(e=l.outsidetextfont),e||(e=l.textfont),a.font(n,o("family"),o("size"),o("color"))}),a.selectedTextStyle(i,l)}),o.style(n)}},{"../../components/drawing":75,"../../components/errorbars":81,d3:13}],284:[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"),n("marker.opacity"),n("selected.marker.color"),n("unselected.marker.color")}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64}],285:[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",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:o({},r.text,{}),textbox:o({},r.textbox,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:o({},i.symbol,{arrayOk:!1,editType:"plot"}),opacity:o({},i.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:o({},i.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:o({},i.color,{arrayOk:!1,editType:"style"}),line:{color:o({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:o({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,selected:{marker:r.selected.marker,editType:"style"},unselected:{marker:r.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":49,"../../lib/extend":161,"../scatter/attributes":330}],286:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=a._,i=t("../../plots/cartesian/axes");function l(t,e,n){var r={text:"tx"};for(var a in r)Array.isArray(e[a])&&(t[r[a]]=e[a][n])}function s(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var n,u,f,d,p,h=t._fullLayout,g=i.getFromId(t,e.xaxis||"x"),v=i.getFromId(t,e.yaxis||"y"),y=[],m="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=g,f="x",d=v,p="y"):(u=v,f="y",d=g,p="x");var x=u.makeCalcdata(e,f),b=function(t,e,n,o,i){if(e in t)return n.makeCalcdata(t,e);var l;l=e+"0"in t?t[e+"0"]:"name"in t&&("category"===n.type||r(t.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(t.name)&&"date"===n.type)?t.name:i;var s=n.d2c(l,0,t[e+"calendar"]);return o.map(function(){return s})}(e,p,d,x,h[m]),_=a.distinctVals(b),w=_.vals,k=_.minDiff/2,M=function(t,e){for(var n=t.length,r=new Array(n+1),a=0;a=0&&S0){var O=L[n].sort(s),z=O.map(c),D=z.length,E={pos:w[n],pts:O};E.min=z[0],E.max=z[D-1],E.mean=a.mean(z,D),E.sd=a.stdev(z,D,E.mean),E.q1=a.interp(z,.25),E.med=a.interp(z,.5),E.q3=a.interp(z,.75),E.lf=Math.min(E.q1,z[Math.min(a.findBin(2.5*E.q1-1.5*E.q3,z,!0)+1,D-1)]),E.uf=Math.max(E.q3,z[Math.max(a.findBin(2.5*E.q3-1.5*E.q1,z),0)]),E.lo=4*E.q1-3*E.q3,E.uo=4*E.q3-3*E.q1,y.push(E)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var n=0;n0?(y[0].t={num:h[m],dPos:k,posLetter:p,valLetter:f,labels:{med:o(t,"median:"),min:o(t,"min:"),q1:o(t,"q1:"),q3:o(t,"q3:"),max:o(t,"max:"),mean:"sd"===e.boxmean?o(t,"mean \xb1 \u03c3:"):o(t,"mean:"),lf:o(t,"lower fence:"),uf:o(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete y[0].t.labels,h[m]++,y):[{t:{empty:!0}}]}},{"../../lib":169,"../../plots/cartesian/axes":213,"fast-isnumeric":16}],287:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../registry"),o=t("../../components/color"),i=t("./attributes");function l(t,e,n,r){var o,i=n("y"),l=n("x");if(i&&i.length)o="v",l||n("x0");else{if(!l||!l.length)return void(e.visible=!1);o="h",n("y0")}a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),n("orientation",o)}function s(t,e,n,a){var o=a.prefix,l=r.coerce2(t,e,i,"marker.outliercolor"),s=n("marker.line.outliercolor"),c=n(o+"points",l||s?"suspectedoutliers":void 0);n("jitter","all"===c?.3:0),n("pointpos","all"===c?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===c&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("textbox"),n("hoveron"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,a){function c(n,a){return r.coerce(t,e,i,n,a)}l(t,e,c,a),!1!==e.visible&&(c("line.color",(t.marker||{}).color||n),c("line.width"),c("fillcolor",o.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),s(t,e,c,{prefix:"box"}))},handleSampleDefaults:l,handlePointsDefaults:s}},{"../../components/color":50,"../../lib":169,"../../registry":262,"./attributes":285}],288:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("../../components/fx"),i=t("../../components/color"),l=t("../scatter/fill_hover_text");function s(t,e,n,l){var s,c,u,f,d,p,h,g,v,y,m=t.cd,x=t.xa,b=t.ya,_=m[0].trace,w=m[0].t,k="violin"===_.type,M=[],T="closest"!==l||k?w.bdPos:2.5*w.bdPos,A=function(t){return t.pos+w.bPos-p};k&&"both"!==_.side?("positive"===_.side&&(v=function(t){var e=A(t);return o.inbox(e,e+T)}),"negative"===_.side&&(v=function(t){var e=A(t);return o.inbox(e-T,e)})):v=function(t){var e=A(t);return o.inbox(e-T,e+T)},y=k?function(t){return o.inbox(t.span[0]-d,t.span[1]-d)}:function(t){return o.inbox(t.min-d,t.max-d)},"h"===_.orientation?(d=e,p=n,h=y,g=v,s="y",u=b,c="x",f=x):(d=n,p=e,h=v,g=y,s="x",u=x,c="y",f=b);var L=o.getDistanceFunction(l,h,g);if(o.getClosest(m,L,t),!1===t.index)return[];var C=m[t.index],S=_.line.color,P=(_.marker||{}).color;i.opacity(S)&&_.line.width?t.color=S:i.opacity(P)&&_.boxpoints?t.color=P:t.color=_.fillcolor,t[s+"0"]=u.c2p(C.pos+w.bPos-w.bdPos,!0),t[s+"1"]=u.c2p(C.pos+w.bPos+w.bdPos,!0),r.tickText(u,u.c2l(C.pos),"hover").text,t[s+"LabelVal"]=C.pos;var O={},z=["med","min","q1","q3","max"];(_.boxmean||(_.meanline||{}).visible)&&z.push("mean"),_.boxpoints&&z.push("lf","uf");for(var D=0;Dt.uf}),i=Math.max((t.max-t.min)/10,t.q3-t.q1),u=1e-9*i,f=i*c,g=[],v=0;if(n.jitter){if(0===i)for(v=1,g=new Array(o.length),e=0;et.lo&&(w.so=!0)}return o}).enter().append("path").classed("point",!0).call(o.translatePoints,u,f)}function d(t,e,n,o){var i,l,s=e.pos,c=e.val,u=o.bPos,f=o.bPosPxOffset||0;Array.isArray(o.bdPos)?(i=o.bdPos[0],l=o.bdPos[1]):(i=o.bdPos,l=o.bdPos),t.selectAll("path.mean").data(a.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+u,!0)+f,a=s.c2p(t.pos+u-i,!0)+f,o=s.c2p(t.pos+u+l,!0)+f,d=c.c2p(t.mean,!0),p=c.c2p(t.mean-t.sd,!0),h=c.c2p(t.mean+t.sd,!0);"h"===n.orientation?r.select(this).attr("d","M"+d+","+a+"V"+o+("sd"===n.boxmean?"m0,0L"+p+","+e+"L"+d+","+a+"L"+h+","+e+"Z":"")):r.select(this).attr("d","M"+a+","+d+"H"+o+("sd"===n.boxmean?"m0,0L"+e+","+p+"L"+a+","+d+"L"+e+","+h+"Z":""))})}e.exports={plot:function(t,e,n){var a=t._fullLayout,o=e.xaxis,i=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(n).enter().append("g").attr("class","trace boxes").each(function(t){var e,n,l=t[0],s=l.t,c=l.trace,p=l.node3=r.select(this),h=a._numBoxes,g="group"===a.boxmode&&h>1,v=s.dPos*(1-a.boxgap)*(1-a.boxgroupgap)/(g?h:1),y=g?2*s.dPos*((s.num+.5)/h-.5)*(1-a.boxgap):0,m=v*c.whiskerwidth;!0!==c.visible||s.empty?r.select(this).remove():("h"===c.orientation?(e=i,n=o):(e=o,n=i),s.bPos=y,s.bdPos=v,s.wdPos=m,u(p,{pos:e,val:n},c,s),c.boxpoints&&f(p,{x:o,y:i},c,s),c.boxmean&&d(p,{pos:e,val:n},c,s))})},plotBoxAndWhiskers:u,plotPoints:f,plotBoxMean:d}},{"../../components/drawing":75,"../../lib":169,d3:13}],293:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,a=t.cd,o=t.xaxis,i=t.yaxis,l=[];if(!1===e)for(n=0;n0&&x.push(g[_]));e.x=y,e.y=m,e.textbox=x}},{"../../lib":169,"../ohlc/helpers":313,"fast-isnumeric":16}],300:[function(t,e,n){"use strict";var r=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../plots/attributes"),l=t("../../lib/extend"),s=l.extendFlat,c=l.extendDeepAll,u=r.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:r.locationmode,z:{valType:"data_array",editType:"calc"},text:s({},r.text,{}),marker:{line:{color:u.color,width:s({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:r.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:r.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},i.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},a,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:o})},{"../../components/colorbar/attributes":51,"../../components/colorscale/attributes":56,"../../lib/extend":161,"../../plots/attributes":211,"../scattergeo/attributes":355}],301:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),i=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection");e.exports=function(t,e){for(var n=e.locations.length,s=new Array(n),c=0;cs&&(e.z=u.slice(0,s)),l("locationmode"),l("text"),l("marker.line.color"),l("marker.line.width"),l("marker.opacity"),a(t,e,i,l,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":60,"../../lib":169,"./attributes":300}],303:[function(t,e,n){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],304:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,n){var i,l,s,c,u=t.cd,f=u[0].trace,d=t.subplot;for(l=0;l")}(t,f,i,d.mockAxis),[t]}},{"../../plots/cartesian/axes":213,"../scatter/fill_hover_text":338,"./attributes":300}],305:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../heatmap/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="choropleth",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","noOpacity"],r.meta={},e.exports=r},{"../../plots/geo":244,"../heatmap/colorbar":309,"./attributes":300,"./calc":301,"./defaults":302,"./event_data":303,"./hover":304,"./plot":306,"./select":307,"./style":308}],306:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../lib/polygon"),i=t("../../lib/topojson_utils").getTopojsonFeatures,l=t("../../lib/geo_location_utils").locationToFeature,s=t("./style");function c(t,e){for(var n=t[0].trace,r=t.length,a=i(n,e),o=0;o0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?n[r++]=[t[a][0]+360,t[a][1]]:a===e?(n[r++]=t[a],n[r++]=[t[a][0],-90]):n[r++]=t[a];var i=o.tester(n);i.pts.pop(),c.push(i)}:function(t){c.push(o.tester(t))},i.type){case"MultiPolygon":for(n=0;nn?e=!0:r1)){var f=a.simpleMap(u.x,e.d2c,0,n.xcalendar),d=a.distinctVals(f).minDiff;i=Math.min(i,d)}}for(i===1/0&&(i=1),l=0;l");L.push(i,i,i,i,i,i,null)},B=0;B")}}return y}},{"../../components/color":50,"./helpers":322,"fast-isnumeric":16,tinycolor2:31}],320:[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"),c=i("labels");if(!Array.isArray(c)){if(!Array.isArray(s)||!s.length)return void(e.visible=!1);i("label0"),i("dlabel")}i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),d&&"none"!==d){var p=i("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(i,"textfont",o.font);g&&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":169,"./attributes":317}],321:[function(t,e,n){"use strict";var r=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var n={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(n.pointNumber=n.i=t.pts[0]),r(n,e,t.pts),n}},{"../../components/fx/helpers":89}],322:[function(t,e,n){"use strict";var r=t("../../lib");n.formatPiePercent=function(t,e){var n=(100*t).toFixed(2);return-1!==n.lastIndexOf(".00")&&(n=n.replace(".00","")),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)},n.getFirstFilled=function(t,e){if(Array.isArray(t)&&e)for(var n=0;n0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}e.exports=function(t,e){var n=t._fullLayout;!function(t,e){var n,r,a,o,i,l,s,c,u,f=[];for(a=0;as&&(s=l.pull[o]);i.r=Math.min(n,r)/(2+2*s),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===f.indexOf(l.scalegroup)&&f.push(l.scalegroup)}for(o=0;oa.vTotal/2?1:0)}(e),d.each(function(){var d=r.select(this).selectAll("g.slice").data(e);d.enter().append("g").classed("slice",!0),d.exit().remove();var g=[[[],[]],[[],[]]],v=!1;d.each(function(e){if(e.hidden)r.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=h.index,g[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var o=p.cx,d=p.cy,y=r.select(this),m=y.selectAll("path.surface").data([e]),x=!1,b=!1;if(m.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,l=t._fullData[h.index];if(!t._dragging&&!1!==i.hovermode){var f=l.hoverinfo;if(Array.isArray(f)&&(f=a.castHoverinfo({hoverinfo:[s.castOption(f,e.pts)],_module:h._module},i,0)),"all"===f&&(f="label+text+value+percent+name"),"none"!==f&&"skip"!==f&&f){var g=u(e,p),v=o+e.pxmid[0]*(1-g),y=d+e.pxmid[1]*(1-g),m=n.separators,_=[];if(-1!==f.indexOf("label")&&_.push(e.label),-1!==f.indexOf("text")){var w=s.castOption(l.hovertext||l.text,e.pts);w&&_.push(w)}-1!==f.indexOf("value")&&_.push(s.formatPieValue(e.v,m)),-1!==f.indexOf("percent")&&_.push(s.formatPiePercent(e.v/p.vTotal,m));var k=h.hoverlabel,M=k.font;a.loneHover({x0:v-g*p.r,x1:v+g*p.r,y:y,text:_.join("
"),name:-1!==f.indexOf("name")?l.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:s.castOption(k.bgcolor,e.pts)||e.color,borderColor:s.castOption(k.bordercolor,e.pts),fontFamily:s.castOption(M.family,e.pts),fontSize:s.castOption(M.size,e.pts),fontColor:s.castOption(M.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),x=!0}t.emit("plotly_hover",{points:[c(e,l)],event:r.event}),b=!0}}).on("mouseout",function(n){var o=t._fullLayout,i=t._fullData[h.index];b&&(n.originalEvent=r.event,t.emit("plotly_unhover",{points:[c(e,i)],event:r.event}),b=!1),x&&(a.loneUnhover(o._hoverlayer.node()),x=!1)}).on("mousedown",function(){var n=t._fullLayout,o=t._fullData[h.index];t._dragging||!1===n.hovermode||(t._hoverdata=[c(e,o)],e.curveNumber=p.trace.index,a.click(t,r.event||{target:!0}))}),h.pull){var _=+s.castOption(h.pull,e.pts)||0;_>0&&(o+=_*e.pxmid[0],d+=_*e.pxmid[1])}e.cxFinal=o,e.cyFinal=d;var w=h.hole;if(e.v===p.vTotal){var k="M"+(o+e.px0[0])+","+(d+e.px0[1])+C(e.px0,e.pxmid,!0,1)+C(e.pxmid,e.px0,!0,1)+"Z";w?m.attr("d","M"+(o+w*e.px0[0])+","+(d+w*e.px0[1])+C(e.px0,e.pxmid,!1,w)+C(e.pxmid,e.px0,!1,w)+"Z"+k):m.attr("d",k)}else{var M=C(e.px0,e.px1,!0,1);if(w){var T=1-w;m.attr("d","M"+(o+w*e.px1[0])+","+(d+w*e.px1[1])+C(e.px1,e.px0,!1,w)+"l"+T*e.px0[0]+","+T*e.px0[1]+M+"Z")}else m.attr("d","M"+o+","+d+"l"+e.px0[0]+","+e.px0[1]+M+"Z")}var A=s.castOption(h.textposition,e.pts),L=y.selectAll("g.slicetext").data(e.text&&"none"!==A?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each(function(){var n=r.select(this).selectAll("text").data([0]);n.enter().append("text").attr("data-notex",1),n.exit().remove(),n.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,"outside"===A?h.outsidetextfont:h.insidetextfont).call(l.convertToTspans,t);var a,s=i.bBox(n.node());"outside"===A?a=f(s,e):(a=function(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/n.vTotal,.5),i=1-n.trace.hole,l=u(e,n),s={scale:l*n.r*2/r,rCenter:1-l,rotate:0};if(s.scale>=1)return s;var c=a+1/(2*Math.tan(o)),f=n.r*Math.min(1/(Math.sqrt(c*c+.5)+c),i/(Math.sqrt(a*a+i/2)+a)),d={scale:2*f/t.height,rCenter:Math.cos(f/n.r)-f*a/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/a,h=p+1/(2*Math.tan(o)),g=n.r*Math.min(1/(Math.sqrt(h*h+.5)+h),i/(Math.sqrt(p*p+i/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/n.r)-g/a/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return s.scale<1&&y.scale>s.scale?y:s}(s,e,p),"auto"===A&&a.scale<1&&(n.call(i.font,h.outsidetextfont),h.outsidetextfont.family===h.insidetextfont.family&&h.outsidetextfont.size===h.insidetextfont.size||(s=i.bBox(n.node())),a=f(s,e)));var c=o+e.pxmid[0]*a.rCenter+(a.x||0),g=d+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=g-s.height/2,e.yLabelMid=g,e.yLabelMax=g+s.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),n.attr("transform","translate("+c+","+g+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}function C(t,n,r,a){return"a"+a*p.r+","+a*p.r+" 0 "+e.largeArc+(r?" 1 ":" 0 ")+a*(n[0]-t[0])+","+a*(n[1]-t[1])}}),v&&function(t,e){var n,r,a,o,i,l,c,u,f,d,p,h,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function m(t,n){n||(n={});var a,u,f,p,h,g,v=n.labelExtraY+(r?n.yLabelMax:n.yLabelMin),y=r?t.yLabelMin:t.yLabelMax,m=r?t.yLabelMax:t.yLabelMin,x=t.cyFinal+i(t.px0[1],t.px1[1]),b=v-y;if(b*c>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(u=0;u=(s.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*c>0?(p=f.cyFinal+i(f.px0[1],f.px1[1]),(b=p-y-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-x)*c>0&&(a=3*l*Math.abs(u-d.indexOf(t)),h=f.cxFinal+o(f.px0[0],f.px1[0]),(g=h+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=g)))}for(r=0;r<2;r++)for(a=r?v:y,i=r?Math.max:Math.min,c=r?1:-1,n=0;n<2;n++){for(o=n?Math.max:Math.min,l=n?1:-1,(u=t[r][n]).sort(a),f=t[1-r][n],d=f.concat(u),h=[],p=0;pMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(a+t.labelExtraX+l):i+="l"+t.labelExtraX+","+s+"v"+(c-s)+"h"+l}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+l;e.append("path").classed("textline",!0).call(o.stroke,h.outsidetextfont.color).attr({"stroke-width":Math.min(2,h.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){d.selectAll("tspan").each(function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":50,"../../components/drawing":75,"../../components/fx":92,"../../lib/svg_text_utils":190,"./event_data":321,"./helpers":322,d3:13}],327:[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].trace,n=r.select(this);n.style({opacity:e.opacity}),n.selectAll("path.surface").each(function(t){r.select(this).call(a,t,e)})})}},{"./style_one":328,d3:13}],328:[function(t,e,n){"use strict";var r=t("../../components/color");t("./helpers").castOption;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}).call(r.fill,e.color).call(r.stroke,a)}},{"../../components/color":50,"./helpers":322}],329:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e){for(var n=0;ne&&s.splice(e,s.length-e),s.map(n)}return n(r.size)}}e.exports={calc:function(t,e){var n=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=n.makeCalcdata(e,"x"),p=f.makeCalcdata(e,"y"),h=Math.min(d.length,p.length);n._minDtick=0,f._minDtick=0,d.length>h&&d.splice(h,d.length-h),p.length>h&&p.splice(h,p.length-h);var g={padded:!0},v={padded:!0},y=u(e,h);y&&(g.ppad=v.ppad=y),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[h-1]&&p[0]===p[h-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[h-1]&&p[0]===p[h-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,a.expand(n,d,g),a.expand(f,p,v);for(var m=new Array(h),x=0;x=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}}}}},{}],334:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,s=n.marker,c="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==s&&s.showscale){var u=s.color,f=s.cmin,d=s.cmax;r(f)||(f=a.aggNums(Math.min,null,u)),r(d)||(d=a.aggNums(Math.max,null,u));var p=e[0].t.cb=l(t,c),h=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}else o.autoMargin(t,c)}},{"../../components/colorbar/draw":54,"../../components/colorscale":65,"../../lib":169,"../../plots/plots":254,"fast-isnumeric":16}],335:[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":57,"../../components/colorscale/has_colorscale":64,"./subtypes":352}],336:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],337:[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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,n,h){function g(n,o){return r.coerce(t,e,a,n,o)}var v=l(t,e,h,g),y=v_[w].x0&&e<_[w].x1&&n>_[w].y0&&n<_[w].y1&&(t.index=w,t.text=t.trace.text[w],b=!0);if(!b)return}if(-1!==m.indexOf("points")){var k=a.getDistanceFunction(u,function(t){var e=Math.max(3,t.mrc||0),n=1-1/e,r=Math.abs(p.c2p(t.x)-g);return rV!=(N=P[C][1])>=V&&(z=P[C-1][0],D=P[C][0],N-E&&(O=z+(D-z)*(V-E)/(N-E),j=Math.min(j,O),B=Math.max(B,O)));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),r.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":50,"../../components/errorbars":81,"../../components/fx":92,"../../lib":169,"./fill_hover_text":338,"./get_trace_color":340}],342:[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").calc,r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style").style,r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":224,"./arrays_to_calcdata":329,"./attributes":330,"./calc":331,"./clean_data":333,"./colorbar":334,"./defaults":337,"./hover":341,"./plot":349,"./select":350,"./style":351,"./subtypes":352}],343:[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,l){var s=(t.marker||{}).color;(i("line.color",n),r(t,"line"))?a(t,e,o,i,{prefix:"line.",cLetter:"c"}):i("line.color",!Array.isArray(s)&&s||n);i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64}],344:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,a=t("../../lib"),o=a.segmentsIntersect,i=a.constrain,l=t("./constants");e.exports=function(t,e){var n,s,c,u,f,d,p,h,g,v,y,m,x,b,_,w,k=e.xaxis,M=e.yaxis,T=e.simplify,A=e.connectGaps,L=e.baseTolerance,C=e.shape,S="linear"===C,P=[],O=l.minTolerance,z=new Array(t.length),D=0;function E(e){var n=t[e],a=k.c2p(n.x),o=M.c2p(n.y);return a===r||o===r?n.intoCenter||!1:[a,o]}function N(t){var e=t[0]/k._length,n=t[1]/M._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*L}function R(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}T||(L=O=-1);var I,F,j,B,q,H,V,U=l.maxScreensAway,G=-k._length*U,Y=k._length*(1+U),X=-M._length*U,Z=M._length*(1+U),W=[[G,X,Y,X],[Y,X,Y,Z],[Y,Z,G,Z],[G,Z,G,X]];function J(t){if(t[0]Y||t[1]Z)return[i(t[0],G,Y),i(t[1],X,Z)]}function Q(t,e){return t[0]===e[0]&&(t[0]===G||t[0]===Y)||(t[1]===e[1]&&(t[1]===X||t[1]===Z)||void 0)}function $(t,e,n){return function(r,o){var i=J(r),l=J(o),s=[];if(i&&l&&Q(i,l))return s;i&&s.push(i),l&&s.push(l);var c=2*a.constrain((r[t]+o[t])/2,e,n)-((i||r)[t]+(l||o)[t]);c&&((i&&l?c>0==i[t]>l[t]?i:l:i||l)[t]+=c);return s}}function K(t){var e=t[0],n=t[1],r=e===z[D-1][0],a=n===z[D-1][1];if(!r||!a)if(D>1){var o=e===z[D-2][0],i=n===z[D-2][1];r&&(e===G||e===Y)&&o?i?D--:z[D-1]=t:a&&(n===X||n===Z)&&i?o?D--:z[D-1]=t:z[D++]=t}else z[D++]=t}function tt(t){z[D-1][0]!==t[0]&&z[D-1][1]!==t[1]&&K([j,B]),K(t),q=null,j=B=0}function et(t){if(I=t[0]Y?Y:0,F=t[1]Z?Z:0,I||F){if(D)if(q){var e=V(q,t);e.length>1&&(tt(e[0]),z[D++]=e[1])}else H=V(z[D-1],t)[0],z[D++]=H;else z[D++]=[I||t[0],F||t[1]];var n=z[D-1];I&&F&&(n[0]!==I||n[1]!==F)?(q&&(j!==I&&B!==F?K(j&&B?(r=q,o=(a=t)[0]-r[0],i=(a[1]-r[1])/o,(r[1]*a[0]-a[1]*r[0])/o>0?[i>0?G:Y,Z]:[i>0?Y:G,X]):[j||I,B||F]):j&&B&&K([j,B])),K([I,F])):j-I&&B-F&&K([I||j,F||B]),q=t,j=I,B=F}else q&&tt(V(q,t)[0]),z[D++]=t;var r,a,o,i}for("linear"===C||"spline"===C?V=function(t,e){for(var n=[],r=0,a=0;a<4;a++){var i=W[a],l=o(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);l&&(!r||Math.abs(l.x-n[0][0])>1||Math.abs(l.y-n[0][1])>1)&&(l=[l.x,l.y],r&&R(l,t)N(d))break;c=d,(x=g[0]*h[0]+g[1]*h[1])>y?(y=x,u=d,p=!1):x=t.length||!d)break;et(d),s=d}}else et(u)}q&&K([j||q[0],B||q[1]]),P.push(z.slice(0,D))}return P}},{"../../constants/numerical":150,"../../lib":169,"./constants":336}],345:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],346:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r,a,o=null;for(a=0;a0?Math.max(e,a):0}}},{"fast-isnumeric":16}],348:[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,c){var u=i.isBubble(t),f=(t.line||{}).color;(c=c||{},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.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?r.background:r.defaultLine),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")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64,"./subtypes":352}],349:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),i=t("../../components/errorbars"),l=t("./subtypes"),s=t("./line_points"),c=t("./link_traces"),u=t("../../lib/polygon").tester;function f(t,e,n,c,f,d,p){var h,g;!function(t,e,n,o,i){var s=n.xaxis,c=n.yaxis,u=r.extent(a.simpleMap(s.range,s.r2c)),f=r.extent(a.simpleMap(c.range,c.r2c)),d=o[0].trace;if(!l.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=o.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;i.forEach(function(t,n){var r=t[0].trace;l.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;function y(t){return v?t.transition():t}var m=n.xaxis,x=n.yaxis,b=c[0].trace,_=b.line,w=r.select(d);if(w.call(i.plot,n,p),!0===b.visible){var k,M;y(w).style("opacity",b.opacity);var T=b.fill.charAt(b.fill.length-1);"x"!==T&&"y"!==T&&(T=""),c[0].node3=w;var A="",L=[],C=b._prevtrace;C&&(A=C._prevRevpath||"",M=C._nextFill,L=C._polygons);var S,P,O,z,D,E,N,R,I,F="",j="",B=[],q=a.noop;if(k=b._ownFill,l.hasLines(b)||"none"!==b.fill){for(M&&M.datum(c),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(O=o.steps(_.shape),z=o.steps(_.shape.split("").reverse().join(""))):O=z="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),_.smoothing):o.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},D=function(t){return z(t.reverse())},B=s(c,{xaxis:m,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),I=b._polygons=new Array(B.length),g=0;g1){var n=r.select(this);if(n.datum(c),t)y(n.style("opacity",0).attr("d",S).call(o.lineGroupStyle)).style("opacity",1);else{var a=y(n);a.attr("d",S),o.singleLineStyle(c,a)}}}}}var H=w.selectAll(".js-line").data(B);y(H.exit()).style("opacity",0).remove(),H.each(q(!1)),H.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(q(!0)),o.setClipUrl(H,n.layerClipId),B.length?(k?E&&R&&(T?("y"===T?E[1]=R[1]=x.c2p(0,!0):"x"===T&&(E[0]=R[0]=m.c2p(0,!0)),y(k).attr("d","M"+R+"L"+E+"L"+F.substr(1)).call(o.singleFillStyle)):y(k).attr("d",F+"Z").call(o.singleFillStyle)):M&&("tonext"===b.fill.substr(0,6)&&F&&A?("tonext"===b.fill?y(M).attr("d",F+"Z"+A+"Z").call(o.singleFillStyle):y(M).attr("d",F+"L"+A.substr(1)+"Z").call(o.singleFillStyle),b._polygons=b._polygons.concat(L)):(U(M),b._polygons=null)),b._prevRevpath=j,b._prevPolygons=I):(k?U(k):M&&U(M),b._polygons=b._prevRevpath=b._prevPolygons=null);var V=w.selectAll(".points");h=V.data([c]),V.each(W),h.enter().append("g").classed("points",!0).each(W),h.exit().remove(),h.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(r.select(this),e?null:n.layerClipId)})}function U(t){y(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function Y(t){return t.id}function X(t){if(t.ids)return Y}function Z(){return!1}function W(e){var i,s=e[0].trace,c=r.select(this),u=l.hasMarkers(s),f=l.hasText(s),d=X(s),p=Z,h=Z;u&&(p=s.marker.maxdisplayed||s._needsCull?G:a.identity),f&&(h=s.marker.maxdisplayed||s._needsCull?G:a.identity);var g=(i=c.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);v&&g.call(o.pointStyle,s,t).call(o.translatePoints,m,x).style("opacity",0).transition().style("opacity",1);var b=u&&o.tryColorscale(s.marker,""),_=u&&o.tryColorscale(s.marker,"line");i.order(),i.each(function(e){var a=r.select(this),i=y(a);o.translatePoint(e,i,m,x)?(o.singlePointStyle(e,i,s,b,_,t),n.layerClipId&&o.hideOutsideRangePoint(e,i,m,x,s.xcalendar,s.ycalendar),s.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),v?i.exit().transition().style("opacity",0).remove():i.exit().remove(),(i=c.selectAll("g").data(h,d)).enter().append("g").classed("textpoint",!0).append("text"),i.order(),i.each(function(t){var e=r.select(this),a=y(e.select("text"));o.translatePoint(t,a,m,x)?n.layerClipId&&o.hideOutsideRangePoint(t,e,m,x,s.xcalendar,s.ycalendar):e.remove()}),i.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=m.c2p(t.x),n=x.c2p(t.y);r.select(this).selectAll("tspan.line").each(function(){y(r.select(this)).attr({x:e,y:n})})}),i.exit().remove()}}e.exports=function(t,e,n,a,i){var l,s,u,d,p=e.plot.select("g.scatterlayer"),h=!a,g=!!a&&a.duration>0;for((u=p.selectAll("g.trace").data(n,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c(t,e,n),function(t,e,n){var a;e.selectAll("g.trace").each(function(t){var e=r.select(this);if((a=t[0].trace)._nexttrace){if(a._nextFill=e.select(".js-fill.js-tonext"),!a._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),a._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),a._nextFill=null;a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace)?(a._ownFill=e.select(".js-fill.js-tozero"),a._ownFill.size()||(a._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),a._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,n.layerClipId)})}(0,p,e),l=0,s={};ls[e[0].trace.uid]?1:-1}),g)?(i&&(d=i()),r.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(r,o){f(t,o,e,r,n,this,a)})})):p.selectAll("g.trace").each(function(r,o){f(t,o,e,r,n,this,a)});h&&u.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":75,"../../components/errorbars":81,"../../lib":169,"../../lib/polygon":181,"./line_points":344,"./link_traces":346,"./subtypes":352,d3:13}],350:[function(t,e,n){"use strict";var r=t("./subtypes");e.exports=function(t,e){var n,a,o,i,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!r.hasMarkers(f)&&!r.hasText(f))return[];if(!1===e)for(n=0;n")}(u,v,p.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":92,"../../constants/numerical":150,"../../plots/cartesian/axes":213,"../scatter/fill_hover_text":338,"../scatter/get_trace_color":340,"./attributes":355}],360:[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.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattergeo",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/geo":244,"../scatter/colorbar":334,"./attributes":355,"./calc":356,"./defaults":357,"./event_data":358,"./hover":359,"./plot":361,"./select":362,"./style":363}],361:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../constants/numerical").BADNUM,i=t("../../lib/topojson_utils").getTopojsonFeatures,l=t("../../lib/geo_location_utils").locationToFeature,s=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");function f(t,e){var n=t[0].trace;if(Array.isArray(n.locations))for(var r=i(n,e),a=n.locationmode,s=0;se?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function h(t){return!isNaN(t)}function g(t){return{left:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)<0?r=o+1:a=o}return r},right:function(e,n,r,a){for(arguments.length<3&&(r=0),arguments.length<4&&(a=e.length);r>>1;t(e[o],n)>0?a=o:r=o+1}return r}}}t.ascending=d,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++ar&&(n=r)}else{for(;++a=r){n=r;break}for(;++ar&&(n=r)}return n},t.max=function(t,e){var n,r,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){n=r;break}for(;++an&&(n=r)}else{for(;++a=r){n=r;break}for(;++an&&(n=r)}return n},t.extent=function(t,e){var n,r,a,o=-1,i=t.length;if(1===arguments.length){for(;++o=r){n=a=r;break}for(;++or&&(n=r),a=r){n=a=r;break}for(;++or&&(n=r),a1)return i/(s-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function y(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,n){return d(t(e),n)}:t)},t.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,o<2&&(e=0));for(var r,a,o=n-e;o;)a=Math.random()*o--|0,r=t[o+e],t[o+e]=t[a+e],t[a+e]=r;return t},t.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},t.pairs=function(t){for(var e=0,n=t.length-1,r=t[0],a=new Array(n<0?0:n);e=0;)for(e=(r=t[a]).length;--e>=0;)n[--i]=r[e];return n};var m=Math.abs;function x(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var r,a=[],o=function(t){var e=1;for(;t*e%1;)e*=10;return e}(m(n)),i=-1;if(t*=o,e*=o,(n*=o)<0)for(;(r=t+n*++i)>e;)a.push(r/o);else for(;(r=t+n*++i)=a.length)return n?n.call(r,o):e?o.sort(e):o;for(var s,c,u,f,d=-1,p=o.length,h=a[l++],g=new b;++d=a.length)return e;var r=[],i=o[n++];return e.forEach(function(e,a){r.push({key:e,values:t(a,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}(i(t.map,e,0),0)},r.key=function(t){return a.push(t),r},r.sortKeys=function(t){return o[a.length-1]=t,r},r.sortValues=function(t){return e=t,r},r.rollup=function(t){return n=t,r},r},t.set=function(t){var e=new P;if(t)for(var n=0,r=t.length;n=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},t.event=null,t.requote=function(t){return t.replace(q,"\\$&")};var q=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};function V(t){return H(t,X),t}var U=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var n=t.matches||t[D(t,"matchesSelector")];return(Y=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(U=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,n,r,a,o=[];t=Z(t);for(var i=-1,l=this.length;++i=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(n)?{space:Q[n],local:t}:t}},X.attr=function(e,n){if(arguments.length<2){if("string"==typeof e){var r=this.node();return(e=t.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(n in e)this.each($(n,e[n]));return this}return this.each($(e,n))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=et(t)).length,a=-1;if(e=n.classList){for(;++a=0;)(n=r[a])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},X.sort=function(t){t=function(t){arguments.length||(t=d);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}.apply(this,arguments);for(var e=-1,n=this.length;++e0&&(e=e.slice(0,i));var s=ht.get(e);function c(){var t=this[o];t&&(this.removeEventListener(e,t,t.$),delete this[o])}return s&&(e=s,l=vt),i?n?function(){var t=l(n,r(arguments));c.call(this),this.addEventListener(e,this[o]=t,t.$=a),t._=n}:c:n?N:function(){var n,r=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(n=a.match(r)){var o=this[a];this.removeEventListener(n[1],o,o.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,n,r,a,o,i=[],l=-1,s=this.length;++l=r&&(r=e+1);!(i=l[r])&&++r0?1:t<0?-1:0}function zt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function Dt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function Et(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Nt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var n,r,a=t[0],o=t[1],i=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-o,d=u*u+f*f;if(d0&&(e=e.transition().duration(g)),e.call(w.event)}function L(){c&&c.domain(s.range().map(function(t){return(t-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function C(t){v++||t({type:"zoomstart"})}function S(t){L(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(t){--v||(t({type:"zoomend"}),n=null)}function O(){var e=this,n=_.of(e,arguments),r=0,a=t.select(i(e)).on(m,function(){r=1,T(t.mouse(e),o),S(n)}).on(x,function(){a.on(m,null).on(x,null),l(r),P(n)}),o=k(t.mouse(e)),l=xt(e);pl.call(e),C(n)}function z(){var e,n=this,r=_.of(n,arguments),a={},o=0,i=".zoom-"+t.event.changedTouches[0].identifier,s="touchmove"+i,c="touchend"+i,u=[],f=t.select(n),p=xt(n);function h(){var r=t.touches(n);return e=d.k,r.forEach(function(t){t.identifier in a&&(a[t.identifier]=k(t))}),r}function g(){var e=t.event.target;t.select(e).on(s,v).on(c,m),u.push(e);for(var r=t.event.changedTouches,i=0,f=r.length;i1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];o=b*b+_*_}}function v(){var i,s,c,u,f=t.touches(n);pl.call(n);for(var d=0,p=f.length;d360?t-=360:t<0&&(t+=360),t<60?r+(a-r)*t/60:t<180?a:t<240?r+(a-r)*(240-t)/60:r}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=2*(n=n<0?0:n>1?1:n)-(a=n<=.5?n*(1+e):n+e-n*e),new oe(o(t+120),o(t),o(t-120))}function Gt(e,n,r){return this instanceof Gt?(this.h=+e,this.c=+n,void(this.l=+r)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Zt?e.l:(e=de((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,n,r)}Vt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,this.l/t)},Vt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,t*this.l)},Vt.rgb=function(){return Ut(this.h,this.s,this.l)},t.hcl=Gt;var Yt=Gt.prototype=new qt;function Xt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(n,Math.cos(t*=St)*e,Math.sin(t)*e)}function Zt(t,e,n){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Gt?Xt(t.h,t.c,t.l):de((t=oe(t)).r,t.g,t.b):new Zt(t,e,n)}Yt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?t:1)))},Yt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?t:1)))},Yt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Zt;var Wt=18,Jt=.95047,Qt=1,$t=1.08883,Kt=Zt.prototype=new qt;function te(t,e,n){var r=(t+16)/116,a=r+e/500,o=r-n/200;return new oe(ae(3.2404542*(a=ne(a)*Jt)-1.5371385*(r=ne(r)*Qt)-.4985314*(o=ne(o)*$t)),ae(-.969266*a+1.8760108*r+.041556*o),ae(.0556434*a-.2040259*r+1.0572252*o))}function ee(t,e,n){return t>0?new Gt(Math.atan2(n,e)*Pt,Math.sqrt(e*e+n*n),t):new Gt(NaN,NaN,t)}function ne(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function re(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ae(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function oe(t,e,n){return this instanceof oe?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof oe?new oe(t.r,t.g,t.b):ue(""+t,oe,Ut):new oe(t,e,n)}function ie(t){return new oe(t>>16,t>>8&255,255&t)}function le(t){return ie(t)+""}Kt.brighter=function(t){return new Zt(Math.min(100,this.l+Wt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Zt(Math.max(0,this.l-Wt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=oe;var se=oe.prototype=new qt;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,n){var r,a,o,i=0,l=0,s=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=r[2].split(","),r[1]){case"hsl":return n(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(o=ge.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function fe(t,e,n){var r,a,o=Math.min(t/=255,e/=255,n/=255),i=Math.max(t,e,n),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),r=t==i?(e-n)/l+(e0&&s<1?0:r),new Ht(r,a,s)}function de(t,e,n){var r=re((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(n=pe(n)))/Jt),a=re((.2126729*t+.7151522*e+.072175*n)/Qt);return Zt(116*a-16,500*(r-a),200*(a-re((.0193339*t+.119192*e+.9503041*n)/$t)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,a=30;return e||n||r?(e&&e=200&&e<300||304===e){try{t=a.call(i,c)}catch(t){return void l.error.call(i,t)}l.load.call(i,t)}else l.error.call(i,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(e){var n=t.event;t.event=e;try{l.progress.call(i,c)}finally{t.event=n}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",i):n},i.responseType=function(t){return arguments.length?(u=t,i):u},i.response=function(t){return a=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(r(arguments)))}}),i.send=function(t,r,a){if(2===arguments.length&&"function"==typeof r&&(a=r,r=null),c.open(t,e,!0),null==n||"accept"in s||(s.accept=n+",*/*"),c.setRequestHeader)for(var o in s)c.setRequestHeader(o,s[o]);return null!=n&&c.overrideMimeType&&c.overrideMimeType(n),null!=u&&(c.responseType=u),null!=a&&i.on("error",a).on("load",function(t){a(null,t)}),l.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},t.rebind(i,l,"on"),null==o?i:i.get(function(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}(o))}ge.forEach(function(t,e){ge.set(t,ie(e))}),t.functor=ve,t.xhr=ye(O),t.dsv=function(t,e){var n=new RegExp('["'+t+"\n]"),r=t.charCodeAt(0);function a(t,n,r){arguments.length<3&&(r=n,n=null);var a=me(t,e,null==n?o:i(n),r);return a.row=function(t){return arguments.length?a.response(null==(n=t)?o:i(t)):n},a}function o(t){return a.parse(t.responseText)}function i(t){return function(e){return a.parse(e.responseText,t)}}function l(e){return e.map(s).join(t)}function s(t){return n.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var n;return a.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,n){return e(a(t),n)}:a})},a.parseRows=function(t,e){var n,a,o={},i={},l=[],s=t.length,c=0,u=0;function f(){if(c>=s)return i;if(a)return a=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,ke(Te))}function Ae(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=xe,n=1/0;e;)e.c?(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}});function Pe(e){var n=e.decimal,r=e.thousands,a=e.grouping,o=e.currency,i=a&&r?function(t,e){for(var n=t.length,o=[],i=0,l=a[0],s=0;n>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(n-=l,n+l)),!((s+=l+1)>e));)l=a[i=(i+1)%a.length];return o.reverse().join(r)}:O;return function(e){var r=Oe.exec(e),a=r[1]||" ",l=r[2]||">",s=r[3]||"-",c=r[4]||"",u=r[5],f=+r[6],d=r[7],p=r[8],h=r[9],g=1,v="",y="",m=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,y="%",h="f";break;case"p":g=100,y="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":m=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=o[0],y=o[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=ze.get(h)||De;var b=u&&d;return function(e){var r=y;if(m&&e%1)return"";var o=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===s?"":s;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),r=c.symbol+y}else e*=g;var _,w,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var M=x?e.lastIndexOf("e"):-1;M<0?(_=e,w=""):(_=e.substring(0,M),w=e.substring(M))}else _=e.substring(0,k),w=n+e.substring(k+1);!u&&d&&(_=i(_,1/0));var T=v.length+_.length+w.length+(b?0:o.length),A=T"===l?A+o+e:"^"===l?A.substring(0,T>>=1)+o+e+A.substring(T):o+(b?e:A+e))+r}}}t.formatPrefix=function(e,n){var r=0;return(e=+e)&&(e<0&&(e*=-1),n&&(e=t.round(e,Ce(e,n))),r=1+Math.floor(1e-12+Math.log(e)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Se[8+r/3]};var Oe=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ze=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,n){return(e=t.round(e,Ce(e,n))).toFixed(Math.max(0,Math.min(20,Ce(e*(1+1e-15),n))))}});function De(t){return t+""}var Ee=t.time={},Ne=Date;function Re(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Re.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ie.setUTCDate.apply(this._,arguments)},setDay:function(){Ie.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ie.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ie.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ie.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ie.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ie.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ie.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ie.setTime.apply(this._,arguments)}};var Ie=Date.prototype;function Fe(t,e,n){function r(e){var n=t(e),r=o(n,1);return e-n1)for(;i=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=w[i in qe?e.charAt(l++):i])||(r=o(t,n,r))<0)return-1}else if(a!=n.charCodeAt(r++))return-1}return r}u.utc=function(t){var e=u(t);function n(t){try{var n=new(Ne=Re);return n._=t,e(n)}finally{Ne=Date}}return n.parse=function(t){try{Ne=Re;var n=e.parse(t);return n&&n._}finally{Ne=Date}},n.toString=e.toString,n},u.multi=u.utc.multi=cn;var d=t.map(),p=Ge(i),h=Ye(i),g=Ge(l),v=Ye(l),y=Ge(s),m=Ye(s),x=Ge(c),b=Ye(c);o.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return l[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:u(n),d:function(t,e){return Ue(t.getDate(),e,2)},e:function(t,e){return Ue(t.getDate(),e,2)},H:function(t,e){return Ue(t.getHours(),e,2)},I:function(t,e){return Ue(t.getHours()%12||12,e,2)},j:function(t,e){return Ue(1+Ee.dayOfYear(t),e,3)},L:function(t,e){return Ue(t.getMilliseconds(),e,3)},m:function(t,e){return Ue(t.getMonth()+1,e,2)},M:function(t,e){return Ue(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Ue(t.getSeconds(),e,2)},U:function(t,e){return Ue(Ee.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ue(Ee.mondayOfYear(t),e,2)},x:u(r),X:u(a),y:function(t,e){return Ue(t.getFullYear()%100,e,2)},Y:function(t,e){return Ue(t.getFullYear()%1e4,e,4)},Z:ln,"%":function(){return"%"}},w={a:function(t,e,n){g.lastIndex=0;var r=g.exec(e.slice(n));return r?(t.w=v.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){p.lastIndex=0;var r=p.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){y.lastIndex=0;var r=y.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,e,n){return f(t,_.c.toString(),e,n)},d:tn,e:tn,H:nn,I:nn,j:en,L:on,m:Ke,M:rn,p:function(t,e,n){var r=d.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)},S:an,U:Ze,w:Xe,W:We,x:function(t,e,n){return f(t,_.x.toString(),e,n)},X:function(t,e,n){return f(t,_.X.toString(),e,n)},y:Qe,Y:Je,Z:$e,"%":sn};return u}Ee.year=Fe(function(t){return(t=Ee.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ee.years=Ee.year.range,Ee.years.utc=Ee.year.utc.range,Ee.day=Fe(function(t){var e=new Ne(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ee.days=Ee.day.range,Ee.days.utc=Ee.day.utc.range,Ee.dayOfYear=function(t){var e=Ee.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=Ee[t]=Fe(function(t){return(t=Ee.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Ee.year(t).getDay();return Math.floor((Ee.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Ee[t+"s"]=n.range,Ee[t+"s"].utc=n.utc.range,Ee[t+"OfYear"]=function(t){var n=Ee.year(t).getDay();return Math.floor((Ee.dayOfYear(t)+(n+e)%7)/7)}}),Ee.week=Ee.sunday,Ee.weeks=Ee.sunday.range,Ee.weeks.utc=Ee.sunday.utc.range,Ee.weekOfYear=Ee.sundayOfYear;var qe={"-":"",_:" ",0:"0"},He=/^\s*\d+/,Ve=/^%/;function Ue(t,e,n){var r=t<0?"-":"",a=(r?-t:t)+"",o=a.length;return r+(o68?1900:2e3),n+a[0].length):-1}function $e(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Ke(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function an(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function on(t,e,n){He.lastIndex=0;var r=He.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ln(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=m(e)/60|0,a=m(e)%60;return n+Ue(r,"0",2)+Ue(a,"0",2)}function sn(t,e,n){Ve.lastIndex=0;var r=Ve.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n=0?1:-1,l=i*o,s=Math.cos(e),c=Math.sin(e),u=a*c,f=r*s+u*Math.cos(l),d=u*i*Math.sin(l);On.add(Math.atan2(d,f)),n=t,r=s,a=c}zn.point=function(i,l){zn.point=o,n=(t=i)*St,r=Math.cos(l=(e=l)*St/2+Tt/4),a=Math.sin(l)},zn.lineEnd=function(){o(t,e)}}function En(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function Nn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Rn(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 In(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function jn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Bn(t){return[Math.atan2(t[1],t[0]),Et(t[2])]}function qn(t,e){return m(t[0]-e[0])kt?a=90:c<-kt&&(n=-90),f[0]=e,f[1]=r}};function p(t,o){u.push(f=[e=t,r=t]),oa&&(a=o)}function h(t,i){var l=En([t*St,i*St]);if(s){var c=Rn(s,l),u=Rn([c[1],-c[0],0],c);jn(u),u=Bn(u);var f=t-o,d=f>0?1:-1,h=u[0]*Pt*d,g=m(f)>180;if(g^(d*oa&&(a=v);else if(g^(d*o<(h=(h+360)%360-180)&&ha&&(a=i);g?t_(e,r)&&(r=t):_(t,r)>_(e,r)&&(e=t):r>=e?(tr&&(r=t)):t>o?_(e,t)>_(e,r)&&(r=t):_(t,r)>_(e,r)&&(e=t)}else p(t,i);s=l,o=t}function g(){d.point=h}function v(){f[0]=e,f[1]=r,d.point=p,s=null}function y(t,e){if(s){var n=t-o;c+=m(n)>180?n+(n>0?360:-360):n}else i=t,l=e;zn.point(t,e),h(t,e)}function x(){zn.lineStart()}function b(){y(i,l),zn.lineEnd(),m(c)>kt&&(e=-(r=180)),f[0]=e,f[1]=r,s=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(i=0,l[c=l.length-1]);i<=c;g=p,++i)p=l[i],(s=_(g[1],p[0]))>h&&(h=s,e=p[0],r=g[1])}return u=f=null,e===1/0||n===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,n],[r,a]]}}(),t.geo.centroid=function(e){bn=_n=wn=kn=Mn=Tn=An=Ln=Cn=Sn=Pn=0,t.geo.stream(e,Hn);var n=Cn,r=Sn,a=Pn,o=n*n+r*r+a*a;return o=0;--l)a.point((f=u[l])[0],f[1]);else r(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function Qn(t){if(e=t.length){for(var e,n,r=0,a=t[0];++r=0?1:-1,k=w*_,M=k>Tt,T=h*x;if(On.add(Math.atan2(T*w*Math.sin(k),g*b+T*Math.cos(k))),o+=M?_+w*At:_,M^d>=n^y>=n){var A=Rn(En(f),En(t));jn(A);var L=Rn(a,A);jn(L);var C=(M^_>=0?-1:1)*Et(L[2]);(r>C||r===C&&(A[0]||A[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=y,h=x,g=b,f=t}}return(o<-kt||o0){for(x||(i.polygonStart(),x=!0),i.lineStart();++o1&&2&e&&n.push(n.pop().concat(n.shift())),l.push(n.filter(tr))}return u}}function tr(t){return t.length>1}function er(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:N,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function nr(t,e){return((t=t.x)[0]<0?t[1]-Ct-kt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-kt:Ct-e[1])}var rr=Kn(Wn,function(t){var e,n=NaN,r=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?Tt:-Tt,s=m(o-n);m(s-Tt)0?Ct:-Ct),t.point(a,r),t.lineEnd(),t.lineStart(),t.point(l,r),t.point(o,r),e=0):a!==l&&s>=Tt&&(m(n-a)kt?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+r)/2}(n,r,o,i),t.point(a,r),t.lineEnd(),t.lineStart(),t.point(l,r),e=0),t.point(n=o,r=i),a=l},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var a;if(null==t)a=n*Ct,r.point(-Tt,a),r.point(0,a),r.point(Tt,a),r.point(Tt,0),r.point(Tt,-a),r.point(0,-a),r.point(-Tt,-a),r.point(-Tt,0),r.point(-Tt,a);else if(m(t[0]-e[0])>kt){var o=t[0]0)){if(o/=d,d<0){if(o0){if(o>f)return;o>u&&(u=o)}if(o=n-s,d||!(o<0)){if(o/=d,d<0){if(o>f)return;o>u&&(u=o)}else if(d>0){if(o0)){if(o/=p,p<0){if(o0){if(o>f)return;o>u&&(u=o)}if(o=r-c,p||!(o<0)){if(o/=p,p<0){if(o>f)return;o>u&&(u=o)}else if(p>0){if(o0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var or=1e9;function ir(e,n,r,a){return function(s){var c,u,f,d,p,h,g,v,y,m,x,b=s,_=er(),w=ar(e,n,r,a),k={point:A,lineStart:function(){k.point=L,u&&u.push(f=[]);m=!0,y=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&y&&_.rejoin(),c.push(_.buffer()));k.point=A,y&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=t.merge(c);var n=function(t){for(var e=0,n=u.length,r=t[1],a=0;ar&&zt(c,o,t)>0&&++e:o[1]<=r&&zt(c,o,t)<0&&--e,c=o;return 0!==e}([e,a]),r=x&&n,o=c.length;(r||o)&&(s.polygonStart(),r&&(s.lineStart(),M(null,null,1,s),s.lineEnd()),o&&Jn(c,i,n,M,s),s.polygonEnd()),c=u=f=null}};function M(t,i,s,c){var u=0,f=0;if(null==t||(u=o(t,s))!==(f=o(i,s))||l(t,i)<0^s>0)do{c.point(0===u||3===u?e:r,u>1?a:n)}while((u=(u+s+4)%4)!==f);else c.point(i[0],i[1])}function T(t,o){return e<=t&&t<=r&&n<=o&&o<=a}function A(t,e){T(t,e)&&s.point(t,e)}function L(t,e){var n=T(t=Math.max(-or,Math.min(or,t)),e=Math.max(-or,Math.min(or,e)));if(u&&f.push([t,e]),m)d=t,p=e,h=n,m=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&y)s.point(t,e);else{var r={a:{x:g,y:v},b:{x:t,y:e}};w(r)?(y||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),x=!1):n&&(s.lineStart(),s.point(t,e),x=!1)}g=t,v=e,y=n}return k};function o(t,a){return m(t[0]-e)0?0:3:m(t[0]-r)0?2:1:m(t[1]-n)0?1:0:a>0?3:2}function i(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}}function lr(t){var e=0,n=Tt/3,r=Or(t),a=r(e,n);return a.parallels=function(t){return arguments.length?r(e=t[0]*Tt/180,n=t[1]*Tt/180):[e/Tt*180,n/Tt*180]},a}function sr(t,e){var n=Math.sin(t),r=(n+Math.sin(e))/2,a=1+n*(2*r-n),o=Math.sqrt(a)/r;function i(t,e){var n=Math.sqrt(a-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),o-n*Math.cos(t)]}return i.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/r,Et((a-(t*t+n*n)*r*r)/(2*r))]},i}t.geo.clipExtent=function(){var t,e,n,r,a,o,i={stream:function(t){return a&&(a.valid=!1),(a=o(t)).valid=!0,a},extent:function(l){return arguments.length?(o=ir(t=+l[0][0],e=+l[0][1],n=+l[1][0],r=+l[1][1]),a&&(a.valid=!1,a=null),i):[[t,e],[n,r]]}};return i.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return lr(sr)}).raw=sr,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,n,r,a,o=t.geo.albers(),i=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};function c(t){var o=t[0],i=t[1];return e=null,n(o,i),e||(r(o,i),e)||a(o,i),e}return c.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,a=(t[1]-n[1])/e;return(a>=.12&&a<.234&&r>=-.425&&r<-.214?i:a>=.166&&a<.234&&r>=-.214&&r<-.115?l:o).invert(t)},c.stream=function(t){var e=o.stream(t),n=i.stream(t),r=l.stream(t);return{point:function(t,a){e.point(t,a),n.point(t,a),r.point(t,a)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},c.precision=function(t){return arguments.length?(o.precision(t),i.precision(t),l.precision(t),c):o.precision()},c.scale=function(t){return arguments.length?(o.scale(t),i.scale(.35*t),l.scale(t),c.translate(o.translate())):o.scale()},c.translate=function(t){if(!arguments.length)return o.translate();var e=o.scale(),u=+t[0],f=+t[1];return n=o.translate(t).clipExtent([[u-.455*e,f-.238*e],[u+.455*e,f+.238*e]]).stream(s).point,r=i.translate([u-.307*e,f+.201*e]).clipExtent([[u-.425*e+kt,f+.12*e+kt],[u-.214*e-kt,f+.234*e-kt]]).stream(s).point,a=l.translate([u-.205*e,f+.212*e]).clipExtent([[u-.214*e+kt,f+.166*e+kt],[u-.115*e-kt,f+.234*e-kt]]).stream(s).point,c},c.scale(1070)};var cr,ur,fr,dr,pr,hr,gr={point:N,lineStart:N,lineEnd:N,polygonStart:function(){ur=0,gr.lineStart=vr},polygonEnd:function(){gr.lineStart=gr.lineEnd=gr.point=N,cr+=m(ur/2)}};function vr(){var t,e,n,r;function a(t,e){ur+=r*t-n*e,n=t,r=e}gr.point=function(o,i){gr.point=a,t=n=o,e=r=i},gr.lineEnd=function(){a(t,e)}}var yr={point:function(t,e){tpr&&(pr=t);ehr&&(hr=e)},lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N};function mr(){var t=xr(4.5),e=[],n={point:r,lineStart:function(){n.point=a},lineEnd:i,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=i,n.point=r},pointRadius:function(e){return t=xr(e),n},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function r(n,r){e.push("M",n,",",r,t)}function a(t,r){e.push("M",t,",",r),n.point=o}function o(t,n){e.push("L",t,",",n)}function i(){n.point=r}function l(){e.push("Z")}return n}function xr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var br,_r={point:wr,lineStart:kr,lineEnd:Mr,polygonStart:function(){_r.lineStart=Tr},polygonEnd:function(){_r.point=wr,_r.lineStart=kr,_r.lineEnd=Mr}};function wr(t,e){wn+=t,kn+=e,++Mn}function kr(){var t,e;function n(n,r){var a=n-t,o=r-e,i=Math.sqrt(a*a+o*o);Tn+=i*(t+n)/2,An+=i*(e+r)/2,Ln+=i,wr(t=n,e=r)}_r.point=function(r,a){_r.point=n,wr(t=r,e=a)}}function Mr(){_r.point=wr}function Tr(){var t,e,n,r;function a(t,e){var a=t-n,o=e-r,i=Math.sqrt(a*a+o*o);Tn+=i*(n+t)/2,An+=i*(r+e)/2,Ln+=i,Cn+=(i=r*t-n*e)*(n+t),Sn+=i*(r+e),Pn+=3*i,wr(n=t,r=e)}_r.point=function(o,i){_r.point=a,wr(t=n=o,e=r=i)},_r.lineEnd=function(){a(t,e)}}function Ar(t){var e=4.5,n={point:r,lineStart:function(){n.point=a},lineEnd:i,polygonStart:function(){n.lineEnd=l},polygonEnd:function(){n.lineEnd=i,n.point=r},pointRadius:function(t){return e=t,n},result:N};function r(n,r){t.moveTo(n+e,r),t.arc(n,r,e,0,At)}function a(e,r){t.moveTo(e,r),n.point=o}function o(e,n){t.lineTo(e,n)}function i(){n.point=r}function l(){t.closePath()}return n}function Lr(t){var e=.5,n=Math.cos(30*St),r=16;function a(e){return(r?function(e){var n,a,i,l,s,c,u,f,d,p,h,g,v={point:y,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){f=NaN,v.point=x,e.lineStart()}function x(n,a){var i=En([n,a]),l=t(n,a);o(f,d,u,p,h,g,f=l[0],d=l[1],u=n,p=i[0],h=i[1],g=i[2],r,e),e.point(f,d)}function b(){v.point=y,e.lineEnd()}function _(){m(),v.point=w,v.lineEnd=k}function w(t,e){x(n=t,e),a=f,i=d,l=p,s=h,c=g,v.point=x}function k(){o(f,d,u,p,h,g,a,i,n,l,s,c,r,e),v.lineEnd=b,b()}return v}:function(e){return Sr(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})})(e)}function o(r,a,i,l,s,c,u,f,d,p,h,g,v,y){var x=u-r,b=f-a,_=x*x+b*b;if(_>4*e&&v--){var w=l+p,k=s+h,M=c+g,T=Math.sqrt(w*w+k*k+M*M),A=Math.asin(M/=T),L=m(m(M)-1)e||m((x*O+b*z)/_-.5)>.3||l*p+s*h+c*g0&&16,a):Math.sqrt(e)},a}function Cr(t){this.stream=t}function Sr(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Pr(t){return Or(function(){return t})()}function Or(e){var n,r,a,o,i,l,s=Lr(function(t,e){return[(t=n(t,e))[0]*c+o,i-t[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,y=rr,x=O,b=null,_=null;function w(t){return[(t=a(t[0]*St,t[1]*St))[0]*c+o,i-t[1]*c]}function k(t){return(t=a.invert((t[0]-o)/c,(i-t[1])/c))&&[t[0]*Pt,t[1]*Pt]}function M(){a=Zn(r=Nr(h,g,v),n);var t=n(d,p);return o=u-t[0]*c,i=f+t[1]*c,T()}function T(){return l&&(l.valid=!1,l=null),w}return w.stream=function(t){return l&&(l.valid=!1),(l=zr(y(r,s(x(t))))).valid=!0,l},w.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,rr):function(t){var e=Math.cos(t),n=e>0,r=m(e)>kt;return Kn(a,function(t){var e,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=n?g?0:i(f,d):g?i(f+(f<0?Tt:-Tt),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(p=o(e,h),(qn(e,p)||qn(h,p))&&(h[0]+=kt,h[1]+=kt,g=a(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=o(h,e),t.point(p[0],p[1])):(p=o(e,h),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(r&&e&&n^g){var y;v&l||!(y=o(h,e,!0))||(u=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&qn(e,h)||t.point(h[0],h[1]),e=h,s=g,l=v},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return u|(c&&s)<<1}}},jr(t,6*St),n?[0,-t]:[-Tt,t-Tt]);function a(t,n){return Math.cos(t)*Math.cos(n)>e}function o(t,n,r){var a=[1,0,0],o=Rn(En(t),En(n)),i=Nn(o,o),l=o[0],s=i-l*l;if(!s)return!r&&t;var c=e*i/s,u=-e*l/s,f=Rn(a,o),d=Fn(a,c);In(d,Fn(o,u));var p=f,h=Nn(d,p),g=Nn(p,p),v=h*h-g*(Nn(d,d)-1);if(!(v<0)){var y=Math.sqrt(v),x=Fn(p,(-h-y)/g);if(In(x,d),x=Bn(x),!r)return x;var b,_=t[0],w=n[0],k=t[1],M=n[1];w<_&&(b=_,_=w,w=b);var T=w-_,A=m(T-Tt)0^x[1]<(m(x[0]-_)Tt^(_<=x[0]&&x[0]<=w)){var L=Fn(p,(-h+y)/g);return In(L,d),[x,Bn(L)]}}}function i(e,r){var a=n?t:Tt-t,o=0;return e<-a?o|=1:e>a&&(o|=2),r<-a?o|=4:r>a&&(o|=8),o}}((b=+t)*St),T()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?ir(t[0][0],t[0][1],t[1][0],t[1][1]):O,T()):_},w.scale=function(t){return arguments.length?(c=+t,M()):c},w.translate=function(t){return arguments.length?(u=+t[0],f=+t[1],M()):[u,f]},w.center=function(t){return arguments.length?(d=t[0]%360*St,p=t[1]%360*St,M()):[d*Pt,p*Pt]},w.rotate=function(t){return arguments.length?(h=t[0]%360*St,g=t[1]%360*St,v=t.length>2?t[2]%360*St:0,M()):[h*Pt,g*Pt,v*Pt]},t.rebind(w,s,"precision"),function(){return n=e.apply(this,arguments),w.invert=n.invert&&k,M()}}function zr(t){return Sr(t,function(e,n){t.point(e*St,n*St)})}function Dr(t,e){return[t,e]}function Er(t,e){return[t>Tt?t-At:t<-Tt?t+At:t,e]}function Nr(t,e,n){return t?e||n?Zn(Ir(t),Fr(e,n)):Ir(t):e||n?Fr(e,n):Er}function Rr(t){return function(e,n){return[(e+=t)>Tt?e-At:e<-Tt?e+At:e,n]}}function Ir(t){var e=Rr(t);return e.invert=Rr(-t),e}function Fr(t,e){var n=Math.cos(t),r=Math.sin(t),a=Math.cos(e),o=Math.sin(e);function i(t,e){var i=Math.cos(e),l=Math.cos(t)*i,s=Math.sin(t)*i,c=Math.sin(e),u=c*n+l*r;return[Math.atan2(s*a-u*o,l*n-c*r),Et(u*a+s*o)]}return i.invert=function(t,e){var i=Math.cos(e),l=Math.cos(t)*i,s=Math.sin(t)*i,c=Math.sin(e),u=c*a-s*o;return[Math.atan2(s*a+c*o,l*n+u*r),Et(u*n-l*r)]},i}function jr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=Br(n,a),o=Br(n,o),(i>0?ao)&&(a+=i*At)):(a=t+i*At,o=t-.5*s);for(var c,u=a;i>0?u>o:u2?t[2]*St:0),e.invert=function(e){return(e=t.invert(e[0]*St,e[1]*St))[0]*=Pt,e[1]*=Pt,e},e},Er.invert=Dr,t.geo.circle=function(){var t,e,n=[0,0],r=6;function a(){var t="function"==typeof n?n.apply(this,arguments):n,r=Nr(-t[0]*St,-t[1]*St,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=r(t,e)),t[0]*=Pt,t[1]*=Pt}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(n=t,a):n},a.angle=function(n){return arguments.length?(e=jr((t=+n)*St,r*St),a):t},a.precision=function(n){return arguments.length?(e=jr(t*St,(r=+n)*St),a):r},a.angle(90)},t.geo.distance=function(t,e){var n,r=(e[0]-t[0])*St,a=t[1]*St,o=e[1]*St,i=Math.sin(r),l=Math.cos(r),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*i)*n+(n=c*u-s*f*l)*n),s*u+c*f*l)},t.geo.graticule=function(){var e,n,r,a,o,i,l,s,c,u,f,d,p=10,h=p,g=90,v=360,y=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(a/g)*g,r,g).map(f).concat(t.range(Math.ceil(s/v)*v,l,v).map(d)).concat(t.range(Math.ceil(n/p)*p,e,p).filter(function(t){return m(t%g)>kt}).map(c)).concat(t.range(Math.ceil(i/h)*h,o,h).filter(function(t){return m(t%v)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(r).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(a=+t[0][0],r=+t[1][0],s=+t[0][1],l=+t[1][1],a>r&&(t=a,a=r,r=t),s>l&&(t=s,s=l,l=t),x.precision(y)):[[a,s],[r,l]]},x.minorExtent=function(t){return arguments.length?(n=+t[0][0],e=+t[1][0],i=+t[0][1],o=+t[1][1],n>e&&(t=n,n=e,e=t),i>o&&(t=i,i=o,o=t),x.precision(y)):[[n,i],[e,o]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],x):[g,v]},x.minorStep=function(t){return arguments.length?(p=+t[0],h=+t[1],x):[p,h]},x.precision=function(t){return arguments.length?(y=+t,c=qr(i,o,90),u=Hr(n,e,y),f=qr(s,l,90),d=Hr(a,r,y),x):y},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,n,r=Vr,a=Ur;function o(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||a.apply(this,arguments)]}}return o.distance=function(){return t.geo.distance(e||r.apply(this,arguments),n||a.apply(this,arguments))},o.source=function(t){return arguments.length?(r=t,e="function"==typeof t?null:t,o):r},o.target=function(t){return arguments.length?(a=t,n="function"==typeof t?null:t,o):a},o.precision=function(){return arguments.length?o:0},o},t.geo.interpolate=function(t,e){return n=t[0]*St,r=t[1]*St,a=e[0]*St,o=e[1]*St,i=Math.cos(r),l=Math.sin(r),s=Math.cos(o),c=Math.sin(o),u=i*Math.cos(n),f=i*Math.sin(n),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(Rt(o-r)+i*s*Rt(a-n))),g=1/Math.sin(h),(v=h?function(t){var e=Math.sin(t*=h)*g,n=Math.sin(h-t)*g,r=n*u+e*d,a=n*f+e*p,o=n*l+e*c;return[Math.atan2(a,r)*Pt,Math.atan2(o,Math.sqrt(r*r+a*a))*Pt]}:function(){return[n*Pt,r*Pt]}).distance=h,v;var n,r,a,o,i,l,s,c,u,f,d,p,h,g,v},t.geo.length=function(e){return br=0,t.geo.stream(e,Gr),br};var Gr={sphere:N,point:N,lineStart:function(){var t,e,n;function r(r,a){var o=Math.sin(a*=St),i=Math.cos(a),l=m((r*=St)-t),s=Math.cos(l);br+=Math.atan2(Math.sqrt((l=i*Math.sin(l))*l+(l=n*o-e*i*s)*l),e*o+n*i*s),t=r,e=o,n=i}Gr.point=function(a,o){t=a*St,e=Math.sin(o*=St),n=Math.cos(o),Gr.point=r},Gr.lineEnd=function(){Gr.point=Gr.lineEnd=N}},lineEnd:N,polygonStart:N,polygonEnd:N};function Yr(t,e){function n(e,n){var r=Math.cos(e),a=Math.cos(n),o=t(r*a);return[o*a*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),a=e(r),o=Math.sin(a),i=Math.cos(a);return[Math.atan2(t*o,r*i),Math.asin(r&&n*o/r)]},n}var Xr=Yr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Pr(Xr)}).raw=Xr;var Zr=Yr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},O);function Wr(t,e){var n=Math.cos(t),r=function(t){return Math.tan(Tt/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(r(e)/r(t)),o=n*Math.pow(r(t),a)/a;if(!a)return $r;function i(t,e){o>0?e<-Ct+kt&&(e=-Ct+kt):e>Ct-kt&&(e=Ct-kt);var n=o/Math.pow(r(e),a);return[n*Math.sin(a*t),o-n*Math.cos(a*t)]}return i.invert=function(t,e){var n=o-e,r=Ot(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(o/r,1/a))-Ct]},i}function Jr(t,e){var n=Math.cos(t),r=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/r+t;if(m(r)1&&zt(t[n[r-2]],t[n[r-1]],t[a])<=0;)--r;n[r++]=a}return n.slice(0,r)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Pr(ea)}).raw=ea,na.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=Kr(na),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90])}).raw=na,t.geom={},t.geom.hull=function(t){var e=ra,n=aa;if(arguments.length)return r(t);function r(t){if(t.length<3)return[];var r,a=ve(e),o=ve(n),i=t.length,l=[],s=[];for(r=0;r=0;--r)p.push(t[l[c[r]][2]]);for(r=+f;rkt)l=l.L;else{if(!((a=o-Ma(l,i))>kt)){r>-kt?(e=l.P,n=l):a>-kt?(e=l,n=l.N):e=n=l;break}if(!l.R){e=l;break}l=l.R}var s=xa(t);if(pa.insert(e,s),e||n){if(e===n)return Sa(e),n=xa(e.site),pa.insert(s,n),s.edge=n.edge=za(e.site,s.site),Ca(e),void Ca(n);if(n){Sa(e),Sa(n);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=n.site,g=h.x-u,v=h.y-f,y=2*(d*v-p*g),m=d*d+p*p,x=g*g+v*v,b={x:(v*m-p*x)/y+u,y:(d*x-g*m)/y+f};Da(n.edge,c,h,b),s.edge=za(c,t,null,b),n.edge=za(t,h,null,b),Ca(e),Ca(n)}else s.edge=za(e.site,s.site)}}function ka(t,e){var n=t.site,r=n.x,a=n.y,o=a-e;if(!o)return r;var i=t.P;if(!i)return-1/0;var l=(n=i.site).x,s=n.y,c=s-e;if(!c)return l;var u=l-r,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+r:(r+l)/2}function Ma(t,e){var n=t.N;if(n)return ka(n,e);var r=t.site;return r.y===e?r.x:1/0}function Ta(t){this.site=t,this.edges=[]}function Aa(t,e){return e.angle-t.angle}function La(){Ra(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ca(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,a=t.site,o=n.site;if(r!==o){var i=a.x,l=a.y,s=r.x-i,c=r.y-l,u=o.x-i,f=2*(s*(v=o.y-l)-c*u);if(!(f>=-Mt)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,y=ya.pop()||new La;y.arc=t,y.site=a,y.x=h+i,y.y=v+Math.sqrt(h*h+g*g),y.cy=v,t.circle=y;for(var m=null,x=ga._;x;)if(y.y=l)return;if(d>h){if(o){if(o.y>=c)return}else o={x:v,y:s};n={x:v,y:c}}else{if(o){if(o.y1)if(d>h){if(o){if(o.y>=c)return}else o={x:(s-a)/r,y:s};n={x:(c-a)/r,y:c}}else{if(o){if(o.y=l)return}else o={x:i,y:r*i+a};n={x:l,y:r*l+a}}else{if(o){if(o.xkt||m(a-n)>kt)&&(l.splice(i,0,new Ea((y=o.site,x=u,b=m(r-f)kt?{x:f,y:m(e-f)kt?{x:m(n-h)kt?{x:d,y:m(e-d)kt?{x:m(n-p)=n&&c.x<=a&&c.y>=r&&c.y<=i?[[n,i],[a,i],[a,r],[n,r]]:[]).point=t[l]}),e}function l(t){return t.map(function(t,e){return{x:Math.round(r(t,e)/kt)*kt,y:Math.round(a(t,e)/kt)*kt,i:e}})}return i.links=function(t){return Ba(l(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},i.triangles=function(t){var e=[];return Ba(l(t)).cells.forEach(function(n,r){for(var a,o,i,l,s=n.site,c=n.edges.sort(Aa),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++uo&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(r=r[0])?l[i]?l[i]+=r:l[++i]=r:(l[++i]=null,s.push({i:i,x:Xa(n,r)})),o=Ja.lastIndex;return og&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;fg&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function M(t,e,n,r,a,o,i,l){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(m(s-n)+m(c-r)<.01)T(t,e,n,r,a,o,i,l);else{var u=t.point;t.x=t.y=t.point=null,T(t,u,s,c,a,o,i,l),T(t,e,n,r,a,o,i,l)}else t.x=n,t.y=r,t.point=e}else T(t,e,n,r,a,o,i,l)}function T(t,e,n,r,a,o,i,l){var s=.5*(a+i),c=.5*(o+l),u=n>=s,f=r>=c,d=f<<1|u;t.leaf=!1,u?a=s:i=s,f?o=c:l=c,M(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,n,r,a,o,i,l)}w>k?v=h+w:g=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(A,t,+y(t,++f),+x(t,f),p,h,g,v)}};if(A.visit=function(t){!function t(e,n,r,a,o,i){if(!e(n,r,a,o,i)){var l=.5*(r+o),s=.5*(a+i),c=n.nodes;c[0]&&t(e,c[0],r,a,l,s),c[1]&&t(e,c[1],l,a,o,s),c[2]&&t(e,c[2],r,s,l,i),c[3]&&t(e,c[3],l,s,o,i)}}(t,A,p,h,g,v)},A.find=function(t){return function(t,e,n,r,a,o,i){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>o||f>i||d=_)<<1|e>=b,k=w+4;w=0&&!(r=t.interpolators[a](e,n)););return r}function $a(t,e){var n,r=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(n=0;n=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function lo(t){return 1-Math.cos(t*Ct)}function so(t){return Math.pow(2,10*(t-1))}function co(t){return 1-Math.sqrt(1-t*t)}function uo(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function fo(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function po(t){var e,n,r,a=[t.a,t.b],o=[t.c,t.d],i=go(a),l=ho(a,o),s=go(((e=o)[0]+=(r=-l)*(n=a)[0],e[1]+=r*n[1],e))||0;a[0]*o[1]=0?t.slice(0,r):t,o=r>=0?t.slice(r+1):"in";return a=to.get(a)||Ka,o=eo.get(o)||O,e=o(a.apply(null,n.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,n){e=t.hcl(e),n=t.hcl(n);var r=e.h,a=e.c,o=e.l,i=n.h-r,l=n.c-a,s=n.l-o;isNaN(l)&&(l=0,a=isNaN(a)?n.c:a);isNaN(i)?(i=0,r=isNaN(r)?n.h:r):i>180?i-=360:i<-180&&(i+=360);return function(t){return Xt(r+i*t,a+l*t,o+s*t)+""}},t.interpolateHsl=function(e,n){e=t.hsl(e),n=t.hsl(n);var r=e.h,a=e.s,o=e.l,i=n.h-r,l=n.s-a,s=n.l-o;isNaN(l)&&(l=0,a=isNaN(a)?n.s:a);isNaN(i)?(i=0,r=isNaN(r)?n.h:r):i>180?i-=360:i<-180&&(i+=360);return function(t){return Ut(r+i*t,a+l*t,o+s*t)+""}},t.interpolateLab=function(e,n){e=t.lab(e),n=t.lab(n);var r=e.l,a=e.a,o=e.b,i=n.l-r,l=n.a-a,s=n.b-o;return function(t){return te(r+i*t,a+l*t,o+s*t)+""}},t.interpolateRound=fo,t.transform=function(e){var n=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate()}return new po(e?e.matrix:vo)})(e)},po.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vo={a:1,b:0,c:0,d:1,e:0,f:0};function yo(t){return t.length?t.pop()+",":""}function mo(e,n){var r=[],a=[];return e=t.transform(e),n=t.transform(n),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var a=n.push("translate(",null,",",null,")");r.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else(e[0]||e[1])&&n.push("translate("+e+")")}(e.translate,n.translate,r,a),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(yo(n)+"rotate(",null,")")-2,x:Xa(t,e)})):e&&n.push(yo(n)+"rotate("+e+")")}(e.rotate,n.rotate,r,a),function(t,e,n,r){t!==e?r.push({i:n.push(yo(n)+"skewX(",null,")")-2,x:Xa(t,e)}):e&&n.push(yo(n)+"skewX("+e+")")}(e.skew,n.skew,r,a),function(t,e,n,r){if(t[0]!==e[0]||t[1]!==e[1]){var a=n.push(yo(n)+"scale(",null,",",null,")");r.push({i:a-4,x:Xa(t[0],e[0])},{i:a-2,x:Xa(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(yo(n)+"scale("+e+")")}(e.scale,n.scale,r,a),e=n=null,function(t){for(var e,n=-1,o=a.length;++n0?r=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:r=0})):t>0&&(s.start({type:"start",alpha:r=t}),e=Me(l.tick)),l):r},l.start=function(){var t,e,n,r=y.length,s=m.length,u=c[0],h=c[1];for(t=0;t=0;)n.push(a[r])}function zo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++i=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return zo(a,function(e){var r,a;t&&(r=e.children)&&r.sort(t),n&&(a=e.parent)&&(a.value+=e.value)}),l}return r.sort=function(e){return arguments.length?(t=e,r):t},r.children=function(t){return arguments.length?(e=t,r):e},r.value=function(t){return arguments.length?(n=t,r):n},r.revalue=function(t){return n&&(Oo(t,function(t){t.children&&(t.value=0)}),zo(t,function(t){var e;t.children||(t.value=+n.call(r,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},r},t.layout.partition=function(){var e=t.layout.hierarchy(),n=[1,1];function r(t,r){var a=e.call(this,t,r);return function t(e,n,r,a){var o=e.children;if(e.x=n,e.y=e.depth*a,e.dx=r,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(r=e.value?r/e.value:0;++cl&&(l=r),i.push(r)}for(n=0;na&&(r=n,a=e);return r}function Yo(t){return t.reduce(Xo,0)}function Xo(t,e){return t+e[1]}function Zo(t,e){return Wo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Wo(t,e){for(var n=-1,r=+t[0],a=(t[1]-r)/e,o=[];++n<=e;)o[n]=a*n+r;return o}function Jo(e){return[t.min(e),t.max(e)]}function Qo(t,e){return t.value-e.value}function $o(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Ko(t,e){t._pack_next=e,e._pack_prev=t}function ti(t,e){var n=e.x-t.x,r=e.y-t.y,a=t.r+e.r;return.999*a*a>n*n+r*r}function ei(t){if((e=t.children)&&(s=e.length)){var e,n,r,a,o,i,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(e.forEach(ni),(n=e[0]).x=-n.r,n.y=0,x(n),s>1&&((r=e[1]).x=r.r,r.y=0,x(r),s>2))for(ai(n,r,a=e[2]),x(a),$o(n,a),n._pack_prev=a,$o(a,r),r=n._pack_next,o=3;o0)for(i=-1;++i=f[0]&&s<=f[1]&&((l=c[t.bisect(d,s,1,h)-1]).y+=g,l.push(o[i]));return c}return o.value=function(t){return arguments.length?(n=t,o):n},o.range=function(t){return arguments.length?(r=ve(t),o):r},o.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Wo(e,t)}:ve(t),o):a},o.frequency=function(t){return arguments.length?(e=!!t,o):e},o},t.layout.pack=function(){var e,n=t.layout.hierarchy().sort(Qo),r=0,a=[1,1];function o(t,o){var i=n.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,zo(l,function(t){t.r=+u(t.value)}),zo(l,ei),r){var f=r*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;zo(l,function(t){t.r+=f}),zo(l,ei),zo(l,function(t){t.r-=f})}return function t(e,n,r,a){var o=e.children;e.x=n+=a*e.x;e.y=r+=a*e.y;e.r*=a;if(o)for(var i=-1,l=o.length;++ip.x&&(p=t),t.depth>h.depth&&(h=t)});var g=n(d,p)/2-d.x,v=r[0]/(p.x+n(p,d)/2+g),y=r[1]/(h.depth||1);Oo(u,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function i(t){var e=t.children,r=t.parent.children,a=t.i?r[t.i-1]:null;if(e.length){!function(t){var e,n=0,r=0,a=t.children,o=a.length;for(;--o>=0;)(e=a[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(t);var o=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+n(t._,a._),t.m=t.z-o):t.z=o}else a&&(t.z=a.z+n(t._,a._));t.parent.A=function(t,e,r){if(e){for(var a,o=t,i=t,l=e,s=o.parent.children[0],c=o.m,u=i.m,f=l.m,d=s.m;l=li(l),o=ii(o),l&&o;)s=ii(s),(i=li(i)).a=t,(a=l.z+f-o.z-c+n(l._,o._))>0&&(si(ci(l,t,r),t,a),c+=a,u+=a),f+=l.m,c+=o.m,d+=s.m,u+=i.m;l&&!li(i)&&(i.t=l,i.m+=f-u),o&&!ii(s)&&(s.t=o,s.m+=c-d,r=t)}return r}(t,a,t.parent.A||r[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=r[0],t.y=t.depth*r[1]}return o.separation=function(t){return arguments.length?(n=t,o):n},o.size=function(t){return arguments.length?(a=null==(r=t)?s:null,o):a?null:r},o.nodeSize=function(t){return arguments.length?(a=null==(r=t)?null:s,o):a?r:null},Po(o,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),n=oi,r=[1,1],a=!1;function o(o,i){var l,s=e.call(this,o,i),c=s[0],u=0;zo(c,function(e){var r=e.children;r&&r.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(r),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(r)):(e.x=l?u+=n(e,l):0,e.y=0,l=e)});var f=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(c),d=function t(e){var n,r=e.children;return r&&(n=r.length)?t(r[n-1]):e}(c),p=f.x-n(f,d)/2,h=d.x+n(d,f)/2;return zo(c,a?function(t){t.x=(t.x-c.x)*r[0],t.y=(c.y-t.y)*r[1]}:function(t){t.x=(t.x-p)/(h-p)*r[0],t.y=(1-(c.y?t.y/c.y:1))*r[1]}),s}return o.separation=function(t){return arguments.length?(n=t,o):n},o.size=function(t){return arguments.length?(a=null==(r=t),o):a?null:r},o.nodeSize=function(t){return arguments.length?(a=null!=(r=t),o):a?r:null},Po(o,e)},t.layout.treemap=function(){var e,n=t.layout.hierarchy(),r=Math.round,a=[1,1],o=null,i=ui,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var n,r,a=-1,o=t.length;++a0;)l.push(n=c[a-1]),l.area+=n.area,"squarify"!==s||(r=p(l,g))<=d?(c.pop(),d=r):(l.area-=l.pop().area,h(l,g,o,!1),g=Math.min(o.dx,o.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,o,!0),l.length=l.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var n,r=i(t),a=e.slice(),o=[];for(u(a,r.dx*r.dy/t.value),o.area=0;n=a.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!a.length),o.length=o.area=0);e.forEach(d)}}function p(t,e){for(var n,r=t.area,a=0,o=1/0,i=-1,l=t.length;++ia&&(a=n));return e*=e,(r*=r)?Math.max(e*a*c/r,r/(e*o*c)):1/0}function h(t,e,n,a){var o,i=-1,l=t.length,s=n.x,c=n.y,u=e?r(t.area/e):0;if(e==n.dx){for((a||u>n.dy)&&(u=n.dy);++in.dx)&&(u=n.dx);++i1);return t+e*n*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var n=t.random.irwinHall(e);return function(){return n()/e}},irwinHall:function(t){return function(){for(var e=0,n=0;n2?mi:hi,l=a?bo:xo;return o=t(e,n,l,r),i=t(n,e,l,Qa),s}function s(t){return o(t)}s.invert=function(t){return i(t)};s.domain=function(t){return arguments.length?(e=t.map(Number),l()):e};s.range=function(t){return arguments.length?(n=t,l()):n};s.rangeRound=function(t){return s.range(t).interpolate(fo)};s.clamp=function(t){return arguments.length?(a=t,l()):a};s.interpolate=function(t){return arguments.length?(r=t,l()):r};s.ticks=function(t){return wi(e,t)};s.tickFormat=function(t,n){return ki(e,t,n)};s.nice=function(t){return bi(e,t),l()};s.copy=function(){return t(e,n,r,a)};return l()}([0,1],[0,1],Qa,!1)};var Mi={s:1,g:1,p:1,r:1,e:1};function Ti(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(n,r,a,o){function i(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(r)}function l(t){return a?Math.pow(r,t):-Math.pow(r,-t)}function s(t){return n(i(t))}s.invert=function(t){return l(n.invert(t))};s.domain=function(t){return arguments.length?(a=t[0]>=0,n.domain((o=t.map(Number)).map(i)),s):o};s.base=function(t){return arguments.length?(r=+t,n.domain(o.map(i)),s):r};s.nice=function(){var t=gi(o.map(i),a?Math:Li);return n.domain(t),o=t.map(l),s};s.ticks=function(){var t=di(o),e=[],n=t[0],s=t[1],c=Math.floor(i(n)),u=Math.ceil(i(s)),f=r%1?2:r;if(isFinite(u-c)){if(a){for(;c0;d--)e.push(l(c)*d);for(c=0;e[c]s;u--);e=e.slice(c,u)}return e};s.tickFormat=function(e,n){if(!arguments.length)return Ai;arguments.length<2?n=Ai:"function"!=typeof n&&(n=t.format(n));var a=Math.max(1,r*e/s.ticks().length);return function(t){var e=t/l(Math.round(i(t)));return e*r0?a[t-1]:n[0],tf?0:1;if(c=Lt)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,y,m,x,b,_,w,k,M,T,A=0,L=0,C=[];if((y=(+i.apply(this,arguments)||0)/2)&&(v=r===Ei?Math.sqrt(l*l+c*c):+r.apply(this,arguments),p||(L*=-1),c&&(L=Et(v/c*Math.sin(y))),l&&(A=Et(v/l*Math.sin(y)))),c){m=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=Tt?0:1;if(L&&Bi(m,x,b,_)===p^S){var P=(u+f)/2;m=c*Math.cos(P),x=c*Math.sin(P),b=_=null}}else m=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),M=l*Math.cos(u+A),T=l*Math.sin(u+A);var O=Math.abs(u-f+2*A)<=Tt?0:1;if(A&&Bi(w,k,M,T)===1-p^O){var z=(u+f)/2;w=l*Math.cos(z),k=l*Math.sin(z),M=T=null}}else w=k=0;if(d>kt&&(h=Math.min(Math.abs(c-l)/2,+n.apply(this,arguments)))>.001){g=l0?0:1}function qi(t,e,n,r,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?r:-r)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,y=p-f,m=v*v+y*y,x=n-r,b=u*p-d*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-v*_)/m,k=(-b*v-y*_)/m,M=(b*y+v*_)/m,T=(-b*v+y*_)/m,A=w-h,L=k-g,C=M-h,S=T-g;return A*A+L*L>C*C+S*S&&(w=M,k=T),[[w-s,k-c],[w*n/x,k*n/x]]}function Hi(t){var e=ra,n=aa,r=Wn,a=Ui,o=a.key,i=.7;function l(o){var l,s=[],c=[],u=-1,f=o.length,d=ve(e),p=ve(n);function h(){s.push("M",a(t(c),i))}for(;++u1&&a.push("H",r[0]);return a.join("")},"step-before":Yi,"step-after":Xi,basis:Ji,"basis-open":function(t){if(t.length<4)return Ui(t);var e,n=[],r=-1,a=t.length,o=[0],i=[0];for(;++r<3;)e=t[r],o.push(e[0]),i.push(e[1]);n.push(Qi(tl,o)+","+Qi(tl,i)),--r;for(;++r9&&(a=3*e/Math.sqrt(a),i[l]=a*n,i[l+1]=a*r));l=-1;for(;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}(t))}});function Ui(t){return t.length>1?t.join("L"):t+"Z"}function Gi(t){return t.join("L")+"Z"}function Yi(t){for(var e=0,n=t.length,r=t[0],a=[r[0],",",r[1]];++e1){l=e[1],o=t[s],s++,r+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;cTt)+",1 "+e}function s(t,e,n,r){return"Q 0,0 "+r}return o.radius=function(t){return arguments.length?(n=ve(t),o):n},o.source=function(e){return arguments.length?(t=ve(e),o):t},o.target=function(t){return arguments.length?(e=ve(t),o):e},o.startAngle=function(t){return arguments.length?(r=ve(t),o):r},o.endAngle=function(t){return arguments.length?(a=ve(t),o):a},o},t.svg.diagonal=function(){var t=Vr,e=Ur,n=il;function r(r,a){var o=t.call(this,r,a),i=e.call(this,r,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return"M"+(s=s.map(n))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return r.source=function(e){return arguments.length?(t=ve(e),r):t},r.target=function(t){return arguments.length?(e=ve(t),r):e},r.projection=function(t){return arguments.length?(n=t,r):n},r},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),n=il,r=e.projection;return e.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Ct;return[n*Math.cos(r),n*Math.sin(r)]}}(n=t)):n},e},t.svg.symbol=function(){var t=sl,e=ll;function n(n,r){return(ul.get(t.call(this,n,r))||cl)(e.call(this,n,r))}return n.type=function(e){return arguments.length?(t=ve(e),n):t},n.size=function(t){return arguments.length?(e=ve(t),n):e},n};var ul=t.map({circle:cl,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*dl)),n=e*dl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/fl),n=e*fl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/fl),n=e*fl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});t.svg.symbolTypes=ul.keys();var fl=Math.sqrt(3),dl=Math.tan(30*St);X.transition=function(t){for(var e,n,r=vl||++xl,a=wl(t),o=[],i=yl||{time:Date.now(),ease:io,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(t,i);if(o>=1)return f.event&&f.event.end.call(t,t.__data__,e),--u.count?delete u[r]:delete t[n],1}f||(o=a.time,i=Me(function(t){var e=f.delay;if(i.t=e+o,e<=t)return d(t-e);i.c=d},0,o),f=u[r]={tween:new b,time:o,timer:i,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++u.count)}ml.call=X.call,ml.empty=X.empty,ml.node=X.node,ml.size=X.size,t.transition=function(e,n){return e&&e.transition?vl?e.transition(n):e:t.selection().transition(e)},t.transition.prototype=ml,ml.select=function(t){var e,n,r,a=this.id,o=this.namespace,i=[];t=Z(t);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,y=this,m=t.select(t.event.target),x=r.of(y,arguments),b=t.select(y),_=m.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&o,M=m.classed("extent"),T=xt(y),A=t.mouse(y),L=t.select(i(y)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(f=null,A[0]-=l[1],A[1]-=s[1],M=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(A[0]+=l[1],A[1]+=s[1],M=0,F())});if(t.event.changedTouches?L.on("touchmove.brush",P).on("touchend.brush",z):L.on("mousemove.brush",P).on("mouseup.brush",z),b.interrupt().selectAll("*").interrupt(),M)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var C=+/w$/.test(_),S=+/^n/.test(_);v=[l[1-C]-A[0],s[1-S]-A[1]],A[0]=l[C],A[1]=s[S]}else t.event.altKey&&(f=A.slice());function P(){var e=t.mouse(y),n=!1;v&&(e[0]+=v[0],e[1]+=v[1]),M||(t.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(e[0]1?{floor:function(e){for(;l(e=t.floor(e));)e=Nl(e-1);return e},ceil:function(e){for(;l(e=t.ceil(e));)e=Nl(+e+1);return e}}:t))},a.ticks=function(t,e){var n=di(a.domain()),r=null==t?o(n,10):"number"==typeof t?o(n,t):!t.range&&[{range:t},e];return r&&(t=r[0],e=r[1]),t.range(n[0],Nl(+n[1]+1),e<1?1:e)},a.tickFormat=function(){return r},a.copy=function(){return El(e.copy(),n,r)},xi(a,e)}function Nl(t){return new Date(t)}Pl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Dl:zl,Dl.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Dl.toString=zl.toString,Ee.second=Fe(function(t){return new Ne(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Ee.seconds=Ee.second.range,Ee.seconds.utc=Ee.second.utc.range,Ee.minute=Fe(function(t){return new Ne(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Ee.minutes=Ee.minute.range,Ee.minutes.utc=Ee.minute.utc.range,Ee.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new Ne(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Ee.hours=Ee.hour.range,Ee.hours.utc=Ee.hour.utc.range,Ee.month=Fe(function(t){return(t=Ee.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Ee.months=Ee.month.range,Ee.months.utc=Ee.month.utc.range;var Rl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Il=[[Ee.second,1],[Ee.second,5],[Ee.second,15],[Ee.second,30],[Ee.minute,1],[Ee.minute,5],[Ee.minute,15],[Ee.minute,30],[Ee.hour,1],[Ee.hour,3],[Ee.hour,6],[Ee.hour,12],[Ee.day,1],[Ee.day,2],[Ee.week,1],[Ee.month,1],[Ee.month,3],[Ee.year,1]],Fl=Pl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Wn]]),jl={range:function(e,n,r){return t.range(Math.ceil(e/r)*r,+n,r).map(Nl)},floor:O,ceil:O};Il.year=Ee.year,Ee.scale=function(){return El(t.scale.linear(),Il,Fl)};var Bl=Il.map(function(t){return[t[0].utc,t[1]]}),ql=Ol.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Wn]]);function Hl(t){return JSON.parse(t.responseText)}function Vl(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Bl.year=Ee.year.utc,Ee.scale.utc=function(){return El(t.scale.linear(),Bl,ql)},t.text=ye(function(t){return t.responseText}),t.json=function(t,e){return me(t,"application/json",Hl,e)},t.html=function(t,e){return me(t,"text/html",Vl,e)},t.xml=ye(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],14:[function(t,e,n){(function(r,a){!function(t,r){"object"==typeof n&&void 0!==e?e.exports=r():t.ES6Promise=r()}(this,function(){"use strict";function e(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,i=void 0,l=void 0,s=function(t,e){g[o]=t,g[o+1]=e,2===(o+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==r&&"[object process]"==={}.toString.call(r),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;t0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!a(e))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var n,r,i,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=(n=this._events[t]).length,r=-1,n===e||a(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(l=i;l-- >0;)if(n[l]===e||n[l].listener&&n[l].listener===e){r=l;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(a(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},{}],16:[function(t,e,n){"use strict";var r=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":20}],17:[function(t,e,n){e.exports=function(t,e){var n=e[0],r=e[1],a=e[2],o=e[3],i=n+n,l=r+r,s=a+a,c=n*i,u=r*i,f=r*l,d=a*i,p=a*l,h=a*s,g=o*i,v=o*l,y=o*s;return t[0]=1-f-h,t[1]=u+y,t[2]=d-v,t[3]=0,t[4]=u-y,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],18:[function(t,e,n){(function(n){"use strict";var r,a=t("is-browser");r="function"==typeof n.matchMedia?!n.matchMedia("(hover: none)").matches:a,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":19}],19:[function(t,e,n){e.exports=!0},{}],20:[function(t,e,n){"use strict";e.exports=function(t){for(var e,n=t.length,r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],21:[function(t,e,n){var r={left:0,top:0};e.exports=function(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var a=t.clientX||0,o=t.clientY||0,i=(l=e,l===window||l===document||l===document.body?r:l.getBoundingClientRect());var l;return n[0]=a-i.left,n[1]=o-i.top,n}},{}],22:[function(t,e,n){var r,a=t("./lib/build-log"),o=t("./lib/epsilon"),i=t("./lib/intersecter"),l=t("./lib/segment-chainer"),s=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=o();function d(t,e,n){var a=r.segments(t),o=r.segments(e),i=n(r.combine(a,o));return r.polygon(i)}r={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=i(!0,f,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:i(!1,f,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(r,t)},polygonToGeoJSON:function(t){return c.fromPolygon(r,f,t)},union:function(t,e){return d(t,e,r.selectUnion)},intersect:function(t,e){return d(t,e,r.selectIntersect)},difference:function(t,e){return d(t,e,r.selectDifference)},differenceRev:function(t,e){return d(t,e,r.selectDifferenceRev)},xor:function(t,e){return d(t,e,r.selectXor)}},"object"==typeof window&&(window.PolyBool=r),e.exports=r},{"./lib/build-log":23,"./lib/epsilon":24,"./lib/geojson":25,"./lib/intersecter":26,"./lib/segment-chainer":28,"./lib/segment-selector":29}],23:[function(t,e,n){e.exports=function(){var t,e=0,n=!1;function r(e,n){return t.list.push({type:e,data:n?JSON.parse(JSON.stringify(n)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return r("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return r("div_seg",{seg:t,pt:e}),r("chop",{seg:t,pt:e})},statusRemove:function(t){return r("pop_seg",{seg:t})},segmentUpdate:function(t){return r("seg_update",{seg:t})},segmentNew:function(t,e){return r("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return r("rem_seg",{seg:t})},tempStatus:function(t,e,n){return r("temp_status",{seg:t,above:e,below:n})},rewind:function(t){return r("rewind",{seg:t})},status:function(t,e,n){return r("status",{seg:t,above:e,below:n})},vert:function(e){return e===n?t:(n=e,r("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),r("log",{txt:t})},reset:function(){return r("reset")},selected:function(t){return r("selected",{segs:t})},chainStart:function(t){return r("chain_start",{seg:t})},chainRemoveHead:function(t,e){return r("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return r("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return r("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return r("chain_match",{index:t})},chainClose:function(t){return r("chain_close",{index:t})},chainAddHead:function(t,e){return r("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return r("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return r("chain_con",{index1:t,index2:e})},chainReverse:function(t){return r("chain_rev",{index:t})},chainJoin:function(t,e){return r("chain_join",{index1:t,index2:e})},done:function(){return r("done")}}}},{}],24:[function(t,e,n){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,n,r){var a=n[0],o=n[1],i=r[0],l=r[1],s=e[0];return(i-a)*(e[1]-o)-(l-o)*(s-a)>=-t},pointBetween:function(e,n,r){var a=e[1]-n[1],o=r[0]-n[0],i=e[0]-n[0],l=r[1]-n[1],s=i*o+a*l;return!(s-t)},pointsSameX:function(e,n){return Math.abs(e[0]-n[0])t!=i-a>t&&(o-c)*(a-u)/(i-u)+c-r>t&&(l=!l),o=c,i=u}return l}};return e}},{}],25:[function(t,e,n){var r={toPolygon:function(t,e){function n(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function n(e){var n=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[n]})}for(var r=n(e[0]),a=1;a0})}function u(t,r){var a=t.seg,o=r.seg,i=a.start,l=a.end,c=o.start,u=o.end;n&&n.checkIntersection(a,o);var f=e.linesIntersect(i,l,c,u);if(!1===f){if(!e.pointsCollinear(i,l,c))return!1;if(e.pointsSame(i,u)||e.pointsSame(l,c))return!1;var d=e.pointsSame(i,c),p=e.pointsSame(l,u);if(d&&p)return r;var h=!d&&e.pointBetween(i,c,u),g=!p&&e.pointBetween(l,c,u);if(d)return g?s(r,l):s(t,u),r;h&&(p||(g?s(r,l):s(t,u)),s(r,i))}else 0===f.alongA&&(-1===f.alongB?s(t,c):0===f.alongB?s(t,f.pt):1===f.alongB&&s(t,u)),0===f.alongB&&(-1===f.alongA?s(r,i):0===f.alongA?s(r,f.pt):1===f.alongA&&s(r,l));return!1}for(var f=[];!o.isEmpty();){var d=o.getHead();if(n&&n.vert(d.pt[0]),d.isStart){n&&n.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var t=u(d,h);if(t)return t}return!!g&&u(d,g)}n&&n.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var y,m,x=v();if(x)t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,n&&n.segmentUpdate(x.seg),d.other.remove(),d.remove();if(o.getHead()!==d){n&&n.rewind(d.seg);continue}t?(m=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=m?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(y=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?i:a,d.seg.otherFill={above:y,below:y}),n&&n.status(d.seg,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(r.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),n&&n.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}o.getHead().remove()}return n&&n.done(),f}return t?{addRegion:function(t){for(var r,a,o,i=t[t.length-1],s=0;s1)for(var n=1;n1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=P(t,360),e=P(e,100),n=P(n,100),0===e)r=a=o=n;else{var l=n<.5?n*(1+e):n+e-n*e,s=2*n-l;r=i(s,l,t+1/3),a=i(s,l,t),o=i(s,l,t-1/3)}return{r:255*r,g:255*a,b:255*o}}(e.h,s,u),f=!0,d="hsl"),e.hasOwnProperty("a")&&(o=e.a));var p,h,g;return o=S(o),{ok:f,format:e.format||d,r:i(255,l(a.r,0)),g:i(255,l(a.g,0)),b:i(255,l(a.b,0)),a:o}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=o(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=u.ok,this._tc_id=a++}function u(t,e,n){t=P(t,255),e=P(e,255),n=P(n,255);var r,a,o=l(t,e,n),s=i(t,e,n),c=(o+s)/2;if(o==s)r=a=0;else{var u=o-s;switch(a=c>.5?u/(2-o-s):u/(o+s),o){case t:r=(e-n)/u+(e>1)+720)%360;--e;)r.h=(r.h+a)%360,o.push(c(r));return o}function A(t,e){e=e||6;for(var n=c(t).toHsv(),r=n.h,a=n.s,o=n.v,i=[],l=1/e;e--;)i.push(c({h:r,s:a,v:o})),o=(o+l)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,n,r,a=this.toRgb();return e=a.r/255,n=a.g/255,r=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,a){var i=[D(o(t).toString(16)),D(o(e).toString(16)),D(o(n).toString(16)),D(N(r))];if(a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*P(this._r,255))+"%",g:o(100*P(this._g,255))+"%",b:o(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%)":"rgba("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var a=c(t);n="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:E(t[r]));t=n}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(t,e,n){n=0===n?0:n||50;var r=c(t).toRgb(),a=c(e).toRgb(),o=n/100;return c({r:(a.r-r.r)*o+r.r,g:(a.g-r.g)*o+r.g,b:(a.b-r.b)*o+r.b,a:(a.a-r.a)*o+r.a})},c.readability=function(e,n){var r=c(e),a=c(n);return(t.max(r.getLuminance(),a.getLuminance())+.05)/(t.min(r.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(t,e,n){var r,a,o=c.readability(t,e);switch(a=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},c.mostReadable=function(t,e,n){var r,a,o,i,l=null,s=0;a=(n=n||{}).includeFallbackColors,o=n.level,i=n.size;for(var u=0;us&&(s=r,l=c(e[u]));return c.isReadable(t,l,{level:o,size:i})||!a?l:(n.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],n))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=c.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(L);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function P(e,n){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=i(n,l(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),t.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function O(t){return i(1,l(0,t))}function z(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function E(t){return t<=1&&(t=100*t+"%"),t}function N(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var I,F,j,B=(F="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",j="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],32:[function(t,e,n){var r;r=this,function(t){"use strict";var e=function(t){return t},n=function(t){if(null==(n=t.transform))return e;var n,r,a,o=n.scale[0],i=n.scale[1],l=n.translate[0],s=n.translate[1];return function(t,e){return e||(r=a=0),t[0]=(r+=t[0])*o+l,t[1]=(a+=t[1])*i+s,t}},r=function(t){var e=t.bbox;function r(t){s[0]=t[0],s[1]=t[1],l(s),s[0]f&&(f=s[0]),s[1]d&&(d=s[1])}function a(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(a);break;case"Point":r(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(r)}}if(!e){var o,i,l=n(t),s=new Array(2),c=1/0,u=c,f=-c,d=-c;for(i in t.arcs.forEach(function(t){for(var e=-1,n=t.length;++ef&&(f=s[0]),s[1]d&&(d=s[1])}),t.objects)a(t.objects[i]);e=t.bbox=[c,u,f,d]}return e},a=function(t,e){for(var n,r=t.length,a=r-e;a<--r;)n=t[a],t[a++]=t[r],t[r]=n};function o(t,e){var n=e.id,r=e.bbox,a=null==e.properties?{}:e.properties,o=i(t,e);return null==n&&null==r?{type:"Feature",properties:a,geometry:o}:null==r?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:r,properties:a,geometry:o}}function i(t,e){var r=n(t),o=t.arcs;function i(t,e){e.length&&e.pop();for(var n=o[t<0?~t:t],i=0,l=n.length;i1)r=function(t,e,n){var r,a=[],o=[];function i(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function l(t){t.forEach(i)}function s(t){t.forEach(l)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":l(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}}(e),o.forEach(null==n?function(t){a.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&a.push(t[0].i)}),a}(0,e,n);else for(a=0,r=new Array(o=t.arcs.length);a1)for(var o,i,c=1,u=s(a[0]);cu&&(i=a[0],a[0]=a[c],a[c]=i,u=o);return a})}}var u=function(t,e){for(var n=0,r=t.length;n>>1;t[a]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var n,a=r(t),o=a[0],i=(a[2]-o)/(e-1)||1,l=a[1],s=(a[3]-l)/(e-1)||1;function c(t){t[0]=Math.round((t[0]-o)/i),t[1]=Math.round((t[1]-l)/s)}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":c(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(c)}}for(n in t.arcs.forEach(function(t){for(var e,n,r,a=1,c=1,u=t.length,f=t[0],d=f[0]=Math.round((f[0]-o)/i),p=f[1]=Math.round((f[1]-l)/s);a1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s.pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*n[0],e.yaxis.r2l(s.y)*n[1],e.zaxis.r2l(s.z)*n[2]]),r(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":251,"../annotations/draw":46}],37:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var n=r.subplotsRegistry.gl3d;if(!n)return;for(var o=n.attrRegex,i=Object.keys(t),l=0;l0||n.explicitOff.length>0},onClick:function(t,e){var n,o=a(t,e),i=o.on,l=o.off.concat(o.explicitOff),s={};if(!i.length&&!l.length)return;for(n=0;n2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}e._w=N,e._h=I;for(var q=!1,H=["x","y"],V=0;V1)&&(Q===J?((it=$.r2fraction(e["a"+W]))<0||it>1)&&(q=!0):q=!0,q))continue;U=$._offset+$.r2p(e[W]),X=.5}else"x"===W?(Y=e[W],U=x.l+x.w*Y):(Y=1-e[W],U=x.t+x.h*Y),X=e.showarrow?.5:Y;if(e.showarrow){ot.head=U;var lt=e["a"+W];Z=tt*B(.5,e.xanchor)-et*B(.5,e.yanchor),Q===J?(ot.tail=$._offset+$.r2p(lt),G=Z):(ot.tail=U+lt,G=Z+lt),ot.text=ot.tail+Z;var st=m["x"===W?"width":"height"];if("paper"===J&&(ot.head=i.constrain(ot.head,1,st-1)),"pixel"===Q){var ct=-Math.max(ot.tail-3,ot.text),ut=Math.min(ot.tail+3,ot.text)-st;ct>0?(ot.tail+=ct,ot.text+=ct):ut>0&&(ot.tail-=ut,ot.text-=ut)}ot.tail+=at,ot.head+=at}else G=Z=nt*B(X,rt),ot.text=U+Z;ot.text+=at,Z+=at,G+=at,e["_"+W+"padplus"]=nt/2+G,e["_"+W+"padminus"]=nt/2-G,e["_"+W+"size"]=nt,e["_"+W+"shift"]=Z}if(q)C.remove();else{var ft=0,dt=0;if("left"!==e.align&&(ft=(N-L)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(I-P)*("middle"===e.valign?.5:1)),u)r.select("svg").attr({x:O+ft-1,y:O+dt}).call(c.setClipUrl,D?_:null);else{var pt=O+dt-v.top,ht=O+ft-v.left;R.call(f.positionText,ht,pt).call(c.setClipUrl,D?_:null)}E.select("rect").call(c.setRect,O,O,N,I),z.call(c.setRect,S/2,S/2,F-S,j-S),C.call(c.setTranslate,Math.round(w.x.text-F/2),Math.round(w.y.text-j/2)),T.attr({transform:"rotate("+k+","+w.x.text+","+w.y.text+")"});var gt,vt,yt=function(n,r){M.selectAll(".annotation-arrow-g").remove();var u=w.x.head,f=w.y.head,d=w.x.tail+n,v=w.y.tail+r,m=w.x.text+n,_=w.y.text+r,A=i.rotationXYMatrix(k,m,_),L=i.apply2DTransform(A),S=i.apply2DTransform2(A),P=+z.attr("width"),O=+z.attr("height"),D=m-.5*P,E=D+P,N=_-.5*O,R=N+O,I=[[D,N,D,R],[D,R,E,R],[E,R,E,N],[E,N,D,N]].map(S);if(!I.reduce(function(t,e){return t^!!i.segmentsIntersect(u,f,u+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){I.forEach(function(t){var e=i.segmentsIntersect(d,v,u,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,v=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,q=M.append("g").style({opacity:s.opacity(j)}).classed("annotation-arrow-g",!0),H=q.append("path").attr("d","M"+d+","+v+"L"+u+","+f).style("stroke-width",F+"px").call(s.stroke,s.rgb(j));if(h(H,B,e),b.annotationPosition&&H.node().parentNode&&!o){var V=u,U=f;if(e.standoff){var G=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-v,2));V+=e.standoff*(d-u)/G,U+=e.standoff*(v-f)/G}var Y,X,Z,W=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(v-U),transform:"translate("+V+","+U+")"}).style("stroke-width",F+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:W.node(),gd:t,prepFn:function(){var t=c.getTranslate(C);X=t.x,Z=t.y,Y={},l&&l.autorange&&(Y[l._name+".autorange"]=!0),g&&g.autorange&&(Y[g._name+".autorange"]=!0)},moveFn:function(t,n){var r=L(X,Z),a=r[0]+t,o=r[1]+n;C.call(c.setTranslate,a,o),Y[y+".x"]=l?l.p2r(l.r2p(e.x)+t):e.x+t/x.w,Y[y+".y"]=g?g.p2r(g.r2p(e.y)+n):e.y-n/x.h,e.axref===e.xref&&(Y[y+".ax"]=l.p2r(l.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[y+".ay"]=g.p2r(g.r2p(e.ay)+n)),q.attr("transform","translate("+t+","+n+")"),T.attr({transform:"rotate("+k+","+a+","+o+")"})},doneFn:function(){a.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&yt(0,0),A)p.init({element:C.node(),gd:t,prepFn:function(){vt=T.attr("transform"),gt={}},moveFn:function(t,n){var r="pointer";if(e.showarrow)e.axref===e.xref?gt[y+".ax"]=l.p2r(l.r2p(e.ax)+t):gt[y+".ax"]=e.ax+t,e.ayref===e.yref?gt[y+".ay"]=g.p2r(g.r2p(e.ay)+n):gt[y+".ay"]=e.ay+n,yt(t,n);else{if(o)return;if(l)gt[y+".x"]=e.x+t/l._m;else{var a=e._xsize/x.w,i=e.x+(e._xshift-e.xshift)/x.w-a/2;gt[y+".x"]=p.align(i+t/x.w,a,0,1,e.xanchor)}if(g)gt[y+".y"]=e.y+n/g._m;else{var s=e._ysize/x.h,c=e.y-(e._yshift+e.yshift)/x.h-s/2;gt[y+".y"]=p.align(c-n/x.h,s,0,1,e.yanchor)}l&&g||(r=p.getCursor(l?.5:gt[y+".x"],g?.5:gt[y+".y"],e.xanchor,e.yanchor))}T.attr({transform:"translate("+t+","+n+")"+vt}),d(C,r)},doneFn:function(){d(C),a.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var n=0;n=0,v=e.indexOf("end")>=0,y=f.backoff*p+n.standoff,m=d.backoff*h+n.startstandoff;if("line"===u.nodeName){i={x:+t.attr("x1"),y:+t.attr("y1")},l={x:+t.attr("x2"),y:+t.attr("y2")};var x=i.x-l.x,b=i.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,y&&m&&y+m>Math.sqrt(x*x+b*b))return void O();if(y){if(y*y>x*x+b*b)return void O();var _=y*Math.cos(s),w=y*Math.sin(s);l.x+=_,l.y+=w,t.attr({x2:l.x,y2:l.y})}if(m){if(m*m>x*x+b*b)return void O();var k=m*Math.cos(s),M=m*Math.sin(s);i.x-=k,i.y-=M,t.attr({x1:i.x,y1:i.y})}}else if("path"===u.nodeName){var T=u.getTotalLength(),A="";if(T=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 o?"rgba("+l+", "+r[3]+")":"rgb("+l+")"}o.overrideColorDefaults=function(t){if(void 0===t)return o.defaults;o.defaults=t},o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(r(t))},o.opacity=function(t){return t?r(t).getAlpha():0},o.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},o.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var a=r(e||s).toRgb(),o=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},i={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 r(i).toRgbString()},o.contrast=function(t,e,n){var a=r(t);return 1!==a.getAlpha()&&(a=r(o.combine(t,s))),(a.isDark()?e?a.lighten(e):s:n?a.darken(n):l).toString()},o.stroke=function(t,e){var n=r(e);t.style({stroke:o.tinyRGB(n),"stroke-opacity":n.getAlpha()})},o.fill=function(t,e){var n=r(e);t.style({fill:o.tinyRGB(n),"fill-opacity":n.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,n,r,a,i=Object.keys(t);for(e=0;e0?A>=D:A<=D));L++)A>N&&A0?A>=D:A<=D));L++)A>C[0]&&A1){var at=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));et*=at*u.roundUp(rt/at,[2,5,10]),(Math.abs(n.levels.start)/n.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+Y,W+V-Y],K.setScale();var ot=_._infolayer.selectAll("g."+e).data([0]);ot.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=r.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var it=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");K._axislayer=ot.select(".cbaxis");var lt=0;if(-1!==["top","bottom"].indexOf(n.titleside)){var st,ct=T.l+(n.x+U)*T.w,ut=K.titlefont.size;st="top"===n.titleside?(1-(W+V-Y))*T.h+T.t+3+.75*ut:(1-(W+Y))*T.h+T.t-3-.25*ut,vt(K._id+"title",{attributes:{x:ct,y:st,"text-anchor":"start"}})}var ft,dt,pt,ht=u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(n.titleside)){var e=ot.select(".cbtitle"),o=e.select("text"),i=[-n.outlinewidth/2,n.outlinewidth/2],l=e.select(".h"+K._id+"title-math-group").node(),c=15.6;if(o.node()&&(c=parseInt(o.node().style.fontSize,10)*y),l?(lt=p.bBox(l).height)>c&&(i[1]-=(lt-c)/2):o.node()&&!o.classed(w.jsPlaceholder)&&(lt=p.bBox(o.node()).height),lt){if(lt+=5,"top"===n.titleside)K.domain[1]-=lt/T.h,i[1]*=-1;else{K.domain[0]+=lt/T.h;var f=v.lineCount(o);i[1]+=(1-f)*c}e.attr("transform","translate("+i+")"),K.setScale()}}ot.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(T.h*(1-K.domain[1]))+")"),K._axislayer.attr("transform","translate(0,"+Math.round(-T.t)+")");var d=ot.select(".cbfills").selectAll("rect.cbfill").data(P);d.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),d.exit().remove(),d.each(function(t,e){var n=[0===e?C[0]:(P[e]+P[e-1])/2,e===P.length-1?C[1]:(P[e]+P[e+1])/2].map(K.c2p).map(Math.round);e!==P.length-1&&(n[1]+=n[1]>n[0]?1:-1);var o=z(t).replace("e-",""),i=a(o).toHexString();r.select(this).attr({x:X,width:Math.max(B,2),y:r.min(n),height:Math.max(r.max(n)-r.min(n),2),fill:i})});var h=ot.select(".cblines").selectAll("path.cbline").data(n.line.color&&n.line.width?S:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){r.select(this).attr("d","M"+X+","+(Math.round(K.c2p(t))+n.line.width/2%1)+"h"+B).call(p.lineGroupStyle,n.line.width,O(t),n.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=X+B+(n.outlinewidth||0)/2-("outside"===n.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(-1===["top","bottom"].indexOf(n.titleside)){var e=K.titlefont.size,a=K._offset+K._length/2,o=T.l+(K.position||0)*T.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));vt("h"+K._id+"title",{avoid:{selection:r.select(t).selectAll("g."+K._id+"tick"),side:n.titleside,offsetLeft:T.l,offsetTop:0,maxShift:_.width},attributes:{x:o,y:a,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},i.previousPromises,function(){var r=B+n.outlinewidth/2+p.bBox(K._axislayer.node()).width;if((I=it.select("text")).node()&&!I.classed(w.jsPlaceholder)){var a,o=it.select(".h"+K._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(n.titleside)?p.bBox(o).width:p.bBox(it.node()).right-X-T.l,r=Math.max(r,a)}var l=2*n.xpad+r+n.borderwidth+n.outlinewidth/2,s=J-Q;ot.select(".cbbg").attr({x:X-n.xpad-(n.borderwidth+n.outlinewidth)/2,y:Q-G,width:Math.max(l,2),height:Math.max(s+2*G,2)}).call(h.fill,n.bgcolor).call(h.stroke,n.bordercolor).style({"stroke-width":n.borderwidth}),ot.selectAll(".cboutline").attr({x:X,y:Q+n.ypad+("top"===n.titleside?lt:0),width:Math.max(B,2),height:Math.max(s-2*n.ypad-lt,2)}).call(h.stroke,n.outlinecolor).style({fill:"None","stroke-width":n.outlinewidth});var c=({center:.5,right:1}[n.xanchor]||0)*l;ot.attr("transform","translate("+(T.l-c)+","+T.t+")"),i.autoMargin(t,e,{x:n.x,y:n.y,l:l*({right:1,center:.5}[n.xanchor]||0),r:l*({left:1,center:.5}[n.xanchor]||0),t:s*({bottom:1,middle:.5}[n.yanchor]||0),b:s*({top:1,middle:.5}[n.yanchor]||0)})}],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.edits.colorbarPosition)c.init({element:ot.node(),gd:t,prepFn:function(){ft=ot.attr("transform"),d(ot)},moveFn:function(t,e){ot.attr("transform",ft+" translate("+t+","+e+")"),dt=c.align(Z+t/T.w,q,0,1,n.xanchor),pt=c.align(W-e/T.h,V,0,1,n.yanchor);var r=c.getCursor(dt,pt,n.xanchor,n.yanchor);d(ot,r)},doneFn:function(){d(ot),void 0!==dt&&void 0!==pt&&o.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},M().index)}});return ht}function gt(t,e){return u.coerce($,K,b,t,e)}function vt(e,n){var r,a=M();r=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:r,traceIndex:a.index,placeholder:_._dfltTitle.colorbar,containerGroup:ot.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,n||{}))}_._infolayer.selectAll("g."+e).remove()}function M(){var n,r,a=e.substr(2);for(n=0;n=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":169,"./flip_scale":62,"./scales":69}],58:[function(t,e,n){"use strict";var r=t("./attributes"),a=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,n){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:a({},r.colorscale,{}),cauto:a({},r.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:a({},r.zmax,{editType:e||r.zmax.editType,impliedEdits:{cauto:!1}}),cmin:a({},r.zmin,{editType:e||r.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:a({},r.autocolorscale,{dflt:!1===n?n:r.autocolorscale.dflt}),reversescale:a({},r.reversescale,{})}}},{"../../lib/extend":161,"./attributes":56,"./scales.js":69}],59:[function(t,e,n){"use strict";var r=t("./scales");e.exports=r.RdBu},{"./scales":69}],60:[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,d=u.prefix,p=u.cLetter,h=d.slice(0,d.length-1),g=d?a.nestedProperty(t,h).get()||{}:t,v=d?a.nestedProperty(e,h).get()||{}:e,y=g[p+"min"],m=g[p+"max"],x=g.colorscale;c(d+p+"auto",!(r(y)&&r(m)&&y=0;a--,o++)e=t[a],r[o]=[1-e[0],e[1]];return r}},{}],63:[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){if(e||(e=a),!t)return e;function n(){try{t=r[t]||JSON.parse(t)}catch(n){t=e}}return"string"==typeof t&&(n(),"string"==typeof t&&n()),o(t)?t:e}},{"./default_scale":59,"./is_valid_scale_array":67,"./scales":69}],64:[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;s4/3-l?i:l}},{}],71:[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":169}],72:[function(t,e,n){"use strict";var r=t("mouse-event-offset"),a=t("../../plotly"),o=t("../../lib"),i=t("../../plots/cartesian/constants"),l=t("../../constants/interactions"),s=e.exports={};s.align=t("./align"),s.getCursor=t("./cursor");var c=t("./unhover");s.unhover=c.wrapped,s.unhoverRaw=c.raw;var u=o.eventListenerOptionsSupported();function f(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.init=function(t){var e,n,r,c,d,p,h,g=t.gd,v=1,y=l.DBLCLICKDELAY,m=t.element;g._mouseDownTime||(g._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=_,u?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=_,m.addEventListener("touchstart",_,{passive:!1})):m.ontouchstart=_;var x=t.clampFn||function(t,e,n){return Math.abs(t)y&&(v=Math.max(v-1,1)),g.childElementCount)if(g._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(v,d),!h){var n;try{n=new MouseEvent("click",e)}catch(t){var r=f(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,r[0],r[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&a.plot(t)}(g),g._dragged=!1,b()?void 0:o.pauseEvent(e)}g._dragged=!1}}},{"../../constants/interactions":149,"../../lib":169,"../../plotly":208,"../../plots/cartesian/constants":218,"./align":70,"./cursor":71,"./unhover":73,"mouse-event-offset":21}],73:[function(t,e,n){"use strict";var r=t("../../lib/events"),a=t("../../lib/throttle"),o=t("../../lib/get_graph_div"),i=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,n){(t=o(t))._fullLayout&&a.clear(t._fullLayout._uid+i.HOVERID),l.raw(t,e,n)},l.raw=function(t,e){var n=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":160,"../../lib/get_graph_div":167,"../../lib/throttle":191,"../fx/constants":87}],74:[function(t,e,n){"use strict";n.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],75:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("tinycolor2"),i=t("../../registry"),l=t("../color"),s=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,h=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,n,r){c.isPlainObject(e)&&(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)},v.setPosition=function(t,e,n){t.attr("x",e).attr("y",n)},v.setSize=function(t,e,n){t.attr("width",e).attr("height",n)},v.setRect=function(t,e,n,r,a){t.call(v.setPosition,e,n).call(v.setSize,r,a)},v.translatePoint=function(t,e,n,r){var o=n.c2p(t.x),i=r.c2p(t.y);return!!(a(o)&&a(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",o).attr("y",i):e.attr("transform","translate("+o+","+i+")"),!0)},v.translatePoints=function(t,e,n){t.each(function(t){var a=r.select(this);v.translatePoint(t,a,e,n)})},v.hideOutsideRangePoint=function(t,e,n,r,a,o){e.attr("display",n.isPtWithinRange(t,a)&&r.isPtWithinRange(t,o)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,a=e.yaxis;t.each(function(e){var o=e[0].trace,i=o.xcalendar,l=o.ycalendar;t.selectAll(".point,.textpoint").each(function(t){v.hideOutsideRangePoint(t,r.select(this),n,a,i,l)})})}},v.crispRound=function(t,e,n){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},v.singleLineStyle=function(t,e,n,r,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=n||o.width||0,s=a||o.dash||"";l.stroke(e,r||o.color),v.dashLine(e,s,i)},v.lineGroupStyle=function(t,e,n,a){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},i=e||o.width||0,s=a||o.dash||"";r.select(this).call(l.stroke,n||o.color).call(v.dashLine,s,i)})},v.dashLine=function(t,e,n){n=+n||0,e=v.dashStyle(e,n),t.style({"stroke-dasharray":e,"stroke-width":n+"px"})},v.dashStyle=function(t,e){e=+e||1;var n=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=n+"px,"+n+"px":"dash"===t?t=3*n+"px,"+3*n+"px":"longdash"===t?t=5*n+"px,"+5*n+"px":"dashdot"===t?t=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===t&&(t=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t},v.singleFillStyle=function(t){var e=(((r.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(l.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var n=r.select(this);try{n.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),n.remove()}})};var y=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(y).forEach(function(t){var e=y[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var m=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var n=t%100;return v.symbolFuncs[n](e)+(t>=200?x:"")}v.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=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=m||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,n,a,i,s){var u=e._fullLayout._defs.select(".gradients").selectAll("#"+n).data([a+i+s],c.identity);u.exit().remove(),u.enter().append("radial"===a?"radialGradient":"linearGradient").each(function(){var t=r.select(this);"horizontal"===a?t.attr(_):"vertical"===a&&t.attr(w),t.attr("id",n);var e=o(i),c=o(s);t.append("stop").attr({offset:"0%","stop-color":l.tinyRGB(c),"stop-opacity":c.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+n+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,n,r,a,o){var s=n.marker;!function(t,e,n,r,a,o,s,c){if(i.traceIs(n,"symbols")){var u=g(n);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:h.isBubble(n)?u(t.ms):(o.size||6)/2,t.mrc=e;var r=v.symbolNumber(t.mx||o.symbol)||0;return t.om=r%200>=100,b(r,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var f,d,p,y=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,f=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?l.defaultLine:s.color,Array.isArray(o.color)&&(f=l.defaultLine,y=!0),f="mc"in t?t.mcc=r(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var m=o.gradient,x=t.mgt;if(x?y=!0:x=m&&m.type,x&&"none"!==x){var _=t.mgc;_?y=!0:_=m.color;var w="g"+c._fullLayout._uid+"-"+n.uid;y&&(w+="-"+t.i),e.call(v.gradient,c,w,x,f,_)}else e.call(l.fill,f);p&&e.call(l.stroke,d)}}(t,e,n,r,a,s,s.line,o)},v.pointStyle=function(t,e,n){if(t.size()){var a=e.marker,o=v.tryColorscale(a,""),i=v.tryColorscale(a,"line");t.each(function(t){v.singlePointStyle(t,r.select(this),e,o,i,n)})}},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=e.selected||{},a=e.unselected||{},o=e.marker||{},s=n.marker||{},c=a.marker||{},u=o.opacity,f=s.opacity,d=c.opacity,h=void 0!==f,g=void 0!==d;t.each(function(t){var e,n=r.select(this),a=t.mo,o=void 0!==a;(o||h||g)&&(t.selected?h&&(e=f):e=g?d:p*(o?a:u)),void 0!==e&&n.style("opacity",e)});var y=s.color,m=c.color;(y||m)&&t.each(function(t){var e,n=r.select(this);t.selected?y&&(e=y):m&&(e=m),e&&l.fill(n,e)});var x=s.size,_=c.size,w=void 0!==x,k=void 0!==_;i.traceIs(e,"symbols")&&(w||k)&&t.each(function(t){var e,n=r.select(this),a=t.mrc,i=t.mx||o.symbol||0;e=t.selected?w?x/2:a:k?_/2:a,n.attr("d",b(v.symbolNumber(i),e)),t.mrc2=e})}},v.tryColorscale=function(t,e){var n=e?c.nestedProperty(t,e).get():t,r=n.colorscale,a=n.color;return r&&Array.isArray(a)?s.makeColorScaleFunc(s.extractScale(r,n.cmin,n.cmax)):c.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};function M(t,e,n,a){var o=r.select(t.node().parentNode),i=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(t)-1)*d+1,f=k[l]*s,p=.75*n+k[i]*s+(k[i]-1)*c*n/2;t.attr("text-anchor",l),o.attr("transform","translate("+f+","+p+")")}function T(t,e){var n=t.ts||e.textfont.size;return a(n)&&n>0?n:0}v.textPointStyle=function(t,e,n){t.each(function(t){var a=r.select(this),o=c.extractOption(t,e,"tx","text");if(o){var i=t.tp||e.textposition,l=T(t,e);a.call(v.font,t.tf||e.textfont.family,l,t.tc||e.textfont.color).text(o).call(u.convertToTspans,n).call(M,i,l,t.mrc)}else a.remove()})},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=e.selected||{},a=e.unselected||{};t.each(function(t){var o,i=r.select(this),s=t.tc||e.textfont.color,c=t.tp||e.textposition,u=T(t,e),f=(n.textfont||{}).color,d=(a.textfont||{}).color;t.selected?f&&(o=f):d?o=d:f||(o=l.addOpacity(s,p)),o&&l.fill(i,o),M(i,c,u,t.mrc2||t.mrc)})}};var A=.5;function L(t,e,n,a){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,A/2),u=Math.pow(l*l+s*s,A/2),f=(u*u*o-c*c*l)*a,d=(u*u*i-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[r.round(e[0]+(p&&f/p),2),r.round(e[1]+(p&&d/p),2)],[r.round(e[0]-(h&&f/h),2),r.round(e[1]-(h&&d/h),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var n,r="M"+t[0],a=[];for(n=1;n=1e4&&(v.savedBBoxes={},P=0),n&&(v.savedBBoxes[n]=y),P++,c.extendFlat({},y)},v.setClipUrl=function(t,e){if(e){var n="#"+e,a=r.select("base");a.size()&&a.attr("href")&&(n=window.location.href.split("#")[0]+n),t.attr("clip-path","url("+n+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,n){var r=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[r]("transform")||"";return e=e||0,n=n||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o=(o+=" translate("+e+", "+n+")").trim(),t[a]("transform",o),o},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,n){return[e,n].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,n){var r=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[r]("transform")||"";return e=e||1,n=n||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o=(o+=" scale("+e+", "+n+")").trim(),t[a]("transform",o),o},v.setPointGroupScale=function(t,e,n){var r,a,o;return n=n||1,a=1===(e=e||1)&&1===n?"":" scale("+e+","+n+")",o=/\s*sc.*/,t.each(function(){r=(this.getAttribute("transform")||"").replace(o,""),r=(r+=a).trim(),this.setAttribute("transform",r)}),a};var z=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,n){t.each(function(){var t,a=r.select(this),o=a.select("text");if(o.node()){var i=parseFloat(o.attr("x")||0),l=parseFloat(o.attr("y")||0),s=(a.attr("transform")||"").match(z);t=1===e&&1===n?[]:["translate("+i+","+l+")","scale("+e+","+n+")","translate("+-i+","+-l+")"],s&&t.push(s),a.attr("transform",t.join(" "))}})}},{"../../constants/alignment":148,"../../constants/interactions":149,"../../constants/xmlns_namespaces":152,"../../lib":169,"../../lib/svg_text_utils":190,"../../registry":262,"../../traces/scatter/make_bubble_size_func":347,"../../traces/scatter/subtypes":352,"../color":50,"../colorscale":65,"./symbol_defs":76,d3:13,"fast-isnumeric":16,tinycolor2:31}],76:[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);return"M-"+e+","+r.round(t/2,2)+"H"+e+"L0,-"+r.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+r.round(t/2,2)+"H"+e+"L0,"+r.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M"+r.round(t/2,2)+",-"+e+"V"+e+"L-"+r.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=r.round(2*t/Math.sqrt(3),2);return"M-"+r.round(t/2,2)+",-"+e+"V"+e+"L"+r.round(t,2)+",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(-.309*t,2);return"M"+e+","+o+"L"+n+","+r.round(.809*t,2)+"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(-.309*e,2),c=r.round(.118*e,2),u=r.round(.809*e,2);return"M"+n+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+r.round(.382*e,2)+"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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!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,noFill:!0}}},{d3:13}],77:[function(t,e,n){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],78:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../registry"),o=t("../../plots/cartesian/axes"),i=t("./compute_error");function l(t,e,n,a){var l=e["error_"+a]||{},s=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var c=i(l),u=0;u0;t.each(function(t){var u,f=t[0].trace,d=f.error_x||{},p=f.error_y||{};f.ids&&(u=function(t){return t.id});var h=i.hasMarkers(f)&&f.marker.maxdisplayed>0;p.visible||d.visible||(t=[]);var g=r.select(this).selectAll("g.errorbar").data(t,u);if(g.exit().remove(),t.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(n.duration).style("opacity",1),o.setClipUrl(g,e.layerClipId),g.each(function(t){var e=r.select(this),o=function(t,e,n){var r={x:e.c2p(t.x),y:n.c2p(t.y)};void 0!==t.yh&&(r.yh=n.c2p(t.yh),r.ys=n.c2p(t.ys),a(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),a(r.xs)||(r.noXS=!0,r.xs=e.c2p(t.xs,!0)));return r}(t,l,s);if(!h||t.vis){var i;if(p.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var u=p.width;i="M"+(o.x-u)+","+o.yh+"h"+2*u+"m-"+u+",0V"+o.ys,o.noYS||(i+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(n.duration).ease(n.easing)),f.attr("d",i)}if(d.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(d.copy_ystyle?p:d).width;i="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(i+="m0,-"+g+"v"+2*g);var v=e.select("path.xerror");!v.size()?v=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(v=v.transition().duration(n.duration).ease(n.easing)),v.attr("d",i)}}})}})}},{"../../traces/scatter/subtypes":352,"../drawing":75,d3:13,"fast-isnumeric":16}],83:[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":50,d3:13}],84:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:r({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":240}],85:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../registry");function o(t,e,n,a){a=a||r.identity,Array.isArray(t)&&(e[0][n]=a(t))}e.exports=function(t){var e=t.calcdata,n=t._fullLayout;function i(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},n)}}for(var l=0;l=0&&n.index-1&&i.length>m&&(i=m>3?i.substr(0,m-3)+"...":i.substr(0,m))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),l+=(l?"z: ":"")+t.zLabel):D&&t[c+"Label"]===L?l=t[("x"===c?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),""===l&&(""===i&&e.remove(),l=i);var _=e.select("text.nums").call(u.font,t.fontFamily||x,t.fontSize||b,t.fontColor||v).text(l).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,n),M=e.select("text.name"),T=0;i&&i!==l?(M.call(u.font,t.fontFamily||x,t.fontSize||b,g).text(i).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,n),T=M.node().getBoundingClientRect().width+2*k):(M.remove(),e.select("rect").remove()),e.select("path").style({fill:g,stroke:v});var A,C,S=_.node().getBoundingClientRect(),E=t.xa._offset+(t.x0+t.x1)/2,N=t.ya._offset+(t.y0+t.y1)/2,R=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),F=S.width+w+k+T;t.ty0=P-S.top,t.bx=S.width+2*k,t.by=S.height+2*k,t.anchor="start",t.txwidth=S.width,t.tx2width=T,t.offset=0,o&&"closest"===c&&a&&a.offsetX&&a.offsetY&&(E=a.offsetX,N=a.offsetY),d?(t.pos=E,A=N+I/2+F<=z,C=N-I/2-F>=0,"top"!==t.idealAlign&&A||!C?A?(N+=I/2,t.anchor="start"):t.anchor="middle":(N-=I/2,t.anchor="end")):(t.pos=N,A=E+R/2+F<=O,C=E-R/2-F>=0,"left"!==t.idealAlign&&A||!C?A?(E+=R/2,t.anchor="start"):t.anchor="middle":(E-=R/2,t.anchor="end")),_.attr("text-anchor",t.anchor),T&&M.attr("text-anchor",t.anchor),e.attr("transform","translate("+E+","+N+")"+(d?"rotate("+y+")":""))}),R}function T(t,e){t.each(function(t){var n=r.select(this);if(t.del)n.remove();else{var a="end"===t.anchor?-1:1,o=n.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],l=i*(w+k),c=l+i*(t.txwidth+k),f=0,d=t.offset;"middle"===t.anchor&&(l-=t.tx2width/2,c-=t.tx2width/2),e&&(d*=-_,f=t.offset*b),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"+(a*w+f)+","+(w+d)+"v"+(t.by/2-w)+"h"+a*t.bx+"v-"+t.by+"H"+(a*w+f)+"V"+(d-w)+"Z"),o.call(s.positionText,l+f,d+t.ty0-t.by/2+k),t.tx2width&&(n.select("text.name").call(s.positionText,c+i*k+f,d+t.ty0-t.by/2+k),n.select("rect").call(u.setRect,c+(i-1)*t.tx2width/2+f,d-t.by/2-1,t.tx2width,t.by+2))}})}function A(t,e,n){var r=t.index,a=t.trace||{},o=t.cd[0],l=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return i.castOption(o,r,t)||i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(l,a,t,e)};function c(e,n,r){var a=s(n,r);a&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("color","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal,null,n),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal,null,n),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+f,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function L(t,e){var n,r,a=e.container,i=e.fullLayout,l=e.event,s=!!t.hLinePoint,c=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),c||s){var d=f.combine(i.plot_bgcolor,i.paper_bgcolor);if(s){var p,h,g=t.hLinePoint;n=g&&g.xa,"cursor"===(r=g&&g.ya).spikesnap?(p=l.pointerX,h=l.pointerY):(p=n._offset+(g.x0+g.x1)/2,h=r._offset+(g.y0+g.y1)/2);var v,y,m=o.readability(g.color,d)<1.5?f.contrast(d):g.color,x=r.spikemode,b=r.spikethickness,_=r.spikecolor||m,w=r._boundingBox,k=(w.left+w.right)/2tt.width||$<0||$>tt.height)return d.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(D="xval"in e?g.flat(s,e.xval):g.p2c(_,Q),E="yval"in e?g.flat(s,e.yval):g.p2c(w,$),!a(D[0])||!a(E[0]))return i.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var et=1/0;for(R=0;RG&&(Z.splice(0,G),et=Z[0].distance),u._has("cartesian")&&0!==X&&0===Z.length){U.distance=X,U.index=!1;var it=F._module.hoverPoints(U,H,V,"closest",u._hoverlayer);if(it){var lt,st=it.filter(function(t){return t.xa.showspikes});if(st.length){var ct=st[0];a(ct.x0)&&a(ct.y0)&&(lt=pt(ct),(!J.vLinePoint||J.vLinePoint.distance>lt.distance)&&(J.vLinePoint=lt))}var ut=it.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];a(ft.x0)&&a(ft.y0)&&(lt=pt(ft),(!J.hLinePoint||J.hLinePoint.distance>lt.distance)&&(J.hLinePoint=lt))}}}}function dt(t,e){if(!t.length)return null;var n=t.map(function(t,e){var n=t.xa,r=t.ya,a=n.c2p(H),o=r.c2p(V),i=function(t){var e=t.kink,n=(t.x1+t.x0)/2-a,r=(t.y1+t.y0)/2-o;return Math.max(Math.sqrt(n*n+r*r)-e,1-3/e)}(t);return{distance:i,index:e}});return n=n.filter(function(t){return t.distance<=e}).sort(function(t,e){return t.distance-e.distance}),n.length?t[n[0].index]:null}function pt(t){return t?{xa:t.xa,ya:t.ya,x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1,distance:t.distance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var ht={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:e},gt=t._spikepoints,vt={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(t._spikepoints=vt,u._has("cartesian")&&0!==X&&0!==Z.length){var yt=Z.filter(function(t){return t.ya.showspikes}),mt=dt(yt,X);J.hLinePoint=pt(mt);var xt=Z.filter(function(t){return t.xa.showspikes}),bt=dt(xt,X);J.vLinePoint=pt(bt)}if(0===Z.length){var _t=d.unhoverRaw(t,e);return!u._has("cartesian")||null===J.hLinePoint&&null===J.vLinePoint||C(gt)&&L(J,ht),_t}u._has("cartesian")&&C(gt)&&L(J,ht);Z.sort(function(t,e){return t.distance-e.distance});var wt=t._hoverdata,kt=[];for(N=0;N1,At=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Lt={hovermode:z,rotateLabels:Tt,bgColor:At,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Ct=M(Z,Lt,t,e,t.layout.hoverFollowsMouse);if(function(t,e,n){var r,a,o,i,l,s,c,u=0,f=t.map(function(t,r){var a=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===a._id.charAt(0)?x:1)/2,pmin:0,pmax:"x"===a._id.charAt(0)?n.width:n.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function d(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(!(o<.01)){if(a<-.01){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&&!(c<=0);i--)(s=t[i]).pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)(s=t[i]).pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(;!r&&u<=t.length;){for(u++,r=!0,i=0;i.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(p.push.apply(p,h),f.splice(i+1,1),c=0,l=p.length-1;l>=0;l--)c+=p[l].dp;for(o=c/p.length,l=p.length-1;l>=0;l--)p[l].dp-=o;r=!1}else i++}f.forEach(d)}for(i=f.length-1;i>=0;i--){var y=f[i];for(l=y.length-1;l>=0;l--){var m=y[l],b=t[m.i];b.offset=m.dp,b.del=m.del}}}(Z,Tt?"xa":"ya",u),T(Ct,Tt),e.target&&e.target.tagName){var St=h.getComponentMethod("annotations","hasClickToShow")(t,kt);c(r.select(e.target),St?"pointer":"")}if(!e.target||o||!function(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}(t,e,wt))return;wt&&t.emit("plotly_unhover",{event:e,points:wt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:D,yvals:E})}(t,e,n,o)})},n.loneHover=function(t,e){var n={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},a=r.select(e.container),o=e.outerContainer?r.select(e.outerContainer):a,i={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o,hoverdistance:v.MAXDIST},l=M([n],i,e.gd);return T(l,i.rotateLabels),l.node()}},{"../../lib":169,"../../lib/events":160,"../../lib/override_cursor":180,"../../lib/svg_text_utils":190,"../../plots/cartesian/axes":213,"../../registry":262,"../color":50,"../dragelement":72,"../drawing":75,"./constants":87,"./helpers":89,d3:13,"fast-isnumeric":16,tinycolor2:31}],91:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e,n,a){n("hoverlabel.bgcolor",(a=a||{}).bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),r.coerceFont(n,"hoverlabel.font",a.font)}},{"../../lib":169}],92:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../dragelement"),i=t("./helpers"),l=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:l},attributes:t("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:i.getDistanceFunction,getClosest:i.getClosest,inbox:i.inbox,quadrature:i.quadrature,appendArrayPointValue:i.appendArrayPointValue,castHoverOption:function(t,e,n){return a.castOption(t,e,"hoverlabel."+n)},castHoverinfo:function(t,e,n){return a.castOption(t,n,"hoverinfo",function(n){return a.coerceHoverinfo({hoverinfo:n},{_module:t._module},e)})},hover:t("./hover").hover,unhover:o.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:r.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":169,"../dragelement":72,"./attributes":84,"./calc":85,"./click":86,"./constants":87,"./defaults":88,"./helpers":89,"./hover":90,"./layout_attributes":93,"./layout_defaults":94,"./layout_global_defaults":95,d3:13}],93:[function(t,e,n){"use strict";var r=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=r.HOVERFONT,a.size.dflt=r.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":240,"./constants":87}],94:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n){function o(n,o){return r.coerce(t,e,a,n,o)}var i;o("dragmode"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,n=0;n=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}},{}],102:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped","natural","normal"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":240,"../color/attributes":49}],103:[function(t,e,n){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],104:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,n){for(var s,c,u,f,d=t.legend||{},p=e.legend={},h=0,g="normal",v=0;v1)){if(m("bgcolor",e.paper_bgcolor),m("bordercolor"),m("borderwidth"),a.coerceFont(m,"font",e.font),m("orientation"),"h"===p.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")}m("traceorder",g),l.isGrouped(e.legend)&&m("tracegroupgap"),m("x",s),m("xanchor",u),m("y",c),m("yanchor",f),a.noneOrAll(d,p,["x","y"])}}},{"../../lib":169,"../../plots/layout_attributes":252,"../../registry":262,"./attributes":102,"./helpers":108}],105:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../lib"),i=t("../../plots/plots"),l=t("../../registry"),s=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),p=t("./constants"),h=t("../../constants/interactions"),g=t("../../constants/alignment").LINE_SPACING,v=t("./get_legend_data"),y=t("./style"),m=t("./helpers"),x=t("./anchor_utils"),b=h.DBLCLICKDELAY;function _(t,e){var n=t.data()[0][0],r=e._fullLayout,i=n.trace,s=l.traceIs(i,"pie"),u=i.index,d=s?n.label:i.name,p=d,h=t.selectAll("text.legendtext").data([0]),v=h.enter();function y(n){f.convertToTspans(n,e,function(){!function(t,e){var n=t.data()[0][0];if(!n.trace.showlegend)return void t.remove();var r,a,o=t.select("g[class*=math-group]"),i=o.node(),l=e._fullLayout.legend.font.size*g;if(i){var s=c.bBox(i);r=s.height,a=s.width,c.setTranslate(o,0,r/4)}else{var u=t.select(".legendtext"),d=f.lineCount(u),p=u.node();r=l*d,a=p?c.bBox(p).width:0;var h=l*(.3+(1-d)/2);f.positionText(u,40,h)}r=Math.max(r,16)+3,n.height=r,n.width=a}(t,e)},!0)}v.append("title").text(d),v.append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.legend.font).text(p),e._context.edits.legendText&&!s?h.call(f.makeEditable,{gd:e}).call(y).on("edit",function(t){this.text(t).call(y);var r,i=t;this.text()||(t=" ");var s=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(s.type))c[(r=n.trace.transforms)[r.length-1].direction+".name"]=t;else if(l.hasTransform(s,"groupby")){var f=l.getTransformIndices(s,"groupby"),d=f[f.length-1],p=o.keyedContainer(s,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),c=p.constructUpdate()}else c.name=t;return a.restyle(e,c,u)}):h.call(y)}function w(t,e){var n,r=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){(n=(new Date).getTime())-e._legendMouseDownTimeb&&(r=Math.max(r-1,1)),1===r?n._clickTimeout=setTimeout(function(){d(t,e,r)},b):2===r&&(n._clickTimeout&&clearTimeout(n._clickTimeout),e._legendMouseDownTime=0,d(t,e,r))}})}function k(t,e,n){var a=t._fullLayout,o=a.legend,i=o.borderwidth,l=m.isGrouped(o),s=0;if(o.width=0,o.height=0,m.isVertical(o))l&&e.each(function(t,e){c.setTranslate(this,0,e*o.tracegroupgap)}),n.each(function(t){var e=t[0],n=e.height,r=e.width;c.setTranslate(this,i,5+i+o.height+n/2),o.height+=n,o.width=Math.max(o.width,r)}),o.width+=45+2*i,o.height+=10+2*i,l&&(o.height+=(o._lgroupsLength-1)*o.tracegroupgap),s=40;else if(l){for(var u=[o.width],f=e.data(),d=0,p=f.length;di+w-k,n.each(function(t){var e=t[0],n=v?40+t[0].width:b;i+_+k+n>a.width-(a.margin.r+a.margin.l)&&(_=0,y+=x,o.height=o.height+x,x=0),c.setTranslate(this,i+_,5+i+e.height/2+y),o.width+=k+n,o.height=Math.max(o.height,e.height),_+=k+n,x=Math.max(e.height,x)}),o.width+=2*i,o.height+=10+2*i}o.width=Math.ceil(o.width),o.height=Math.ceil(o.height),n.each(function(e){var n=e[0];r.select(this).select(".legendtoggle").call(c.setRect,0,-n.height/2,(t._context.edits.legendText?0:o.width)+s,n.height)})}function M(t){var e=t._fullLayout.legend,n="left";x.isRightAnchor(e)?n="right":x.isCenterAnchor(e)&&(n="center");var r="top";x.isBottomAnchor(e)?r="bottom":x.isMiddleAnchor(e)&&(r="middle"),i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:e.height*({top:1,middle:.5}[r]||0),t:e.height*({bottom:1,middle:.5}[r]||0)})}e.exports=function(t){var e=t._fullLayout,n="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var f=e.legend,h=e.showlegend&&v(t.calcdata,f),g=e.hiddenlabels||[];if(!e.showlegend||!h.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+n).remove(),void i.autoMargin(t,"legend");var m=e._infolayer.selectAll("g.legend").data([0]);m.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=e._topdefs.selectAll("#"+n).data([0]);T.enter().append("clipPath").attr("id",n).append("rect");var A=m.selectAll("rect.bg").data([0]);A.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),A.call(u.stroke,f.bordercolor),A.call(u.fill,f.bgcolor),A.style("stroke-width",f.borderwidth+"px");var L=m.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=m.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:2,ry:2,width:0,height:0}).call(u.fill,"#808BA4");var S=L.selectAll("g.groups").data(h);S.enter().append("g").attr("class","groups"),S.exit().remove();var P=S.selectAll("g.traces").data(o.identity);P.enter().append("g").attr("class","traces"),P.exit().remove(),P.call(y,t).style("opacity",function(t){var e=t[0].trace;return l.traceIs(e,"pie")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){r.select(this).call(_,t).call(w,t)});var O=0!==m.enter().size();O&&(k(t,S,P),M(t));var z=e.width,D=e.height;if(k(t,S,P),"v"===f.orientation&&f.width>150&&(f.width=150),"v"===f.orientation&&e._hasPie&&1===t.data.length&&(f.width=Math.max(.37*e.width,70)),"v"===f.orientation&&f.width>.45*e.width&&!e._hasPie||"v"===f.orientation&&f.width>.5*e.width&&e._hasPie||"h"===f.orientation&&f.height>.38*e.height||"left"!==f.xanchor&&"right"!==f.xanchor&&"v"===f.orientation&&f.height>.4*e.height)return e._infolayer.selectAll(".legend").remove(),void e._topdefs.select("#"+n).remove();f.height>D?function(t){var e=t._fullLayout.legend,n="left";x.isRightAnchor(e)?n="right":x.isCenterAnchor(e)&&(n="center");i.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[n]||0),r:e.width*({left:1,center:.5}[n]||0),b:0,t:0})}(t):M(t);var E=e._size,N=E.l+E.w*f.x,R=E.t+E.h*(1-f.y);x.isRightAnchor(f)?N-=f.width:x.isCenterAnchor(f)&&(N-=f.width/2),x.isBottomAnchor(f)?R-=f.height:x.isMiddleAnchor(f)&&(R-=f.height/2);var I=f.width;E.w;N+I>z&&(N=z-I),N<0&&(N=0),I=Math.min(z-N,f.width);var F=f.height,j=E.h;F>j?(R=E.t,F=j):(R+F>D&&(R=D-F),R<0&&(R=0),F=Math.min(D-R,f.height)),c.setTranslate(m,N,R);var B,q,H,V,U,G,Y=F-p.scrollBarHeight-2*p.scrollBarMargin,X=f.height-F;if(f.height<=F||t._context.staticPlot)A.attr({width:I-f.borderwidth,height:F-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),c.setTranslate(L,0,0),T.select("rect").attr({width:I-2*f.borderwidth,height:F-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth}),L.call(c.setClipUrl,n);else{B=p.scrollBarMargin,q=L.attr("data-scroll")||0,A.attr({width:I-2*f.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:F-f.borderwidth,x:f.borderwidth/2,y:f.borderwidth/2}),T.select("rect").attr({width:I-2*f.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:F-2*f.borderwidth,x:f.borderwidth,y:f.borderwidth-q}),L.call(c.setClipUrl,n),O&&W(B,q),m.on("wheel",null),m.on("wheel",function(){q=o.constrain(L.attr("data-scroll")-r.event.deltaY/Y*X,-X,0),W(B=p.scrollBarMargin-q/X*Y,q),0!==q&&q!==-X&&r.event.preventDefault()}),C.on("drag",null),L.on("drag",null);var Z=r.behavior.drag().on("drag",function(t){B=o.constrain(r.event.y-p.scrollBarHeight/2,p.scrollBarMargin,p.scrollBarMargin+Y),q=-(B-p.scrollBarMargin)/Y*X});C.call(Z),L.call(Z)}if(t._context.edits.legendPosition)m.classed("cursor-move",!0),s.init({element:m.node(),gd:t,prepFn:function(){var t=c.getTranslate(m);U=t.x,G=t.y},moveFn:function(t,e){var n=U+t,r=G+e;c.setTranslate(m,n,r),H=s.align(n,0,E.l,E.l+E.w,f.xanchor),V=s.align(r,0,E.t+E.h,E.t,f.yanchor)},doneFn:function(){void 0!==H&&void 0!==V&&a.relayout(t,{"legend.x":H,"legend.y":V})},clickFn:function(n,r){var a=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom});a.size()>0&&(1===n?m._clickTimeout=setTimeout(function(){d(a,t,n)},b):2===n&&(m._clickTimeout&&clearTimeout(m._clickTimeout),d(a,t,n)))}})}function W(t,e){L.attr("data-scroll",e).call(c.setTranslate,0,e),C.call(c.setRect,I,t,p.scrollBarWidth,p.scrollBarHeight),T.select("rect").attr({y:f.borderwidth-e})}}},{"../../constants/alignment":148,"../../constants/interactions":149,"../../lib":169,"../../lib/svg_text_utils":190,"../../plotly":208,"../../plots/plots":254,"../../registry":262,"../color":50,"../dragelement":72,"../drawing":75,"./anchor_utils":101,"./constants":103,"./get_legend_data":106,"./handle_click":107,"./helpers":108,"./style":110,d3:13}],106:[function(t,e,n){"use strict";var r=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var n,o,i={},l=[],s=!1,c={},u=0;function f(t,n){if(""!==t&&a.isGrouped(e))-1===l.indexOf(t)?(l.push(t),s=!0,i[t]=[[n]]):i[t].push([n]);else{var r="~~i"+u;l.push(r),i[r]=[[n]],u++}}for(n=0;nt[0]&&t[0].label?t[0].label.localeCompare(e[0].label,void 0,{numeric:!0}):t[0]&&t[0].trace&&t[0].trace.name?t[0].trace.name.localeCompare(e[0].trace.name,void 0,{numeric:!0}):void 0),m}},{"../../registry":262,"./helpers":108}],107:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("../../lib"),o=t("../../registry"),i=!0;e.exports=function(t,e,n){if(!e._dragged&&!e._editing){var l,s,c,u,f,d=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],p=t.data()[0][0],h=e._fullData,g=p.trace,v=g.legendgroup,y={},m=[],x=[],b=[];if(1===n&&i&&e.data&&e._context.showTips?(a.notifier(a._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,o.traceIs(g,"pie")){var _=p.label,w=d.indexOf(_);1===n?-1===w?d.push(_):d.splice(w,1):2===n&&(d=[],e.calcdata[0].forEach(function(t){_!==t.label&&d.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===d.length&&-1===w&&(d=[])),r.relayout(e,"hiddenlabels",d)}else{var k,M=v&&v.length,T=[],A=-1;if(M)for(l=0;ln[1])return n[1]}return a}function h(t){return t[0]}if(u||f||d){var g={},v={};u&&(g.mc=p("marker.color",h),g.mo=p("marker.opacity",o.mean,[.2,1]),g.ms=p("marker.size",o.mean,[2,16]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",o.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(v.line={width:p("line.width",h,[0,10])}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),n=[o.minExtend(l,g)],a=o.minExtend(c,v)}var y=r.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(u?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(i.pointStyle,a,e),u&&(n[0].mrc=3);var x=y.selectAll("g.pointtext").data(f?n:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(i.textPointStyle,a,e)})}},{"../../lib":169,"../../registry":262,"../../traces/pie/style_one":328,"../../traces/scatter/subtypes":352,"../color":50,"../drawing":75,d3:13}],111:[function(t,e,n){"use strict";var r=t("../../plotly"),a=t("../../plots/plots"),o=t("../../plots/cartesian/axis_ids"),i=t("../../lib"),l=t("../../snapshot/download"),s=t("../../../build/ploticon"),c=i._,u=e.exports={};function f(t,e){var n,a,i=e.currentTarget,l=i.getAttribute("data-attr"),s=i.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=o.list(t,null,!0),d="on";if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1)return x(["resetViews","toggleHover"]),s(m,n);f&&(x(["zoom3d","pan3d","orbitRotation","tableRotation"]),x(["resetCameraDefault3d","resetCameraLastSave3d"]),x(["hoverClosest3d"]));var b=function(t){for(var e=r.list({_fullLayout:t},null,!0),n=0;n0)){var h=function(t,e,n){for(var r=n.filter(function(n){return e[n].anchor===t._id}),a=0,o=0;op&&(p=f)));return p>=d?[d,p]:void 0}}e.exports=function(t){var e=t._fullLayout,n=r.filterVisible(e.shapes);if(n.length&&t._fullData.length)for(var i=0;ic&&(t="X"),t});return a>c&&(u=u.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),o+u})}(e.path,o,c);var h=o(e.x0),g=o(e.x1),v=c(e.y0),y=c(e.y1);if("line"===u)return"M"+h+","+v+"L"+g+","+y;if("rect"===u)return"M"+h+","+v+"H"+g+"V"+y+"H"+h+"Z";var m=(h+g)/2,x=(v+y)/2,b=Math.abs(m-h),_=Math.abs(x-v),w="A"+b+","+_,k=m+b+","+x;return"M"+k+w+" 0 1,1 "+(m+","+(x-_))+w+" 0 0,1 "+k+"Z"}e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var n=0;n0)&&(a("active"),a("x"),a("y"),r.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("len"),a("lenmode"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),r.coerceFont(a,"font",n.font),a("currentvalue.visible")&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),r.coerceFont(a,"currentvalue.font",e.font)),a("transition.duration"),a("transition.easing"),a("bgcolor"),a("activebgcolor"),a("bordercolor"),a("borderwidth"),a("ticklen"),a("tickwidth"),a("tickcolor"),a("minorticklen"))}e.exports=function(t,e){a(t,e,{name:i,handleItemDefaults:s})}},{"../../lib":169,"../../plots/array_container_defaults":210,"./attributes":136,"./constants":137}],139:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plots/plots"),o=t("../color"),i=t("../drawing"),l=t("../../lib/svg_text_utils"),s=t("../legend/anchor_utils"),c=t("./constants"),u=t("../../constants/alignment").LINE_SPACING;function f(t){return t._index}function d(t,e){var n=i.tester.selectAll("g."+c.labelGroupClass).data(e.steps);n.enter().append("g").classed(c.labelGroupClass,!0);var o=0,u=0;n.each(function(t){var n=g(r.select(this),{step:t},e).node();if(n){var a=i.bBox(n);u=Math.max(u,a.height),o=Math.max(o,a.width)}}),n.remove(),e.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var f=t._fullLayout._size;e.lx=f.l+f.w*e.x,e.ly=f.t+f.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(f.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*c.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var d=(e.inputAreaLength-2*c.stepInset)/(e.steps.length-1),h=o+c.labelPadding;if(e.labelStride=Math.max(1,Math.ceil(h/d)),e.labelHeight=u,e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentValueMaxLines=1,e.currentvalue.visible){var v=i.tester.append("g");n.each(function(t){var n=p(v,e,t.label),r=n.node()&&i.bBox(n.node())||{width:0,height:0},a=l.lineCount(n);e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(r.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(r.height)),e.currentValueMaxLines=Math.max(e.currentValueMaxLines,a)}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,v.remove()}e.height=e.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var y="left";s.isRightAnchor(e)&&(e.lx-=e.outerLength,y="right"),s.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,y="center");var m="top";s.isBottomAnchor(e)&&(e.ly-=e.height,m="bottom"),s.isMiddleAnchor(e)&&(e.ly-=e.height/2,m="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),a.autoMargin(t,c.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[y]||0),r:e.outerLength*({left:1,center:.5}[y]||0),b:e.height*({top:1,middle:.5}[m]||0),t:e.height*({bottom:1,middle:.5}[m]||0)})}function p(t,e,n){if(e.currentvalue.visible){var r,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":r=e.inputAreaLength-c.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":r=.5*e.inputAreaLength,a="middle";break;default:r=c.currentValueInset,a="left"}o.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var s=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof n)s+=n;else s+=e.steps[e.active].label;e.currentvalue.suffix&&(s+=e.currentvalue.suffix),o.call(i.font,e.currentvalue.font).text(s).call(l.convertToTspans,e.gd);var f=l.lineCount(o),d=(e.currentValueMaxLines+1-f)*e.currentvalue.font.size*u;return l.positionText(o,r,d),o}}function h(t,e,n){var r=t.selectAll("rect."+c.gripRectClass).data([0]);r.enter().append("rect").classed(c.gripRectClass,!0).call(x,e,t,n).style("pointer-events","all"),r.attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(o.stroke,n.bordercolor).call(o.fill,n.bgcolor).style("stroke-width",n.borderwidth+"px")}function g(t,e,n){var r=t.selectAll("text").data([0]);return r.enter().append("text").classed(c.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),r.call(i.font,n.font).text(e.step.label).call(l.convertToTspans,n.gd),r}function v(t,e){var n=t.selectAll("g."+c.labelsClass).data([0]);n.enter().append("g").classed(c.labelsClass,!0);var a=n.selectAll("g."+c.labelGroupClass).data(e.labelSteps);a.enter().append("g").classed(c.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var n=r.select(this);n.call(g,t,e),i.setTranslate(n,w(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*u+c.labelOffset+e.currentValueTotalHeight)})}function y(t,e,n,r,a){var o=Math.round(r*(n.steps.length-1));o!==n.active&&m(t,e,n,o,!0,a)}function m(t,e,n,r,o,i){var l=n.active;n._input.active=n.active=r;var s=n.steps[n.active];e.call(_,n,n.active/(n.steps.length-1),i),e.call(p,n),t.emit("plotly_sliderchange",{slider:n,step:n.steps[n.active],interaction:o,previousActive:l}),s&&s.method&&o&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=o,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:o,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var n=e._nextMethod.step;n.method&&(n.execute&&a.executeAPICommand(t,n.method,n.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function x(t,e,n){var a=n.node(),i=r.select(e);function l(){return n.data()[0]}t.on("mousedown",function(){var t=l();e.emit("plotly_sliderstart",{slider:t});var s=n.select("."+c.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),s.call(o.fill,t.activebgcolor);var u=k(t,r.mouse(a)[0]);y(e,n,t,u,!0),t._dragging=!0,i.on("mousemove",function(){var t=l(),o=k(t,r.mouse(a)[0]);y(e,n,t,o,!1)}),i.on("mouseup",function(){var t=l();t._dragging=!1,s.call(o.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function b(t,e){var n=t.selectAll("rect."+c.tickRectClass).data(e.steps);n.enter().append("rect").classed(c.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each(function(t,n){var a=n%e.labelStride==0,l=r.select(this);l.attr({height:a?e.ticklen:e.minorticklen}).call(o.fill,e.tickcolor),i.setTranslate(l,w(e,n/(e.steps.length-1))-.5*e.tickwidth,(a?c.tickOffset:c.minorTickOffset)+e.currentValueTotalHeight)})}function _(t,e,n,r){var a=t.select("rect."+c.gripRectClass),o=w(e,n);if(!e._invokingCommand){var i=a;r&&e.transition.duration>0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*c.gripWidth)+","+e.currentValueTotalHeight+")")}}function w(t,e){return t.inputAreaStart+c.stepInset+(t.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function k(t,e){return Math.min(1,Math.max(0,(e-c.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*c.stepInset-2*t.inputAreaStart)))}function M(t,e,n){var r=t.selectAll("rect."+c.railTouchRectClass).data([0]);r.enter().append("rect").classed(c.railTouchRectClass,!0).call(x,e,t,n).style("pointer-events","all"),r.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+n.ticklen+n.labelHeight)}).call(o.fill,n.bgcolor).attr("opacity",0),i.setTranslate(r,0,n.currentValueTotalHeight)}function T(t,e){var n=t.selectAll("rect."+c.railRectClass).data([0]);n.enter().append("rect").classed(c.railRectClass,!0);var r=e.inputAreaLength-2*c.railInset;n.attr({width:r,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(o.stroke,e.bordercolor).call(o.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),i.setTranslate(n,c.railInset,.5*(e.inputAreaWidth-c.railWidth)+e.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,n=function(t,e){for(var n=t[c.name],r=[],a=0;a0?[0]:[]);if(o.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),o.exit().remove(),o.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;r=n.steps.length&&(n.active=0);e.call(p,n).call(T,n).call(v,n).call(b,n).call(M,t,n).call(h,t,n),i.setTranslate(e,n.lx+n.pad.l,n.ly+n.pad.t),e.call(_,n,n.active/(n.steps.length-1),!1),e.call(p,n)}(t,r.select(this),e)}})}}},{"../../constants/alignment":148,"../../lib/svg_text_utils":190,"../../plots/plots":254,"../color":50,"../drawing":75,"../legend/anchor_utils":101,"./constants":137,d3:13}],140:[function(t,e,n){"use strict";var r=t("./constants");e.exports={moduleType:"component",name:r.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":136,"./constants":137,"./defaults":138,"./draw":139}],141:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),d=e.exports={},p=/ [XY][0-9]* /;d.draw=function(t,e,n){var d,h=n.propContainer,g=n.propName,v=n.placeholder,y=n.traceIndex,m=n.avoid||{},x=n.attributes,b=n.transform,_=n.containerGroup,w=t._fullLayout,k=h.titlefont||{},M=k.family,T=k.size,A=k.color,L=1,C=!1,S=(h.title||"").trim();"title"===g?d="titleText":-1!==g.indexOf("axis")?d="axisTitleText":g.indexOf(!0)&&(d="colorbarTitleText");var P=t._context.edits[d];h===w?P=t._context.editableMainTitle:h===w.xaxis?P=t._context.editableAxisXTitle:h===w.yaxis?P=t._context.editableAxisYTitle:h===w.yaxis2?P=t._context.editableAxisY2Title:h===w.xaxis2&&(P=t._context.editableAxisX2Title),""===S?L=0:S.replace(p," % ")===v.replace(p," % ")&&(L=.2,C=!0,P||(S=""));var O=S||P;_||(_=w._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var z=_.selectAll("text").data(O?[0]:[]);if(z.enter().append("text"),z.text(S).attr("class",e),z.exit().remove(),!O)return _;function D(t){l.syncOrAsync([E,N],t)}function E(e){var n;return b?(n="",b.rotate&&(n+="rotate("+[b.rotate,x.x,x.y]+")"),b.offset&&(n+="translate(0, "+b.offset+")")):n=null,e.attr("transform",n),e.style({"font-family":M,"font-size":r.round(T,2)+"px",fill:c.rgb(A),opacity:L*c.opacity(A),"font-weight":i.fontWeight}).attr(x).call(u.convertToTspans,t),i.previousPromises(t)}function N(t){var e=r.select(t.node().parentNode);if(m&&m.selection&&m.side&&S){e.attr("transform",null);var n=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[m.side],i=-1!==["left","top"].indexOf(m.side)?-1:1,c=a(m.pad)?m.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},d=m.maxShift||(f[m.side]-u[m.side])*("left"===m.side||"top"===m.side?-1:1);if(d<0)n=d;else{var p=m.offsetLeft||0,h=m.offsetTop||0;u.left-=p,u.right-=p,u.top-=h,u.bottom-=h,m.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(n=Math.max(n,i*(t[m.side]-u[o])+c))}),n=Math.min(d,n)}if(n>0||d<0){var g={left:[-n,0],right:[n,0],top:[0,-n],bottom:[0,n]}[m.side];e.attr("transform","translate("+g+")")}}}return z.call(D),P&&(S?z.on(".opacity",null):(L=0,C=!0,z.text(v).on("mouseover.opacity",function(){r.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?o.restyle(t,g,e,y):o.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(D)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)})),z.classed("js-placeholder",C),h._titleElement=z,_}},{"../../constants/interactions":149,"../../lib":169,"../../lib/svg_text_utils":190,"../../plotly":208,"../../plots/plots":254,"../color":50,"../drawing":75,d3:13,"fast-isnumeric":16}],142:[function(t,e,n){"use strict";var r=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes");e.exports=i({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:o({},l,{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":161,"../../plot_api/edit_types":197,"../../plots/font_attributes":240,"../../plots/pad_attributes":253,"../color/attributes":49}],143:[function(t,e,n){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],144:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),i=t("./constants").name,l=o.buttons;function s(t,e,n){function a(n,a){return r.coerce(t,e,o,n,a)}var i=function(t,e){var n,a,o=t.buttons||[],i=e.buttons=[];function s(t,e){return r.coerce(n,a,l,t,e)}for(var c=0;c0)&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),r.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),r.coerceFont(a,"font",n.font),a("bgcolor",n.paper_bgcolor),a("bordercolor"),a("borderwidth"))}e.exports=function(t,e){a(t,e,{name:i,handleItemDefaults:s})}},{"../../lib":169,"../../plots/array_container_defaults":210,"./attributes":142,"./constants":143}],145:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plots/plots"),o=t("../color"),i=t("../drawing"),l=t("../../lib/svg_text_utils"),s=t("../legend/anchor_utils"),c=t("../../constants/alignment").LINE_SPACING,u=t("./constants"),f=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function h(t,e,n,r,a,o,i,l){e._input.active=e.active=i,"buttons"===e.type?v(t,r,null,null,e):"dropdown"===e.type&&(a.attr(u.menuIndexAttrName,"-1"),g(t,r,a,o,e),l||v(t,r,a,o,e))}function g(t,e,n,r,a){var o=e.selectAll("g."+u.headerClassName).data([0]);o.enter().append("g").classed(u.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||u.blankHeaderOpts,c={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};o.call(y,a,s,t).call(M,a,c,f);var d=e.selectAll("text."+u.headerArrowClassName).data([0]);d.enter().append("text").classed(u.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(i.font,a.font).text(u.arrowSymbol[a.direction]),d.attr({x:a.headerWidth-u.arrowOffsetX+a.pad.l,y:a.headerHeight/2+u.textOffsetY+a.pad.t}),o.on("click",function(){n.call(T),n.attr(u.menuIndexAttrName,p(n,a)?-1:String(a._index)),v(t,e,n,r,a)}),o.on("mouseover",function(){o.call(_)}),o.on("mouseout",function(){o.call(w,a)}),i.setTranslate(e,a.lx,a.ly)}function v(t,e,n,o,i){n||(n=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(u.menuIndexAttrName)}(n)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?u.dropdownButtonClassName:u.buttonClassName,c=n.selectAll("g."+s).data(l),f=c.enter().append("g").classed(s,!0),d=c.exit();"dropdown"===i.type?(f.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,g=0,v=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(v?g=i.headerHeight+u.gapButtonHeader:p=i.headerWidth+u.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(g=-u.gapButtonHeader+u.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(p=-u.gapButtonHeader+u.gapButton-i.openWidth);var m={x:i.lx+p+i.pad.l,y:i.ly+g+i.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},x={l:m.x+i.borderwidth,t:m.y+i.borderwidth};c.each(function(l,s){var u=r.select(this);u.call(y,i,l,t).call(M,i,m),u.on("click",function(){r.event.defaultPrevented||(h(t,i,0,e,n,o,s),l.execute&&a.executeAPICommand(t,l.method,l.args),t.emit("plotly_buttonclicked",{menu:i,button:l,active:i.active}))}),u.on("mouseover",function(){u.call(_)}),u.on("mouseout",function(){u.call(w,i),c.call(b,i)})}),c.call(b,i),v?(x.w=Math.max(i.openWidth,i.headerWidth),x.h=m.y-x.t):(x.w=m.x-x.l,x.h=Math.max(i.openHeight,i.headerHeight)),x.direction=i.direction,o&&(c.size()?function(t,e,n,r,a,o){var i,l,s,c=a.direction,f="up"===c||"down"===c,d=a.active;if(f)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},n=Object.keys(e),r=0;rw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,C=v+y;C+A>c&&(C=c-A);var S=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=S.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:C,width:T,height:A}),this._hbarXMin=L+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=y>k,O=l.barWidth+2*l.barPad,z=l.barLength+2*l.barPad,D=h+g,E=v;D+O>s&&(D=s-O);var N=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:D,y:E,width:O,height:z}),this._vbarYMin=E+z/2,this._vbarTranslateMax=k-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,I=u-.5,F=P?f+O+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,q=i._topdefs.selectAll("#"+R).data(M||P?[0]:[]);if(q.exit().remove(),q.enter().append("clipPath").attr("id",R).append("rect"),M||P?(this._clipRect=q.select("rect").attr({x:Math.floor(I),y:Math.floor(j),width:Math.ceil(F)-Math.floor(I),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),M||P){var H=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),P&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,n)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},l.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},l.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,a=n+this._hbarTranslateMax;t=(i.constrain(r.event.x,n,a)-n)/(a-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,l=o+this._vbarTranslateMax;e=(i.constrain(r.event.y,o,l)-o)/(l-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},l.prototype.setTranslate=function(t,e){var n=this.position.w-this._box.w,r=this.position.h-this._box.h;if(t=i.constrain(t||0,0,n),e=i.constrain(e||0,0,r),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/n;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var l=e/r;this.vbar.call(o.setTranslate,t,e+l*this._vbarTranslateMax)}}},{"../../lib":169,"../color":50,"../drawing":75,d3:13}],148:[function(t,e,n){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.2,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],149:[function(t,e,n){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],150:[function(t,e,n){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],151:[function(t,e,n){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],152:[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}},{}],153:[function(t,e,n){"use strict";var r=t("./plotly");n.version="1.33.1-ion41",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),n.plot=r.plot,n.newPlot=r.newPlot,n.restyle=r.restyle,n.relayout=r.relayout,n.redraw=r.redraw,n.update=r.update,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=t("./plot_api/register"),n.toImage=t("./plot_api/to_image"),n.downloadImage=t("./snapshot/download"),n.validate=t("./plot_api/validate"),n.addFrames=r.addFrames,n.deleteFrames=r.deleteFrames,n.animate=r.animate,n.register(t("./traces/scatter")),n.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),n.register([t("./locale-en"),t("./locale-en-us")]),n.Icons=t("../build/ploticon"),n.Plots=r.Plots,n.Fx=t("./components/fx"),n.Snapshot=t("./snapshot"),n.PlotSchema=t("./plot_api/plot_schema"),n.Queue=t("./lib/queue"),n.d3=t("d3");var a=t("./components/color");n.colorDefaults=a.overrideColorDefaults;var o=t("./lib/dates");n.dateTime2ms=o.dateTime2ms},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":48,"./components/annotations3d":37,"./components/color":50,"./components/fx":92,"./components/images":100,"./components/legend":109,"./components/rangeselector":121,"./components/rangeslider":127,"./components/shapes":134,"./components/sliders":140,"./components/updatemenus":146,"./fonts/mathjax_config":154,"./lib/dates":158,"./lib/queue":183,"./locale-en":195,"./locale-en-us":194,"./plot_api/plot_schema":202,"./plot_api/register":203,"./plot_api/set_plot_config":204,"./plot_api/to_image":206,"./plot_api/validate":207,"./plotly":208,"./snapshot":267,"./snapshot/download":264,"./traces/scatter":342,d3:13,"es6-promise":14}],154:[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},{}],155:[function(t,e,n){"use strict";var r=Math.PI;n.deg2rad=function(t){return t/180*r},n.rad2deg=function(t){return t/r*180},n.wrap360=function(t){var e=t%360;return e<0?e+360:e},n.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],156:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),r(t)?Number(t):a}},{"../constants/numerical":150,"fast-isnumeric":16}],157:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../plots/attributes"),i=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;n.valObjectMeta={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)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var n=e.values,r=0;ra.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;!0!==r.strict&&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)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every(function(t){return 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)?e.set(u(+t)):e.set(n)}},subplotid:{coerceFunction:function(t,e,n){"string"==typeof t&&s(n).test(t)?e.set(t):e.set(n)},validateFunction:function(t,e){var n=e.dflt;return t===n||"string"==typeof t&&!!s(n).test(t)}},flaglist:{coerceFunction:function(t,e,n,r){if("string"==typeof t)if(-1===(r.extras||[]).indexOf(t)){for(var a=t.split("+"),o=0;o=r&&t<=a?t:u;if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var o=_(e),i=t.charAt(0);!o||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var l=o&&"chinese"===e.substr(0,7),s=t.match(l?x:m);if(!s)return u;var c=s[1],y=s[3]||"1",w=Number(s[5]||1),k=Number(s[7]||0),M=Number(s[9]||0),T=Number(s[11]||0);if(o){if(2===c.length)return u;var A;c=Number(c);try{var L=v.getComponentMethod("calendars","getCal")(e);if(l){var C="i"===y.charAt(y.length-1);y=parseInt(y,10),A=L.newDate(c,L.toMonthIndex(c,y,C),w)}else A=L.newDate(c,Number(y),w)}catch(t){return u}return A?(A.toJD()-g)*f+k*d+M*p+T*h:u}c=2===c.length?(Number(c)+2e3-b)%100+b:Number(c),y-=1;var S=new Date(Date.UTC(2e3,y,w,k,M));return S.setUTCFullYear(c),S.getUTCMonth()!==y?u:S.getUTCDate()!==w?u:S.getTime()+T*h},r=n.MIN_MS=n.dateTime2ms("-9999"),a=n.MAX_MS=n.dateTime2ms("9999-12-31 23:59:59.9999"),n.isDateTime=function(t,e){return n.dateTime2ms(t,e)!==u};var k=90*f,M=3*d,T=5*p;function A(t,e,n,r,a){if((e||n||r||a)&&(t+=" "+w(e,2)+":"+w(n,2),(r||a)&&(t+=":"+w(r,2),a))){for(var o=4;a%10==0;)o-=1,a/=10;t+="."+w(a,o)}return t}n.ms2DateTime=function(t,e,n){if("number"!=typeof t||!(t>=r&&t<=a))return u;e||(e=0);var o,i,l,c,m,x,b=Math.floor(10*s(t+.05,1)),w=Math.round(t-b/10);if(_(n)){var L=Math.floor(w/f)+g,C=Math.floor(s(t,f));try{o=v.getComponentMethod("calendars","getCal")(n).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){o=y("G%Y-%m-%d")(new Date(w))}if("-"===o.charAt(0))for(;o.length<11;)o="-0"+o.substr(1);else for(;o.length<10;)o="0"+o;i=e=r+f&&t<=a-f))return u;var e=Math.floor(10*s(t+.05,1)),n=new Date(Math.round(t-e/10));return A(o.time.format("%Y-%m-%d")(n),n.getHours(),n.getMinutes(),n.getSeconds(),10*n.getUTCMilliseconds()+e)},n.cleanDate=function(t,e,r){if(n.isJSDate(t)||"number"==typeof t){if(_(r))return l.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=n.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!n.isDateTime(t,r))return l.error("unrecognized date",t),e;return t};var L=/%\d?f/g;var C=[59,59.9,59.99,59.999,59.9999];function S(t,e){var n=s(t+.05,f),r=w(Math.floor(n/d),2)+":"+w(s(Math.floor(n/p),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(s(t/h,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),r+=":"+a}return r}function P(t){return t.formatDate("yyyy")}n.formatDate=function(t,e,n,r,a){var o,i;if(a=_(a)&&a,e)return function(t,e,n,r){t=t.replace(L,function(t){var n=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(n).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(_(r))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return n(t)(a)}(e,t,r,a);if(a)try{var l=Math.floor((t+.05)/f)+g,s=v.getComponentMethod("calendars","getCal")(a).fromJD(l);"y"===n?i=P(s):"m"===n?i=function(t){return t.formatDate("M yyyy")}(s):"d"===n?(o=P(s),i=function(t){return t.formatDate("M d")}(s)):(o=function(t){return t.formatDate("M d, yyyy")}(s),i=S(t,n))}catch(t){return"Invalid"}else{var c=new Date(Math.floor(t+.05));"y"===n?i=r("%Y")(c):"m"===n?i=r("%b %Y")(c):"d"===n?(o=r("%Y")(c),i=r("%b %-d")(c)):(o=r("%b %-d, %Y")(c),i=S(t,n))}return i+(o?"\n"+o:"")};var O=3*f;n.incrementMonth=function(t,e,n){n=_(n)&&n;var r=s(t,f);if(t=Math.round(t-r),n)try{var a=Math.round(t/f)+g,o=v.getComponentMethod("calendars","getCal")(n),i=o.fromJD(a);return e%12?o.add(i,e,"m"):o.add(i,e/12,"y"),(i.toJD()-g)*f+r}catch(e){l.error("invalid ms "+t+" in calendar "+n)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+r-O},n.findExactDates=function(t,e){for(var n,r,a=0,o=0,l=0,s=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u0&&(n.push(a),a=[])}return a.length>0&&n.push(a),n},n.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},n.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),n=0;n1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}function s(t,e,n,r,a){var o=r*t+a*e;if(o<0)return r*r+a*a;if(o>n){var i=r-t,l=a-e;return i*i+l*l}var s=r*e-a*t;return s*s/n}n.segmentsIntersect=l,n.segmentDistance=function(t,e,n,r,a,o,i,c){if(l(t,e,n,r,a,o,i,c))return 0;var u=n-t,f=r-e,d=i-a,p=c-o,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-t,o-e),s(u,f,h,i-t,c-e),s(d,p,g,t-a,e-o),s(d,p,g,n-a,r-o));return Math.sqrt(v)},n.getTextLocation=function(t,e,n,l){if(t===a&&l===o||(r={},a=t,o=l),r[n])return r[n];var s=t.getPointAtLength(i(n-l/2,e)),c=t.getPointAtLength(i(n+l/2,e)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=t.getPointAtLength(i(n,e)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return r[n]=d,d},n.clearLocationCache=function(){a=null},n.getVisibleSegment=function(t,e,n){var r,a,o=e.left,i=e.right,l=e.top,s=e.bottom,c=0,u=t.getTotalLength(),f=u;function d(e){var n=t.getPointAtLength(e);0===e?r=n:e===u&&(a=n);var c=n.xi?n.x-i:0,f=n.ys?n.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+n)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+n))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(r.x-a.x)<.1&&Math.abs(r.y-a.y)<.1}},n.findPointOnPath=function(t,e,n,r){for(var a,o,i,l=(r=r||{}).pathLength||t.getTotalLength(),s=r.tolerance||.001,c=r.iterationLimit||30,u=t.getPointAtLength(0)[n]>t.getPointAtLength(l)[n]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return o}},{"./mod":176}],167:[function(t,e,n){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],168:[function(t,e,n){"use strict";e.exports=function(t){return t}},{}],169:[function(t,e,n){"use strict";var r=t("d3"),a=t("fast-isnumeric"),o=t("../constants/numerical"),i=o.FP_SAFE,l=o.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./angles");s.deg2rad=h.deg2rad,s.rad2deg=h.rad2deg,s.wrap360=h.wrap360,s.wrap180=h.wrap180;var g=t("./geometry2d");s.segmentsIntersect=g.segmentsIntersect,s.segmentDistance=g.segmentDistance,s.getTextLocation=g.getTextLocation,s.clearLocationCache=g.clearLocationCache,s.getVisibleSegment=g.getVisibleSegment,s.findPointOnPath=g.findPointOnPath;var v=t("./extend");s.extendFlat=v.extendFlat,s.extendDeep=v.extendDeep,s.extendDeepAll=v.extendDeepAll,s.extendDeepNoArrays=v.extendDeepNoArrays;var y=t("./loggers");s.log=y.log,s.warn=y.warn,s.error=y.error;var m=t("./regex");s.counterRegex=m.counter;var x=t("./throttle");s.throttle=x.throttle,s.throttleDone=x.done,s.clearThrottle=x.clear,s.getGraphDiv=t("./get_graph_div"),s._=t("./localize"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t))<-i||t>i?l:a(t)?Number(t):l:l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,n,r){n||(n="x"),r||(r="y");for(var a=0;an?Math.max(n,Math.min(e,t)):Math.max(e,Math.min(n,t))},s.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},s.simpleMap=function(t,e,n,r){for(var a=t.length,o=new Array(a),i=0;i-1||c!==1/0&&c>=Math.pow(2,n)?t(e,n,r):l},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var n={optionList:[],_newoption:function(r){r[e]=t,n[r.name]=r,n.optionList.push(r)}};return n["_"+e]=t,n},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)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;n=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[r];u[n]=o}return u},s.syncOrAsync=function(t,e,n){var r;function a(){return s.syncOrAsync(t,e,n)}for(;t.length;)if((r=(0,t.splice(0,1)[0])(e))&&r.then)return r.then(a).then(void 0,s.promiseError);return n&&n(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,n){if(t){var r,a=!1,o=!0;for(r=0;r=0&&o%1==0){var h=r?r[p]:p,g=n?n[h]:h;f(g)&&(t[g].selected=1)}}},s.getTargetArray=function(t,e){var n=e.target;if("string"==typeof n&&n){var r=s.nestedProperty(t,n).get();return!!Array.isArray(r)&&r}return!!Array.isArray(n)&&n},s.minExtend=function(t,e){var n={};"object"!=typeof e&&(e={});var r,a,o,i=Object.keys(t);for(r=0;r1?a+i[1]:"";if(o&&(i.length>1||l.length>4||n))for(;r.test(l);)l=l.replace(r,"$1"+o+"$2");return l+s};var w=/%{([^\s%{}]*)}/g,k=/^\w*$/;s.templateString=function(t,e){var n={};return t.replace(w,function(t,r){return k.test(r)?e[r]||"":(n[r]=n[r]||s.nestedProperty(e,r).get,n[r]()||"")})};s.subplotSort=function(t,e){for(var n=Math.min(t.length,e.length)+1,r=0,a=0,o=0;o=48&&i<=57,c=l>=48&&l<=57;if(s&&(r=10*r+i-48),c&&(a=10*a+l-48),!s||!c){if(r!==a)return r-a;if(i!==l)return i-l}}return a-r},s.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":150,"./angles":155,"./clean_number":156,"./coerce":157,"./dates":158,"./ensure_array":159,"./extend":161,"./filter_unique":162,"./filter_visible":163,"./geometry2d":166,"./get_graph_div":167,"./identity":168,"./is_array":170,"./is_plain_object":171,"./keyed_container":172,"./localize":173,"./loggers":174,"./matrix":175,"./mod":176,"./nested_property":177,"./noop":178,"./notifier":179,"./push_unique":182,"./regex":184,"./relative_attr":185,"./relink_private":186,"./search":187,"./stats":189,"./throttle":191,"./to_log_range":192,d3:13,"fast-isnumeric":16}],170:[function(t,e,n){"use strict";var r="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||r.isView(t)}},{}],171:[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}},{}],172:[function(t,e,n){"use strict";var r=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,n,o){var i,l;n=n||"name",o=o||"value";var s={};l=e&&e.length?r(t,e).get():t,e=e||"",l=l||[];var c={};for(i=0;i2)return s[e]=2|s[e],f.set(t,null);if(u){for(i=e;i1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(r=t[e][0],o=t[e][1],l=!1,a(r))for(n=r.length-1;n>=0;n--)u(r[n],d(o,n))?l?r[n]=void 0:r.pop():l=!0;else if("object"==typeof r&&null!==r)for(i=Object.keys(r),l=!1,n=i.length-1;n>=0;n--)u(r[i[n]],d(o,i[n]))?delete r[i[n]]:l=!0;if(l)return}}(c)):l[e[i]]=r}}function d(t,e){var n=e;return r(e)?n="["+e+"]":t&&(n="."+e),t+n}function p(t,e,n,r){var o,i=a(n),l=!0,s=n,c=r.replace("-1",0),d=!i&&u(n,c),p=e[0];for(o=0;o/g),i=0;ii||o===a||os||e&&c(t))}:function(t,e){var o=t[0],c=t[1];if(o===a||oi||c===a||cs)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;uMath.max(f,v)||c>Math.max(d,y)))if(cu||Math.abs(r(i,d))>a)return!0;return!1};o.filter=function(t,e){var n=[t[0]],r=0,a=0;function o(o){t.push(o);var l=n.length,s=r;n.splice(a+1);for(var c=s+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:n}}},{"../constants/numerical":150,"./matrix":175}],182:[function(t,e,n){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var n,r=e.toString();for(n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,n;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;n=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,n=0;ne}function s(t,e){return t>=e}n.findBin=function(t,e,n){if(r(e.start))return n?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,d=e.length,p=0,h=d>1?(e[d-1]-e[0])/(d-1):1;for(u=h>=0?n?o:i:n?s:l,t+=1e-9*h*(n?-1:1)*(h>=0?1:-1);f90&&a.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;le[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;at.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":16}],190:[function(t,e,n){"use strict";var r=t("d3"),a=t("../lib"),o=t("../constants/xmlns_namespaces"),i=t("../constants/string_mappings"),l=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;n.convertToTspans=function(t,e,i,y){var S=t.text(),P=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&S.match(c),O=r.select(t.node().parentNode);if(!O.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),P?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var n=parseInt(t.node().style.fontSize,10),o={fontSize:n};!function(t,e,n){var o="math-output-"+a.randstr([],64),i=r.select("body").append("div").attr({id:o}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((l=t,l.replace(u,"\\lt ").replace(f,"\\gt ")));var l;MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=r.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())a.log("There was an error in the tex syntax.",t),n();else{var o=i.select("svg").node().getBoundingClientRect();n(i.select(".MathJax_SVG"),e,o)}i.remove()})}(P[2],o,function(r,a,o){O.selectAll("svg."+z).remove(),O.selectAll("g."+z+"-group").remove();var l=r&&r.select("svg");if(!l||!l.node())return D(),void e();var c=O.append("g").classed(z+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:z,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";l.select("g").attr({fill:u,stroke:u});var f=s(l,"width"),d=s(l,"height"),p=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],h=-(n||s(t,"height"))/4;"y"===z[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),l.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?l.attr({x:t.attr("x"),y:h-d/2}):"a"===z[0]?l.attr({x:0,y:h}):l.attr({x:p,y:+t.attr("y")+h-d/2}),i&&i.call(t,c),e(c)})})):D(e,y),t}function D(e,s){O.empty()||(z=t.attr("class")+"-math",O.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e,n,i){e=(s=e,function(t,e){if(!t)return"";for(var n=0;n1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),c=f[f.length-1].node}else a.log("Ignoring unexpected end tag .",e)}w.test(e)?S():(c=t,f=[{node:t}]);var D=e,E=17;n._fullLayout._hasPie&&n._fullLayout.legend&&"v"===n._fullLayout.legend.orientation&&n._fullLayout.width>170&&1===n.data.length&&(E=5+Math.floor((n._fullLayout.width-170)/22));if(i&&e.indexOf("
")<0&&e.length>E){var N=E,R=!1;for(let t=E;t>N-11&&t>0;t--)if(" "===e.charAt(t)){N=t,R=!0;break}(D=R?D.substr(0,N)+"
"+D.substr(N+1):D.substr(0,N)+"
"+D.substr(N)).length-4>2*E&&(D=D.substr(0,2*E+4-3)+"...")}for(var I=D.split(b),F=0;F|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},g="\u200b",v=["http:","https:","mailto:","",void 0,":"],y=new RegExp("]*)?/?>","g"),m=Object.keys(i.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:i.entityToUnicode[t]}}),x=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=//i,k=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,M=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function L(t,e){if(!t)return null;var n=t.match(e);return n&&(n[3]||n[4])}var C=/(^|;)\s*color:/;function S(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}}n.plainText=function(t){return(t||"").replace(y," ")},n.lineCount=function(t){return t.selectAll("tspan.line").size()||1},n.positionText=function(t,e,n){return t.each(function(){var t=r.select(this);function a(e,n){return void 0===n?null===(n=t.attr(e))&&(t.attr(e,0),n=0):t.attr(e,n),n}var o=a("x",e),i=a("y",n);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:o,y:i})})},n.makeEditable=function(t,e){var n=e.gd,a=e.delegate,o=r.dispatch("edit","input","cancel"),i=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function l(){var a,l,c,u;a=r.select(n).select(".svg-container"),l=a.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12),l.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(S(t,a,e)).on("blur",function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=r.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&r.select(t.node().parentNode).select(e).style({opacity:0});var i=this.textContent;r.select(this).transition().duration(0).remove(),r.select(document).on("mouseup",null),o.edit.call(t,i)}).on("focus",function(){var t=this;n._editing=!0,r.select(document).on("mouseup",function(){if(r.event.target===t)return!1;document.activeElement===l.node()&&l.node().blur()})}).on("keyup",function(){27===r.event.which?(n._editing=!1,t.style({opacity:1}),r.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),r.select(this).call(S(t,a,e)))}).on("keydown",function(){13===r.event.which&&this.blur()}).call(s),t.style({opacity:0});var f,d=i.attr("class");(f=d?"."+d.split(" ")[0]+"-math-group":"[class*=-math-group]")&&r.select(t.node().parentNode).select(f).style({opacity:0})}function s(t){var e=t.node(),n=document.createRange();n.selectNodeContents(e);var r=window.getSelection();r.removeAllRanges(),r.addRange(n),e.focus()}return e.immediate?l():i.on("click",l),r.rebind(t,o,"on")}},{"../constants/alignment":148,"../constants/string_mappings":151,"../constants/xmlns_namespaces":152,"../lib":169,d3:13}],191:[function(t,e,n){"use strict";var r={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}n.throttle=function(t,e,n){var o=r[t],i=Date.now();if(!o){for(var l in r)r[l].tso.ts+e?s():o.timer=setTimeout(function(){s(),o.timer=null},e)},n.done=function(t){var e=r[t];return e&&e.timer?new Promise(function(t){var n=e.onDone;e.onDone=function(){n&&n(),t(),e.onDone=null}}):Promise.resolve()},n.clear=function(t){if(t)a(r[t]),delete r[t];else for(var e in r)n.clear(e)}},{}],192:[function(t,e,n){"use strict";var r=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}},{"fast-isnumeric":16}],193:[function(t,e,n){"use strict";var r=e.exports={},a=t("../plots/geo/constants").locationmodeToLayer,o=t("topojson-client").feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return t+e+".json"},r.getTopojsonFeatures=function(t,e){var n=a[t.locationmode],r=e.objects[n];return o(e,r).features}},{"../plots/geo/constants":242,"topojson-client":32}],194:[function(t,e,n){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],195:[function(t,e,n){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""]}}},{}],196:[function(t,e,n){"use strict";var r=t("../registry");e.exports=function(t){for(var e,n,a=r.layoutArrayContainers,o=r.layoutArrayRegexes,i=t.split("[")[0],l=0;l0&&i.log("Clearing previous rejected promises from queue."),t._promises=[]},n.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var r=(l.subplotsRegistry.cartesian||{}).attrRegex,o=(l.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(A.x=1.02,A.xanchor="left"):A.x<-2&&(A.x=-.02,A.xanchor="right"),A.y>3?(A.y=1.02,A.yanchor="bottom"):A.y<-2&&(A.y=-.02,A.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t},n.cleanData=function(t,e){for(var r=[],a=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s0)return t.substr(0,e)}n.hasParent=function(t,e){for(var n=v(e);n;){if(n in t)return!0;n=v(n)}return!1};var y=["x","y","z"];n.clearAxisTypes=function(t,e,n){for(var r=0;r1&&i.warn("Full array edits are incompatible with other edits",f);var m=n[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return i.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,T,A=Object.keys(n).map(Number).sort(l),L=e.get(),C=L||[],S=r(y,f).get(),P=[],O=-1,z=C.length;for(x=0;xC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?P.push(_):T?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===O&&(O=_);else for(b=0;b=0;x--)C.splice(P[x],1),S&&S.splice(P[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==o){var D;if(-1===O)D=A;else{for(z=Math.max(C.length,z),D=[],x=0;x=O);x++)D.push(_);for(x=O;x=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||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+n+" must be unique.")}}function D(t,e,n){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),void 0===n||Array.isArray(n)||(n=[n]),void 0!==n&&z(t,n,"newIndices"),void 0!==n&&e.length!==n.length)throw new Error("current and new indices must be of equal length.")}function E(t,e,n,r,o,i){!function(t,e,n,r){var a=l.isPlainObject(r);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!l.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===n)throw new Error("indices must be an integer or array of integers");for(var o in z(t,n,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==n.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in r)||!Array.isArray(r[o])||r[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,r);for(var s,c,u,f=function(t,e,n,r){var o,i,s,c,u,f=l.isPlainObject(r),d=[];for(var p in Array.isArray(n)||(n=[n]),n=O(n,t.data.length-1),e)for(var h=0;h=0&&uY.range[0]?[1,2]:[2,1]);else{var W=Y.range[0],J=Y.range[1];X?(W<=0&&J<=0&&T(j+".autorange",!0),W<=0?W=J/1e6:J<=0&&(J=W/1e6),T(j+".range[0]",Math.log(W)/Math.LN10),T(j+".range[1]",Math.log(J)/Math.LN10)):(T(j+".range[0]",Math.pow(10,W)),T(j+".range[1]",Math.pow(10,J)))}else T(j+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,q,D,T),u.getComponentMethod("images","convertCoords")(t,q,D,T)}else T(j+".autorange",!0),T(j+".range",null);l.nestedProperty(s,j+"._inputRange").set(null)}else if(I.match(M.AX_NAME_PATTERN)){var Q=l.nestedProperty(s,O).get(),$=(D||{}).type;$&&"-"!==$||($="linear"),u.getComponentMethod("annotations","convertCoords")(t,Q,$,T),u.getComponentMethod("images","convertCoords")(t,Q,$,T)}var K=b.containerArrayMatch(O);if(K){n=K.array,r=K.index;var tt=K.property,et=(l.nestedProperty(o,n)||[])[r]||{},nt=et,rt=V||{editType:"calc"},at=-1!==rt.editType.indexOf("calcIfAutorange");""===r?(at?m.calc=!0:k.update(m,rt),at=!1):""===tt&&(nt=D,b.isAddVal(D)?w[O]=null:b.isRemoveVal(D)?(w[O]=et,nt=et):l.warn("unrecognized full object value",e)),at&&(A(nt,"x")||A(nt,"y"))?m.calc=!0:k.update(m,rt),h[n]||(h[n]={});var ot=h[n][r];ot||(ot=h[n][r]={}),ot[tt]=D,delete e[O]}else"reverse"===I?(B.range?B.range.reverse():(T(j+".autorange",!0),B.range=[1,0]),q.autorange?m.calc=!0:m.plot=!0):((!s._has("gl2d")&&!s._has("regl")||"dragmode"!==O||"lasso"!==D&&"select"!==D||"lasso"===H||"select"===H)&&V?k.update(m,V):m.calc=!0,z.set(D))}}for(n in h){b.applyContainerArrayChanges(t,l.nestedProperty(o,n),h[n],m)||(m.plot=!0)}var it=s._axisConstraintGroups||[];for(L in S)for(r=0;r=a.length?a[0]:a[t]:a}function s(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var n=0;return function(){if(t&&++n===e)return t()}}return void 0===r._frameWaitingCnt&&(r._frameWaitingCnt=0),new Promise(function(o,u){function f(){r._currentFrame&&r._currentFrame.onComplete&&r._currentFrame.onComplete();var e=r._currentFrame=r._frameQueue.shift();if(e){var n=e.name?e.name.toString():null;t._fullLayout._currentFrame=n,r._lastFrameAt=Date.now(),r._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:n,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(r._animationRaf),r._animationRaf=null}function p(){t.emit("plotly_animating"),r._lastFrameAt=-1/0,r._timeToNext=0,r._runningTransitions=0,r._currentFrame=null;var e=function(){r._animationRaf=window.requestAnimationFrame(e),Date.now()-r._lastFrameAt>r._timeToNext&&f()};e()}var h,g,v=0;function y(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var m=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&l.isPlainObject(e))m.push({type:"object",data:y(l.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&MM)&&T.push(g);m=T}}m.length>0?function(e){if(0!==e.length){for(var a=0;a=0;r--)if(l.isPlainObject(e[r])){var g=(f[e[r].name]||{}).name,v=e[r].name;g&&v&&"number"==typeof v&&f[g]&&(s++,l.warn('addFrames: overwriting frame "'+f[g].name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),s>5&&l.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:d.supplyFrameDefaults(e[r]),index:n&&void 0!==n[r]&&null!==n[r]?n[r]:p+r})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;r--){if("number"==typeof(a=h[r].frame).name&&l.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;f[a.name="frame "+t._transitionData._counter++];);if(f[a.name]){for(o=0;o=0;n--)r=e[n],o.push({type:"delete",index:r}),i.unshift({type:"insert",index:r,value:a[r]});var s=d.modifyFrames,u=d.modifyFrames,f=[t,i],p=[t,o];return c&&c.add(t,s,f,u,p),d.modifyFrames(t,o)},i.purge=function(t){var e=(t=l.getGraphDiv(t))._fullLayout||{},n=t._fullData||[];return d.cleanPlot([],{},n,e),d.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":50,"../components/drawing":75,"../components/errorbars":81,"../constants/xmlns_namespaces":152,"../lib":169,"../lib/events":160,"../lib/queue":183,"../lib/svg_text_utils":190,"../plotly":208,"../plots/cartesian/axis_ids":216,"../plots/cartesian/constants":218,"../plots/cartesian/constraints":220,"../plots/cartesian/graph_interact":222,"../plots/plots":254,"../plots/polar/legacy":257,"../registry":262,"./edit_types":197,"./helpers":198,"./manage_arrays":199,"./plot_schema":202,"./subroutines":205,d3:13,"fast-isnumeric":16,"has-hover":18}],201:[function(t,e,n){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},editableMainTitle:!0,editableAxisXTitle:!0,editableAxisX2Title:!0,editableAxisYTitle:!0,editableAxisY2Title:!0,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!1,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],202:[function(t,e,n){"use strict";var r=t("../registry"),a=t("../lib"),o=t("../plots/attributes"),i=t("../plots/layout_attributes"),l=t("../plots/frame_attributes"),s=t("../plots/animation_attributes"),c=t("../plots/polar/legacy/area_attributes"),u=t("../plots/polar/legacy/axis_attributes"),f=t("./edit_types"),d=a.extendFlat,p=a.extendDeepAll,h="_isSubplotObj",g="_isLinkedToArray",v=[h,g,"_arrayAttrRegexps","_deprecated"];function y(t,e,n){if(!t)return!1;if(t._isLinkedToArray)if(m(e[n]))n++;else if(n=t.items.length)return!1;t=t.items[o]}}return t}function m(t){return t===Math.round(t)&&t>=0}function x(){var t,e,n={};for(t in p(n,i),r.subplotsRegistry){if((e=r.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)w(n,e,"xaxis"),w(n,e,"yaxis");else w(n,e,"subplot"===e.attr?e.name:e.attr)}for(t in n=function(t){return d(t,{radialaxis:u.radialaxis,angularaxis:u.angularaxis}),d(t,u.layout),t}(n),r.componentsRegistry){var a=(e=r.componentsRegistry[t]).schema;if(a&&(a.subplots||a.layout)){var o=a.subplots;if(o&&o.xaxis&&!o.yaxis)for(var l in o.xaxis)delete n.yaxis[l]}else e.layoutAttributes&&k(n,e.layoutAttributes,e.name)}return{layoutAttributes:_(n)}}function b(){var t={frames:a.extendDeepAll({},l)};return _(t),t.frames}function _(t){return function(t){n.crawl(t,function(t,e,r){n.isValObject(t)?"data_array"===t.valType?(t.role="data",r[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(r[e+"src"]={valType:"string",editType:"none"}):a.isPlainObject(t)&&(t.role="object")})}(t),function(t){n.crawl(t,function(t,e,n){if(!t)return;var r=t[g];if(!r)return;delete t[g],n[e]={items:{}},n[e].items[r]=t,n[e].role="object"})}(t),t}function w(t,e,n){var r=a.nestedProperty(t,n),o=p({},e.layoutAttributes);o[h]=!0,r.set(o)}function k(t,e,n){var r=a.nestedProperty(t,n);r.set(p(r.get()||{},e))}n.IS_SUBPLOT_OBJ=h,n.IS_LINKED_TO_ARRAY=g,n.DEPRECATED="_deprecated",n.UNDERSCORE_ATTRS=v,n.get=function(){var t={};r.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,n;"area"===t?(e={attributes:c},n={}):(e=r.modules[t]._module,n=e.basePlotModule);var a={type:null};p(a,o),p(a,e.attributes),n.attributes&&p(a,n.attributes);a.type=t;var i={meta:e.meta||{},attributes:_(a)};if(e.layoutAttributes){var l={};p(l,e.layoutAttributes),i.layoutAttributes=_(l)}return i}(e)});var e={};return Object.keys(r.transformsRegistry).forEach(function(t){e[t]=function(t){var e=r.transformsRegistry[t],n=p({},e.attributes);return Object.keys(r.componentsRegistry).forEach(function(e){var a=r.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach(function(e){k(n,a.schema.transforms[t][e],e)})}),{attributes:_(n)}}(t)}),{defs:{valObjects:a.valObjectMeta,metaKeys:v.concat(["description","role","editType","impliedEdits"]),editType:{traces:f.traces,layout:f.layout},impliedEdits:{}},traces:t,layout:x(),transforms:e,frames:b(),animation:_(s)}},n.crawl=function(t,e,r,o){var i=r||0;o=o||"",Object.keys(t).forEach(function(r){var l=t[r];if(-1===v.indexOf(r)){var s=(o?o+".":"")+r;e(l,r,t,i,s),n.isValObject(l)||a.isPlainObject(l)&&"impliedEdits"!==r&&n.crawl(l,e,i+1,s)}})},n.isValObject=function(t){return t&&void 0!==t.valType},n.findArrayAttributes=function(t){var e=[],r=[];function i(n,o,i,l){if(r=r.slice(0,l).concat([o]),n&&("data_array"===n.valType||!0===n.arrayOk)&&!("colorbar"===r[l-1]&&("ticktext"===o||"tickvals"===o))){var s=function(t){return t.join(".")}(r),c=a.nestedProperty(t,s).get();Array.isArray(c)&&e.push(s)}}if(n.crawl(o,i),t._module&&t._module.attributes&&n.crawl(t._module.attributes,i),t.transforms)for(var l=t.transforms,s=0;s=t.transforms.length)return!1;a=(n=(r.transformsRegistry[t.transforms[s].type]||{}).attributes)&&n[e[2]],l=3}else if("area"===t.type)a=c[i];else{var u=t._module;if(u||(u=(r.modules[t.type||o.type.dflt]||{})._module),!u)return!1;if(!(a=(n=u.attributes)&&n[i])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[i])}a||(a=o[i])}return y(a,e,l)},n.getLayoutValObject=function(t,e){return y(function(t,e){var n,a,o,l,s=t._basePlotModules;if(s){var c;for(n=0;n=t[1]||a[1]<=t[0])&&o[0]e[0])return!0}return!1}(n,r,w)?(_.push(t),w.push([n,r])):a=[0];var i=e.plotgroup.selectAll(".bg").data(a);i.enter().append("rect").classed("bg",!0),i.exit().remove(),i.each(function(){e.bg=i;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var k=o._bgLayer.selectAll(".bg").data(_);return k.enter().append("rect").classed("bg",!0),k.exit().remove(),k.each(function(t){o._plots[t].bg=r.select(this)}),b.each(function(t){var n=o._plots[t],r=n.xaxis,a=n.yaxis;n.bg&&d&&n.bg.call(c.setRect,r._offset-l,a._offset-l,r._length+2*l,a._length+2*l).call(s.fill,o.plot_bgcolor).style("stroke-width",0),n.clipId="clip"+o._uid+t+"plot";var i,f,h=o._clips.selectAll("#"+n.clipId).data([0]);for(h.enter().append("clipPath").attr({class:"plotclip",id:n.clipId}).append("rect"),h.selectAll("rect").attr({width:r._length,height:a._length}),c.setTranslate(n.plot,r._offset,a._offset),n._hasClipOnAxisFalse?(i=null,f=n.clipId):(i=n.clipId,f=null),c.setClipUrl(n.plot,i),e=0;e1&&p.push(d("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=n.length,y=0;y2e-6||((n-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},k.getAutoRange=function(t){var e,n=[],r=t._min[0].val,a=t._max[0].val;for(e=1;e0&&f>0&&d/f>p&&(c=i,u=s,p=d/f);if(r===a){var v=r-1,y=r+1;n="tozero"===t.rangemode?r<0?[v,0]:[0,y]:"nonnegative"===t.rangemode?[Math.max(0,v),Math.max(0,y)]:[v,y]}else p&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(c.val>=0&&(c={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(c.val-p*c.pad<0&&(c={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),p=(u.val-c.val)/(t._length-c.pad-u.pad)),n=[c.val-p*c.pad,u.val+p*u.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(),l.simpleMap(n,t.l2r||Number)},k.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=k.getAutoRange(t),t._r=t.range.slice(),t._rl=l.simpleMap(t._r,t.r2l);var n=t._input;n.range=t.range.slice(),n.autorange=t.autorange}},k.saveRangeInitial=function(t,e){for(var n=k.list(t,"",!0),r=!1,a=0;a0?n.ppadplus:n.ppadminus)||n.ppad||0),_=M((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),w=M(n.vpadplus||n.vpad),k=M(n.vpadminus||n.vpad);for(r=0;r<6;r++)T(r);for(r=y-1;r>5;r--)T(r)}function M(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function T(n){if(s=e[n],a(s)){if(f=b(n)+m,d=_(n)+m,g=s-k(n),v=s+w(n),"log"===t.type&&g=d?h=!1:i.val>=c&&i.pad<=d&&(t._min.splice(o,1),o--);h&&t._min.push({val:c,pad:x&&0===c?0:d})}if(r(u)){for(h=!0,o=0;o=u&&i.pad>=f?h=!1:i.val<=u&&i.pad<=f&&(t._max.splice(o,1),o--);h&&t._max.push({val:u,pad:x&&0===u?0:f})}}function r(t){return a(t)&&Math.abs(t).3*d||u(r)||u(o))){var p=n.dtick/2;t+=t+p.8){var i=Number(n.substr(1));o.exactYears>.8&&i%12==0?t=k.tickIncrement(t,"M6","reverse")+1.5*v:o.exactMonths>.8?t=k.tickIncrement(t,"M1","reverse")+15.5*v:t-=v/2;var s=k.tickIncrement(t,n);if(s<=r)return s}return t}(y,t,s.dtick,c,o)),h=y,g=0;h<=u;)h=k.tickIncrement(h,s.dtick,!1,o),g++;return{start:e.c2r(y,0,o),end:e.c2r(h,0,o),size:s.dtick,_count:g}},k.calcTicks=function(t,e){var n=l.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,a=t.nticks;a||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/r):(r="y"===t._id.charAt(0)?40:80,a=l.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),k.autoTicks(t,Math.abs(n[1]-n[0])/a),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),I(t),"array"===t.tickmode)return function(t){var e,n,r=t.tickvals,a=t.ticktext,o=new Array(r.length),i=l.simpleMap(t.range,t.r2l),s=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(s,c),f=Math.max(s,c),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(n=0;nu&&e=s:f<=s)&&!(i.length>u||f===c);f=k.tickIncrement(f,t.dtick,o,t.calendar))c=f,i.push(f);"angular"===t._id&&360===Math.abs(n[1]-n[0])&&i.pop(),t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;p10||"01-01"!==r.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=v&&o<=10||e>=15*v)t._tickround="d";else if(e>=m&&o<=16||e>=y)t._tickround="M";else if(e>=x&&o<=19||e>=m)t._tickround="S";else{var i=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(o,i)-20}}else if(a(e)||"L"===e.charAt(0)){var l=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(B(t.exponentformat)&&!q(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function F(t,e,n){var r=t.tickfont||{};return{x:e,dx:0,dy:0,text:n||"",fontSize:r.size,font:r.family,fontColor:r.color}}k.autoTicks=function(t,e){var n;function r(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=l.dateTick0(t.calendar);var o=2*e;o>h?(e/=h,n=r(10),t.dtick="M"+12*R(e,n,S)):o>g?(e/=g,t.dtick="M"+R(e,1,P)):o>v?(t.dtick=R(e,v,z),t.tick0=l.dateTick0(t.calendar,!0)):o>y?t.dtick=R(e,y,P):o>m?t.dtick=R(e,m,O):o>x?t.dtick=R(e,x,O):(n=r(10),t.dtick=R(e,n,S))}else if("log"===t.type){t.tick0=0;var i=l.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var s=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/s,n=r(10),t.dtick="L"+R(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))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=R(e,n,N)):(t.tick0=0,n=r(10),t.dtick=R(e,n,S));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},k.tickIncrement=function(t,e,n,o){var i=n?-1:1;if(a(e))return t+i*e;var s=e.charAt(0),c=i*Number(e.substr(1));if("M"===s)return l.incrementMonth(t,c,o);if("L"===s)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===s){var u="D2"===e?E:D,f=t+.01*i,d=l.roundUp(l.mod(f,1),u,n);return Math.floor(f)+Math.log(r.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},k.tickFirst=function(t){var e=t.r2l||Number,n=l.simpleMap(t.range,e),o=n[1]"+s,t._prevDateHead=s));e.text=c}(t,s,n,u):"log"===t.type?function(t,e,n,r,o){var i=t.dtick,s=e.x,c=t.tickformat;"never"===o&&(o="");!r||"string"==typeof i&&"L"===i.charAt(0)||(i="L3");if(c||"string"==typeof i&&"L"===i.charAt(0))e.text=H(Math.pow(10,s),t,o,r);else if(a(i)||"D"===i.charAt(0)&&l.mod(s+.01,1)<.1){var u=Math.round(s);-1!==["e","E","power"].indexOf(t.exponentformat)||B(t.exponentformat)&&q(u)?(e.text=0===u?1:1===u?"10":u>1?"10"+u+"":"10"+b+-u+"",e.fontSize*=1.25):(e.text=H(Math.pow(10,s),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,l.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,s,0,u,o):"category"===t.type?function(t,e){var n=t._categories[Math.round(e.x)];void 0===n&&(n="");e.text=String(n)}(t,s):"angular"===t._id?function(t,e,n,r,a){if("radians"!==t.thetaunit||n)e.text=H(e.x,t,a,r);else{var o=e.x/180;if(0===o)e.text="0";else{var i=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var n=function(t){var n=1;for(;!e(Math.round(t*n)/n,t);)n*=10;return n}(t),r=t*n,a=Math.abs(function t(n,r){return e(r,0)?n:t(r,n%r)}(r,n));return[Math.round(r/a),Math.round(n/a)]}(o);if(i[1]>=100)e.text=H(l.deg2rad(e.x),t,a,r);else{var s=e.x<0;1===i[1]?1===i[0]?e.text="\u03c0":e.text=i[0]+"\u03c0":e.text=["",i[0],"","\u2044","",i[1],"","\u03c0"].join(""),s&&(e.text=b+e.text)}}}}(t,s,n,u,o):function(t,e,n,r,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=H(e.x,t,a,r)}(t,s,0,u,o),t.tickprefix&&!h(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!h(t.showticksuffix)&&(s.text+=t.ticksuffix),"x"===t._id&&r&&r.layout.xaxis.formatCallback?s.text=r.layout.xaxis.formatCallback(s.text,s.x):"y"===t._id&&r&&r.layout.yaxis.formatCallback?s.text=r.layout.yaxis.formatCallback(s.text,s.x):"x2"===t._id&&r&&r.layout.xaxis2&&r.layout.xaxis2.formatCallback?s.text=r.layout.xaxis2.formatCallback(s.text,s.x):"y2"===t._id&&r&&r.layout.yaxis2&&r.layout.yaxis2.formatCallback&&(s.text=r.layout.yaxis2.formatCallback(s.text,s.x)),s},k.hoverLabelText=function(t,e,n,r){if(n&&n!==_&&n!==e)return k.hoverLabelText(t,e,null,r)+" - "+k.hoverLabelText(t,n,null,r);var a="log"===t.type&&e<=0,o=k.tickText(t,t.c2l(a?-e:e),"hover",r).text;return a?0===e?"0":b+o:o};var j=["f","p","n","\u03bc","m","","k","M","G","T"];function B(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function H(t,e,n,r){var o=t<0,i=e._tickround,s=n||e.exponentformat||"B",c=e._tickexponent,u=k.getTickFormat(e),f=e.separatethousands;if(r){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};I(d),i=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,b);var p,h=Math.pow(10,-i)/2;if("none"===s&&(c=0),(t=Math.abs(t))"+p+"":"B"===s&&9===c?t+="B":B(s)&&(t+=j[c/3+5]));return o?b+t:t}function V(t,e){for(var n=0;n=0,o=c(t,e[1])<=0;return(n||a)&&(r||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(r))){n=t.tickformatstops[e];break}break;case"log":for(e=0;e1&&eo+1){var i=t.text,l=Math.round(o/(a/i.length)),s=Math.floor(l/2),c=l-s-1;i=i.substr(0,s)+"\u2026"+i.substr(-c);var u=e.select("text");u.text(i),e.insert("title","text").text(t.text)}})),Q(),e+" done"},P,function(){var e,n,r,a,i,l=d._boundingBox,s=0,c=0;if("x"===d._id.charAt(0)?(e="height",a="r","2"===d._id.charAt(1)?(c=1,n="t"):n="b"):"y"===d._id.charAt(0)&&(e="width","2"===d._id.charAt(1)?(s=1,n="r"):n="l"),e&&n){r=l[e],d._titleElement&&(r+=d._titleElement.node().getBoundingClientRect()[e]+2);var u=.5*t._fullLayout[e];r=Math.min(r,u);var f={x:s,y:c,l:0,r:0,b:0,t:0};if(f[n]=r,"r"===a&&(0===d._lastangle&&(i=d._lastLabelWidth/2),i>0)){var p={x:1.01,y:0,l:0,r:i,b:0,t:0};o.autoMargin(t,"xaxis_on_r",p)}o.autoMargin(t,d._name,f)}}]);return O&&O.then&&t._promises.push(O),O}function Q(){if(!n){var a,o,i,l,s=T.getFromId(t,e),u=r.select(t).selectAll("g."+e+"tick"),d={selection:u,side:s.side},h=e.charAt(0),g=t._fullLayout._size,v=s.titlefont.size;if(u.size()){var y=f.getTranslate(u.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}var m=10+1.5*v+(s.linewidth?s.linewidth-1:0);"x"===h?(o="free"===s.anchor?{_offset:g.t+(1-(s.position||0))*g.h,_length:0}:T.getFromId(t,s.anchor),i=s._offset+s._length/2,l="top"===s.side?-m-v*(s.showticklabels?1:0):o._length+m+v*(s.showticklabels?1.5:.5),l+=o._offset,s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(l+=(p.height-p.margin.b-p.margin.t)*s.rangeslider.thickness+s._boundingBox.height),d.side||(d.side="bottom")):(o="free"===s.anchor?{_offset:g.l+(s.position||0)*g.w,_length:0}:T.getFromId(t,s.anchor),l=s._offset+s._length/2,i="right"===s.side?o._length+m+v*(s.showticklabels?1:.5):-m-v*(s.showticklabels?.5:0),i+=o._offset,a={rotate:"-90",offset:0},d.side||(d.side="left")),c.draw(t,e+"title",{propContainer:s,propName:s._name+".title",placeholder:p._dfltTitle[h],avoid:d,transform:a,attributes:{x:i,y:l,"text-anchor":"middle"}})}}function $(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!i.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[M])||t.fill&&t.fill.charAt(t.fill.length-1)===M)}function K(n,a,o){var i=n.gridlayer.selectAll("."+e),s=n.zerolinelayer,c=n["hidegrid"+M]?[]:q,f=d._gridpath||("x"===M?"M0,"+a._offset+"v":"M"+a._offset+",0h")+a._length,p=i.selectAll("path."+P).data(!1===d.showgrid?[]:c,C);if(p.enter().append("path").classed(P,1).classed("crisp",1).attr("d",f).each(function(t){d.zeroline&&("linear"===d.type||"-"===d.type)&&Math.abs(t.x)1)for(r=1;r2*i}(t,e)?"date":function(t){for(var e,n=Math.max(1,(t.length-1)/1e3),r=0,i=0,l=0;l2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;er?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":262,"./constants":218}],217:[function(t,e,n){"use strict";e.exports=function(t,e,n){if("category"===e.type){var r,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(r="array");var i=n("categoryorder",r);"array"===i&&n("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],218:[function(t,e,n){"use strict";var r=t("../../lib").counterRegex;e.exports={idRegex:{x:r("x"),y:r("y")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":169}],219:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./axis_ids").id2name;e.exports=function(t,e,n,o,i){var l=i._axisConstraintGroups,s=e._id,c=s.charAt(0);if(!e.fixedrange&&(n("constrain"),r.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,n,r){var o,i,l,s,c=r[a(e)].type,u=[];for(i=0;io*y)||_)for(n=0;nO&&DS&&(S=D);f/=(S-C)/(2*P),C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=T=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function O(t,e,n,r,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+n+", "+r+")").attr("d",a+"Z")}function z(t,e,n){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+n+")").attr("d","M0,0Z")}function D(t){t.selectAll(".select-outline").remove()}function E(t,e,n,r,a,o){t.attr("d",r+"M"+n.l+","+n.t+"v"+n.h+"h"+n.w+"v-"+n.h+"h-"+n.w+"Z"),N(t,e,a,o)}function N(t,e,n,r){n||(t.transition().style("fill",r>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function I(t){M&&t.data&&t._context.showTips&&(l.notifier(l._(t,"Double-click to zoom back out"),"long"),M=!1)}function F(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,w)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function B(t,e){if(k){var n=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(n,t._onwheel),t._onwheel=e,t.addEventListener(n,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}e.exports={makeDragBox:function(t,e,n,c,d,k,M,T){var N,q,H,V,U,G,Y,X,Z,W,J,Q,$,K=t._fullLayout,tt=t._fullLayout._zoomlayer,et=M+T==="nsew",nt=1===(M+T).length;function rt(){q=[e.xaxis],H=[e.yaxis];var n=q[0],r=H[0];G=n._length,Y=r._length;var a,o,i=K._axisConstraintGroups,s=[n._id],c=[r._id];N=[e].concat(M&&T?e.overlays:[]);for(var u=1;uw||i>w?(dt="xy",o/G>i/Y?(i=o*Y/G,lt>a?st.t=lt-i:st.b=lt+i):(o=i*G/Y,it>r?st.l=it-o:st.r=it+o),ht.attr("d",j(st))):l():!Z||i0&&(t.emit("plotly_zoom",a),a.userHandled||(Tt(),I(t),a.pre=!1,t.emit("plotly_zoom",a)))}var xt=[0,0,G,Y],bt=null,_t=b.REDRAWDELAY,wt=e.mainplot?K._plots[e.mainplot]:e;function kt(e,n){if(!t._transitioningWithDuration){if(rt(),"ew"===X||"ns"===Z)return X&&S(q,e),Z&&S(H,n),At([X?-e:0,Z?-n:0,G,Y]),void Mt(Z,X);if(J&&X&&Z){var r="w"===X==("n"===Z)?1:-1,a=(e/G+r*n/Y)/2;e=a*G,n=r*a*Y}"w"===X?e=s(q,0,e):"e"===X?e=s(q,1,-e):X||(e=0),"n"===Z?n=s(H,1,n):"s"===Z?n=s(H,0,-n):Z||(n=0);var o="w"===X?e:0,i="n"===Z?n:0;if(J){var l;if(!X&&1===Z.length){for(l=0;l rect").call(u.setTranslate,a,o).call(u.setScale,n,r);var P=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(u.setTranslate,C,S).call(u.setScale,1/n,1/r),P.selectAll(".point").call(u.setPointGroupScale,n,r),P.selectAll(".textpoint").call(u.setTextPointsScale,n,r),P.call(u.hideOutsideRangePoints,m)}}}return M.length*T.length!=1&&B(at,function(e){if(t._context.scrollZoom||K._enablescrollzoom){if(t._transitioningWithDuration)return l.pauseEvent(e);var n=t.querySelector(".plotly");if(rt(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(bt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var a,o=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=wt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-i.left)/i.width,c=(i.bottom-e.clientY)/i.height;if(T||J){for(T||(s=.5),a=0;au[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return n("layer"),e}},{"../../lib":169,"fast-isnumeric":16}],230:[function(t,e,n){"use strict";var r=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=a[0]+(a[1]-a[0])*n;t.range=t._input.range=[t.l2r(o+(a[0]-o)*e),t.l2r(o+(a[1]-o)*e)]}},{"../../constants/alignment":148}],231:[function(t,e,n){"use strict";var r=t("polybooljs"),a=t("../../lib/polygon"),o=t("../../lib/throttle"),i=t("../../components/color"),l=t("../../components/fx/helpers").makeEventData,s=t("../../components/fx"),c=t("./axes"),u=t("./constants"),f=a.filter,d=a.tester,p=a.multitester,h=u.MINSELECT;function g(t){return t._id}function v(t,e,n){var r,a,o;if(n){var i=n.points||[];for(r=0;r0)return Math.log(e)/Math.LN10;if(e<=0&&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 d}function y(e,n,r){var o=s(e,r||t.calendar);if(o===d){if(!a(e))return d;o=s(new Date(+e))}return o}function m(e,n,r){return l(e,n,r||t.calendar)}function x(e){return t._categories[Math.round(e)]}function b(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(a(e))return+e}function _(e){return a(e)?r.round(t._b+t._m*e,2):d}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?v:c,t.l2c="log"===t.type?g:c,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(v(t,e))}:_,t.p2c="log"===t.type?function(t){return g(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=i,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(i(e))},t.p2d=t.p2r=w,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return v(i(t),e)},t.r2d=t.r2c=function(t){return g(i(t))},t.d2c=t.r2l=i,t.c2d=t.l2r=c,t.c2r=v,t.l2d=g,t.d2p=function(e,n){return t.l2p(t.d2r(e,n))},t.p2d=function(t){return g(w(t))},t.r2p=function(e){return t.l2p(i(e))},t.p2r=w,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=y,t.c2d=t.c2r=t.l2d=t.l2r=m,t.d2p=t.r2p=function(e,n,r){return t.l2p(y(e,0,r))},t.p2d=t.p2r=function(t,e,n){return m(w(t),e,n)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!=e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var n=t._categories.length-1;return t._categoriesMap[e]=n,n}return d},t.r2d=t.c2d=t.l2d=x,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var n=b(e);return void 0!==n?n:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return x(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return t.l2r(n+e*(r-n))},t.r2fraction=function(e){var n=t.r2l(t.range[0]),r=t.r2l(t.range[1]);return(t.r2l(e)-n)/(r-n)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var i,l,s=o.nestedProperty(t,e).get();if(l=(l="date"===t.type?o.dfltRange(t.calendar):"y"===n?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX).slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),i=0;i<2;i++)if("date"===t.type){if(!o.isDateTime(s[i],t.calendar)){t[e]=l;break}if(t.r2l(s[0])===t.r2l(s[1])){var c=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(c-1e3),s[1]=t.l2r(c+1e3);break}}else{if(!a(s[i])){if(!a(s[1-i])){t[e]=l;break}s[i]=s[1-i]*(i?10:.1)}if(s[i]<-f?s[i]=-f:s[i]>f&&(s[i]=f),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else o.nestedProperty(t,e).set(l)},t.setScale=function(r){var a=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var o=h.getFromId({_fullLayout:e},t.overlaying);t.domain=o.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===n?(t._offset=a.t+(1-t.domain[1])*a.h,t._length=a.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=a.l+t.domain[0]*a.w,t._length=a.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,n){var r,a,o,i="date"===t.type&&e[n+"calendar"];if(n in e)for(r=e[n],a=new Array(r.length),o=0;o=t.r2l(t.range[0])&&a<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:r.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:r.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":150,"../../lib":169,"./axis_ids":216,"./constants":218,d3:13,"fast-isnumeric":16}],233:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,n,o,i){var l=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(n){return t[n]===t[e[0]]})||1===e.length)return t[e[0]]}(t);if(n("tickprefix")&&n("showtickprefix",l),n("ticksuffix",i.tickSuffixDflt)&&n("showticksuffix",l),n("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;if(r.coerceFont(n,"tickfont",{family:s.family,size:s.size,color:c}),n("tickangle"),"category"!==o){var u=n("tickformat");!function(t,e){var n,o,i=t.tickformatstops,l=e.tickformatstops=[];if(!Array.isArray(i))return;function s(t,e){return r.coerce(n,o,a.tickformatstops,t,e)}for(var c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);((d=r(d)?Number(d):0)<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===i?a.dateTick0(e.calendar):0,h=n("tick0",p);"date"===i?e.tick0=a.cleanDate(h,p):r(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{void 0===n("tickvals")?e.tickmode="auto":n("ticktext")}}},{"../../constants/numerical":150,"../../lib":169,"fast-isnumeric":16}],236:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,n,c){var u=t._fullLayout,f=[];var d,p,h,g,v=function(t){var e,n,r,a,o={};for(e in t)if((n=e.split("."))[0].match(s)){var i=e.charAt(0),l=n[0];if(r=u[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=r._length,f.push(i),o[i]=a}return o}(e),y=Object.keys(v),m=function(t,e,n){var r,a,o,i=t._plots,l=[];for(r in i){var s=i[r];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=n[c]?n[c].to:f,o=n[u]?n[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(u,y,v);if(!m.length)return function(){function e(e,n,r){for(var a=0;a rect").call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,n._offset).call(i.setScale,1,1);var r=t.plot.selectAll(".scatterlayer .trace");r.selectAll(".point").call(i.setPointGroupScale,1,1),r.selectAll(".textpoint").call(i.setTextPointsScale,1,1),r.call(i.hideOutsideRangePoints,t)}function b(e,n){var r,a,s,c=v[e.xaxis._id],f=v[e.yaxis._id],d=[];if(c){a=(r=t._fullLayout[c.axisName])._r,s=c.to,d[0]=(a[0]*(1-n)+n*s[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var p=a[1]-a[0],h=s[1]-s[0];r.range[0]=a[0]*(1-n)+n*s[0],r.range[1]=a[1]*(1-n)+n*s[1],d[2]=e.xaxis._length*(1-n+n*h/p)}else d[0]=0,d[2]=e.xaxis._length;if(f){a=(r=t._fullLayout[f.axisName])._r,s=f.to,d[1]=(a[1]*(1-n)+n*s[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var g=a[1]-a[0],y=s[1]-s[0];r.range[0]=a[0]*(1-n)+n*s[0],r.range[1]=a[1]*(1-n)+n*s[1],d[3]=e.yaxis._length*(1-n+n*y/g)}else d[1]=0,d[3]=e.yaxis._length;!function(e,n){var r,a=[];for(a=[e._id,n._id],r=0;r rect").call(i.setTranslate,M,T).call(i.setScale,1/w,1/k),e.plot.call(i.setTranslate,C,S).call(i.setScale,w,k).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/w,1/k),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/w,1/k)}c&&(d=c());var _=r.ease(n.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(g),g=null,function(){for(var e={},n=0;nn.duration?(function(){for(var e={},n=0;n0?".":"")+o;a.isPlainObject(i)?s(i,e,l,r+1):e(l,o,i)}})}n.manageCommandObserver=function(t,e,r,i){var l={},s=!0;e&&e._commandObserver&&(l=e._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=n.hasSimpleAPICommandBindings(t,r,l.lookupTable);if(e&&e._commandObserver){if(c)return l;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,l}if(c){o(t,c,l.cache),l.check=function(){if(s){var e=o(t,c,l.cache);return e.changed&&i&&void 0!==l.lookupTable[e.value]&&(l.disable(),Promise.resolve(i({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[e.value]})).then(l.enable,l.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fa*Math.PI/180}return!1},n.getPath=function(){return r.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),o&&n.clipExtent(null);var i=n.getBounds(e),l=Math.min(r/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+t[0][0]+(r-l*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(a-l*(i[1][1]+i[0][1]))/2;return o&&n.clipExtent(o),n.scale(150*l).translate([s,c])},n.precision(h.precision),a&&n.clipAngle(a-h.clipPad);return n}(e);u.center([c.lon-s.lon,c.lat-s.lat]).rotate([-s.lon,-s.lat,s.roll]).parallels(l.parallels);var f=[[n.l+n.w*i.x[0],n.t+n.h*(1-i.y[1])],[n.l+n.w*i.x[1],n.t+n.h*(1-i.y[0])]],d=e.lonaxis,p=e.lataxis,g=function(t,e){var n=h.clipPad,r=t[0]+n,a=t[1]-n,o=e[0]+n,i=e[1]-n;r>0&&a<0&&(a+=360);var l=(a-r)/4;return{type:"Polygon",coordinates:[[[r,o],[r,i],[r+l,i],[r+2*l,i],[r+3*l,i],[a,i],[a,o],[a-l,o],[a-2*l,o],[a-3*l,o],[r,o]]]}}(d.range,p.range);u.fitExtent(f,g);var v=this.bounds=u.getBounds(g),y=this.fitScale=u.scale(),m=u.translate();if(!isFinite(v[0][0])||!isFinite(v[0][1])||!isFinite(v[1][0])||!isFinite(v[1][1])||isNaN(m[0])||isNaN(m[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k0&&k<0&&(k+=360);var M,T,A,L=(w+k)/2;if(!c){var C=u?l.projRotate:[L,0,0];M=n("projection.rotation.lon",C[0]),n("projection.rotation.lat",C[1]),n("projection.rotation.roll",C[2]),n("showcoastlines",!u)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean")&&n("oceancolor")}(c?(T=-96.6,A=38.7):(T=u?L:M,A=(_[0]+_[1])/2),n("center.lon",T),n("center.lat",A),f)&&n("projection.parallels",l.projParallels||[0,60]);n("projection.scale"),n("showland")&&n("landcolor"),n("showlakes")&&n("lakecolor"),n("showrivers")&&(n("rivercolor"),n("riverwidth")),n("showcountries",u&&"usa"!==o)&&(n("countrycolor"),n("countrywidth")),("usa"===o||"north america"===o&&50===r)&&(n("showsubunits",!0),n("subunitcolor"),n("subunitwidth")),u||n("showframe",!0)&&(n("framecolor"),n("framewidth")),n("bgcolor")}e.exports=function(t,e,n){r(t,e,n,{type:"geo",attributes:o,handleDefaults:l,partition:"y"})}},{"../../subplot_defaults":261,"../constants":242,"./layout_attributes":247}],247:[function(t,e,n){"use strict";var r=t("../../../components/color/attributes"),a=t("../../domain_attributes"),o=t("../constants"),i=t("../../../plot_api/edit_types").overrideAll,l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=i({domain:a({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(o.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(o.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:o.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:o.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:o.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:o.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")},{"../../../components/color/attributes":49,"../../../plot_api/edit_types":197,"../../domain_attributes":239,"../constants":242}],248:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,e)}}function n(e,r){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,r)})};if(!c.hasOwnProperty(e.type))return null;var a=c[e.type];return t.geo.stream(e,r(a)),a.result()}t.geo.project=function(t,e){var a=e.stream;if(!a)throw new Error("not yet supported");return(t&&r.hasOwnProperty(t.type)?r[t.type]:n)(t,a)};var r={Feature:e,FeatureCollection:function(t,n){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,n)})}}},a=[],o=[],i={point:function(t,e){a.push([t,e])},result:function(){var t=a.length?a.length<2?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a}:null;return a=[],t}},l={lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){a.length&&(o.push(a),a=[])},result:function(){var t=o.length?o.length<2?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o}:null;return o=[],t}},s={polygonStart:u,lineStart:u,point:function(t,e){a.push([t,e])},lineEnd:function(){var t=a.length;if(t){do{a.push(a[0].slice())}while(++t<4);o.push(a),a=[]}},polygonEnd:u,result:function(){if(!o.length)return null;var t=[],e=[];return o.forEach(function(n){!function(t){if((e=t.length)<4)return!1;for(var e,n=0,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++nr^p>r&&n<(d-c)*(r-u)/(p-u)+c&&(a=!a)}return a}(t[0],n))return t.push(e),!0})||t.push([e])}),o=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:i,MultiPoint:i,LineString:l,MultiLineString:l,Polygon:s,MultiPolygon:s,Sphere:s};function u(){}var f=1e-6,d=f*f,p=Math.PI,h=p/2,g=(Math.sqrt(p),p/180),v=180/p;function y(t){return t>1?h:t<-1?-h:Math.asin(t)}function m(t){return t>1?0:t<-1?p:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var n=(2+h)*Math.sin(e);e/=2;for(var r=0,a=1/0;r<10&&Math.abs(a)>f;r++){var o=Math.cos(e);e-=a=(e+Math.sin(e)*(o+2)-n)/(2*o*(1+o))}return[2/Math.sqrt(p*(4+p))*t*(1+Math.cos(e)),2*Math.sqrt(p/(4+p))*Math.sin(e)]}t.geo.interrupt=function(e){var n,r=[[[[-p,0],[0,h],[p,0]]],[[[-p,0],[0,-h],[p,0]]]];function a(t,n){for(var a=n<0?-1:1,o=r[+(n<0)],i=0,l=o.length-1;io[i][2][0];++i);var s=e(t-o[i][1][0],n);return s[0]+=e(o[i][1][0],a*n>a*o[i][0][1]?o[i][0][1]:n)[0],s}e.invert&&(a.invert=function(t,o){for(var i=n[+(o<0)],l=r[+(o<0)],c=0,u=i.length;c=0;--a){var i=r[1][a],s=180*i[0][0]/p,c=180*i[0][1]/p,u=180*i[1][1]/p,f=180*i[2][0]/p,d=180*i[2][1]/p;n.push(l([[f-e,d-e],[f-e,u+e],[s+e,u+e],[s+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(n)]}}(),s)},a},o.lobes=function(t){return arguments.length?(r=t.map(function(t){return t.map(function(t){return[[t[0][0]*p/180,t[0][1]*p/180],[t[1][0]*p/180,t[1][1]*p/180],[t[2][0]*p/180,t[2][1]*p/180]]})}),n=r.map(function(t){return t.map(function(t){var n,r=e(t[0][0],t[0][1])[0],a=e(t[2][0],t[2][1])[0],o=e(t[1][0],t[0][1])[1],i=e(t[1][0],t[1][1])[1];return o>i&&(n=o,o=i,i=n),[[r,o],[a,i]]})}),o):r.map(function(t){return t.map(function(t){return[[180*t[0][0]/p,180*t[0][1]/p],[180*t[1][0]/p,180*t[1][1]/p],[180*t[2][0]/p,180*t[2][1]/p]]})})},o},_.invert=function(t,e){var n=.5*e*Math.sqrt((4+p)/p),r=y(n),a=Math.cos(r);return[t/(2/Math.sqrt(p*(4+p))*(1+a)),y((r+n*(a+2))/(2+h))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return M;function n(n,r){var a=w(n/e,r);return a[0]*=t,a}return n.invert=function(n,r){var a=w.invert(n/t,r);return a[0]*=e,a},n}function M(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function T(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function A(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function L(t){return function(e){var n,r=t*Math.sin(e),a=30;do{e-=n=(e+Math.sin(e)-r)/(1+Math.cos(e))}while(Math.abs(n)>f&&--a>0);return e/2}}M.invert=function(t,e){var n=2*y(e/2);return[t*Math.cos(n/2)/Math.cos(n),n]},(t.geo.hammer=function(){var t=2,e=b(k),n=e(t);return n.coefficient=function(n){return arguments.length?e(t=+n):t},n}).raw=k,T.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(T)}).raw=T,A.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(A)}).raw=A,L(p);var C=function(t,e,n){var r=L(n);function a(n,a){return[t*n*Math.cos(a=r(a)),e*Math.sin(a)]}return a.invert=function(r,a){var o=y(a/e);return[r/(t*Math.cos(o)),y((2*o+Math.sin(2*o))/n)]},a}(Math.SQRT2/h,Math.SQRT2,p);function S(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}(t.geo.mollweide=function(){return x(C)}).raw=C,S.invert=function(t,e){var n,r=e,a=25;do{var o=r*r,i=o*o;r-=n=(r*(1.007226+o*(.015085+i*(.028874*o-.044475-.005916*i)))-e)/(1.007226+o*(.045255+i*(.259866*o-.311325-.005916*11*i)))}while(Math.abs(n)>f&&--a>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},(t.geo.naturalEarth=function(){return x(S)}).raw=S;var P=[[.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]];function O(t,e){var n,r=Math.min(18,36*Math.abs(e)/p),a=Math.floor(r),o=r-a,i=(n=P[a])[0],l=n[1],s=(n=P[++a])[0],c=n[1],u=(n=P[Math.min(19,++a)])[0],f=n[1];return[t*(s+o*(u-i)/2+o*o*(u-2*s+i)/2),(e>0?h:-h)*(c+o*(f-l)/2+o*o*(f-2*c+l)/2)]}function z(t,e){return[t*Math.cos(e),e]}function D(t,e){var n,r=Math.cos(e),a=(n=m(r*Math.cos(t/=2)))?n/Math.sin(n):1;return[2*r*Math.sin(t)*a,Math.sin(e)*a]}function E(t,e){var n=D(t,e);return[(n[0]+t/h)/2,(n[1]+e)/2]}P.forEach(function(t){t[1]*=1.0144}),O.invert=function(t,e){var n=e/h,r=90*n,a=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(a));do{var i=P[o][1],l=P[o+1][1],s=P[Math.min(19,o+2)][1],c=s-i,u=s-2*l+i,f=2*(Math.abs(n)-l)/c,p=u/c,y=f*(1-p*f*(1-2*p*f));if(y>=0||1===o){r=(e>=0?5:-5)*(y+a);var m,x=50;do{y=(a=Math.min(18,Math.abs(r)/5))-(o=Math.floor(a)),i=P[o][1],l=P[o+1][1],s=P[Math.min(19,o+2)][1],r-=(m=(e>=0?h:-h)*(l+y*(s-i)/2+y*y*(s-2*l+i)/2)-e)*v}while(Math.abs(m)>d&&--x>0);break}}while(--o>=0);var b=P[o][0],_=P[o+1][0],w=P[Math.min(19,o+2)][0];return[t/(_+y*(w-b)/2+y*y*(w-2*_+b)/2),r*g]},(t.geo.robinson=function(){return x(O)}).raw=O,z.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(z)}).raw=z,D.invert=function(t,e){if(!(t*t+4*e*e>p*p+f)){var n=t,r=e,a=25;do{var o,i=Math.sin(n),l=Math.sin(n/2),s=Math.cos(n/2),c=Math.sin(r),u=Math.cos(r),d=Math.sin(2*r),h=c*c,g=u*u,v=l*l,y=1-g*s*s,x=y?m(u*s)*Math.sqrt(o=1/y):o=0,b=2*x*u*l-t,_=x*c-e,w=o*(g*v+x*u*s*h),k=o*(.5*i*d-2*x*c*l),M=.25*o*(d*l-x*c*g*i),T=o*(h*s+x*v*u),A=k*M-T*w;if(!A)break;var L=(_*k-b*T)/A,C=(b*M-_*w)/A;n-=L,r-=C}while((Math.abs(L)>f||Math.abs(C)>f)&&--a>0);return[n,r]}},(t.geo.aitoff=function(){return x(D)}).raw=D,E.invert=function(t,e){var n=t,r=e,a=25;do{var o,i=Math.cos(r),l=Math.sin(r),s=Math.sin(2*r),c=l*l,u=i*i,d=Math.sin(n),p=Math.cos(n/2),g=Math.sin(n/2),v=g*g,y=1-u*p*p,x=y?m(i*p)*Math.sqrt(o=1/y):o=0,b=.5*(2*x*i*g+n/h)-t,_=.5*(x*l+r)-e,w=.5*o*(u*v+x*i*p*c)+.5/h,k=o*(d*s/4-x*l*g),M=.125*o*(s*g-x*l*u*d),T=.5*o*(c*p+x*v*i)+.5,A=k*M-T*w,L=(_*k-b*T)/A,C=(b*M-_*w)/A;n-=L,r-=C}while((Math.abs(L)>f||Math.abs(C)>f)&&--a>0);return[n,r]},(t.geo.winkel3=function(){return x(E)}).raw=E}},{}],249:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=Math.PI/180,i=180/Math.PI,l={cursor:"pointer"},s={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,n){var r=t.id,o=t.graphDiv,i=o.layout[r],l=o._fullLayout[r],s={};function c(t,e){var n=a.nestedProperty(l,t);n.get()!==e&&(n.set(e),a.nestedProperty(i,t).set(e),s[r+"."+t]=e)}n(c),c("projection.scale",e.scale()/t.fitScale),o.emit("plotly_relayout",s)}function f(t,e){var n=c(0,e),a=e.scale();function o(n){var r=e.invert(t.midPt);n("center.lon",r[0]),n("center.lat",r[1])}return n.on("zoomstart",function(){r.select(this).style(l)}).on("zoom",function(){var o=Math.max(a,r.event.scale);n.scale(o),e.scale(o).translate(r.event.translate),t.render()}).on("zoomend",function(){r.select(this).style(s),u(t,e,o)}),n}function d(t,e){var n,a,o,i,f,d,p,h,g=c(0,e),v=e.scale(),y=2;function m(t){return e.invert(t)}function x(n){var r=e.rotate(),a=e.invert(t.midPt);n("projection.rotation.lon",-r[0]),n("center.lon",a[0]),n("center.lat",a[1])}return g.on("zoomstart",function(){r.select(this).style(l),n=r.mouse(this),a=e.rotate(),o=e.translate(),i=a,f=m(n)}).on("zoom",function(){if(d=r.mouse(this),s=e(m(l=n)),Math.abs(s[0]-l[0])>y||Math.abs(s[1]-l[1])>y)return g.scale(e.scale()),void g.translate(e.translate());var l,s;e.scale(Math.max(v,r.event.scale));var c=e.scale()*Math.PI,u=o[0]-c/2,x=c/2,b=Math.min(Math.max(r.event.translate[1],u),x);e.translate([o[0],b]),g.translate([o[0],b]),f?m(d)&&(h=m(d),p=[i[0]+(h[0]-f[0]),a[1],a[2]],e.rotate(p),i=p):f=m(n=d),t.render()}).on("zoomend",function(){r.select(this).style(s),u(t,e,x)}),g}function p(t,e){var n,a={r:e.rotate(),k:e.scale()},f=c(0,e),d=function(t){var e=0,n=arguments.length,a=[];for(;++eh?(o=(f>0?90:-90)-p,a=0):(o=Math.asin(f/h)*i-p,a=Math.sqrt(h*h-f*f));var v=180-o-2*p,m=(Math.atan2(d,u)-Math.atan2(c,a))*i,x=(Math.atan2(d,u)-Math.atan2(c,-a))*i,b=g(n[0],n[1],o,m),_=g(n[0],n[1],v,x);return b<=_?[o,m,n[2]]:[v,x,n[2]]}(k,n,C);isFinite(M[0])&&isFinite(M[1])&&isFinite(M[2])||(M=C),e.rotate(M),C=M}}else n=h(e,A=b);d.of(this,arguments)({type:"zoom"})}),T=d.of(this,arguments),p++||T({type:"zoomstart"})}).on("zoomend",function(){var n;r.select(this).style(s),v.call(f,"zoom",null),n=d.of(this,arguments),--p||n({type:"zoomend"}),u(t,e,x)}).on("zoom.redraw",function(){t.render()}),r.rebind(f,d,"on")}function h(t,e){var n=t.invert(e);return n&&isFinite(n[0])&&isFinite(n[1])&&function(t){var e=t[0]*o,n=t[1]*o,r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}(n)}function g(t,e,n,r){var a=v(n-t),o=v(r-e);return Math.sqrt(a*a+o*o)}function v(t){return(t%360+540)%360-180}function y(t,e,n){var r=n*o,a=t.slice(),i=0===e?1:0,l=2===e?1:2,s=Math.cos(r),c=Math.sin(r);return a[i]=t[i]*s-t[l]*c,a[l]=t[l]*s+t[i]*c,a}function m(t,e){for(var n=0,r=0,a=t.length;r=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"),s=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var n=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)n.on("click",function(){p.sendDataToCloud(t)});else{var r=window.location.pathname.split("/"),a=window.location.search;n.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+r[2].split(".")[0]+"/"+r[1]+a})}}(t,i),l.text(i.text()&&s.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),a=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),a.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,n=t._fullLayout||{},a=t._fullLayout={},o=t.layout||{},i=t._fullData||[],f=t._fullData=[],d=t.data||[];t._transitionData||p.createTransitionData(t),a._dfltTitle={plot:u(t,"Click to enter Plot title"),x:u(t,"Click to enter X axis title"),y:u(t,"Click to enter Y axis title"),colorbar:u(t,"Click to enter Colorscale title"),annotation:u(t,"new text")},a._traceWord=u(t,"trace");var h=function(t){var e=t._context.locale;var n=!1,r={};function a(t){for(var e=!0,a=0;a=0)return!0}return!1},p.cleanPlot=function(t,e,n,r){var a,o,i=r._basePlotModules||[];for(a=0;a0){var u=function(t){var e,n={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(n.left+=t[e].left||0,n.right+=t[e].right||0,n.bottom+=t[e].bottom||0,n.top+=t[e].top||0);return n}(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};r=Math.round(h*(g.width-f)),o=Math.round(h*(g.height-d))}else{var v=s?window.getComputedStyle(t):{};r=parseFloat(v.width)||n.width,o=parseFloat(v.height)||n.height}var y=p.layoutAttributes.width.min,m=p.layoutAttributes.height.min;r1,b=!e.height&&Math.abs(n.height-o)>1;(b||x)&&(x&&(n.width=r),b&&(n.height=o)),t._initialAutoSize||(t._initialAutoSize={width:r,height:o}),p.sanitizeMargins(n)},p.supplyLayoutModuleDefaults=function(t,e,n,r){var a,o,i,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(a in s)(i=s[a]).includeBasePlot&&i.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),o=0;o.45*r.width&&(n.l=n.r=0),n.b+n.t>.4*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];r._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,r=JSON.stringify(n),i=Math.max(e.margin.l||0,0),l=Math.max(e.margin.r||0,0),s=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var f in u.base={l:{val:0,size:i},r:{val:1,size:l},t:{val:1,size:s},b:{val:0,size:c}},u){var d=u[f].l||{},p=u[f].b||{},h=d.val,g=d.size,v=p.val,y=p.size;for(var m in u){if(a(g)&&u[m].r){var x=u[m].r.val,b=u[m].r.size;if(x>h){var _=(g*x+(b-e.width)*h)/(x-h),w=(b*(1-h)+(g-e.width)*(1-x))/(x-h);_>=0&&w>=0&&_+w>i+l&&(i=_,l=w)}}if(a(y)&&u[m].t){var k=u[m].t.val,M=u[m].t.size;if(k>v){var T=(y*k+(M-e.height)*v)/(k-v),A=(M*(1-v)+(y-e.height)*(1-k))/(k-v);T>=0&&A>=0&&T+A>c+s&&(c=T,s=A)}}}}if(n.l=Math.round(i),n.r=Math.round(l),n.t=Math.round(s),n.b=Math.round(c),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,!e._replotting&&"{}"!==r&&r!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,n,r,a){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=a?t._fullData:t.data,i=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function s(t){if("function"==typeof t)return null;if(c.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("string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0&&!c.isPlainObject(t.stream))continue}else if("keepall"!==n&&"string"==typeof(r=t[e+"src"])&&r.indexOf(":")>0)continue;a[e]=s(t[e])}return a}return Array.isArray(t)?t.map(s):c.isJSDate(t)?c.ms2DateTimeLocal(+t):t}var u={data:(o||[]).map(function(t){var n=s(t);return e&&delete n.fit,n})};return e||(u.layout=s(i)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=s(l)),"object"===r?u:JSON.stringify(u)},p.modifyFrames=function(t,e){var n,r,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(n=0;n0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){h=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var r,l,s=0,u=0;function f(){return s++,function(){var n;u++,h||u!==s||(n=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return o.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(n)))}}var p=t._fullLayout._basePlotModules,g=!1;if(n)for(l=0;l=0;o--)if(b[o].enabled){n._indexToPoints=b[o]._indexToPoints;break}r&&r.calc&&(x=r.calc(t,n))}Array.isArray(x)&&x[0]||(x=[{x:d,y:d}]),x[0].t||(x[0].t={}),x[0].trace=n,p[a]=x}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,n,r){var a,o=e.traceHash,i={};for(a=0;a=0?d.angularAxis.domain:r.extent(k),C=Math.abs(k[1]-k[0]);T&&!M&&(C=0);var S=L.slice();A&&M&&(S[1]+=C);var P=d.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),d.angularAxis.ticksStep&&(P=(S[1]-S[0])/P);var O=d.angularAxis.ticksStep||(S[1]-S[0])/(P*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var z=r.range.apply(this,S);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=r.scale.linear().domain(S.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?C:0,void 0===(t=r.select(this).select("svg.chart-root"))||t.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),E=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));t=r.select(E)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var N,R=t.select(".chart-group"),I={fill:"none",stroke:d.tickColor},F={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){N=t.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var n=i.util.cloneJson(t);return n.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",n.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,n.color="LinePlot"===t.geometry?t.strokeColor:t.color,n});i.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},i.Legend.defaultConfig().legendConfig,{container:N,elements:j,reverseOrder:d.legend.reverseOrder})})();var B=N.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],n.range([0,x]),u.layout.radialAxis.domain=n.domain(),N.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else N=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var q=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(q[0]=Math.max(0,q[0]),q[1]=Math.max(0,q[1]),t.select(".outer-group").attr("transform","translate("+q+")"),d.title){var H=t.select("g.title-group text").style(F).text(d.title),V=H.node().getBBox();H.attr({x:_[0]-V.width/2,y:_[1]-x-20})}var U=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=U.selectAll("circle.grid-circle").data(n.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(I),G.attr("r",n),G.exit().remove()}U.select("circle.outside-circle").attr({r:x}).style(I);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function X(t,e){return l(t)%360+d.orientation}if(d.radialAxis.visible){var Z=r.svg.axis().scale(n).ticks(5).tickSize(5);U.call(Z).attr({transform:"rotate("+d.radialAxis.orientation+")"}),U.selectAll(".domain").style(I),U.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),U.selectAll("g>line").style({stroke:"black"})}var W=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),J=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(I),J.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(F);var Q=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:o+"em",transform:function(t,e){var n=X(t),r=x+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-n+" "+r+" 0)":"radial"==a?n<270&&n>90?"rotate(180 "+r+" 0)":null:"rotate("+(n<=180&&n>0?-90:90)+" "+r+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(F);d.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var $=r.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));N.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||K){var et=[];p.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=l,r.container=tt.filter(function(t,n){return n==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,et.push({data:t,geometryConfig:r})});var nt=r.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),rt=[];nt.forEach(function(t,e){"unstacked"===t.key?rt=rt.concat(t.values.map(function(t,e){return[t]})):rt.push(t.values)}),rt.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 a(i[n].defaultConfig(),t)});i[n]().config(r)()})}var at,ot,it=t.select(".guides-group"),lt=t.select(".tooltips-group"),st=i.tooltipPanel().config({container:lt,fontSize:8})(),ct=i.tooltipPanel().config({container:lt,fontSize:8})(),ut=i.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var n=i.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+n+")"}).style({opacity:.5});var r=(n+180+360-d.orientation)%360;at=l.invert(r);var a=i.util.convertToCartesian(x+12,n+180);st.text(i.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var dt=it.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var r=i.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=n.invert(i.util.getMousePos(Y).radius);var a=i.util.convertToCartesian(r,d.radialAxis.orientation);ct.text(i.util.round(ot)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,n){var a=r.select(this),o=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),o&&"none"!==o){a.attr({"data-fill":o}),l=r.hsl(o).darker().toString(),a.style({fill:l,opacity:1});var c={t:i.util.round(e[0]),r:i.util.round(e[1])};M&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),p=[f.left+f.width/2-q[0]-d.left,f.top+f.height/2-q[1]-d.top];ut.config({color:l}).text(u),ut.move(p)}else o=this.style.stroke||"black",a.attr({"data-stroke":o}),l=r.hsl(o).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=r.event.which)return!1;r.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var n=r.select(this),a=n.attr("data-fill");a?n.style({fill:a,opacity:n.attr("data-opacity")}):n.style({stroke:n.attr("data-stroke"),opacity:n.attr("data-opacity")})})})}(c),this},d.config=function(t){if(!arguments.length)return s;var e=i.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),a(s.data[e],i.Axis.defaultConfig().data[0]),a(s.data[e],t)}),a(s.layout,i.Axis.defaultConfig().layout),a(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return n},d.angularScale=function(t){return l},d.svg=function(){return t},r.rebind(d,f,"on"),d},i.Axis.defaultConfig=function(t,e){return{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:r.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}}},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var n in t)n in e&&(e[n]=t[n])},i.util._extend=function(t,e){for(var n in t)e[n]=t[n]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.util.dataFromEquation2=function(t,e){var n=e||6;return r.range(0,360+n,n).map(function(e,n){var r=e*Math.PI/180;return[e,t(r)]})},i.util.dataFromEquation=function(t,e,n){var a=e||6,o=[],i=[];r.range(0,360+a,a).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},i.util.ensureArray=function(t,e){if(void 0===t)return null;var n=[].concat(t);return r.range(e).map(function(t,e){return n[e]||n[0]})},i.util.fillArrays=function(t,e,n){return e.forEach(function(e,r){t[e]=i.util.ensureArray(t[e],n)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var n=e.shift();return t[n]&&(!e.length||objHasKeys(t[n],e))},i.util.sumArrays=function(t,e){return r.zip(t,e).map(function(t,e){return r.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var n=Math.max(t.length,e.length,1);n-- >=0&&t[n]===e[n];);return-2===n},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,n){return n.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var n=e*Math.PI/180;return[t*Math.cos(n),t*Math.sin(n)]},i.util.round=function(t,e){var n=e||2,r=Math.pow(10,n);return Math.round(t*r)/r},i.util.getMousePos=function(t){var e=r.mouse(t.node()),n=e[0],a=e[1],o={};return o.x=n,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,n)+Math.PI)/Math.PI,o.radius=Math.sqrt(n*n+a*a),o},i.util.duplicatesCount=function(t){for(var e,n={},r={},a=0,o=t.length;a0)){var s=r.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(t,n){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return h.fill(n,a,o)},"fill-opacity":0,stroke:function(t,e){return h.stroke(n,a,o)},"stroke-width":function(t,e){return h["stroke-width"](n,a,o)},"stroke-dasharray":function(t,e){return h["stroke-dasharray"](n,a,o)},opacity:function(t,e){return h.opacity(n,a,o)},display:function(t,e){return h.display(n,a,o)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/i[0].length*Math.PI/180,p=r.svg.arc().startAngle(function(t){return-d/2}).endAngle(function(t){return d/2}).innerRadius(function(t){return e.radialScale(s+(t[2]||0))}).outerRadius(function(t){return e.radialScale(s+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,n,a){r.select(this).attr({class:"mark arc",d:p,transform:function(t,n){return"rotate("+(e.orientation+l(t[0])+90)+")"}})};var h={fill:function(e,n,r){return t[r].data.color},stroke:function(e,n,r){return t[r].data.strokeColor},"stroke-width":function(e,n,r){return t[r].data.strokeSize+"px"},"stroke-dasharray":function(e,r,a){return n[t[a].data.strokeDash]},opacity:function(e,n,r){return t[r].data.opacity},display:function(e,n,r){return void 0===t[r].data.visible||t[r].data.visible?"block":"none"}},g=r.select(this).selectAll("g.layer").data(i);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[e.geometryType]),v.exit().remove(),g.exit().remove()})}return o.config=function(e){return arguments.length?(e.forEach(function(e,n){t[n]||(t[n]={}),a(t[n],i.PolyChart.defaultConfig()),a(t[n],e)}),this):t},o.getColorScale=function(){},r.rebind(o,e,"on"),o},i.PolyChart.defaultConfig=function(){return{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:r.scale.category20()}}},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},i.Legend=function(){var t=i.Legend.defaultConfig(),e=r.dispatch("hover");function n(){var e=t.legendConfig,o=t.data.map(function(t,n){return[].concat(t).map(function(t,r){var o=a({},e.elements[n]);return o.name=t,o.color=[].concat(e.elements[n].color)[r],o})}),i=r.merge(o);i=i.filter(function(t,n){return e.elements[n]&&(e.elements[n].visibleInLegend||void 0===e.elements[n].visibleInLegend)}),e.reverseOrder&&(i=i.reverse());var l=e.container;("string"==typeof l||l.nodeName)&&(l=r.select(l));var s=i.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof i[0]:e.isContinuous,f=u?e.height:c*i.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.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 h=r.range(i.length),g=r.scale[u?"linear":"ordinal"]().domain(h).range(s),v=r.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var y=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var m=d.select(".legend-marks").selectAll("path.legend-mark").data(i);m.enter().append("path").classed("legend-mark",!0),m.attr({transform:function(t,e){return"translate("+[c/2,v(e)+c/2]+")"},d:function(t,e){var n,a,o,i=t.symbol;return o=3*(a=c),"line"===(n=i)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=r.svg.symbolTypes.indexOf(n)?r.svg.symbol().type(n).size(o)():r.svg.symbol().type("square").size(o)()},fill:function(t,e){return g(e)}}),m.exit().remove()}var x=r.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return i[e].name}),n}return n.config=function(e){return arguments.length?(a(t,e),this):t},r.rebind(n,e,"on"),n},i.Legend.defaultConfig=function(t,e){return{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}}},i.tooltipPanel=function(){var t,e,n,o={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=10,c=function(){var r=(t=o.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return n=r.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=r.append("text").attr({dx:o.padding+s,dy:.3*+o.fontSize}),c};return c.text=function(a){var i=r.hsl(o.color).l,l=i>=.5?"#aaa":"white",u=i>=.5?"black":"white",f=a||"";e.style({fill:u,"font-size":o.fontSize+"px"}).text(f);var d=o.padding,p=e.node().getBBox(),h={fill:o.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return n.attr({d:"M"+[[s,-v/2],[s,-v/4],[o.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[s,-v/2+2*d]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return a(o,t),c},c},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={convert:function(t,e){var n={};if(t.data&&(n.data=t.data.map(function(t,n){var r=a({},t);return[[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"]]].forEach(function(t,n){i.util.translator.apply(null,t.concat(e))}),e||delete r.marker,e&&delete r.groupId,e?("LinePlot"===r.geometry?(r.type="scatter",!0===r.dotVisible?(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 o=i.util.duplicates(n.data.map(function(t,e){return t.geometry}));n.data.forEach(function(t,e){var r=o.indexOf(t.geometry);-1!=r&&(n.data[e].groupId=r)})}if(t.layout){var l=a({},t.layout);if([[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"]]].forEach(function(t,n){i.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==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&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};r.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}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}};return t}},{"../../../constants/alignment":148,"../../../lib":169,d3:13}],259:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../../lib"),o=t("../../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){var e,n,a,o,u,f=new l;function d(n,l){return l&&(u=l),r.select(r.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?s(e,n):n,a||(a=i.Axis()),o=i.adapter.plotly().convert(e),a.config(o).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return i.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,r,a=this,o=i.util.cloneJson(e);t=o,r=n,f.add({undo:function(){r&&a(r)},redo:function(){a(t)}}),n=i.util.cloneJson(o)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(t){var e=r.select(t).selectAll(".plot-container"),n=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:n,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../../components/color":50,"../../../lib":169,"./micropolar":258,"./undo_manager":260,d3:13}],260:[function(t,e,n){"use strict";e.exports=function(){var t,e=[],n=-1,r=!1;function a(t,e){return t?(r=!0,t[e](),r=!1,this):this}return{add:function(t){return r?this:(e.splice(n+1,e.length-n),e.push(t),n=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var r=e[n];return r?(a(r,"undo"),n-=1,t&&t(r.undo),this):this},redo:function(){var r=e[n+1];return r?(a(r,"redo"),n+=1,t&&t(r.redo),this):this},clear:function(){e=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1&&(u[d[n]].title="");for(n=0;n")?"":e.html(t).text()});return e.remove(),n}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":50,"../components/drawing":75,"../constants/xmlns_namespaces":152,"../lib":169,d3:13}],271:[function(t,e,n){"use strict";var r=t("../../lib").mergeArray;e.exports=function(t,e){for(var n=0;no))return e}return void 0!==n?n:t.dflt}function k(t,e,n){return o(e).isValid()?e:void 0!==n?n:t.dflt}e.exports=function(t,e,n){var o=e.xaxis,f=e.yaxis,w=t._fullLayout,k=e.plot.select(".barlayer").selectAll("g.trace.bars").data(n);k.enter().append("g").attr("class","trace bars"),k.each(function(t){t[0].node3=r.select(this)}),k.append("g").attr("class","points").each(function(e){var n=r.select(this),u=e[0].t,k=e[0].trace,M=u.poffset,T=Array.isArray(M);n.selectAll("g.point").data(i.identity).enter().append("g").classed("point",!0).each(function(n,i){var u,A,L,C,S=n.p+(T?M[i]:M),P=S+n.w,O=n.b,z=O+n.s;if("h"===k.orientation?(L=f.c2p(S,!0),C=f.c2p(P,!0),u=o.c2p(O,!0),A=o.c2p(z,!0),n.ct=[A,(L+C)/2]):(u=o.c2p(S,!0),A=o.c2p(P,!0),L=f.c2p(O,!0),C=f.c2p(z,!0),n.ct=[(u+A)/2,C]),a(u)&&a(A)&&a(L)&&a(C)&&u!==A&&L!==C){var D=(n.mlw+1||k.marker.line.width+1||(n.trace?n.trace.marker.line.width:0)+1)-1,E=r.round(D/2%1,2);if(!t._context.staticPlot){var N=s.opacity(n.mc||k.marker.color)<1||D>.01?I:function(t,e){return Math.abs(t-e)>=2?I(t):t>e?Math.ceil(t):Math.floor(t)};u=N(u,A),A=N(A,u),L=N(L,C),C=N(C,L)}var R=r.select(this);R.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+u+","+L+"V"+C+"H"+A+"V"+L+"Z"),function(t,e,n,r,a,o,i,s){var u;function f(e,n,r){var a=e.append("text").text(n).attr({class:"bartext bartext-"+u,transform:"","text-anchor":"middle","data-notex":1}).call(c.font,r).call(l.convertToTspans,t);return a}var w=n[0].trace,k=w.orientation,M=function(t,e){var n=b(t.text,e);return _(d,n)}(w,r);if(!M)return;if("none"===(u=function(t,e){var n=b(t.textposition,e);return function(t,e,n){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==n?n:t.dflt}(p,n)}(w,r)))return;var T,A,L,C,S,P,O=function(t,e,n){return x(h,t.textfont,e,n)}(w,r,t._fullLayout.font),z=function(t,e,n){return x(g,t.insidetextfont,e,n)}(w,r,O),D=function(t,e,n){return x(v,t.outsidetextfont,e,n)}(w,r,O),E=t._fullLayout.barmode,N="relative"===E,R="stack"===E||N,I=n[r],F=!R||I._outmost,j=Math.abs(o-a)-2*y,B=Math.abs(s-i)-2*y;"outside"===u&&(F||(u="inside"));if("auto"===u)if(F){u="inside",T=f(e,M,z),A=c.bBox(T.node()),L=A.width,C=A.height;var q=L>0&&C>0,H=L<=j&&C<=B,V=L<=B&&C<=j,U="h"===k?j>=L*(B/C):B>=C*(j/L);q&&(H||V||U)?u="inside":(u="outside",T.remove(),T=null)}else u="inside";if(!T&&(T=f(e,M,"outside"===u?D:z),A=c.bBox(T.node()),L=A.width,C=A.height,L<=0||C<=0))return void T.remove();"outside"===u?(P="both"===w.constraintext||"outside"===w.constraintext,S=function(t,e,n,r,a,o,i){var l,s="h"===o?Math.abs(r-n):Math.abs(e-t);s>2*y&&(l=y);var c=1;i&&(c="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width));var u,f,d,p,h=(a.left+a.right)/2,g=(a.top+a.bottom)/2;u=c*a.width,f=c*a.height,"h"===o?en?(d=(t+e)/2,p=r+l+f/2):(d=(t+e)/2,p=r-l-f/2);return m(h,g,d,p,c,!1)}(a,o,i,s,A,k,P)):(P="both"===w.constraintext||"inside"===w.constraintext,S=function(t,e,n,r,a,o,i){var l,s,c,u,f,d,p,h=a.width,g=a.height,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=Math.abs(e-t),_=Math.abs(r-n);b>2*y&&_>2*y?(b-=2*(f=y),_-=2*f):f=0;h<=b&&g<=_?(d=!1,p=1):h<=_&&g<=b?(d=!0,p=1):hn?(c=(t+e)/2,u=r-f-s/2):(c=(t+e)/2,u=r+f+s/2);return m(v,x,c,u,p,d)}(a,o,i,s,A,k,P));T.attr("transform",S)}(t,R,e,i,u,A,L,C)}else r.select(this).remove();function I(t){return 0===w.bargap&&0===w.bargroupgap?r.round(Math.round(t)-E,2):t}})}),k.call(u.plot,e)}},{"../../components/color":50,"../../components/drawing":75,"../../components/errorbars":81,"../../lib":169,"../../lib/svg_text_utils":190,"./attributes":272,d3:13,"fast-isnumeric":16,tinycolor2:31}],280:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r=t.cd,a=t.xaxis,o=t.yaxis,i=[];if(!1===e)for(n=0;nf+c||!r(u))&&(p=!0,h(d,t))}for(var v=0;v1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),n.selectAll("g.points").each(function(e){var n=r.select(this),o=n.selectAll("path"),i=n.selectAll("text"),l=e[0].trace;a.pointStyle(o,l,t),a.selectedPointStyle(o,l),i.each(function(t){var e,n=r.select(this);function o(n){var r=e[n];return Array.isArray(r)?r[t.i]:r}n.classed("bartext-inside")?e=l.insidetextfont:n.classed("bartext-outside")&&(e=l.outsidetextfont),e||(e=l.textfont),a.font(n,o("family"),o("size"),o("color"))}),a.selectedTextStyle(i,l)}),o.style(n)}},{"../../components/drawing":75,"../../components/errorbars":81,d3:13}],284:[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"),n("marker.opacity"),n("selected.marker.color"),n("unselected.marker.color")}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64}],285:[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",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:o({},r.text,{}),textbox:o({},r.textbox,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:o({},i.symbol,{arrayOk:!1,editType:"plot"}),opacity:o({},i.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:o({},i.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:o({},i.color,{arrayOk:!1,editType:"style"}),line:{color:o({},l.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:o({},l.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,selected:{marker:r.selected.marker,editType:"style"},unselected:{marker:r.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":49,"../../lib/extend":161,"../scatter/attributes":330}],286:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=a._,i=t("../../plots/cartesian/axes");function l(t,e,n){var r={text:"tx"};for(var a in r)Array.isArray(e[a])&&(t[r[a]]=e[a][n])}function s(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var n,u,f,d,p,h=t._fullLayout,g=i.getFromId(t,e.xaxis||"x"),v=i.getFromId(t,e.yaxis||"y"),y=[],m="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=g,f="x",d=v,p="y"):(u=v,f="y",d=g,p="x");var x=u.makeCalcdata(e,f),b=function(t,e,n,o,i){if(e in t)return n.makeCalcdata(t,e);var l;l=e+"0"in t?t[e+"0"]:"name"in t&&("category"===n.type||r(t.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(t.name)&&"date"===n.type)?t.name:i;var s=n.d2c(l,0,t[e+"calendar"]);return o.map(function(){return s})}(e,p,d,x,h[m]),_=a.distinctVals(b),w=_.vals,k=_.minDiff/2,M=function(t,e){for(var n=t.length,r=new Array(n+1),a=0;a=0&&S0){var O=L[n].sort(s),z=O.map(c),D=z.length,E={pos:w[n],pts:O};E.min=z[0],E.max=z[D-1],E.mean=a.mean(z,D),E.sd=a.stdev(z,D,E.mean),E.q1=a.interp(z,.25),E.med=a.interp(z,.5),E.q3=a.interp(z,.75),E.lf=Math.min(E.q1,z[Math.min(a.findBin(2.5*E.q1-1.5*E.q3,z,!0)+1,D-1)]),E.uf=Math.max(E.q3,z[Math.max(a.findBin(2.5*E.q3-1.5*E.q1,z),0)]),E.lo=4*E.q1-3*E.q3,E.uo=4*E.q3-3*E.q1,y.push(E)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var n=0;n0?(y[0].t={num:h[m],dPos:k,posLetter:p,valLetter:f,labels:{med:o(t,"median:"),min:o(t,"min:"),q1:o(t,"q1:"),q3:o(t,"q3:"),max:o(t,"max:"),mean:"sd"===e.boxmean?o(t,"mean \xb1 \u03c3:"):o(t,"mean:"),lf:o(t,"lower fence:"),uf:o(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete y[0].t.labels,h[m]++,y):[{t:{empty:!0}}]}},{"../../lib":169,"../../plots/cartesian/axes":213,"fast-isnumeric":16}],287:[function(t,e,n){"use strict";var r=t("../../lib"),a=t("../../registry"),o=t("../../components/color"),i=t("./attributes");function l(t,e,n,r){var o,i=n("y"),l=n("x");if(i&&i.length)o="v",l||n("x0");else{if(!l||!l.length)return void(e.visible=!1);o="h",n("y0")}a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),n("orientation",o)}function s(t,e,n,a){var o=a.prefix,l=r.coerce2(t,e,i,"marker.outliercolor"),s=n("marker.line.outliercolor"),c=n(o+"points",l||s?"suspectedoutliers":void 0);n("jitter","all"===c?.3:0),n("pointpos","all"===c?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===c&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("textbox"),n("hoveron"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,a){function c(n,a){return r.coerce(t,e,i,n,a)}l(t,e,c,a),!1!==e.visible&&(c("line.color",(t.marker||{}).color||n),c("line.width"),c("fillcolor",o.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),s(t,e,c,{prefix:"box"}))},handleSampleDefaults:l,handlePointsDefaults:s}},{"../../components/color":50,"../../lib":169,"../../registry":262,"./attributes":285}],288:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("../../components/fx"),i=t("../../components/color"),l=t("../scatter/fill_hover_text");function s(t,e,n,l){var s,c,u,f,d,p,h,g,v,y,m=t.cd,x=t.xa,b=t.ya,_=m[0].trace,w=m[0].t,k="violin"===_.type,M=[],T="closest"!==l||k?w.bdPos:2.5*w.bdPos,A=function(t){return t.pos+w.bPos-p};k&&"both"!==_.side?("positive"===_.side&&(v=function(t){var e=A(t);return o.inbox(e,e+T)}),"negative"===_.side&&(v=function(t){var e=A(t);return o.inbox(e-T,e)})):v=function(t){var e=A(t);return o.inbox(e-T,e+T)},y=k?function(t){return o.inbox(t.span[0]-d,t.span[1]-d)}:function(t){return o.inbox(t.min-d,t.max-d)},"h"===_.orientation?(d=e,p=n,h=y,g=v,s="y",u=b,c="x",f=x):(d=n,p=e,h=v,g=y,s="x",u=x,c="y",f=b);var L=o.getDistanceFunction(l,h,g);if(o.getClosest(m,L,t),!1===t.index)return[];var C=m[t.index],S=_.line.color,P=(_.marker||{}).color;i.opacity(S)&&_.line.width?t.color=S:i.opacity(P)&&_.boxpoints?t.color=P:t.color=_.fillcolor,t[s+"0"]=u.c2p(C.pos+w.bPos-w.bdPos,!0),t[s+"1"]=u.c2p(C.pos+w.bPos+w.bdPos,!0),r.tickText(u,u.c2l(C.pos),"hover").text,t[s+"LabelVal"]=C.pos;var O={},z=["med","min","q1","q3","max"];(_.boxmean||(_.meanline||{}).visible)&&z.push("mean"),_.boxpoints&&z.push("lf","uf");for(var D=0;Dt.uf}),i=Math.max((t.max-t.min)/10,t.q3-t.q1),u=1e-9*i,f=i*c,g=[],v=0;if(n.jitter){if(0===i)for(v=1,g=new Array(o.length),e=0;et.lo&&(w.so=!0)}return o}).enter().append("path").classed("point",!0).call(o.translatePoints,u,f)}function d(t,e,n,o){var i,l,s=e.pos,c=e.val,u=o.bPos,f=o.bPosPxOffset||0;Array.isArray(o.bdPos)?(i=o.bdPos[0],l=o.bdPos[1]):(i=o.bdPos,l=o.bdPos),t.selectAll("path.mean").data(a.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=s.c2p(t.pos+u,!0)+f,a=s.c2p(t.pos+u-i,!0)+f,o=s.c2p(t.pos+u+l,!0)+f,d=c.c2p(t.mean,!0),p=c.c2p(t.mean-t.sd,!0),h=c.c2p(t.mean+t.sd,!0);"h"===n.orientation?r.select(this).attr("d","M"+d+","+a+"V"+o+("sd"===n.boxmean?"m0,0L"+p+","+e+"L"+d+","+a+"L"+h+","+e+"Z":"")):r.select(this).attr("d","M"+a+","+d+"H"+o+("sd"===n.boxmean?"m0,0L"+e+","+p+"L"+a+","+d+"L"+e+","+h+"Z":""))})}e.exports={plot:function(t,e,n){var a=t._fullLayout,o=e.xaxis,i=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(n).enter().append("g").attr("class","trace boxes").each(function(t){var e,n,l=t[0],s=l.t,c=l.trace,p=l.node3=r.select(this),h=a._numBoxes,g="group"===a.boxmode&&h>1,v=s.dPos*(1-a.boxgap)*(1-a.boxgroupgap)/(g?h:1),y=g?2*s.dPos*((s.num+.5)/h-.5)*(1-a.boxgap):0,m=v*c.whiskerwidth;!0!==c.visible||s.empty?r.select(this).remove():("h"===c.orientation?(e=i,n=o):(e=o,n=i),s.bPos=y,s.bdPos=v,s.wdPos=m,u(p,{pos:e,val:n},c,s),c.boxpoints&&f(p,{x:o,y:i},c,s),c.boxmean&&d(p,{pos:e,val:n},c,s))})},plotBoxAndWhiskers:u,plotPoints:f,plotBoxMean:d}},{"../../components/drawing":75,"../../lib":169,d3:13}],293:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,a=t.cd,o=t.xaxis,i=t.yaxis,l=[];if(!1===e)for(n=0;n0&&x.push(g[_]));e.x=y,e.y=m,e.textbox=x}},{"../../lib":169,"../ohlc/helpers":313,"fast-isnumeric":16}],300:[function(t,e,n){"use strict";var r=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../plots/attributes"),l=t("../../lib/extend"),s=l.extendFlat,c=l.extendDeepAll,u=r.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:r.locationmode,z:{valType:"data_array",editType:"calc"},text:s({},r.text,{}),marker:{line:{color:u.color,width:s({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:r.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:r.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},i.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},a,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:o})},{"../../components/colorbar/attributes":51,"../../components/colorscale/attributes":56,"../../lib/extend":161,"../../plots/attributes":211,"../scattergeo/attributes":355}],301:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),i=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection");e.exports=function(t,e){for(var n=e.locations.length,s=new Array(n),c=0;cs&&(e.z=u.slice(0,s)),l("locationmode"),l("text"),l("marker.line.color"),l("marker.line.width"),l("marker.opacity"),a(t,e,i,l,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":60,"../../lib":169,"./attributes":300}],303:[function(t,e,n){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],304:[function(t,e,n){"use strict";var r=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,n){var i,l,s,c,u=t.cd,f=u[0].trace,d=t.subplot;for(l=0;l")}(t,f,i,d.mockAxis),[t]}},{"../../plots/cartesian/axes":213,"../scatter/fill_hover_text":338,"./attributes":300}],305:[function(t,e,n){"use strict";var r={};r.attributes=t("./attributes"),r.supplyDefaults=t("./defaults"),r.colorbar=t("../heatmap/colorbar"),r.calc=t("./calc"),r.plot=t("./plot"),r.style=t("./style"),r.hoverPoints=t("./hover"),r.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="choropleth",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","noOpacity"],r.meta={},e.exports=r},{"../../plots/geo":244,"../heatmap/colorbar":309,"./attributes":300,"./calc":301,"./defaults":302,"./event_data":303,"./hover":304,"./plot":306,"./select":307,"./style":308}],306:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../lib/polygon"),i=t("../../lib/topojson_utils").getTopojsonFeatures,l=t("../../lib/geo_location_utils").locationToFeature,s=t("./style");function c(t,e){for(var n=t[0].trace,r=t.length,a=i(n,e),o=0;o0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?n[r++]=[t[a][0]+360,t[a][1]]:a===e?(n[r++]=t[a],n[r++]=[t[a][0],-90]):n[r++]=t[a];var i=o.tester(n);i.pts.pop(),c.push(i)}:function(t){c.push(o.tester(t))},i.type){case"MultiPolygon":for(n=0;nn?e=!0:r1)){var f=a.simpleMap(u.x,e.d2c,0,n.xcalendar),d=a.distinctVals(f).minDiff;i=Math.min(i,d)}}for(i===1/0&&(i=1),l=0;l");L.push(i,i,i,i,i,i,null)},B=0;B")}}return y}},{"../../components/color":50,"./helpers":322,"fast-isnumeric":16,tinycolor2:31}],320:[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"),c=i("labels");if(!Array.isArray(c)){if(!Array.isArray(s)||!s.length)return void(e.visible=!1);i("label0"),i("dlabel")}i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),d&&"none"!==d){var p=i("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(i,"textfont",o.font);g&&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":169,"./attributes":317}],321:[function(t,e,n){"use strict";var r=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var n={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(n.pointNumber=n.i=t.pts[0]),r(n,e,t.pts),n}},{"../../components/fx/helpers":89}],322:[function(t,e,n){"use strict";var r=t("../../lib");n.formatPiePercent=function(t,e){var n=(100*t).toFixed(2);return-1!==n.lastIndexOf(".00")&&(n=n.replace(".00","")),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)},n.getFirstFilled=function(t,e){if(Array.isArray(t)&&e)for(var n=0;n0?1:-1)/2,y:o/(1+n*n/(r*r)),outside:!0}}e.exports=function(t,e){var n=t._fullLayout;!function(t,e){var n,r,a,o,i,l,s,c,u,f=[];for(a=0;as&&(s=l.pull[o]);i.r=Math.min(n,r)/(2+2*s),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===f.indexOf(l.scalegroup)&&f.push(l.scalegroup)}for(o=0;oa.vTotal/2?1:0)}(e),d.each(function(){var d=r.select(this).selectAll("g.slice").data(e);d.enter().append("g").classed("slice",!0),d.exit().remove();var g=[[[],[]],[[],[]]],v=!1;d.each(function(e){if(e.hidden)r.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=h.index,g[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var o=p.cx,d=p.cy,y=r.select(this),m=y.selectAll("path.surface").data([e]),x=!1,b=!1;if(m.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,l=t._fullData[h.index];if(!t._dragging&&!1!==i.hovermode){var f=l.hoverinfo;if(Array.isArray(f)&&(f=a.castHoverinfo({hoverinfo:[s.castOption(f,e.pts)],_module:h._module},i,0)),"all"===f&&(f="label+text+value+percent+name"),"none"!==f&&"skip"!==f&&f){var g=u(e,p),v=o+e.pxmid[0]*(1-g),y=d+e.pxmid[1]*(1-g),m=n.separators,_=[];if(-1!==f.indexOf("label")&&_.push(e.label),-1!==f.indexOf("text")){var w=s.castOption(l.hovertext||l.text,e.pts);w&&_.push(w)}-1!==f.indexOf("value")&&_.push(s.formatPieValue(e.v,m)),-1!==f.indexOf("percent")&&_.push(s.formatPiePercent(e.v/p.vTotal,m));var k=h.hoverlabel,M=k.font;a.loneHover({x0:v-g*p.r,x1:v+g*p.r,y:y,text:_.join("
"),name:-1!==f.indexOf("name")?l.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:s.castOption(k.bgcolor,e.pts)||e.color,borderColor:s.castOption(k.bordercolor,e.pts),fontFamily:s.castOption(M.family,e.pts),fontSize:s.castOption(M.size,e.pts),fontColor:s.castOption(M.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),x=!0}t.emit("plotly_hover",{points:[c(e,l)],event:r.event}),b=!0}}).on("mouseout",function(n){var o=t._fullLayout,i=t._fullData[h.index];b&&(n.originalEvent=r.event,t.emit("plotly_unhover",{points:[c(e,i)],event:r.event}),b=!1),x&&(a.loneUnhover(o._hoverlayer.node()),x=!1)}).on("mousedown",function(){var n=t._fullLayout,o=t._fullData[h.index];t._dragging||!1===n.hovermode||(t._hoverdata=[c(e,o)],e.curveNumber=p.trace.index,a.click(t,r.event||{target:!0}))}),h.pull){var _=+s.castOption(h.pull,e.pts)||0;_>0&&(o+=_*e.pxmid[0],d+=_*e.pxmid[1])}e.cxFinal=o,e.cyFinal=d;var w=h.hole;if(e.v===p.vTotal){var k="M"+(o+e.px0[0])+","+(d+e.px0[1])+C(e.px0,e.pxmid,!0,1)+C(e.pxmid,e.px0,!0,1)+"Z";w?m.attr("d","M"+(o+w*e.px0[0])+","+(d+w*e.px0[1])+C(e.px0,e.pxmid,!1,w)+C(e.pxmid,e.px0,!1,w)+"Z"+k):m.attr("d",k)}else{var M=C(e.px0,e.px1,!0,1);if(w){var T=1-w;m.attr("d","M"+(o+w*e.px1[0])+","+(d+w*e.px1[1])+C(e.px1,e.px0,!1,w)+"l"+T*e.px0[0]+","+T*e.px0[1]+M+"Z")}else m.attr("d","M"+o+","+d+"l"+e.px0[0]+","+e.px0[1]+M+"Z")}var A=s.castOption(h.textposition,e.pts),L=y.selectAll("g.slicetext").data(e.text&&"none"!==A?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each(function(){var n=r.select(this).selectAll("text").data([0]);n.enter().append("text").attr("data-notex",1),n.exit().remove(),n.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,"outside"===A?h.outsidetextfont:h.insidetextfont).call(l.convertToTspans,t);var a,s=i.bBox(n.node());"outside"===A?a=f(s,e):(a=function(t,e,n){var r=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/n.vTotal,.5),i=1-n.trace.hole,l=u(e,n),s={scale:l*n.r*2/r,rCenter:1-l,rotate:0};if(s.scale>=1)return s;var c=a+1/(2*Math.tan(o)),f=n.r*Math.min(1/(Math.sqrt(c*c+.5)+c),i/(Math.sqrt(a*a+i/2)+a)),d={scale:2*f/t.height,rCenter:Math.cos(f/n.r)-f*a/n.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/a,h=p+1/(2*Math.tan(o)),g=n.r*Math.min(1/(Math.sqrt(h*h+.5)+h),i/(Math.sqrt(p*p+i/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/n.r)-g/a/n.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return s.scale<1&&y.scale>s.scale?y:s}(s,e,p),"auto"===A&&a.scale<1&&(n.call(i.font,h.outsidetextfont),h.outsidetextfont.family===h.insidetextfont.family&&h.outsidetextfont.size===h.insidetextfont.size||(s=i.bBox(n.node())),a=f(s,e)));var c=o+e.pxmid[0]*a.rCenter+(a.x||0),g=d+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=g-s.height/2,e.yLabelMid=g,e.yLabelMax=g+s.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),n.attr("transform","translate("+c+","+g+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}function C(t,n,r,a){return"a"+a*p.r+","+a*p.r+" 0 "+e.largeArc+(r?" 1 ":" 0 ")+a*(n[0]-t[0])+","+a*(n[1]-t[1])}}),v&&function(t,e){var n,r,a,o,i,l,c,u,f,d,p,h,g;function v(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function m(t,n){n||(n={});var a,u,f,p,h,g,v=n.labelExtraY+(r?n.yLabelMax:n.yLabelMin),y=r?t.yLabelMin:t.yLabelMax,m=r?t.yLabelMax:t.yLabelMin,x=t.cyFinal+i(t.px0[1],t.px1[1]),b=v-y;if(b*c>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(u=0;u=(s.castOption(e.pull,f.pts)||0)||((t.pxmid[1]-f.pxmid[1])*c>0?(p=f.cyFinal+i(f.px0[1],f.px1[1]),(b=p-y-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-x)*c>0&&(a=3*l*Math.abs(u-d.indexOf(t)),h=f.cxFinal+o(f.px0[0],f.px1[0]),(g=h+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=g)))}for(r=0;r<2;r++)for(a=r?v:y,i=r?Math.max:Math.min,c=r?1:-1,n=0;n<2;n++){for(o=n?Math.max:Math.min,l=n?1:-1,(u=t[r][n]).sort(a),f=t[1-r][n],d=f.concat(u),h=[],p=0;pMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(a+t.labelExtraX+l):i+="l"+t.labelExtraX+","+s+"v"+(c-s)+"h"+l}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+l;e.append("path").classed("textline",!0).call(o.stroke,h.outsidetextfont.color).attr({"stroke-width":Math.min(2,h.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){d.selectAll("tspan").each(function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":50,"../../components/drawing":75,"../../components/fx":92,"../../lib/svg_text_utils":190,"./event_data":321,"./helpers":322,d3:13}],327:[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].trace,n=r.select(this);n.style({opacity:e.opacity}),n.selectAll("path.surface").each(function(t){r.select(this).call(a,t,e)})})}},{"./style_one":328,d3:13}],328:[function(t,e,n){"use strict";var r=t("../../components/color");t("./helpers").castOption;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}).call(r.fill,e.color).call(r.stroke,a)}},{"../../components/color":50,"./helpers":322}],329:[function(t,e,n){"use strict";var r=t("../../lib");e.exports=function(t,e){for(var n=0;ne&&s.splice(e,s.length-e),s.map(n)}return n(r.size)}}e.exports={calc:function(t,e){var n=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),d=n.makeCalcdata(e,"x"),p=f.makeCalcdata(e,"y"),h=Math.min(d.length,p.length);n._minDtick=0,f._minDtick=0,d.length>h&&d.splice(h,d.length-h),p.length>h&&p.splice(h,p.length-h);var g={padded:!0},v={padded:!0},y=u(e,h);y&&(g.ppad=v.ppad=y),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[h-1]&&p[0]===p[h-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[h-1]&&p[0]===p[h-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(v.padded=!1):v.tozero=!0,a.expand(n,d,g),a.expand(f,p,v);for(var m=new Array(h),x=0;x=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===n.xaxis&&o.yaxis===n.yaxis){o.opacity=void 0;break}}}}}},{}],334:[function(t,e,n){"use strict";var r=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var n=e[0].trace,s=n.marker,c="cb"+n.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==s&&s.showscale){var u=s.color,f=s.cmin,d=s.cmax;r(f)||(f=a.aggNums(Math.min,null,u)),r(d)||(d=a.aggNums(Math.max,null,u));var p=e[0].t.cb=l(t,c),h=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}else o.autoMargin(t,c)}},{"../../components/colorbar/draw":54,"../../components/colorscale":65,"../../lib":169,"../../plots/plots":254,"fast-isnumeric":16}],335:[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":57,"../../components/colorscale/has_colorscale":64,"./subtypes":352}],336:[function(t,e,n){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],337:[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"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,n,h){function g(n,o){return r.coerce(t,e,a,n,o)}var v=l(t,e,h,g),y=v_[w].x0&&e<_[w].x1&&n>_[w].y0&&n<_[w].y1&&(t.index=w,t.text=t.trace.text[w],b=!0);if(!b)return}if(-1!==m.indexOf("points")){var k=a.getDistanceFunction(u,function(t){var e=Math.max(3,t.mrc||0),n=1-1/e,r=Math.abs(p.c2p(t.x)-g);return rV!=(N=P[C][1])>=V&&(z=P[C-1][0],D=P[C][0],N-E&&(O=z+(D-z)*(V-E)/(N-E),j=Math.min(j,O),B=Math.max(B,O)));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),r.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":50,"../../components/errorbars":81,"../../components/fx":92,"../../lib":169,"./fill_hover_text":338,"./get_trace_color":340}],342:[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").calc,r.arraysToCalcdata=t("./arrays_to_calcdata"),r.plot=t("./plot"),r.colorbar=t("./colorbar"),r.style=t("./style").style,r.hoverPoints=t("./hover"),r.selectPoints=t("./select"),r.animatable=!0,r.moduleType="trace",r.name="scatter",r.basePlotModule=t("../../plots/cartesian"),r.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/cartesian":224,"./arrays_to_calcdata":329,"./attributes":330,"./calc":331,"./clean_data":333,"./colorbar":334,"./defaults":337,"./hover":341,"./plot":349,"./select":350,"./style":351,"./subtypes":352}],343:[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,l){var s=(t.marker||{}).color;(i("line.color",n),r(t,"line"))?a(t,e,o,i,{prefix:"line.",cLetter:"c"}):i("line.color",!Array.isArray(s)&&s||n);i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64}],344:[function(t,e,n){"use strict";var r=t("../../constants/numerical").BADNUM,a=t("../../lib"),o=a.segmentsIntersect,i=a.constrain,l=t("./constants");e.exports=function(t,e){var n,s,c,u,f,d,p,h,g,v,y,m,x,b,_,w,k=e.xaxis,M=e.yaxis,T=e.simplify,A=e.connectGaps,L=e.baseTolerance,C=e.shape,S="linear"===C,P=[],O=l.minTolerance,z=new Array(t.length),D=0;function E(e){var n=t[e],a=k.c2p(n.x),o=M.c2p(n.y);return a===r||o===r?n.intoCenter||!1:[a,o]}function N(t){var e=t[0]/k._length,n=t[1]/M._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-n,n-1))*L}function R(t,e){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}T||(L=O=-1);var I,F,j,B,q,H,V,U=l.maxScreensAway,G=-k._length*U,Y=k._length*(1+U),X=-M._length*U,Z=M._length*(1+U),W=[[G,X,Y,X],[Y,X,Y,Z],[Y,Z,G,Z],[G,Z,G,X]];function J(t){if(t[0]Y||t[1]Z)return[i(t[0],G,Y),i(t[1],X,Z)]}function Q(t,e){return t[0]===e[0]&&(t[0]===G||t[0]===Y)||(t[1]===e[1]&&(t[1]===X||t[1]===Z)||void 0)}function $(t,e,n){return function(r,o){var i=J(r),l=J(o),s=[];if(i&&l&&Q(i,l))return s;i&&s.push(i),l&&s.push(l);var c=2*a.constrain((r[t]+o[t])/2,e,n)-((i||r)[t]+(l||o)[t]);c&&((i&&l?c>0==i[t]>l[t]?i:l:i||l)[t]+=c);return s}}function K(t){var e=t[0],n=t[1],r=e===z[D-1][0],a=n===z[D-1][1];if(!r||!a)if(D>1){var o=e===z[D-2][0],i=n===z[D-2][1];r&&(e===G||e===Y)&&o?i?D--:z[D-1]=t:a&&(n===X||n===Z)&&i?o?D--:z[D-1]=t:z[D++]=t}else z[D++]=t}function tt(t){z[D-1][0]!==t[0]&&z[D-1][1]!==t[1]&&K([j,B]),K(t),q=null,j=B=0}function et(t){if(I=t[0]Y?Y:0,F=t[1]Z?Z:0,I||F){if(D)if(q){var e=V(q,t);e.length>1&&(tt(e[0]),z[D++]=e[1])}else H=V(z[D-1],t)[0],z[D++]=H;else z[D++]=[I||t[0],F||t[1]];var n=z[D-1];I&&F&&(n[0]!==I||n[1]!==F)?(q&&(j!==I&&B!==F?K(j&&B?(r=q,o=(a=t)[0]-r[0],i=(a[1]-r[1])/o,(r[1]*a[0]-a[1]*r[0])/o>0?[i>0?G:Y,Z]:[i>0?Y:G,X]):[j||I,B||F]):j&&B&&K([j,B])),K([I,F])):j-I&&B-F&&K([I||j,F||B]),q=t,j=I,B=F}else q&&tt(V(q,t)[0]),z[D++]=t;var r,a,o,i}for("linear"===C||"spline"===C?V=function(t,e){for(var n=[],r=0,a=0;a<4;a++){var i=W[a],l=o(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);l&&(!r||Math.abs(l.x-n[0][0])>1||Math.abs(l.y-n[0][1])>1)&&(l=[l.x,l.y],r&&R(l,t)N(d))break;c=d,(x=g[0]*h[0]+g[1]*h[1])>y?(y=x,u=d,p=!1):x=t.length||!d)break;et(d),s=d}}else et(u)}q&&K([j||q[0],B||q[1]]),P.push(z.slice(0,D))}return P}},{"../../constants/numerical":150,"../../lib":169,"./constants":336}],345:[function(t,e,n){"use strict";e.exports=function(t,e,n){"spline"===n("line.shape")&&n("line.smoothing")}},{}],346:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r,a,o=null;for(a=0;a0?Math.max(e,a):0}}},{"fast-isnumeric":16}],348:[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,c){var u=i.isBubble(t),f=(t.line||{}).color;(c=c||{},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.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?r.background:r.defaultLine),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")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/has_colorscale":64,"./subtypes":352}],349:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),i=t("../../components/errorbars"),l=t("./subtypes"),s=t("./line_points"),c=t("./link_traces"),u=t("../../lib/polygon").tester;function f(t,e,n,c,f,d,p){var h,g;!function(t,e,n,o,i){var s=n.xaxis,c=n.yaxis,u=r.extent(a.simpleMap(s.range,s.r2c)),f=r.extent(a.simpleMap(c.range,c.r2c)),d=o[0].trace;if(!l.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=o.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;i.forEach(function(t,n){var r=t[0].trace;l.hasMarkers(r)&&r.marker.maxdisplayed>0&&n0;function y(t){return v?t.transition():t}var m=n.xaxis,x=n.yaxis,b=c[0].trace,_=b.line,w=r.select(d);if(w.call(i.plot,n,p),!0===b.visible){var k,M;y(w).style("opacity",b.opacity);var T=b.fill.charAt(b.fill.length-1);"x"!==T&&"y"!==T&&(T=""),c[0].node3=w;var A="",L=[],C=b._prevtrace;C&&(A=C._prevRevpath||"",M=C._nextFill,L=C._polygons);var S,P,O,z,D,E,N,R,I,F="",j="",B=[],q=a.noop;if(k=b._ownFill,l.hasLines(b)||"none"!==b.fill){for(M&&M.datum(c),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(O=o.steps(_.shape),z=o.steps(_.shape.split("").reverse().join(""))):O=z="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),_.smoothing):o.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},D=function(t){return z(t.reverse())},B=s(c,{xaxis:m,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),I=b._polygons=new Array(B.length),g=0;g1){var n=r.select(this);if(n.datum(c),t)y(n.style("opacity",0).attr("d",S).call(o.lineGroupStyle)).style("opacity",1);else{var a=y(n);a.attr("d",S),o.singleLineStyle(c,a)}}}}}var H=w.selectAll(".js-line").data(B);y(H.exit()).style("opacity",0).remove(),H.each(q(!1)),H.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(q(!0)),o.setClipUrl(H,n.layerClipId),B.length?(k?E&&R&&(T?("y"===T?E[1]=R[1]=x.c2p(0,!0):"x"===T&&(E[0]=R[0]=m.c2p(0,!0)),y(k).attr("d","M"+R+"L"+E+"L"+F.substr(1)).call(o.singleFillStyle)):y(k).attr("d",F+"Z").call(o.singleFillStyle)):M&&("tonext"===b.fill.substr(0,6)&&F&&A?("tonext"===b.fill?y(M).attr("d",F+"Z"+A+"Z").call(o.singleFillStyle):y(M).attr("d",F+"L"+A.substr(1)+"Z").call(o.singleFillStyle),b._polygons=b._polygons.concat(L)):(U(M),b._polygons=null)),b._prevRevpath=j,b._prevPolygons=I):(k?U(k):M&&U(M),b._polygons=b._prevRevpath=b._prevPolygons=null);var V=w.selectAll(".points");h=V.data([c]),V.each(W),h.enter().append("g").classed("points",!0).each(W),h.exit().remove(),h.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(r.select(this),e?null:n.layerClipId)})}function U(t){y(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function Y(t){return t.id}function X(t){if(t.ids)return Y}function Z(){return!1}function W(e){var i,s=e[0].trace,c=r.select(this),u=l.hasMarkers(s),f=l.hasText(s),d=X(s),p=Z,h=Z;u&&(p=s.marker.maxdisplayed||s._needsCull?G:a.identity),f&&(h=s.marker.maxdisplayed||s._needsCull?G:a.identity);var g=(i=c.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);v&&g.call(o.pointStyle,s,t).call(o.translatePoints,m,x).style("opacity",0).transition().style("opacity",1);var b=u&&o.tryColorscale(s.marker,""),_=u&&o.tryColorscale(s.marker,"line");i.order(),i.each(function(e){var a=r.select(this),i=y(a);o.translatePoint(e,i,m,x)?(o.singlePointStyle(e,i,s,b,_,t),n.layerClipId&&o.hideOutsideRangePoint(e,i,m,x,s.xcalendar,s.ycalendar),s.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),v?i.exit().transition().style("opacity",0).remove():i.exit().remove(),(i=c.selectAll("g").data(h,d)).enter().append("g").classed("textpoint",!0).append("text"),i.order(),i.each(function(t){var e=r.select(this),a=y(e.select("text"));o.translatePoint(t,a,m,x)?n.layerClipId&&o.hideOutsideRangePoint(t,e,m,x,s.xcalendar,s.ycalendar):e.remove()}),i.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=m.c2p(t.x),n=x.c2p(t.y);r.select(this).selectAll("tspan.line").each(function(){y(r.select(this)).attr({x:e,y:n})})}),i.exit().remove()}}e.exports=function(t,e,n,a,i){var l,s,u,d,p=e.plot.select("g.scatterlayer"),h=!a,g=!!a&&a.duration>0;for((u=p.selectAll("g.trace").data(n,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c(t,e,n),function(t,e,n){var a;e.selectAll("g.trace").each(function(t){var e=r.select(this);if((a=t[0].trace)._nexttrace){if(a._nextFill=e.select(".js-fill.js-tonext"),!a._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),a._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),a._nextFill=null;a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace)?(a._ownFill=e.select(".js-fill.js-tozero"),a._ownFill.size()||(a._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),a._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,n.layerClipId)})}(0,p,e),l=0,s={};ls[e[0].trace.uid]?1:-1}),g)?(i&&(d=i()),r.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(r,o){f(t,o,e,r,n,this,a)})})):p.selectAll("g.trace").each(function(r,o){f(t,o,e,r,n,this,a)});h&&u.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":75,"../../components/errorbars":81,"../../lib":169,"../../lib/polygon":181,"./line_points":344,"./link_traces":346,"./subtypes":352,d3:13}],350:[function(t,e,n){"use strict";var r=t("./subtypes");e.exports=function(t,e){var n,a,o,i,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace;if(!r.hasMarkers(f)&&!r.hasText(f))return[];if(!1===e)for(n=0;n")}(u,v,p.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":92,"../../constants/numerical":150,"../../plots/cartesian/axes":213,"../scatter/fill_hover_text":338,"../scatter/get_trace_color":340,"./attributes":355}],360:[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.eventData=t("./event_data"),r.selectPoints=t("./select"),r.moduleType="trace",r.name="scattergeo",r.basePlotModule=t("../../plots/geo"),r.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],r.meta={},e.exports=r},{"../../plots/geo":244,"../scatter/colorbar":334,"./attributes":355,"./calc":356,"./defaults":357,"./event_data":358,"./hover":359,"./plot":361,"./select":362,"./style":363}],361:[function(t,e,n){"use strict";var r=t("d3"),a=t("../../lib"),o=t("../../constants/numerical").BADNUM,i=t("../../lib/topojson_utils").getTopojsonFeatures,l=t("../../lib/geo_location_utils").locationToFeature,s=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");function f(t,e){var n=t[0].trace;if(Array.isArray(n.locations))for(var r=i(n,e),a=n.locationmode,s=0;s fullLayout.width * 0.45) o.l = o.r = 0; - if(o.b + o.t > fullLayout.height * 0.38) o.b = o.t = 0; + if(o.b + o.t > fullLayout.height * 0.4) o.b = o.t = 0; fullLayout._pushmargin[id] = { l: {val: o.x, size: o.l + pad},