diff --git a/DESCRIPTION b/DESCRIPTION index a27e11f4a3..62143a5a6e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library -Version: 2.0.16 +Version: 2.0.15 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), email = "cpsievert1@gmail.com"), person("Chris", "Parmer", role = c("aut", "cph"), diff --git a/NEWS b/NEWS index 09ab92430b..94990cef96 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,3 @@ -2.0.16 -- 16 Dec 2015 - -Fix #325 - 2.0.15 -- 13 Dec 2015 Fix #346 diff --git a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js index 8e617526fd..e3fda49153 100644 --- a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js +++ b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js @@ -1,10 +1,10 @@ /** -* plotly.js v1.2.1 +* plotly.js v1.1.1 * Copyright 2012-2015, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;or;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(0>i)for(var f=c-1,d=0;c>d;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;c>d;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;c>d;++d,--f)y[d]=o[f],x[d]=u[f]*m,b[d]=o[f+c],_[d]=u[f+c]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;c>d;++d)a[d]=y[d];else s(y,x,b,_,(t-g)/m,a)}for(var k=h[0],A=h[1],d=0;c>d;++d)a[d]=n(k[d],A[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(t-e[r-1],0);u>h;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,h=0;u>h;++h,--c)g[h]=a[c],m[h]=o[c]*p,v[h]=a[c+u],y[h]=o[c+u]*p,b=b&&g[h]===v[h]&&m[h]===y[h]&&0===m[h];if(b)for(var h=0;u>h;++h)i[h]=0;else{s.derivative(g,m,v,y,(t-f)/p,i);for(var h=0;u>h;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;2>c;++c)for(var h=0;r>h;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":4,"cubic-hermite":5}],4:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],5:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],6:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],7:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],8:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],9:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],10:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function i(t){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var g=n.prototype;g.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;16>u;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;16>u;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;16>u;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(1e-6>c||f)for(var u=0;16>u;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],d(g,g);var v=this.computedInverse;s(v,n);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;3>u;++u)b[u]=m[u]-n[2+4*u]*x}},g.idle=function(t){if(!(tn;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(tr;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":12,"gl-mat4/invert":78,"gl-mat4/lookAt":79,"gl-mat4/rotateX":83,"gl-mat4/rotateY":84,"gl-mat4/rotateZ":85,"gl-mat4/scale":86,"gl-mat4/translate":87,"gl-vec3/normalize":10,"mat4-interpolate":13}],12:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],13:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return i&&a?(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0):!1}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":74,"gl-vec3/lerp":9,"mat4-decompose":14,"mat4-recompose":16,"quat-slerp":17}],14:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),h=t("gl-mat4/transpose"),f={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],k=d[12],A=d[13],M=d[14],L=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=L;var T=c(p,p);if(!T)return!1;h(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=k,e[1]=A,e[2]=M,i(v,d),r[0]=f.length(v[0]),f.normalize(v[0],v[0]),s[0]=f.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=f.length(v[1]),f.normalize(v[1],v[1]),s[0]/=r[1],s[1]=f.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=f.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=f.length(v[2]),f.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],f.cross(m,v[1],v[2]),f.dot(v[0],m)<0)for(var E=0;3>E;E++)r[E]*=-1,v[E][0]*=-1,v[E][1]*=-1,v[E][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":15,"gl-mat4/clone":72,"gl-mat4/create":73,"gl-mat4/determinant":74,"gl-mat4/invert":78,"gl-mat4/transpose":88,"gl-vec3/cross":6,"gl-vec3/dot":7,"gl-vec3/length":8,"gl-vec3/normalize":10}],15:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;16>i;i++)t[i]=e[i]*n;return!0}},{}],16:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":73,"gl-mat4/fromRotationTranslation":76,"gl-mat4/identity":77,"gl-mat4/multiply":80,"gl-mat4/scale":86,"gl-mat4/translate":87}],17:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":18}],18:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],g=r[2],v=r[3];return a=u*d+c*p+h*g+f*v,0>a&&(a=-a,d=-d,p=-p,g=-g,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*f+l*v,t}e.exports=n},{}],19:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],20:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;3>l;++l){for(var u=0,h=0;3>h;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var g=a[2],v=a[6],m=a[10],y=g*o+v*s+m*l,b=g*c+v*h+m*f;g-=y*o+b*c,v-=y*s+b*h,m-=y*l+b*f;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=c*e+o*r,w=h*e+s*r,k=f*e+l*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],g=o[10],v=e*s+r*c,m=e*l+r*h,y=e*u+r*f,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=i(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var A=this.computedRotation,M=A[0],L=A[1],T=A[2],E=A[3],C=M*w+E*b+L*_-T*x,S=L*w+E*x+T*b-M*_,z=T*w+E*_+M*x-L*b,P=E*w-M*b-L*x-T*_;if(a){b=d,x=p,_=g;var j=Math.sin(a)/n(b,x,_);b*=j,x*=j,_*=j,w=Math.cos(e),C=C*w+P*b+S*_-z*x,S=S*w+P*x+z*b-C*_,z=z*w+P*_+C*x-S*b,P=P*w-C*b-S*x-z*_}var O=i(C,S,z,P);O>1e-6?(C/=O,S/=O,z/=O,P/=O):(C=S=z=0,P=1),this.rotation.set(t,C,S,z,P)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;3>l;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":19,"filtered-vector":3,"gl-mat4/fromQuat":75,"gl-mat4/invert":78,"gl-mat4/lookAt":79}],21:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;3>s;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;3>s;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;16>u;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var g=d(r,p)/s,v=d(i,p)/s;u=Math.acos(g),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;3>o;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;3>o;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;3>o;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,k=b,A=-v*b,M=-m*b,L=y,T=this.computedEye,E=this.computedMatrix,o=0;3>o;++o){var C=_*r[o]+w*c[o]+k*e[o];E[4*o+1]=A*r[o]+M*c[o]+L*e[o],E[4*o+2]=C,E[4*o+3]=0}var S=E[1],z=E[5],P=E[9],j=E[2],O=E[6],I=E[10],D=z*I-P*O,R=P*j-S*I,F=S*O-z*j,N=n(D,R,F);D/=N,R/=N,F/=N,E[0]=D,E[4]=R,E[8]=F;for(var o=0;3>o;++o)T[o]=x[o]+E[2+4*o]*d; +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;or;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;0>=e||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(0>i)for(var f=c-1,d=0;c>d;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;c>d;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,g=e[i],v=e[i+1],m=v-g||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;c>d;++d,--f)y[d]=o[f],x[d]=u[f]*m,b[d]=o[f+c],_[d]=u[f+c]*m,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;c>d;++d)a[d]=y[d];else s(y,x,b,_,(t-g)/m,a)}for(var k=h[0],A=h[1],d=0;c>d;++d)a[d]=n(k[d],A[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(t-e[r-1],0);u>h;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,g=this._scratch[1],v=this._scratch[2],m=this._scratch[3],y=this._scratch[4],b=!0,h=0;u>h;++h,--c)g[h]=a[c],m[h]=o[c]*p,v[h]=a[c+u],y[h]=o[c+u]*p,b=b&&g[h]===v[h]&&m[h]===y[h]&&0===m[h];if(b)for(var h=0;u>h;++h)i[h]=0;else{s.derivative(g,m,v,y,(t-f)/p,i);for(var h=0;u>h;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;2>c;++c)for(var h=0;r>h;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(e>t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(e>=t||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(e>t)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":4,"cubic-hermite":5}],4:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){var a=new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],5:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],6:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],7:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],8:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],9:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],10:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],11:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function i(t){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var g=n.prototype;g.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(0>r)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;16>u;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;16>u;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;16>u;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(1e-6>c||f)for(var u=0;16>u;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=n[1],g[1]=n[5],g[2]=n[6],d(g,g);var v=this.computedInverse;s(v,n);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;3>u;++u)b[u]=m[u]-n[2+4*u]*x}},g.idle=function(t){if(!(tn;++n)e.push(e[r++]);this._time.push(t)}},g.flush=function(t){var e=a.gt(this._time,t)-2;0>e||(this._time.slice(0,e),this._components.slice(0,16*e))},g.lastT=function(){return this._time[this._time.length-1]},g.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;3>a;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},g.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];g.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,v),this.setMatrix(t,s(i,i))},g.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,v),this.setMatrix(t,i)},g.setMatrix=function(t,e){if(!(tr;++r)this._components.push(e[r])}},g.setDistance=function(t,e){this.computedRadius[0]=e},g.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},g.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":12,"gl-mat4/invert":78,"gl-mat4/lookAt":79,"gl-mat4/rotateX":83,"gl-mat4/rotateY":84,"gl-mat4/rotateZ":85,"gl-mat4/scale":86,"gl-mat4/translate":87,"gl-vec3/normalize":10,"mat4-interpolate":13}],12:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],13:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return i&&a?(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0):!1}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":74,"gl-vec3/lerp":9,"mat4-decompose":14,"mat4-recompose":16,"quat-slerp":17}],14:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),h=t("gl-mat4/transpose"),f={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),g=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],k=d[12],A=d[13],M=d[14],L=d[15];if(0!==x||0!==_||0!==w){g[0]=x,g[1]=_,g[2]=w,g[3]=L;var T=c(p,p);if(!T)return!1;h(p,p),n(y,g,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=k,e[1]=A,e[2]=M,i(v,d),r[0]=f.length(v[0]),f.normalize(v[0],v[0]),s[0]=f.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=f.length(v[1]),f.normalize(v[1],v[1]),s[0]/=r[1],s[1]=f.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=f.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=f.length(v[2]),f.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],f.cross(m,v[1],v[2]),f.dot(v[0],m)<0)for(var E=0;3>E;E++)r[E]*=-1,v[E][0]*=-1,v[E][1]*=-1,v[E][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":15,"gl-mat4/clone":72,"gl-mat4/create":73,"gl-mat4/determinant":74,"gl-mat4/invert":78,"gl-mat4/transpose":88,"gl-vec3/cross":6,"gl-vec3/dot":7,"gl-vec3/length":8,"gl-vec3/normalize":10}],15:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;16>i;i++)t[i]=e[i]*n;return!0}},{}],16:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":73,"gl-mat4/fromRotationTranslation":76,"gl-mat4/identity":77,"gl-mat4/multiply":80,"gl-mat4/scale":86,"gl-mat4/translate":87}],17:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":18}],18:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],g=r[2],v=r[3];return a=u*d+c*p+h*g+f*v,0>a&&(a=-a,d=-d,p=-p,g=-g,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*f+l*v,t}e.exports=n},{}],19:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],20:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;3>l;++l){for(var u=0,h=0;3>h;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var g=a[2],v=a[6],m=a[10],y=g*o+v*s+m*l,b=g*c+v*h+m*f;g-=y*o+b*c,v-=y*s+b*h,m-=y*l+b*f;var x=n(g,v,m);g/=x,v/=x,m/=x;var _=c*e+o*r,w=h*e+s*r,k=f*e+l*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],g=o[10],v=e*s+r*c,m=e*l+r*h,y=e*u+r*f,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),k=i(b,x,_,w);k>1e-6?(b/=k,x/=k,_/=k,w/=k):(b=x=_=0,w=1);var A=this.computedRotation,M=A[0],L=A[1],T=A[2],E=A[3],C=M*w+E*b+L*_-T*x,S=L*w+E*x+T*b-M*_,z=T*w+E*_+M*x-L*b,P=E*w-M*b-L*x-T*_;if(a){b=d,x=p,_=g;var j=Math.sin(a)/n(b,x,_);b*=j,x*=j,_*=j,w=Math.cos(e),C=C*w+P*b+S*_-z*x,S=S*w+P*x+z*b-C*_,z=z*w+P*_+C*x-S*b,P=P*w-C*b-S*x-z*_}var O=i(C,S,z,P);O>1e-6?(C/=O,S/=O,z/=O,P/=O):(C=S=z=0,P=1),this.rotation.set(t,C,S,z,P)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;3>l;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":19,"filtered-vector":3,"gl-mat4/fromQuat":75,"gl-mat4/invert":78,"gl-mat4/lookAt":79}],21:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;3>s;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;3>s;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;16>u;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var g=d(r,p)/s,v=d(i,p)/s;u=Math.acos(g),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;3>o;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;3>o;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;3>o;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,k=b,A=-v*b,M=-m*b,L=y,T=this.computedEye,E=this.computedMatrix,o=0;3>o;++o){var C=_*r[o]+w*c[o]+k*e[o];E[4*o+1]=A*r[o]+M*c[o]+L*e[o],E[4*o+2]=C,E[4*o+3]=0}var S=E[1],z=E[5],P=E[9],j=E[2],O=E[6],I=E[10],D=z*I-P*O,R=P*j-S*I,F=S*O-z*j,N=n(D,R,F);D/=N,R/=N,F/=N,E[0]=D,E[4]=R,E[8]=F;for(var o=0;3>o;++o)T[o]=x[o]+E[2+4*o]*d; for(var o=0;3>o;++o){for(var l=0,B=0;3>B;++B)l+=E[o+4*B]*T[B];E[12+o]=-l}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;16>n;++n)e[n]=r[n];return e}return r};var g=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;g[0]=i[2],g[1]=i[6],g[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;3>l;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,g);for(var l=0;3>l;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var g=c*e+o*r,v=h*e+s*r,m=f*e+l*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(0>o||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),g=Math.max(f,d,p);f===g?(l=0>l?-1:1,c=h=0):p===g?(h=0>h?-1:1,l=c=0):(c=0>c?-1:1,l=h=0)}else{var v=n(l,c,h);l/=v,c/=v,h/=v}var m=e[s],y=e[s+4],b=e[s+8],x=m*l+y*c+b*h;m-=l*x,y-=c*x,b-=h*x;var _=n(m,y,b);m/=_,y/=_,b/=_;var w=c*b-h*y,k=h*m-l*b,A=l*y-c*m,M=n(w,k,A);w/=M,k/=M,A/=M,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,m,y,b);var L,T;if(2===o){var E=e[1],C=e[5],S=e[9],z=E*m+C*y+S*b,P=E*w+C*k+S*A;L=0>D?-Math.PI/2:Math.PI/2,T=Math.atan2(P,z)}else{var j=e[2],O=e[6],I=e[10],D=j*l+O*c+I*h,R=j*m+O*y+I*b,F=j*w+O*k+I*A;L=Math.asin(i(D)),T=Math.atan2(F,R)}this.angle.jump(t,T,L),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*W,G-B*W,Y-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(1e-6>u)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(1e-6>d)){c/=d,h/=d,f/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=o*g+s*v+l*m;g-=y*o,v-=y*s,m-=y*l;var b=n(g,v,m);if(!(.01>b&&(g=s*f-l*h,v=l*c-o*f,m=o*h-s*c,b=n(g,v,m),1e-6>b))){g/=b,v/=b,m/=b,this.up.set(t,o,s,l),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*m-l*v,_=l*g-o*m,w=o*v-s*g,k=n(x,_,w);x/=k,_/=k,w/=k;var A=o*c+s*h+l*f,M=g*c+v*h+m*f,L=x*c+_*h+w*f,T=Math.asin(i(A)),E=Math.atan2(L,M),C=this.angle._state,S=C[C.length-1],z=C[C.length-2];S%=2*Math.PI;var P=Math.abs(S+2*Math.PI-E),j=Math.abs(S-E),O=Math.abs(S-2*Math.PI-E);j>P&&(S+=2*Math.PI),j>O&&(S-=2*Math.PI),this.angle.jump(this.angle.lastT(),S,z),this.angle.set(t,E,T)}}}}},{"filtered-vector":3,"gl-mat4/invert":78,"gl-mat4/rotate":82,"gl-vec3/cross":6,"gl-vec3/dot":7,"gl-vec3/normalize":10}],22:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype,u=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];u.forEach(function(t){for(var e=t[0],r=[],n=0;ne)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":11,"orbit-camera-controller":20,"turntable-camera-controller":21}],23:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":24,"simplicial-complex-boundary":27}],24:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;ii;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;e>a;++a){for(var l=0;a>=l;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,h=u[e+1],a=0;aa;++a){for(var h=u[a],d=0,l=0;ls;++s)r[s]+=t[a][s]*n[a];return r}var o=t("dup"),s=t("robust-linear-solve");a.barycenetric=i,e.exports=a},{dup:55,"robust-linear-solve":192}],27:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":28,"reduce-simplicial-complex":31}],28:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;e>n;++n)r+=t[n].length;for(var i=new Array(r),a=0,n=0;e>n;++n)for(var o=t[n],s=o.length,l=0;s>l;++l)for(var u=i[a++]=new Array(s-1),c=1;s>c;++c)u[c-1]=o[(l+c)%s];return i}e.exports=n},{}],29:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;rn;++n)if(t[r]n;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":29,"compare-cell":41,"compare-oriented-cell":30}],32:[function(t,e,r){"use strict";var n=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/(r-1),i=[],a=0;r>a;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;r>i;i++){n[i]=[];for(var a=0;aa;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;3>i;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,f=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c};e.exports=n()},{}],33:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(0>t)},r.abs=function(t){var e=t>>i-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],34:[function(t,e,r){(function(e){function n(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t){return this instanceof a?(this.length=0,this.parent=void 0,"number"==typeof t?o(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):l(this,t)):arguments.length>1?new a(t,arguments[1]):new a(t)}function o(t,e){if(t=g(t,0>e?0:0|v(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function s(t,e,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|y(e,r);return t=g(t,n),t.write(e,r),t}function l(t,e){if(a.isBuffer(e))return u(t,e);if(Q(e))return c(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return h(t,e);if(e instanceof ArrayBuffer)return f(t,e)}return e.length?d(t,e):p(t,e)}function u(t,e){var r=0|v(e.length);return t=g(t,r),e.copy(t,0,0,r),t}function c(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function h(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){return a.TYPED_ARRAY_SUPPORT?(e.byteLength,t=a._augment(new Uint8Array(e))):t=h(t,new Uint8Array(e)),t}function d(t,e){var r=0|v(e.length);t=g(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function p(t,e){var r,n=0;"Buffer"===e.type&&Q(e.data)&&(r=e.data,n=0|v(r.length)),t=g(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function g(t,e){a.TYPED_ARRAY_SUPPORT?(t=a._augment(new Uint8Array(e)),t.__proto__=a.prototype):(t.length=e,t._isBuffer=!0);var r=0!==e&&e<=a.poolSize>>>1;return r&&(t.parent=$),t}function v(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var r=new a(t,e);return delete r.parent,r}function y(t,e){"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return C(this,e,r);case"binary":return S(this,e,r);case"base64":return L(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new Error("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;n>o;o++){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[r+o]=s}return o}function _(t,e,r,n){return W(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return W(H(e),t,r,n)}function k(t,e,r,n){return w(t,e,r,n)}function A(t,e,r,n){return W(Y(e),t,r,n)}function M(t,e,r,n){return W(G(e,t.length-r),t,r,n)}function L(t,e,r){return 0===e&&r===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(r>=i+s){var l,u,c,h;switch(s){case 1:128>a&&(o=a);break;case 2:l=t[i+1],128===(192&l)&&(h=(31&a)<<6|63&l,h>127&&(o=h));break;case 3:l=t[i+1],u=t[i+2],128===(192&l)&&128===(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u,h>2047&&(55296>h||h>57343)&&(o=h));break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128===(192&l)&&128===(192&u)&&128===(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c,h>65535&&1114112>h&&(o=h))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return E(n)}function E(t){var e=t.length;if(K>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=K));return r}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function z(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",a=e;r>a;a++)i+=V(t[a]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",a=0;at)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range")}function I(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);a>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);a>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function R(t,e,r,n,i,a){if(e>i||a>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function F(t,e,r,n,i){return i||R(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,i){return i||R(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function B(t){if(t=U(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function U(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return 16>t?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;n>o;o++){if(r=t.charCodeAt(o),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=i-55296<<10|r-56320|65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;a.push(r)}else if(2048>r){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Y(t){return X.toByteArray(B(t))}function W(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}var X=t("base64-js"),Z=t("ieee754"),Q=t("is-array");r.Buffer=a,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50,a.poolSize=8192;var $={};a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array),a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Q(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new a(0);var r;if(void 0===e)for(e=0,r=0;r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},a.prototype.compare=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:a.compare(this,t)},a.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(a.isBuffer(t))return r(this,t,e);if("number"==typeof t)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},a.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},a.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"binary":return k(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=a._augment(this.subarray(t,e));else{var i=e-t;n=new a(i,void 0);for(var o=0;i>o;o++)n[o]=this[o+t]}return n.length&&(n.parent=this.parent||this),n},a.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||O(this,t,e,r,Math.pow(2,8*r),0);var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0>t?1:0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0>t?1:0;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||O(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-er&&n>e)for(i=o-1;i>=0;i--)t[i+e]=this[i+r];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)t[i+e]=this[i+r];else t._set(this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=q(t.toString()),a=i.length;for(n=e;r>n;n++)this[n]=i[n%a]}return this}},a.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(a.TYPED_ARRAY_SUPPORT)return new a(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var J=a.prototype;a._augment=function(t){return t.constructor=a,t._isBuffer=!0,t._set=t.set,t.get=J.get,t.set=J.set,t.write=J.write,t.toString=J.toString,t.toLocaleString=J.toString,t.toJSON=J.toJSON,t.equals=J.equals,t.compare=J.compare,t.indexOf=J.indexOf,t.copy=J.copy,t.slice=J.slice,t.readUIntLE=J.readUIntLE,t.readUIntBE=J.readUIntBE,t.readUInt8=J.readUInt8,t.readUInt16LE=J.readUInt16LE,t.readUInt16BE=J.readUInt16BE,t.readUInt32LE=J.readUInt32LE,t.readUInt32BE=J.readUInt32BE,t.readIntLE=J.readIntLE,t.readIntBE=J.readIntBE,t.readInt8=J.readInt8,t.readInt16LE=J.readInt16LE,t.readInt16BE=J.readInt16BE,t.readInt32LE=J.readInt32LE,t.readInt32BE=J.readInt32BE,t.readFloatLE=J.readFloatLE,t.readFloatBE=J.readFloatBE,t.readDoubleLE=J.readDoubleLE,t.readDoubleBE=J.readDoubleBE,t.writeUInt8=J.writeUInt8,t.writeUIntLE=J.writeUIntLE,t.writeUIntBE=J.writeUIntBE,t.writeUInt16LE=J.writeUInt16LE,t.writeUInt16BE=J.writeUInt16BE,t.writeUInt32LE=J.writeUInt32LE,t.writeUInt32BE=J.writeUInt32BE,t.writeIntLE=J.writeIntLE,t.writeIntBE=J.writeIntBE,t.writeInt8=J.writeInt8,t.writeInt16LE=J.writeInt16LE,t.writeInt16BE=J.writeInt16BE,t.writeInt32LE=J.writeInt32LE,t.writeInt32BE=J.writeInt32BE,t.writeFloatLE=J.writeFloatLE,t.writeFloatBE=J.writeFloatBE,t.writeDoubleLE=J.writeDoubleLE,t.writeDoubleBE=J.writeDoubleBE,t.fill=J.fill,t.inspect=J.inspect,t.toArrayBuffer=J.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":35,ieee754:36,"is-array":37}],35:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===o||e===h?62:e===s||e===f?63:l>e?-1:l+10>e?e-l+26+26:c+26>e?e-c:u+26>e?e-u+26:void 0}function r(t){function r(t){u[h++]=t}var n,i,o,s,l,u;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=t.length;l="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,u=new a(3*t.length/4-l),o=l>0?t.length-4:t.length;var h=0;for(n=0,i=0;o>n;n+=4,i+=3)s=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===l?(s=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&s)):1===l&&(s=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(s>>8&255),r(255&s)),u}function i(t){function e(t){ return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,a,o,s=t.length%3,l="";for(i=0,o=t.length-s;o>i;i+=3)a=(t[i]<<16)+(t[i+1]<<8)+t[i+2],l+=r(a);switch(s){case 1:a=t[t.length-1],l+=e(a>>2),l+=e(a<<4&63),l+="==";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],l+=e(a>>10),l+=e(a>>4&63),l+=e(a<<2&63),l+="="}return l}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),s="/".charCodeAt(0),l="0".charCodeAt(0),u="a".charCodeAt(0),c="A".charCodeAt(0),h="-".charCodeAt(0),f="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}("undefined"==typeof r?this.base64js={}:r)},{}],36:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],37:[function(t,e,r){var n=Array.isArray,i=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==i.call(t)}},{}],38:[function(t,e,r){function n(){c=!1,s.length?u=s.concat(u):h=-1,u.length&&i()}function i(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(s=u,u=[];++h1)for(var r=1;rn;++n)e=t[n],e=e.toString(16),r+=("00"+e).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("./colorScales.json");e.exports=function(t){var e,r,s,l,u,c,h,f,d,p,g,v,m,y=[],b=[],x=[],_=[];if(a.isPlainObject(t)||(t={}),t.colormap||(h="jet"),Array.isArray(t.alpha)?2!==t.alpha.length&&(t.alpha=[1,1]):"number"==typeof t.alpha?t.alpha=[t.alpha,t.alpha]:t.alpha=[1,1],"string"==typeof t.colormap){if(h=t.colormap.toLowerCase(),!(h in o))throw Error(h+" not a supported colorscale");c=o[h]}else Array.isArray(t.colormap)&&(c=t.colormap);if(d=t.nshades||72,f=t.format||"hex",g=t.alpha,c.length>d)throw new Error(h+" map requires nshades to be at least size "+c.length);for(e=c.map(function(t){return Math.round(t.index*d)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),m=0;m=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(m=0;mx;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],42:[function(t,e,r){"use strict";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t("./lib/ch1d"),a=t("./lib/ch2d"),o=t("./lib/chnd");e.exports=n},{"./lib/ch1d":43,"./lib/ch2d":44,"./lib/chnd":45}],43:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0,n=1;nt[r][0]&&(r=n);return r>e?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],44:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(2>=r)return[];for(var n=new Array(r),a=e[r-1],o=0;r>o;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":47}],45:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),i=0;ii;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;r>i;++i)for(var a=t[i],o=0;os)a[o]=e[s];else{s-=n;for(var l=0;n>l;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(r){var a=s(t);if(a.length<=e)return[];var l=n(t,a),u=o(l,!0);return i(u,a)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":46,"incremental-convex-hull":168}],46:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;n=i;++i){for(var o=new Array(e),s=0;e>s;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}var l=a.apply(void 0,r);if(l)return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;e>o;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":195}],47:[function(t,e,r){"use strict";function n(t){var e=t.length;if(3>e){for(var r=new Array(e),n=0;e>n;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;e>n;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;e>n;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;f>n;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":195}],48:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":49}],49:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":51}],50:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;a>n;++n)u.push(["i",n,"=0"].join(""));for(i=0;o>i;++i)for(n=0;a>n;++n)h=c,c=t[n],0===n?u.push(["d",i,"s",n,"=t",i,"p",c].join("")):u.push(["d",i,"s",n,"=(t",i,"p",c,"-s",h,"*t",i,"p",h,")"].join(""));for(l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"n;++n){for(h=c,c=t[n],i=0;o>i;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;o>c;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=t;a>c;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;o>c;++c){for(var h=["offset"+c],f=t;a>f;++f)h.push(["j",f,"*t",c,"p",e[f]].join(""));u.push(["p",c,"=(",h.join("+"),")"].join(""))}u.push(n(e,r,i));for(var c=t;a>c;++c)u.push("}");return u.join("\n")}function a(t){for(var e=0,r=t[0].length;r>e;){for(var n=1;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;hy;++y)_.push(["s",y,"=SS[",y,"]"].join(""));for(var h=0;hy;++y)_.push(["t",h,"p",y,"=t",h,"[",p[h]+y,"]"].join(""));for(var y=0;y0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),h=0;r>h;++h)w[h]="0";_.push(["index=[",w.join(","),"]"].join(""))}for(var h=0;h3&&x.push(o(t.pre,t,c));var L=o(t.body,t,c),T=a(v);r>T?x.push(i(T,v[0],t,L)):x.push(n(v[0],t,L)),t.post.body.length>3&&x.push(o(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var E=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",T,s(c)].join(""),C=new Function(["function ",E,"(",b.join(","),"){",x.join("\n"),"} return ",E].join(""));return C()}var u=t("uniq");e.exports=l},{uniq:52}],51:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;co;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;r>a;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],53:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function h(){this._=Object.create(null)}function f(t){return(t+="")===mo||t[0]===yo?yo+t:t}function d(t){return(t+="")[0]===yo?t.slice(1):t}function p(t){return f(t)in this._}function g(t){return(t=f(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(d(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=bo.length;n>r;++r){var i=bo[r]+e;if(i in t)return i}}function k(){}function A(){}function M(t){function e(){for(var e,n=r,i=-1,a=n.length;++ir;r++)for(var i,a=t[r],o=0,s=a.length;s>o;o++)(i=a[o])&&e(i,o,r);return t}function Y(t){return _o(t,To),t}function W(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e0&&(t=t.slice(0,s));var u=Eo.get(t);return u&&(t=u,l=Q),s?e?i:n:e?k:a}function Z(t,e){return function(r){var n=no.event;no.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{no.event=n}}}function Q(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function $(t){var r=".dragsuppress-"+ ++So,i="click"+r,a=no.select(n(t)).on("touchmove"+r,L).on("dragstart"+r,L).on("selectstart"+r,L);if(null==Co&&(Co="onselectstart"in t?!1:w(t.style,"userSelect")),Co){var o=e(t).style,s=o[Co];o[Co]="none"}return function(t){if(a.on(r,null),Co&&(o[Co]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){L(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>zo){var a=n(t);if(a.scrollX||a.scrollY){r=no.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();zo=!(o.f||o.e),r.remove()}}return zo?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function J(){return no.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:-1>t?Oo:Math.acos(t)}function nt(t){return t>1?Ro:-1>t?-Ro:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):kt(""+t,At,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(o-a)*t/60:180>t?o:240>t?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,r=0>r?0:r>1?1:r,o=.5>=r?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ht(t,e,r){return this instanceof ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ht?new ht(t.h,t.c,t.l):t instanceof dt?gt(t.l,t.a,t.b):gt((t=Mt((t=no.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ht(t,e,r)}function ft(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=Fo)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ht?ft(t.h,t.c,t.l):Mt((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=vt(i)*Zo,n=vt(n)*Qo,a=vt(a)*$o,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function gt(t,e,r){return t>0?new ht(Math.atan2(r,e)*No,Math.sqrt(e*e+r*r),t):new ht(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):kt(""+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){t=t.toLowerCase();var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Tt(i[0]),Tt(i[1]),Tt(i[2]))}return(a=ts.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o=o>>4|o,s=240&a,s=s>>4|s,l=15&a,l=l<<4|l):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function At(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=.5>l?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(r>e?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&1>l?0:n),new ut(n,i,l)}function Mt(t,e,r){t=Lt(t),e=Lt(e),r=Lt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/Zo),i=mt((.2126729*t+.7151522*e+.072175*r)/Qo),a=mt((.0193339*t+.119192*e+.9503041*r)/$o);return dt(116*i-16,500*(n-i),200*(i-a))}function Lt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Et(t){return"function"==typeof t?t:function(){return t}}function Ct(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),St(e,r,t,n)}}function St(t,e,r,n){function i(){var t,e=l.status;if(!e&&Pt(l)||e>=200&&300>e||304===e){try{t=r.call(a,l)}catch(n){return void o.error.call(a,n)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=no.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=no.event;no.event=t;try{o.progress.call(a,l)}finally{no.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ao(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},no.rebind(a,o,"on"),null==n?a:a.get(zt(n))}function zt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Pt(t){ var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function jt(){var t=Ot(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(is),is=setTimeout(jt,e)),ns=0):(ns=1,os(jt))}function Ot(){var t=Date.now();for(as=es;as;)t>=as.t&&(as.f=as.c(t-as.t)),as=as.n;return t}function It(){for(var t,e=es,r=1/0;e;)e.f?e=t?t.n=e.n:es=e.n:(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Ft(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=ls.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,g="",v="",m=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":m=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(g=i[0],v=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=us.get(d)||Nt;var b=u&&h;return function(t){var r=v;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=no.formatPrefix(t,f);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(".");if(0>w){var k=y?t.lastIndexOf("e"):-1;0>k?(x=t,_=""):(x=t.substring(0,k),_=t.substring(k))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var A=g.length+x.length+_.length+(b?0:i.length),M=c>A?new Array(A=c-A+1).join(n):"";return b&&(x=a(M+x,M.length?c-_.length:1/0)),i+=g,t=x+_,("<"===o?i+t+M:">"===o?M+i+t:"^"===o?M.substring(0,A>>=1)+i+t+M.substring(A):i+(b?t:M+t))+r}}}function Nt(t){return t+""}function Bt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ut(t,e,r){function n(e){var r=t(e),n=a(r,1);return n-e>e-r?r:n}function i(r){return e(r=t(new hs(r-1)),1),r}function a(t,r){return e(t=new hs(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;n>o;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;n>o;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{hs=Bt;var n=new Bt;return n._=t,o(n,e,r)}finally{hs=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=Vt(t);return l.floor=l,l.round=Vt(n),l.ceil=Vt(i),l.offset=Vt(a),l.range=s,t}function Vt(t){return function(e,r){try{hs=Bt;var n=new Bt;return n._=e,t(n,r)._}finally{hs=Date}}}function qt(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++ss;){if(n>=u)return-1;if(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=C[o in ds?e.charAt(s++):o],!a||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=k.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){L.lastIndex=0;var n=L.exec(e.slice(r));return n?(t.m=T.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){A.lastIndex=0;var n=A.exec(e.slice(r));return n?(t.m=M.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,E.c.toString(),e,n)}function l(t,e,n){return r(t,E.x.toString(),e,n)}function u(t,e,n){return r(t,E.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{hs=Bt;var e=new hs;return e._=t,n(e)}finally{hs=Date}}var n=e(t);return r.parse=function(t){try{hs=Bt;var e=n.parse(t);return e&&e._}finally{hs=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var b=no.map(),x=Gt(g),_=Yt(g),w=Gt(v),k=Yt(v),A=Gt(m),M=Yt(m),L=Gt(y),T=Yt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(h),d:function(t,e){return Ht(t.getDate(),e,2)},e:function(t,e){return Ht(t.getDate(),e,2)},H:function(t,e){return Ht(t.getHours(),e,2)},I:function(t,e){return Ht(t.getHours()%12||12,e,2)},j:function(t,e){return Ht(1+cs.dayOfYear(t),e,3)},L:function(t,e){return Ht(t.getMilliseconds(),e,3)},m:function(t,e){return Ht(t.getMonth()+1,e,2)},M:function(t,e){return Ht(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Ht(t.getSeconds(),e,2)},U:function(t,e){return Ht(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ht(cs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Ht(t.getFullYear()%100,e,2)},Y:function(t,e){return Ht(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},C={a:n,A:i,b:a,B:o,c:s,d:ee,e:ee,H:ne,I:ne,j:re,L:oe,m:te,M:ie,p:c,S:ae,U:Xt,w:Wt,W:Zt,x:l,X:u,y:$t,Y:Qt,Z:Kt,"%":le};return e}function Ht(t,e,r){var n=0>t?"-":"",i=(n?-t:t)+"",a=i.length;return n+(r>a?new Array(r-a+1).join(e)+i:i)}function Gt(t){return new RegExp("^(?:"+t.map(no.requote).join("|")+")","i")}function Yt(t){for(var e=new h,r=-1,n=t.length;++r68?1900:2e3)}function te(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function ee(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function re(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ne(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ie(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ae(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function oe(t,e,r){ps.lastIndex=0;var n=ps.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=vo(e)/60|0,i=vo(e)%60;return r+Ht(n,"0",2)+Ht(i,"0",2)}function le(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);_s.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ws.point=function(o,s){ws.point=t,n=(e=o)*Fo,i=Math.cos(s=(r=s)*Fo/2+Oo/4),a=Math.sin(s)},ws.lineEnd=function(){t(e,r)}}function ve(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(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 be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _e(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 we(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function ke(t,e){return vo(t[0]-e[0])s;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new je(r,t,null,!0),u=new je(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new je(n,t,null,!1),u=new je(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),Pe(a),Pe(o),a.length){for(var s=0,l=r,u=o.length;u>s;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Ie))}var d,p,g,v=e(a),m=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=no.merge(d);var t=Ue(m,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,Re,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=De(),x=e(b),_=!1;return y}}function Ie(t){return t.length>1}function De(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Re(t,e){return((t=t.x)[0]<0?t[1]-Ro-Po:Ro-t[1])-((e=e.x)[0]<0?e[1]-Ro-Po:Ro-e[1])}function Fe(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Oo:-Oo,l=vo(a-r);vo(l-Oo)0?Ro:-Ro),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Oo&&(vo(r-i)Po?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Be(t,e,r,n){var i;if(null==t)i=r*Ro,n.point(-Oo,i),n.point(0,i),n.point(Oo,i),n.point(Oo,0),n.point(Oo,-i),n.point(0,-i),n.point(-Oo,-i),n.point(-Oo,0),n.point(-Oo,i);else if(vo(t[0]-e[0])>Po){var a=t[0]s;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+Oo/4,p=Math.sin(d),g=Math.cos(d),v=1;;){v===c&&(v=0),t=u[v];var m=t[0],y=t[1]/2+Oo/4,b=Math.sin(y),x=Math.cos(y),_=m-f,w=_>=0?1:-1,k=w*_,A=k>Oo,M=p*b;if(_s.add(Math.atan2(M*w*Math.sin(k),g*x+M*Math.cos(k))),a+=A?_+w*Io:_,A^f>=r^m>=r){var L=ye(ve(h),ve(t));_e(L);var T=ye(i,L);_e(T);var E=(A^_>=0?-1:1)*nt(T[2]);(n>E||n===E&&(L[0]||L[1]))&&(o+=A^_>=0?1:-1)}if(!v++)break;f=m,p=b,g=x,h=t}}return(-Po>a||Po>a&&0>_s)^1&o}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],g=e(h,f),v=o?g?0:i(h,f):g?i(h+(0>h?Oo:-Oo),f):0;if(!r&&(u=l=g)&&t.lineStart(),g!==l&&(d=n(r,p),(ke(r,d)||ke(p,d))&&(p[0]+=Po,p[1]+=Po,g=e(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^g){var m;v&a||!(m=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||r&&ke(r,p)||t.point(p[0],p[1]),r=p,l=g,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ve(t),i=ve(e),o=[1,0,0],s=ye(n,i),l=me(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=ye(o,s),p=xe(o,h),g=xe(s,f);be(p,g);var v=d,m=me(p,v),y=me(v,v),b=m*m-y*(me(p,p)-1);if(!(0>b)){var x=Math.sqrt(b),_=xe(v,(-m-x)/y);if(be(_,p),_=we(_),!r)return _;var w,k=t[0],A=e[0],M=t[1],L=e[1];k>A&&(w=k,k=A,A=w);var T=A-k,E=vo(T-Oo)T;if(!E&&M>L&&(w=M,M=L,L=w),C?E?M+L>0^_[1]<(vo(_[0]-k)Oo^(k<=_[0]&&_[0]<=A)){var S=xe(v,(-m+x)/y);return be(S,p),[_,we(S)]}}}function i(e,r){var n=o?t:Oo-t,i=0;return-n>e?i|=1:e>n&&(i|=2),-n>r?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=vo(a)>Po,l=gr(t,6*Fo);return Oe(e,r,l,o?[0,-t]:[-Oo,t-Oo])}function qe(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,h=s.y,f=0,d=1,p=c-l,g=h-u;if(a=t-l,p||!(a>0)){if(a/=p,0>p){if(f>a)return;d>a&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(0>a)){if(a/=p,0>p){if(a>d)return;a>f&&(f=a)}else if(p>0){if(f>a)return;d>a&&(d=a)}if(a=e-u,g||!(a>0)){if(a/=g,0>g){if(f>a)return;d>a&&(d=a)}else if(g>0){if(a>d)return;a>f&&(f=a)}if(a=n-u,g||!(0>a)){if(a/=g,0>g){if(a>d)return;a>f&&(f=a)}else if(g>0){if(f>a)return;d>a&&(d=a)}return f>0&&(i.a={x:l+f*p,y:u+f*g}),1>d&&(i.b={x:l+d*p,y:u+d*g}),i}}}}}}function He(t,e,r,n){function i(n,i){return vo(n[0]-t)0?0:3:vo(n[0]-r)0?2:1:vo(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=v.length,n=t[1],i=0;r>i;++i)for(var a,o=1,s=v[i],l=s.length,u=s[0];l>o;++o)a=s[o],u[1]<=n?a[1]>n&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0){do u.point(0===c||3===c?t:r,c>1?n:e);while((c=(c+l+4)%4)!==h)}else u.point(s[0],s[1])}function c(i,a){return i>=t&&r>=i&&a>=e&&n>=a}function h(t,e){c(t,e)&&s.point(t,e)}function f(){C.point=p,v&&v.push(m=[]),A=!0,k=!1,_=w=NaN}function d(){g&&(p(y,b),x&&k&&T.rejoin(),g.push(T.buffer())),C.point=h,k&&s.lineEnd()}function p(t,e){t=Math.max(-Ds,Math.min(Ds,t)),e=Math.max(-Ds,Math.min(Ds,e));var r=c(t,e);if(v&&m.push([t,e]),A)y=t,b=e,x=r,A=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&k)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(k||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),M=!1):r&&(s.lineStart(),s.point(t,e),M=!1)}_=t,w=e,k=r}var g,v,m,y,b,x,_,w,k,A,M,L=s,T=De(),E=qe(t,e,r,n),C={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=T,g=[],v=[],M=!0},polygonEnd:function(){s=L,g=no.merge(g);var e=l([t,n]),r=M&&e,i=g.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&ze(g,a,e,u,s),s.polygonEnd()),g=v=m=null}};return C}}function Ge(t){var e=0,r=Oo/3,n=sr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Oo/180,r=t[1]*Oo/180):[e/Oo*180,r/Oo*180]},i}function Ye(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Fs+=i*t-n*e,n=t,i=e}var e,r,n,i;qs.point=function(a,o){qs.point=t,e=n=a,r=i=o},qs.lineEnd=function(){t(e,r)}}function Xe(t,e){Ns>t&&(Ns=t),t>Us&&(Us=t),Bs>e&&(Bs=e),e>Vs&&(Vs=e)}function Ze(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Qe(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Qe(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function $e(t,e){Ms+=t,Ls+=e,++Ts}function Ke(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Es+=o*(e+t)/2,Cs+=o*(r+n)/2,Ss+=o,$e(e=t,r=n)}var e,r;Gs.point=function(n,i){Gs.point=t,$e(e=n,r=i)}}function Je(){Gs.point=$e}function tr(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Es+=o*(n+t)/2,Cs+=o*(i+e)/2,Ss+=o,o=i*t-n*e,zs+=o*(n+t),Ps+=o*(i+e),js+=3*o,$e(n=t,i=e)}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,$e(e=n=a,r=i=o)},Gs.lineEnd=function(){t(e,r)}}function er(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Io)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:k};return s}function rr(t){function e(t){return(s?n:r)(t)}function r(e){return ar(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,A.point=a,e.lineStart()}function a(r,n){var a=ve([r,n]),o=t(r,n);i(b,x,y,_,w,k,b=o[0],x=o[1],y=r,_=a[0],w=a[1],k=a[2],s,e),e.point(b,x)}function o(){A.point=r,e.lineEnd()}function l(){n(),A.point=u,A.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,g=_,v=w,m=k,A.point=a}function c(){i(b,x,y,_,w,k,d,p,h,g,v,m,s,e),A.lineEnd=o,o()}var h,f,d,p,g,v,m,y,b,x,_,w,k,A={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),A.lineStart=l},polygonEnd:function(){e.polygonEnd(),A.lineStart=n}};return A}function i(e,r,n,s,l,u,c,h,f,d,p,g,v,m){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,k=u+g,A=Math.sqrt(_*_+w*w+k*k),M=Math.asin(k/=A),L=vo(vo(k)-1)a||vo((y*S+b*z)/x-.5)>.3||o>s*d+l*p+u*g)&&(i(e,r,n,s,l,u,E,C,L,_/=A,w/=A,k,v,m),m.point(E,C),i(E,C,L,_,w,k,c,h,f,d,p,g,v,m))}}var a=.5,o=Math.cos(30*Fo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function nr(t){var e=rr(function(e,r){return t([e*No,r*No])});return function(t){return lr(e(t))}}function ir(t){this.stream=t}function ar(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 or(t){return sr(function(){return t})()}function sr(t){function e(t){return t=s(t[0]*Fo,t[1]*Fo),[t[0]*f+l,u-t[1]*f]}function r(t){return t=s.invert((t[0]-l)/f,(u-t[1])/f),t&&[t[0]*No,t[1]*No]}function n(){s=Ce(o=hr(m,y,b),a);var t=a(g,v);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=rr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,g=0,v=0,m=0,y=0,b=0,_=Is,w=x,k=null,A=null;return e.stream=function(t){return c&&(c.valid=!1),c=lr(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Is):Ve((k=+t)*Fo),i()):k},e.clipExtent=function(t){return arguments.length?(A=t,w=t?He(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):A},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Fo,v=t[1]%360*Fo,n()):[g*No,v*No]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Fo,y=t[1]%360*Fo,b=t.length>2?t[2]%360*Fo:0,n()):[m*No,y*No,b*No]},no.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function lr(t){return ar(t,function(e,r){t.point(e*Fo,r*Fo)})}function ur(t,e){return[t,e]}function cr(t,e){return[t>Oo?t-Io:-Oo>t?t+Io:t,e]}function hr(t,e,r){return t?e||r?Ce(dr(t),pr(e,r)):dr(t):e||r?pr(e,r):cr}function fr(t){return function(e,r){return e+=t,[e>Oo?e-Io:-Oo>e?e+Io:e,r]}}function dr(t){var e=fr(t);return e.invert=fr(-t),e}function pr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function gr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=vr(r,i),a=vr(r,a),(o>0?a>i:i>a)&&(i+=o*Io)):(i=t+o*Io,a=t-.5*l);for(var u,c=i;o>0?c>a:a>c;c-=l)s.point((u=we([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function vr(t,e){var r=ve(e);r[0]-=t,_e(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Po)%(2*Math.PI)}function mr(t,e,r){var n=no.range(t,e-Po,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function yr(t,e,r){var n=no.range(t,e-Po,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function _r(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*No,Math.atan2(o,Math.sqrt(n*n+i*i))*No]}:function(){return[t*No,e*No]};return p.distance=f,p}function wr(){function t(t,i){var a=Math.sin(i*=Fo),o=Math.cos(i),s=vo((t*=Fo)-e),l=Math.cos(s);Ys+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Ws.point=function(i,a){e=i*Fo,r=Math.sin(a*=Fo),n=Math.cos(a),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=k}}function kr(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function Ar(t,e){function r(t,e){o>0?-Ro+Po>e&&(e=-Ro+Po):e>Ro-Po&&(e=Ro-Po);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Oo/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Ro]},r):Lr}function Mr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return vo(i)i;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function jr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Dr(){nn(this),this.edge=this.site=this.circle=null}function Rr(t){var e=al.pop()||new Dr;return e.site=t,e}function Fr(t){Xr(t),rl.remove(t),al.push(t),nn(t)}function Nr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Fr(t);for(var l=a;l.circle&&vo(r-l.circle.x)c;++c)u=s[c],l=s[c-1],tn(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=Kr(l.site,u.site,null,i),Wr(l),Wr(u)}function Br(t){for(var e,r,n,i,a=t.x,o=t.y,s=rl._;s;)if(n=Ur(s,o)-a,n>Po)s=s.L;else{if(i=a-Vr(s,o),!(i>Po)){n>-Po?(e=s.P,r=s):i>-Po?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Rr(t);if(rl.insert(e,l),e||r){if(e===r)return Xr(e),r=Rr(e.site),rl.insert(l,r),l.edge=r.edge=Kr(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=Kr(e.site,l.site));Xr(e),Xr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,g=p.x-c,v=p.y-h,m=2*(f*v-d*g),y=f*f+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(f*b-g*y)/m+h};tn(r.edge,u,p,x),l.edge=Kr(u,t,null,x),r.edge=Kr(t,p,null,x),Wr(e),Wr(r)}}function Ur(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-(1/0);r=o.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function Vr(t,e){var r=t.N;if(r)return Ur(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Hr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],g=el,v=g.length;v--;)if(a=g[v],a&&a.prepare())for(s=a.edges,l=s.length,o=0;l>o;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(vo(n-e)>Po||vo(i-r)>Po)&&(s.splice(o,0,new en(Jr(a.site,c,vo(n-h)Po?{x:h,y:vo(e-h)Po?{x:vo(r-p)Po?{x:f,y:vo(e-f)Po?{x:vo(r-d)=-jo)){var d=l*l+u*u,p=c*c+h*h,g=(h*d-u*p)/f,v=(l*p-c*d)/f,h=v+s,m=ol.pop()||new Yr;m.arc=t,m.site=i,m.x=g+o,m.y=h+Math.sqrt(g*g+v*v),m.cy=h,t.circle=m;for(var y=null,b=il._;b;)if(m.yv||v>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.yn||n>1)if(f>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.yd){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xa||h>o||n>f||i>d)){if(p=t.point){var p,g=e-t.x,v=r-t.y,m=g*g+v*v;if(l>m){var y=Math.sqrt(l=m);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=t.nodes,x=.5*(c+f),_=.5*(h+d),w=e>=x,k=r>=_,A=k<<1|w,M=A+4;M>A;++A)if(t=b[3&A])switch(3&A){ @@ -24,18 +24,18 @@ args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"], }var i,a,o;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)i=a=o=r;else{var s=.5>r?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=q(t,e,r),o=V(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(r>e?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function l(t,e,r){t=6*L(t,360),e=L(e,100),r=L(r,100);var n=B.floor(t),i=t-n,a=r*(1-e),o=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,u=[r,o,a,a,s,r][l],c=[s,r,r,o,a,a][l],h=[a,a,s,r,r,o][l];return{r:255*u,g:255*c,b:255*h}}function u(t,e,r,n){var i=[z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return n&&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[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(t,e,r,n){var i=[z(j(n)),z(U(t).toString(16)),z(U(e).toString(16)),z(U(r).toString(16))];return i.join("")}function h(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s-=r/100,n.s=T(n.s),e(n)}function f(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.s+=r/100,n.s=T(n.s),e(n)}function d(t){return e(t).desaturate(100)}function p(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l+=r/100,n.l=T(n.l),e(n)}function g(t,r){r=0===r?0:r||10;var n=e(t).toRgb();return n.r=q(0,V(255,n.r-U(255*-(r/100)))),n.g=q(0,V(255,n.g-U(255*-(r/100)))),n.b=q(0,V(255,n.b-U(255*-(r/100)))),e(n)}function v(t,r){r=0===r?0:r||10;var n=e(t).toHsl();return n.l-=r/100,n.l=T(n.l),e(n)}function m(t,r){var n=e(t).toHsl(),i=(U(n.h)+r)%360;return n.h=0>i?360+i:i,e(n)}function y(t){var r=e(t).toHsl();return r.h=(r.h+180)%360,e(r)}function b(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+120)%360,s:r.s,l:r.l}),e({h:(n+240)%360,s:r.s,l:r.l})]}function x(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+90)%360,s:r.s,l:r.l}),e({h:(n+180)%360,s:r.s,l:r.l}),e({h:(n+270)%360,s:r.s,l:r.l})]}function _(t){var r=e(t).toHsl(),n=r.h;return[e(t),e({h:(n+72)%360,s:r.s,l:r.l}),e({h:(n+216)%360,s:r.s,l:r.l})]}function w(t,r,n){r=r||6,n=n||30;var i=e(t).toHsl(),a=360/n,o=[e(t)];for(i.h=(i.h-(a*r>>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function k(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function A(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function M(t){return t=parseFloat(t),(isNaN(t)||0>t||t>1)&&(t=1),t}function L(t,e){C(t)&&(t="100%");var r=S(t);return t=V(e,q(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),B.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function T(t){return V(1,q(0,t))}function E(t){return parseInt(t,16)}function C(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function S(t){return"string"==typeof t&&-1!=t.indexOf("%")}function z(t){return 1==t.length?"0"+t:""+t}function P(t){return 1>=t&&(t=100*t+"%"),t}function j(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return E(t)/255}function I(t){t=t.replace(R,"").replace(F,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=W.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=W.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=W.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=W.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=W.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=W.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=W.hex8.exec(t))?{a:O(r[1]),r:E(r[2]),g:E(r[3]),b:E(r[4]),format:e?"name":"hex8"}:(r=W.hex6.exec(t))?{r:E(r[1]),g:E(r[2]),b:E(r[3]),format:e?"name":"hex"}:(r=W.hex3.exec(t))?{r:E(r[1]+""+r[1]),g:E(r[2]+""+r[2]),b:E(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function D(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var R=/^[\s,#]+/,F=/\s+$/,N=0,B=Math,U=B.round,V=B.min,q=B.max,H=B.random;e.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 t,e,r,n,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4),i=.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4),a=.03928>=r?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=M(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=U(360*t.h),r=U(100*t.s),n=U(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return c(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*L(this._r,255))+"%",g:U(100*L(this._g,255))+"%",b:U(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*L(this._r,255))+"%, "+U(100*L(this._g,255))+"%, "+U(100*L(this._b,255))+"%)":"rgba("+U(100*L(this._r,255))+"%, "+U(100*L(this._g,255))+"%, "+U(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:Y[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+c(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=e(t);n=a.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(f,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?n[i]=t[i]:n[i]=P(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return t&&r?e(t).toRgbString()==e(r).toRgbString():!1},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,u=o.a-a.a;i=l*u==-1?l:(l+u)/(1+l*u),i=(i+1)/2;var c=1-i,h={r:o.r*i+a.r*c,g:o.g*i+a.g*c,b:o.b*i+a.b*c,a:o.a*s+a.a*(1-s)};return e(h)},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=D(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,u=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var c=0;cu&&(u=i,l=e(r[c]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var G=e.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"},Y=e.hexNames=A(G),W=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),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})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],214:[function(e,r,i){!function(){function e(t,e){function r(e){var r,n=t.arcs[0>e?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],0>e?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[0>t?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[0>r?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[0>t?~t:t]||s.push([t])}),s}function i(t,r,n){function i(t){var e=0>t?~t:t;(c[e]||(c[e]=[])).push({i:t,g:u})}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){"GeometryCollection"===t.type?t.geometries.forEach(s):t.type in h&&(u=t,h[t.type](t.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:a,MultiLineString:o,Polygon:o,MultiPolygon:function(t){t.forEach(o)}};s(r),c.forEach(arguments.length<3?function(t){l.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&l.push(t[0].i)})}else for(var f=0,d=t.arcs.length;d>f;++f)l.push(f);return{type:"MultiLineString",arcs:e(t,l)}}function a(t,r){function i(t){t.forEach(function(e){e.forEach(function(e){(o[e=0>e?~e:e]||(o[e]=[])).push(t)})}),s.push(t)}function a(e){return d(l(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var o={},s=[],u=[];return r.forEach(function(t){"Polygon"===t.type?i(t.arcs):"MultiPolygon"===t.type&&t.arcs.forEach(i)}),s.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),s.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(t){t.forEach(function(t){t.forEach(function(t){o[0>t?~t:t].length<2&&i.push(t)})})}),i=e(t,i),(n=i.length)>1)for(var s,l=a(r[0][0]),u=0;ut?~t:t],i=0,a=n.length;a>i;++i)e.push(r=n[i].slice()),l(r,i);0>t&&u(e,a)}function n(t){return t=t.slice(),l(t,0),t}function i(t){for(var e=[],n=0,i=t.length;i>n;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e=t.type;return"GeometryCollection"===e?{type:e,geometries:t.geometries.map(s)}:e in h?{type:e,coordinates:h[e](t)}:null}var l=m(t.transform),c=t.arcs,h={Point:function(t){return n(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(n)},LineString:function(t){return i(t.arcs)},MultiLineString:function(t){return t.arcs.map(i)},Polygon:function(t){return o(t.arcs)},MultiPolygon:function(t){return t.arcs.map(o)}};return s(e)}function u(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}function c(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;t[i]t&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,h=0;u>h;++h)for(var f=h+1;u>f;++f){var d,p=l[h],g=l[f];(d=a[p])[s=c(d,g)]!==g&&d.splice(s,0,g),(d=a[g])[s=c(d,p)]!==p&&d.splice(s,0,p)}return a}function f(t,e){function r(t){a.remove(t),t[1][2]=e(t),a.push(t)}var n=m(t.transform),i=y(t.transform),a=v();return e||(e=p),t.arcs.forEach(function(t){for(var o,s,l=[],u=0,c=0,h=t.length;h>c;++c)s=t[c],n(t[c]=[s[0],s[1],1/0],c);for(var c=1,h=t.length-1;h>c;++c)o=t.slice(c-1,c+2),o[1][2]=e(o),l.push(o),a.push(o);for(var c=0,h=l.length;h>c;++c)o=l[c],o.previous=l[c-1],o.next=l[c+1];for(;o=a.pop();){var f=o.previous,d=o.next;o[1][2]0;){var r=(e+1>>1)-1,i=n[r];if(g(t,i)>=0)break;n[i._=e]=i,n[t._=e=r]=t}}function e(t,e){for(;;){var r=e+1<<1,a=r-1,o=e,s=n[o];if(i>a&&g(n[a],s)<0&&(s=n[o=a]),i>r&&g(n[r],s)<0&&(s=n[o=r]),o===e)break;n[s._=e]=s,n[t._=e=o]=t}}var r={},n=[],i=0;return r.push=function(e){return t(n[e._=i]=e,i++),i},r.pop=function(){if(!(0>=i)){var t,r=n[0];return--i>0&&(t=n[i],e(n[t._=0]=t,0)),r}},r.remove=function(r){var a,o=r._;if(n[o]===r)return o!==--i&&(a=n[i],(g(a,r)<0?t:e)(n[a._=o]=a,o)),o},r}function m(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0),t[0]=(e+=t[0])*n+a,t[1]=(r+=t[1])*i+o}}function y(t){if(!t)return b;var e,r,n=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=r=0);var l=(t[0]-a)/n|0,u=(t[1]-o)/i|0;t[0]=l-e,t[1]=u-r,e=l,r=u}}function b(){}var x={version:"1.6.19",mesh:function(t){return l(t,i.apply(this,arguments))},meshArcs:i,merge:function(t){return l(t,a.apply(this,arguments))},mergeArcs:a,feature:o,neighbors:h,presimplify:f};"function"==typeof t&&t.amd?t(x):"object"==typeof r&&r.exports?r.exports=x:this.topojson=x}()},{}],215:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,h=u-c,f=e-h,d=n-s*h,p=d-l*h,g=p-s*f,v=l*f-g;return r?(r[0]=v,r[1]=n,r):[v,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],216:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],217:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function g(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function m(t){t=y.nextPow2(t);var e=y.log2(t),r=k[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,k=_.BUFFER;r.free=function(t){if(n.isBuffer(t))k[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){k[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return g(t);case"buffer":return m(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=g,r.mallocDataView=v,r.mallocBuffer=m,r.clearCache=function(){for(var t=0;32>t;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,k[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":33,buffer:34,dup:55}],218:[function(t,e,r){arguments[4][52][0].apply(r,arguments)},{dup:52}],219:[function(t,e,r){"use strict";function n(t,e){return("object"!=typeof e||null===e)&&(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":220}],220:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;s>l;++l)for(var u=t[l],c=0;2>c;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var f=0;switch(i){case"hanging":case"top":f=-a[1];break;case"middle":f=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":f=-3*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.heights)){if(n>i){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;i>s;++s)for(var l=o[s],u=1;uc||e.isConstraint(s,c))){for(var h=l[u-1],f=-1,d=1;df||a(t[s],t[c],t[h],t[f])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;ph||0>f||a(t[s],t[c],t[h],t[f])>=0||(e.flip(s,c),n(t,e,r,h,s,f),n(t,e,r,s,f,h),n(t,e,r,f,c,h),n(t,e,r,c,h,f))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":226,"robust-in-sphere":227}],223:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;a>o;++o){var s=r[o],l=s[0],u=s[1],c=s[2];c>u?l>u&&(s[0]=u,s[1]=c,s[2]=l):l>c&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var h=new Array(a),o=0;oo;++o)for(var s=r[o],y=0;3>y;++y){var l=s[y],u=s[(y+1)%3],b=p[3*o+y]=m.locate(u,l,t.opposite(u,l)),x=g[3*o+y]=t.isConstraint(l,u);0>b&&(x?d.push(o):(f.push(o),h[o]=1),e&&v.push([u,l,-1]))}return m}function o(t,e,r){for(var n=0,i=0;i0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);3>p;++p){var g=f[3*d+p];g>=0&&0===u[g]&&(h[3*d+p]?l.push(g):(s.push(g),u[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=o(c,u,e);return r?m.concat(n.boundary):m}var l=t("binary-search-bounds");e.exports=s;var u=n.prototype;u.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return n>r?e>r&&(a=r,o=n,s=e):e>n&&(a=n,o=e,s=r),0>a?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":226}],224:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r?r:t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;s>l;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]h;++h)l.push(new i(t[h],null,p,h));for(var h=0;o>h;++h){var f=e[h],d=t[f[0]],m=t[f[1]];d[0]m[0]&&l.push(new i(m,d,v,h),new i(d,m,g,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],h=0,_=l.length;_>h;++h){var w=l[h],k=w.type;k===p?s(x,b,t,w.a,w.idx):k===v?u(b,t,w):c(b,t,w)}return x}var f=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,g=1,v=2;e.exports=h},{"binary-search-bounds":226,"robust-orientation":195}],225:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;i>n;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;t>i;++i)r[i]=[];return new n(r,e)}var o=t("binary-search-bounds");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;i>n;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;n>r;++r)for(var i=t[r],a=0,o=i.length;o>a;a+=2){var s=i[a],l=i[a+1];rr;++r){e[r]=new Array(t);for(var n=0;t>n;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;rn;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;t>s;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;t>s;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f="exactInSphere"+t,d=[],s=0;t>s;++s)d.push("m"+s);for(var p=["function ",f,"(",d.join(),"){"],s=0;t>s;++s){p.push("var w",s,"=",u(s,t),";");for(var g=0;t>g;++g)g!==s&&p.push("var w",s,"m",g,"=scale(w",s,",m",g,"[0]);")}p.push("var p=",c,",n=",h,",d=diff(p,n);return d[d.length-1];}return ",f);var x=new Function("sum","diff","prod","scale",p.join(""));return x(m,y,v,b)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function g(){for(;_.length<=x;)_.push(c(_.length));for(var t=[],r=["slow"],n=0;x>=n;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;x>=n;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i=n;++n)e.exports[n]=_[n]}var v=t("two-product"),m=t("robust-sum"),y=t("robust-subtract"),b=t("robust-scale"),x=6,_=[h,f,d];g()},{"robust-scale":196,"robust-subtract":197,"robust-sum":198,"two-product":215}],228:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return 0>r?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s=0;--s){var g=n[s],u=g[0],v=e[u],m=v[0],x=v[1],w=t[m],A=t[x];if((w[0]-A[0]||w[1]-A[1])<0){var M=m;m=x,x=M}v[0]=m;var L,T=v[1]=g[1];for(i&&(L=v[2]);s>0&&n[s-1][0]===u;){var g=n[--s],E=g[1];i?e.push([T,E,L]):e.push([T,E]),T=E}i?e.push([T,x,L]):e.push([T,x])}return o}function u(t,e,r){for(var i=t.length+e.length,a=new g(i),o=r,s=0;ss;++s){var p=a.find(s);p===s?(d[s]=h,t[h++]=t[s]):(f=!1,d[s]=-1)}if(t.length=h,f)return null;for(var s=0;i>s;++s)d[s]<0&&(d[s]=d[a.find(s)]);return d}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r?r:t[2]e[2]?1:0}function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n0||d.length>0}function p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o0?r=r.shln(h):0>h&&(c=c.shln(-h)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":232,"./is-rat":234,"./lib/is-bn":238,"./lib/num-to-bn":239,"./lib/rationalize":240,"./lib/str-to-bn":241}],234:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":238}],235:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":243}],236:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;e>i;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],237:[function(t,e,r){"use strict";function n(t){var e=a(i.lo(t));if(32>e)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":33,"double-bits":254}],238:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":243}],239:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return 52>e?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":243,"double-bits":254}],240:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];0>n&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":235,"./num-to-bn":239}],241:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":243}],242:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":240}],243:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,("le"===e||"be"===e)&&(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;i>a;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&54>=o?o-49+10:o>=17&&22>=o?o-17+10:15&o}return n}function o(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;a>o;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function h(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function f(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){f.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&36>=e),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){0>t&&(this.sign=!0,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<>>26-n&4194303}this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,l=Math.min(a,a-s)+r,u=0,c=r;l>c;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var h=1,u=o(t,c,t.length,e),c=0;s>c;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?""};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,a=0,o=0;o>>24-i&16777215,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&36>=t){var u=g[t],c=v[t],n="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(c).toString(t);h=h.idivn(c),n=0!==h.cmpn(0)?p[u-f.length]+f+n:f+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26}for(;0!==i&&a>>26}if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e}for(;0!==a&&o>26,this.words[o]=67108863&e}if(0===a&&o>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);o>=s;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],h=u*c,f=67108863&h;i=i+(h/67108864|0)|0,f=f+a|0,a=67108863&f,i=i+(f>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i=l;l++){var u=i-l,c=0|this.words[u],h=0|t.words[l],f=c*h,d=67108863&f;a=a+(f/67108864|0)|0,d=d+o|0,o=67108863&d,a=a+(d>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);o>=s;s++){var l=n-s,u=this.words[l],c=t.words[s],h=u*c,f=67108863&h;i+=h/67108864|0,f+=a,a=67108863&f,i+=f>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;n>o;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<u;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o){this.length-=o;for(var u=0;u=0&&(0!==c||u>=i);u--){var h=this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<t?this.isubn(-t):this.sign?1===this.length&&this.words[0]=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),0>t)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(-1===s),s=0;for(var i=0;i>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,u=n.length-a.length;if("mod"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c=0;f--){var d=67108864*n.words[a.length+f]+n.words[a.length+f-1];for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,f);n.sign;)d--,n.sign=!1,n._ishlnsubmul(a,1,f),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[f]=d)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return 0>a||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(67108863>=t);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(67108863>=t);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(h).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(1);var i=e.cmp(r);if(0>i){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<a;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=0>t;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:t>n?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){i>n?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new f(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;n>i;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function y(t){if(m[t])return m[t];var y;if("k256"===t)y=new l;else if("p224"===t)y=new u;else if("p192"===t)y=new c;else{if("p25519"!==t)throw new Error("Unknown prime "+t);y=new h}return m[t]=y,y},f.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},f.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},f.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},f.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},f.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(t,e){this._verify2(t,e); var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},f.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},f.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},f.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},f.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},f.prototype.isqr=function(t){return this.imul(t,t)},f.prototype.sqr=function(t){return this.mul(t,t)},f.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var g=d,v=0;0!==g.cmp(l);v++)g=g.redSqr();r(p>v);var m=this.pow(f,new i(1).ishln(p-v-1));a=a.redMul(m),f=m.redSqr(),d=d.redMul(f),p=v}return a},f.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},f.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],244:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":235}],245:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":240}],246:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=a(s)+4,c=i(l.shln(u).divRound(r));return 0>s&&(c=-c),s+c*Math.pow(2,-u)}var h=r.bitLength()-l.bitLength()+53,c=i(l.shln(h).divRound(r));return 1023>h?c*Math.pow(2,-h):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-h))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":236,"./lib/ctz":237}],247:[function(t,e,r){"use strict";function n(t,e){for(var r=0;t>r;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;l>s;++s){var u=t[s];if(!n(e,u)){for(var c=0;2*e>c;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(0>=a||0>=o)){var s=t[0].length>>>1;if(!(0>=s)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if(a=i(t,s,u,c),a>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),g=h.mallocInt32(o);o=i(e,s,p,g),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,g):d(s,r,n,a,u,c,o,p,g),h.free(p),h.free(g))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,h=t("typedarray-pool"),f=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":249,"./lib/sweep":253,"typedarray-pool":217}],248:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",a,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+h+";++i,"+p+"+="+u+"){var x0="+f+"["+o+"+"+p+"],x1="+f+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",k="for(var j="+g+","+b+"="+u+"*"+g+";j<"+v+";++j,"+b+"+="+u+"){var y0="+m+"["+o+"+"+b+"],"+(r?"y1="+m+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",k):i.push(k,_,":",l),r?i.push("if(y1"+v+"-"+g+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join(""),u=new Function(s);return u()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",g="bs",v="be",m="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,c,h,f,d,g,v,m,y];r.partial=i(!1),r.full=i(!0)},{}],249:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(M*r);E.lengthC&&(l.free(C),C=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=M*t;E[u]=e,E[u+1]=r,E[u+2]=n,E[u+3]=i,E[u+4]=a,E[u+5]=o;var c=L*t;C[c]=s,C[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,g=i*h;a>p;++p,g+=h){var v=o[g+e],m=o[g+e+t];if(!(v>d||d>m||n&&d===v)){for(var y=s[p],b=e+1;t>b;++b){var v=o[g+b],m=o[g+b+t],x=u[f+b],_=u[f+b+t];if(x>m||v>_)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;i>d;++d,p+=c){var g=o[d];if(g!==u){var v=a[p+e],m=a[p+e+t];if(!(v>f||f>m)){for(var y=e+1;t>y;++y){var v=a[p+y],m=a[p+y+t],b=l[h+y],x=l[h+y+t];if(b>m||v>x)continue t}var _=r(g,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,g,T){n(t,s+c);var S,z=0,P=2*t;for(i(z++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(z++,0,0,c,0,s,1,-(1/0),1/0);z>0;){z-=1;var j=z*M,O=E[j],I=E[j+1],D=E[j+2],R=E[j+3],F=E[j+4],N=E[j+5],B=z*L,U=C[B],V=C[B+1],q=1&N,H=!!(16&N),G=l,Y=u,W=g,X=T;if(q&&(G=g,Y=T,W=l,X=u),!(2&N&&(D=_(t,O,I,D,G,Y,V),I>=D)||4&N&&(I=w(t,O,I,D,G,Y,U),I>=D))){var Z=D-I,Q=F-R;if(H){if(y>t*Z*(Z+Q)){if(S=d.scanComplete(t,O,e,I,D,G,Y,R,F,W,X),void 0!==S)return S;continue}}else{if(t*Math.min(Z,Q)t*Z*Q){if(S=d.scanBipartite(t,O,e,q,I,D,G,Y,R,F,W,X),void 0!==S)return S;continue}}var $=b(t,O,I,D,G,Y,U,V);if($>I)if(v>t*($-I)){if(S=f(t,O+1,e,I,$,G,Y,R,F,W,X),void 0!==S)return S}else if(O===t-2){if(S=q?d.sweepBipartite(t,e,R,F,W,X,I,$,G,Y):d.sweepBipartite(t,e,I,$,G,Y,R,F,W,X),void 0!==S)return S}else i(z++,O+1,I,$,R,F,q,-(1/0),1/0),i(z++,O+1,R,F,I,$,1^q,-(1/0),1/0);if(D>$){var K=p(t,O,R,F,W,X),J=W[P*K+O],tt=x(t,O,K,F,W,X,J);if(F>tt&&i(z++,O,$,D,tt,F,(4|q)+(H?16:0),J,V),K>R&&i(z++,O,$,D,R,K,(2|q)+(H?16:0),U,J),K+1===tt){if(S=H?o(t,O,e,$,D,G,Y,K,W,X[K]):a(t,O,e,q,$,D,G,Y,K,W,X[K]),void 0!==S)return S}else if(tt>K){var et;if(H){if(et=k(t,O,$,D,G,Y,J),et>$){var rt=x(t,O,$,et,G,Y,J);if(O===t-2){if(rt>$&&(S=d.sweepComplete(t,e,$,rt,G,Y,K,tt,W,X),void 0!==S))return S;if(et>rt&&(S=d.sweepBipartite(t,e,rt,et,G,Y,K,tt,W,X),void 0!==S))return S}else rt>$&&i(z++,O+1,$,rt,K,tt,16,-(1/0),1/0),et>rt&&(i(z++,O+1,rt,et,K,tt,0,-(1/0),1/0),i(z++,O+1,K,tt,rt,et,1,-(1/0),1/0))}}else et=q?A(t,O,$,D,G,Y,J):k(t,O,$,D,G,Y,J),et>$&&(O===t-2?S=q?d.sweepBipartite(t,e,K,tt,W,X,$,et,G,Y):d.sweepBipartite(t,e,$,et,G,Y,K,tt,W,X):(i(z++,O+1,$,et,K,tt,q,-(1/0),1/0),i(z++,O+1,K,tt,$,et,1^q,-(1/0),1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),u=t("bit-twiddle"),c=t("./brute"),h=c.partial,f=c.full,d=t("./sweep"),p=t("./median"),g=t("./partition"),v=128,m=1<<22,y=1<<22,b=g("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),x=g("lo===p0",["p0"]),_=g("lol;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;o>p;++p,++f,++d){var g=i[f];i[f]=i[d],i[d]=g}var v=a[c];a[c]=a[c-1],a[c-1]=v}}function i(t,e,r,i,a,l){if(r+1>=i)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=a[f*h+e];c>u;){if(s>c-u){n(t,e,u,c,a,l),p=a[f*h+e];break}var g=c-u,v=Math.random()*g+u|0,m=a[f*v+e],y=Math.random()*g+u|0,b=a[f*y+e],x=Math.random()*g+u|0,_=a[f*x+e];b>=m?_>=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=f*(c-1),k=f*d,A=0;f>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var L=l[c-1];l[c-1]=l[d],l[d]=L,d=o(t,e,u,c-1,a,l,p);for(var w=f*(c-1),k=f*d,A=0;f>A;++A,++w,++k){var M=a[w];a[w]=a[k],a[k]=M}var L=l[c-1];if(l[c-1]=l[d],l[d]=L,d>h){for(c=d-1;c>u&&a[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(h>d))break;for(u=d+1;c>u&&a[f*u+e]===p;)u+=1}}return o(t,e,r,h,a,l,a[f*h+e])}e.exports=i;var a=t("./partition"),o=a("lo=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],252:[function(t,e,r){"use strict";function n(t,e){4*f>=e?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;e>=i;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-->t;){var u=r[l-2],c=r[l-1];if(a>u)break;if(u===a&&o>c)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return i>n?!1:n===i?r[t+1]>r[e+1]:!0}function c(t,e,r,n){t*=2;var i=n[t];return e>i?!0:i===e?n[t+1]>1,v=g-n,m=g+n,y=d,b=v,x=g,_=m,w=p,k=t+1,A=e-1,M=0;u(y,b,r)&&(M=y,y=b,b=M),u(_,w,r)&&(M=_,_=w,w=M),u(y,x,r)&&(M=y,y=x,x=M),u(b,x,r)&&(M=b,b=x,x=M),u(y,_,r)&&(M=y,y=_,_=M),u(x,_,r)&&(M=x,x=_,_=M),u(b,w,r)&&(M=b,b=w,w=M),u(b,x,r)&&(M=b,b=x,x=M),u(_,w,r)&&(M=_,_=w,w=M);for(var L=r[2*b],T=r[2*b+1],E=r[2*_],C=r[2*_+1],S=2*y,z=2*x,P=2*w,j=2*d,O=2*g,I=2*p,D=0;2>D;++D){var R=r[S+D],F=r[z+D],N=r[P+D];r[j+D]=R,r[O+D]=F,r[I+D]=N}o(v,t,r),o(m,e,r);for(var B=k;A>=B;++B)if(c(B,L,T,r))B!==k&&a(B,k,r),++k;else if(!c(B,E,C,r))for(;;){if(c(A,E,C,r)){c(A,L,T,r)?(s(B,k,A,r),++k,--A):(a(B,A,r),--A);break}if(--A=k-2-t?i(t,k-2,r):h(t,k-2,r),f>=e-(A+2)?i(A+2,e,r):h(A+2,e,r),f>=A-k?i(k,A,r):h(k,A,r)}e.exports=n;var f=32},{}],253:[function(t,e,r){"use strict";function n(t){var e=h.nextPow2(t);g.lengthk;++k){var A=s[k],M=b*k;_[p++]=o[M+x],_[p++]=-(A+1),_[p++]=o[M+w],_[p++]=A}for(var k=l;u>k;++k){var A=h[k]+d,L=b*k;_[p++]=c[L+x],_[p++]=-A,_[p++]=c[L+w],_[p++]=A}var T=p>>>1;f(_,T);for(var E=0,C=0,k=0;T>k;++k){var S=0|_[2*k+1];if(S>=d)S=S-d|0,i(m,y,C--,S);else if(S>=0)i(g,v,E--,S);else if(-d>=S){S=-S-d|0;for(var z=0;E>z;++z){var P=e(g[z],S);if(void 0!==P)return P}a(m,y,C++,S)}else{S=-S-1|0;for(var z=0;C>z;++z){var P=e(S,m[z]);if(void 0!==P)return P}a(g,v,E++,S)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,p=2*t,w=t-1,k=p-1,A=r;n>A;++A){var M=s[A]+1<<1,L=p*A;_[d++]=o[L+w],_[d++]=-M,_[d++]=o[L+k],_[d++]=M}for(var A=l;u>A;++A){var M=h[A]+1<<1,T=p*A;_[d++]=c[T+w],_[d++]=1|-M,_[d++]=c[T+k],_[d++]=1|M}var E=d>>>1;f(_,E);for(var C=0,S=0,z=0,A=0;E>A;++A){var P=0|_[2*A+1],j=1&P;if(E-1>A&&P>>1===_[2*A+3]>>1&&(j=2,A+=1),0>P){for(var O=-(P>>1)-1,I=0;z>I;++I){var D=e(b[I],O);if(void 0!==D)return D}if(0!==j)for(var I=0;C>I;++I){var D=e(g[I],O);if(void 0!==D)return D}if(1!==j)for(var I=0;S>I;++I){var D=e(m[I],O);if(void 0!==D)return D}0===j?a(g,v,C++,O):1===j?a(m,y,S++,O):2===j&&a(b,x,z++,O)}else{var O=(P>>1)-1;0===j?i(g,v,C--,O):1===j?i(m,y,S--,O):2===j&&i(b,x,z--,O)}}}function l(t,e,r,n,o,s,l,u,c,h,p,m){var y=0,b=2*t,x=e,w=e+t,k=1,A=1;n?A=d:k=d;for(var M=o;s>M;++M){var L=M+k,T=b*M;_[y++]=l[T+x],_[y++]=-L,_[y++]=l[T+w],_[y++]=L}for(var M=c;h>M;++M){var L=M+A,E=b*M;_[y++]=p[E+x],_[y++]=-L}var C=y>>>1;f(_,C);for(var S=0,M=0;C>M;++M){var z=0|_[2*M+1];if(0>z){var L=-z,P=!1;if(L>=d?(P=!n,L-=d):(P=!!n,L-=1),P)a(g,v,S++,L);else{var j=m[L],O=b*L,I=p[O+e+1],D=p[O+e+1+t];t:for(var R=0;S>R;++R){var F=g[R],N=b*F;if(!(DB;++B)if(p[O+B+t]y;++y){var b=y+d,x=p*y;_[h++]=a[x+v],_[h++]=-b,_[h++]=a[x+m],_[h++]=b}for(var y=s;l>y;++y){var b=y+1,w=p*y;_[h++]=u[w+v],_[h++]=-b}var k=h>>>1;f(_,k);for(var A=0,y=0;k>y;++y){var M=0|_[2*y+1];if(0>M){var b=-M;if(b>=d)g[A++]=b-d;else{b-=1;var L=c[b],T=p*b,E=u[T+e+1],C=u[T+e+1+t];t:for(var S=0;A>S;++S){var z=g[S],P=o[z];if(P===L)break;var j=p*z;if(!(CO;++O)if(u[T+O+t]=0;--S)if(g[S]===b){for(var O=S+1;A>O;++O)g[O-1]=g[O];break}--A}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),h=t("bit-twiddle"),f=t("./sort"),d=1<<28,p=1024,g=c.mallocInt32(p),v=c.mallocInt32(p),m=c.mallocInt32(p),y=c.mallocInt32(p),b=c.mallocInt32(p),x=c.mallocInt32(p),_=c.mallocDouble(8*p)},{"./sort":252,"bit-twiddle":33,"typedarray-pool":217}],254:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if("undefined"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){var r=e.exports.hi(t);return(r<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:34}],255:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return 0>e?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":254}],256:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":230}],257:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;rs;++s)o[s]=a(t[s],r);return o}var i=t("big-rat"),a=t("big-rat/mul");e.exports=n},{"big-rat":233,"big-rat/mul":242}],259:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;r>a;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":245}],260:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;2>i;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c),f=Math.max(u,c);if(s>f||h>l)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||0>o&&0>s)return!1;var l=a(r,t,e),u=a(i,t,e);return l>0&&u>0||0>l&&0>u?!1:0===o&&0===s&&0===l&&0===u?n(t,e,r,i):!0}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":195}],261:[function(t,e,r){arguments[4][170][0].apply(r,arguments)},{dup:170}],262:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s=l&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;sn;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=(0|e)+1}e=0|e;for(var o=new Array(e),n=0;e>n;++n)o[n]=[];for(var n=0;r>n;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;e>s;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:218}],264:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,c=0;2>c;++c)if(u[c][n].length>0){o=u[c][n][0],l=c;break}s=o[1^l];for(var h=0;2>h;++h)for(var f=u[h][n],d=0;d0&&(o=p,s=g,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=u[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],h=t,f=s[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;s.push(t),l=n(c,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;s>c;++c)u[0][c]=[],u[1][c]=[];for(var c=0;l>c;++c){var h=t[c];u[0][h[0]].push(h),u[1][h[1]].push(h)}for(var f=[],c=0;s>c;++c)u[0][c].length+u[1][c].length===0&&f.push([c]);for(var c=0;s>c;++c)for(var d=0;2>d;++d){for(var p=[];u[d][c].length>0;){var g=(u[0][c].length,a(c,d));o(p,g)?p.push.apply(p,g):(p.length>0&&f.push(p),p=g)}p.length>0&&f.push(p)}return f}e.exports=n;var i=t("compare-angle")},{"compare-angle":265}],265:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r),h=n(t,e,i);return c===h?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var f=a(t,e,r);if(f>0)return s>0&&a(t,e,i)>0?1:-1;if(0>f)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":195,"robust-product":266,"robust-sum":198,signum:267,"two-sum":216}],266:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.lengtht?-1:t>0?1:0}},{}],268:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],269:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return 0>n?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=m.ge(this.leftPoints,t,f),n=m.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var u=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=u,l.right=n}i(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var u=m.ge(this.leftPoints,t,f);uthis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},_.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var w=g.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){return this.root?this.root.queryPoint(t,e):void 0},w.queryInterval=function(t,e,r){return e>=t&&this.root?this.root.queryInterval(t,e,r):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":268}],270:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return s>o?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),0>l){if(0>=u)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":195}],271:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(0>=i){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}return n.right?u(t,e,r,n.right):void 0}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(0>=o){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}return s>0&&i.right?c(t,e,r,n,i.right):void 0}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=m);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=m,r._color=m,s._color=m,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=m,n._color=m,e._color=m,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+11){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=m,n._color=m,e._color=m,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===m){if(r._color===v)return r._color=m,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1t?-1:t>e?1:0}function g(t){return new s(t||p,null)}e.exports=g;var v=0,m=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=0>=c?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){var i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===m||i._color===m)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=f.right,f._color=m,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var g=l[h-3];g.left===d?g.left=f:g.right=f}break}f._color=m,d.right=a(m,p),d._color=v,h-=1}else{var p=d.right;if(!p||p._color!==v){if(f.right=i.left,d._color=v,d.left=i.right,i._color=m,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var g=l[h-3];g.left===d?g.left=i:g.right=i}break}f._color=m,d.right=a(m,p),d._color=v,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=f.left,f._color=m,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var g=l[h-3];g.right===d?g.right=f:g.left=f}break}f._color=m,d.left=a(m,p),d._color=v,h-=1}else{var p=d.left;if(!p||p._color!==v){if(f.left=i.right,d._color=v,d.right=i.left,i._color=m,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var g=l[h-3];g.right===d?g.right=i:g.left=i}break}f._color=m,d.left=a(m,p),d._color=v,h-=1}}return l[0]._color=m,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root); -case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(0>t)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>=a&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>a&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=0>=i?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=0>=n?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],272:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]s)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;e>a;++a){var l=t[a],u=l[0][0]a;){for(var v=i[a].x,m=[];r>a;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":270,"binary-search-bounds":268,"functional-red-black-tree":271,"robust-orientation":195}],273:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return i?!!i.queryPoint(r,n):!1}}function a(t){for(var e={},r=0;rn)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;e>i;++i)for(var c=t[i],h=c.length,d=h-1,p=0;h>p;d=p++){var g=c[d],v=c[p];g[0]===v[0]?n.push([g,v]):r.push([g,v])}if(0===r.length)return 0===n.length?s:l(a(n));var m=f(r),y=o(m.slabs,m.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":268,"interval-tree-1d":269,"robust-orientation":195,"slab-decomposition":272}],274:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!O[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,o(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),k=l([w]),A=0;t:for(var M=0;y>M;++M)if(_[M]=0,v!==M){for(var L=m[M],T=L.length,E=0;T>E;++E){var C=k(e[L[E]]);if(0!==C){0>C&&(_[M]=1,A+=1);continue t}}_[M]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],S=_[1],z=_[2],M=0;y>M;++M)z[M]&&(b[M]=S);for(var P=i(y),v=0;y>v;++v)P[v].push(b[v]),P[b[v]].push(v);for(var j={},O=n(p,!1),v=0;y>v;++v)for(var L=m[v],T=L.length,M=0;T>M;++M){var I=L[M],D=L[(M+1)%T],R=Math.min(I,D)+":"+Math.max(I,D);if(R in j){var F=j[R];P[F].push(v),P[v].push(F),O[I]=O[D]=!0}else j[R]=v}for(var N=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||a(m[v])?B[v]=-1:(N.push(v),B[v]=0);for(var d=[];N.length>0;){var U=N.pop(),V=P[U];h(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var L=m[U];q=[L]}for(var v=0;H>v;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,N.push(Y),0===G)){var L=m[Y];a(L)||(L.reverse(),q.push(L))}}0===G&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":262,"edges-to-adjacency-list":263,"planar-dual":264,"point-in-big-polygon":273,"robust-sum":198,"two-product":215,uniq:218}],275:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],276:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],277:[function(t,e,r){arguments[4][171][0].apply(r,arguments)},{"bit-twiddle":275,dup:171,"union-find":276}],278:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,L[r]=e,L[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(E>n){var l=s(n);r>l&&(o=n,r=l)}if(E>i){var u=s(i);r>u&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function h(){if(E>0){var t=M[0];return a(0,E-1),E-=1,u(0),t}return-1}function f(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),c(t),h(),b[r]=e,E+=1,c(E-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),L[e]>=0&&f(L[e],i(e)),L[r]>=0&&f(L[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var k=w[1],A=w[0];-1!==y[A]?y[A]=-2:y[A]=k,-1!==m[k]?m[k]=-2:m[k]=A}for(var M=[],L=new Array(g),_=0;g>_;++_){var T=b[_]=i(_);1/0>T?(L[_]=M.length,M.push(_)):L[_]=-1}for(var E=M.length,_=E>>1;_>=0;--_)u(_);for(;;){var C=h();if(0>C||b[C]>r)break;d(C)}for(var S=[],_=0;g>_;++_)x[_]||(L[_]=S.length,S.push(e[_].slice()));var z=(S.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=L[e],i=L[r];n!==i&&z.push([n,i])}}),o.unique(o.normalize(z)),{positions:S,edges:z}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":195,"simplicial-complex":277}],279:[function(t,e,r){e.exports={name:"plotly.js",version:"1.2.1",description:"The open source javascript graphing library that powers plotly",license:"MIT",main:"./src/index.js",webpack:"./dist/plotly.min.js",repository:{type:"git",url:"https://github.com/plotly/plotly.js.git"},bugs:{url:"https://github.com/plotly/plotly.js/issues"},author:"Plotly, Inc.",keywords:["graphing","plotting","data","visualization","plotly"],scripts:{preprocess:"node tasks/preprocess.js",postinstall:"npm run preprocess",bundle:"node tasks/bundle.js",header:"node tasks/header.js",build:"npm run preprocess && npm run bundle && npm run header",cibuild:"node tasks/cibundle.js",watch:"node tasks/watch_plotly.js",lint:"cd src && jshint . || true","test-jasmine":"karma start test/jasmine/karma.conf.js","citest-jasmine":"karma start test/jasmine/karma.ciconf.js","test-image":"./tasks/test_image.sh",test:"npm run test-jasmine && npm test-image","start-test_dashboard":"node devtools/test_dashboard/server.js","start-image_viewer":"node devtools/image_viewer/server.js",baseline:"./tasks/baseline.sh",version:"npm run build && git add -A dist",postversion:"git push && git push --tags"},dependencies:{"3d-view":"^2.0.0","alpha-shape":"^1.0.0",arraytools:"^1.0.0","convex-hull":"^1.0.3",d3:"3.5.6","delaunay-triangulate":"^1.1.6","es6-promise":"^3.0.2","fast-isnumeric":"^1.1.1","fs-extra":"^0.26.2","gl-error2d":"^1.0.0","gl-error3d":"^1.0.0","gl-line2d":"^1.2.1","gl-line3d":"^1.0.1","gl-mat4":"^1.1.2","gl-mesh3d":"^1.0.4","gl-plot2d":"^1.1.6","gl-plot3d":"^1.3.0","gl-scatter2d":"^1.0.5","gl-scatter2d-fancy":"^1.1.1","gl-scatter3d":"^1.0.4","gl-select-box":"^1.0.1","gl-spikes2d":"^1.0.1","gl-surface3d":"^1.0.6","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2",ndarray:"^1.0.16","ndarray-fill":"^1.0.1","ndarray-homography":"^1.0.0","ndarray-ops":"^1.2.2","node-sass":"^3.4.1","right-now":"^1.0.0","robust-orientation":"^1.1.3","sane-topojson":"^1.2.0","superscript-text":"^1.0.0",tinycolor2:"1.1.2",topojson:"^1.6.19",xml2js:"^0.4.15"},devDependencies:{brfs:"^1.4.1",browserify:"^12.0.1","browserify-transform-tools":"^1.5.0",ecstatic:"^1.2.0","jasmine-core":"^2.3.4",jshint:"^2.8.0",karma:"^0.13.15","karma-browserify":"^4.4.1","karma-chrome-launcher":"^0.2.1","karma-coverage":"^0.5.3","karma-firefox-launcher":"^0.1.6","karma-jasmine":"^0.3.6",open:"0.0.5","prepend-file":"^1.3.0",prettysize:"0.0.3",through2:"^2.0.0","uglify-js":"^2.5.0",watchify:"^3.6.0"}}},{}],280:[function(t,e,r){e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],281:[function(t,e,r){var n=t("../../plotly"),i=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},a,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:i.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":316,"../../plotly":336,"../../plots/font_attributes":342,"./arrow_paths":280}],282:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return o.Lib.coerce(t,n,u.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),a=o.Color.opacity(i);r("borderpad");var s=r("borderwidth"),l=r("showarrow");l&&(r("arrowcolor",a?n.bordercolor:o.Color.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(a&&s||1)),r("ax"),r("ay"),o.Lib.noneOrAll(t,n,["ax","ay"])),r("text",l?" ":"new text"),r("textangle"),o.Lib.coerceFont(r,"font",e.font);for(var c=["x","y"],h=0;2>h;h++){var f=c[h],d={_fullLayout:e},p=o.Axes.coerceRef(t,n,d,f),g=.5;if("paper"!==p){var v=o.Axes.getFromId(d,p);if(g=v.range[0]+g*(v.range[1]-v.range[0]),-1!==["date","category"].indexOf(v.type)&&"string"==typeof t[f]){var m;"date"===v.type?(m=o.Lib.dateTime2ms(t[f]),m!==!1&&(t[f]=m)):(v._categories||[]).length&&(m=v._categories.indexOf(t[f]),-1!==m&&(t[f]=m))}}r(f,g),l||r(f+"anchor")}return o.Lib.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=o.Axes.getFromId(t,e.xref),n=o.Axes.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,s=(e._ysize||0)/2,l=e._yshift||0,u=i-a,c=i+a,h=s-l,f=s+l;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;u=Math.max(u,d),c=Math.max(c,d),h=Math.max(h,d),f=Math.max(f,d)}r&&r.autorange&&o.Axes.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:u}),n&&n.autorange&&o.Axes.expand(n,[n.l2c(e.y)],{ppadplus:f,ppadminus:h})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var g=(u*d-c*f)/p,v=(u*h-l*f)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+h*g}}var o=t("../../plotly"),s=t("d3"),l=t("fast-isnumeric"),u=e.exports={};u.ARROWPATHS=t("./arrow_paths"),u.layoutAttributes=t("./attributes"),u.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;at?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}W.selectAll("tspan.line").attr({y:0,x:0});var n=U.select(".annotation-math-group"),i=!n.empty(),l=o.Drawing.bBox((i?n:W).node()),c=l.width,h=l.height,f=Math.round(c+2*H),d=Math.round(h+2*H);O._w=c,O._h=h;var g=!1;if(["x","y"].forEach(function(e){var n,i=o.Axes.getFromId(t,O[e+"ref"]||e),a=(F+("x"===e?0:90))*Math.PI/180,s=f*Math.abs(Math.cos(a))+d*Math.abs(Math.sin(a)),l=O[e+"anchor"];if(i){if(!i.autorange&&(O[e]-i.range[0])*(O[e]-i.range[1])>0)return void(g=!0);R[e]=i._offset+i.l2p(O[e]),n=.5}else n=O[e],"y"===e&&(n=1-n),R[e]="x"===e?w.l+w.w*n:w.t+w.h*n;var u=0;u=O.showarrow?O["a"+e]:s*r(n,l),R[e]+=u,O["_"+e+"type"]=i&&i.type,O["_"+e+"size"]=s,O["_"+e+"shift"]=u}),g)return void U.remove();var v,m;O.showarrow&&(v=o.Lib.constrain(R.x-O.ax,1,p.width-1),m=o.Lib.constrain(R.y-O.ay,1,p.height-1)),R.x=o.Lib.constrain(R.x,1,p.width-1),R.y=o.Lib.constrain(R.y,1,p.height-1);var y=H-l.top,b=H-l.left;i?n.select("svg").attr({x:H-1,y:H}):(W.attr({x:b,y:y}),W.selectAll("tspan.line").attr({y:y,x:b})),G.call(o.Drawing.setRect,V/2,V/2,f-V,d-V),U.call(o.Drawing.setRect,Math.round(R.x-f/2),Math.round(R.y-d/2),f,d);var x="annotations["+e+"]",_=function(r,n){s.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=R.x+r,l=R.y+n,c=o.Lib.rotationXYMatrix(F,i,l),h=o.Lib.apply2DTransform(c),f=o.Lib.apply2DTransform2(c),d=G.attr("width")/2,p=G.attr("height")/2,g=[[i-d,l-p,i-d,l+p],[i-d,l+p,i+d,l+p],[i+d,l+p,i+d,l-p],[i+d,l-p,i-d,l-p]].map(f);if(!g.reduce(function(t,e){return t^!!a(v,m,v+1e6,m+1e6,e[0],e[1],e[2],e[3])},!1)){g.forEach(function(t){var e=a(i,l,v,m,t[0],t[1],t[2],t[3]);e&&(i=e.x,l=e.y)});var y=O.arrowwidth,b=O.arrowcolor,_=N.append("g").style({opacity:o.Color.opacity(b)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),k=_.append("path").attr("d","M"+i+","+l+"L"+v+","+m).style("stroke-width",y+"px").call(o.Color.stroke,o.Color.rgb(b));u.arrowhead(k,O.arrowhead,"end",O.arrowsize);var A=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-v)+","+(l-m),transform:"translate("+v+","+m+")"}).style("stroke-width",y+6+"px").call(o.Color.stroke,"rgba(0,0,0,0)").call(o.Color.fill,"rgba(0,0,0,0)");if(t._context.editable){var M,L,T;o.Fx.dragElement({element:A.node(),prepFn:function(){L=Number(U.attr("x")),T=Number(U.attr("y")),M={},I&&I.autorange&&(M[I._name+".autorange"]=!0),D&&D.autorange&&(M[D._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=h(L,T),n=r[0]+t,i=r[1]+e;U.call(o.Drawing.setPosition,n,i),M[x+".x"]=I?O.x+t/I._m:(v+t-w.l)/w.w,M[x+".y"]=D?O.y+e/D._m:1-(m+e-w.t)/w.h,B.attr({transform:"rotate("+F+","+n+","+i+")"})},doneFn:function(e){if(e){o.relayout(t,M);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};O.showarrow&&_(0,0);var k=o.Lib.rotationXYMatrix(F,R.x,R.y),A=o.Lib.apply2DTransform(k);if(t._context.editable){var M,L,T;o.Fx.dragElement({element:U.node(),prepFn:function(){M=Number(U.attr("x")),L=Number(U.attr("y")),T={}},moveFn:function(t,e){U.call(o.Drawing.setPosition,M+t,L+e);var r="pointer";if(O.showarrow)T[x+".ax"]=O.ax+t,T[x+".ay"]=O.ay+e,_(t,e);else{if(I)T[x+".x"]=O.x+t/I._m;else{var n=O._xsize/w.w,i=O.x+O._xshift/w.w-n/2;T[x+".x"]=o.Fx.dragAlign(i+t/w.w,n,0,1,O.xanchor)}if(D)T[x+".y"]=O.y+e/D._m;else{var a=O._ysize/w.h,s=O.y-O._yshift/w.h-a/2;T[x+".y"]=o.Fx.dragAlign(s-e/w.h,a,0,1,O.yanchor)}I&&D||(r=o.Fx.dragCursors(I?.5:T[x+".x"],D?.5:T[x+".y"],O.xanchor,O.yanchor))}var l=A(M,L),u=l[0]+t,c=l[1]+e;U.call(o.Drawing.setPosition,u,c),B.attr({transform:"rotate("+F+","+u+","+c+")"}),o.Fx.setCursor(U,r)},doneFn:function(e){if(o.Fx.setCursor(U),e){o.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var f,d=t.layout,p=t._fullLayout;if(!l(e)||-1===e){if(!e&&Array.isArray(i))return d.annotations=i,u.supplyLayoutDefaults(d,p),void u.drawAll(t);if("remove"===i)return delete d.annotations,p.annotations=[],void u.drawAll(t);if(r&&"add"!==i){for(f=0;fe;f--)p._infolayer.selectAll('.annotation[data-index="'+(f-1)+'"]').attr("data-index",String(f)),u.draw(t,f)}}p._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var v=d.annotations[e],m=p.annotations[e];if(v){var y={xref:v.xref,yref:v.yref},b={};"string"==typeof r&&r?b[r]=i:o.Lib.isPlainObject(r)&&(b=r);var x=Object.keys(b);for(f=0;ff;f++){var A=k[f];if(void 0===b[A]&&void 0!==v[A]){var M=o.Axes.getFromId(t,o.Axes.coerceRef(y,{},t,A)),L=o.Axes.getFromId(t,o.Axes.coerceRef(v,{},t,A)),T=v[A],E=m["_"+A+"type"];if(void 0!==b[A+"ref"]){var C="auto"===v[A+"anchor"],S="x"===A?w.w:w.h,z=(m["_"+A+"size"]||0)/(2*S);if(M&&L)T=(T-M.range[0])/(M.range[1]-M.range[0]),T=L.range[0]+T*(L.range[1]-L.range[0]);else if(M){if(T=(T-M.range[0])/(M.range[1]-M.range[0]),T=M.domain[0]+T*(M.domain[1]-M.domain[0]),C){var P=T+z,j=T-z;2/3>T+j?T=j:T+P>4/3&&(T=P)}}else L&&(C&&(1/3>T?T+=z:T>2/3&&(T-=z)),T=(T-L.domain[0])/(L.domain[1]-L.domain[0]),T=L.range[0]+T*(L.range[1]-L.range[0]))}L&&L===M&&E&&("log"===E&&"log"!==L.type?T=Math.pow(10,T):"log"!==E&&"log"===L.type&&(T=T>0?Math.log(T)/Math.LN10:void 0)),v[A]=T}}var O=n(v,p);p.annotations[e]=O;var I=o.Axes.getFromId(t,O.xref),D=o.Axes.getFromId(t,O.yref),R={x:0,y:0},F=+O.textangle||0,N=p._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",O.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:v,fullAnnotation:O})}),B=N.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),U=B.append("svg").call(o.Drawing.setPosition,0,0),V=O.borderwidth,q=O.borderpad,H=V+q,G=U.append("rect").attr("class","bg").style("stroke-width",V+"px").call(o.Color.stroke,O.bordercolor).call(o.Color.fill,O.bgcolor),Y=O.font,W=U.append("text").classed("annotation",!0).attr("data-unformatted",O.text).text(O.text);t._context.editable?W.call(o.util.makeEditable,U).call(c).on("edit",function(r){O.text=r,this.attr({"data-unformatted":O.text}),this.call(c);var n={};n["annotations["+e+"].text"]=O.text,I&&I.autorange&&(n[I._name+".autorange"]=!0),D&&D.autorange&&(n[D._name+".autorange"]=!0),o.relayout(t,n)}):W.call(c),B.attr({transform:"rotate("+F+","+R.x+","+R.y+")"}).call(o.Drawing.setPosition,R.x,R.y)}},u.arrowhead=function(t,e,r,n){l(n)||(n=1);var i=t.node(),a=u.ARROWPATHS[e||0];if(a){"string"==typeof r&&r||(r="end");var c,h,f,d,p=(o.Drawing.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||o.Color.defaultLine,v=t.style("stroke-opacity")||1,m=r.indexOf("start")>=0,y=r.indexOf("end")>=0,b=a.backoff*p;if("line"===i.nodeName){if(c={x:+t.attr("x1"),y:+t.attr("y1")},h={x:+t.attr("x2"),y:+t.attr("y2")},f=Math.atan2(c.y-h.y,c.x-h.x),d=f+Math.PI,b){var x=b*Math.cos(f),_=b*Math.sin(f);m&&(c.x-=x,c.y-=_,t.attr({x1:c.x,y1:c.y})),y&&(h.x+=x,h.y+=_,t.attr({x2:h.x,y2:h.y}))}}else if("path"===i.nodeName){var w=i.getTotalLength(),k="";if(m){var A=i.getPointAtLength(0),M=i.getPointAtLength(.1);f=Math.atan2(A.y-M.y,A.x-M.x),c=i.getPointAtLength(Math.min(b,w)),b&&(k="0px,"+b+"px,")}if(y){var L=i.getPointAtLength(w),T=i.getPointAtLength(w-.1);if(d=Math.atan2(L.y-T.y,L.x-T.x),h=i.getPointAtLength(Math.max(0,w-b)),b){var E=k?2*b:b;k+=w-E+"px,"+w+"px"}}else k&&(k+=w+"px");k&&t.style("stroke-dasharray",k)}var C=function(r,n){e>5&&(n=0),s.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:a.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+p+")"}).style({fill:g,opacity:v,"stroke-width":0})};m&&C(c,f),y&&C(h,d)}},u.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=o.Axes.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return o.Lib.syncOrAsync([u.drawAll,i],t)}}},{"../../plotly":336,"./arrow_paths":280,"./attributes":281,d3:53,"fast-isnumeric":58}],283:[function(t,e,r){r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff"},{}],284:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;el&&(o[1]-=(H-l)/2)):r.node()&&!r.classed("js-placeholder")&&(H=n.Drawing.bBox(e.node()).height),H){if(H+=5,"top"===a.titleside)D.domain[1]-=H/u._size.h,o[1]*=-1;else{D.domain[0]+=H/u._size.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),D.setScale()}}V.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(u._size.h*(1-D.domain[1]))+")");var v=V.select(".cbfills").selectAll("rect.cbfill").data(d);v.enter().append("rect").classed("cbfill",!0).style("stroke","none"),v.exit().remove(),v.each(function(t,e){var r=[0===e?h[0]:(d[e]+d[e-1])/2,e===d.length-1?h[1]:(d[e]+d[e+1])/2].map(D.c2p).map(Math.round);e!==d.length-1&&(r[1]+=r[1]>r[0]?1:-1),i.select(this).attr({x:S,width:Math.max(k,2),y:i.min(r),height:Math.max(i.max(r)-i.min(r),2)}).style("fill",g(t))});var m=V.select(".cblines").selectAll("path.cbline").data(a.line.color&&a.line.width?f:[]);return m.enter().append("path").classed("cbline",!0),m.exit().remove(),m.each(function(t){i.select(this).attr("d","M"+S+","+(Math.round(D.c2p(t))+a.line.width/2%1)+"h"+k).call(n.Drawing.lineGroupStyle,a.line.width,p(t),a.line.dash)}),D._axislayer.selectAll("g."+D._id+"tick,path").remove(),D._pos=S+k+(a.outlinewidth||0)/2-("outside"===a.ticks?1:0),D.side="right",n.Axes.doTicks(t,D)}function l(){var r=k+a.outlinewidth/2+n.Drawing.bBox(D._axislayer.node()).width;if(x=q.select("text"),x.node()&&!x.classed("js-placeholder")){var i,o=q.select(".h"+D._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(a.titleside)?n.Drawing.bBox(o).width:n.Drawing.bBox(q.node()).right-S-u._size.l,r=Math.max(r,i)}var s=2*a.xpad+r+a.borderwidth+a.outlinewidth/2,l=j-O;V.select(".cbbg").attr({x:S-a.xpad-(a.borderwidth+a.outlinewidth)/2,y:O-E,width:Math.max(s,2),height:Math.max(l+2*E,2)}).call(n.Color.fill,a.bgcolor).call(n.Color.stroke,a.bordercolor).style({"stroke-width":a.borderwidth}),V.selectAll(".cboutline").attr({x:S,y:O+a.ypad+("top"===a.titleside?H:0),width:Math.max(k,2),height:Math.max(l-2*a.ypad-H,2)}).call(n.Color.stroke,a.outlinecolor).style({fill:"None","stroke-width":a.outlinewidth});var c=({center:.5,right:1}[a.xanchor]||0)*s;V.attr("transform","translate("+(u._size.l-c)+","+u._size.t+")"),n.Plots.autoMargin(t,e,{x:a.x,y:a.y,l:s*({right:1,center:.5}[a.xanchor]||0),r:s*({left:1,center:.5}[a.xanchor]||0),t:l*({bottom:1,middle:.5}[a.yanchor]||0),b:l*({top:1,middle:.5}[a.yanchor]||0)})}var u=t._fullLayout;if("function"!=typeof a.fillcolor&&"function"!=typeof a.line.color)return void u._infolayer.selectAll("g."+e).remove();var c,h=i.extent(("function"==typeof a.fillcolor?a.fillcolor:a.line.color).domain()),f=[],d=[],p="function"==typeof a.line.color?a.line.color:function(){return a.line.color},g="function"==typeof a.fillcolor?a.fillcolor:function(){return a.fillcolor},v=a.levels.end+a.levels.size/100,m=a.levels.size,y=1.001*h[0]-.001*h[1],b=1.001*h[1]-.001*h[0];for(c=a.levels.start;0>(c-v)*m;c+=m)c>y&&b>c&&f.push(c);if("function"==typeof a.fillcolor)if(a.filllevels)for(v=a.filllevels.end+a.filllevels.size/100,m=a.filllevels.size,c=a.filllevels.start;0>(c-v)*m;c+=m)c>h[0]&&c1){var U=Math.pow(10,Math.floor(Math.log(B)/Math.LN10));F*=U*n.Lib.roundUp(B/U,[2,5,10]),(Math.abs(a.levels.start)/a.levels.size+1e-6)%1<2e-6&&(D.tick0=0)}D.dtick=F}D.domain=[P+C,P+L-C],D.setScale();var V=u._infolayer.selectAll("g."+e).data([0]);V.enter().append("g").classed(e,!0).each(function(){var t=i.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0)}),V.attr("transform","translate("+Math.round(u._size.l)+","+Math.round(u._size.t)+")");var q=V.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(u._size.l)+",-"+Math.round(u._size.t)+")");D._axislayer=V.select(".cbaxis");var H=0;-1!==["top","bottom"].indexOf(a.titleside)&&n.Titles.draw(t,D._id+"title");var G=n.Lib.syncOrAsync([n.Plots.previousPromises,s,n.Plots.previousPromises,l],t);if(G&&G.then&&(t._promises||[]).push(G),t._context.editable){var Y,W,X;n.Fx.dragElement({element:V.node(),prepFn:function(){Y=V.attr("transform"),n.Fx.setCursor(V)},moveFn:function(e,r){var i=t._fullLayout._size;V.attr("transform",Y+" translate("+e+","+r+")"),W=n.Fx.dragAlign(z+e/i.w,A,0,1,a.xanchor),X=n.Fx.dragAlign(P-r/i.h,L,0,1,a.yanchor);var o=n.Fx.dragCursors(W,X,a.xanchor,a.yanchor);n.Fx.setCursor(V,o)},doneFn:function(r){if(n.Fx.setCursor(V),r&&void 0!==W&&void 0!==X){var i,a=e.substr(2);t._fullData.some(function(t){return t.uid===a?(i=t.index,!0):void 0}),n.restyle(t,{"colorbar.x":W,"colorbar.y":X},i)}}})}return G}var a={};return Object.keys(o.attributes).forEach(function(t){a[t]=null}),a.fillcolor=null,a.line={color:null,width:null,dash:null},a.levels={start:null,end:null,size:null},a.filllevels=null,Object.keys(a).forEach(function(t){r[t]=function(e){return arguments.length?(a[t]=n.Lib.isPlainObject(a[t])?n.Lib.extendFlat(a[t],e):e,r):a[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=a,r};o.attributes=t("./attributes"),o.supplyDefaults=function(t,e,r){function i(t,e){return n.Lib.coerce(s,a,o.attributes,t,e)}var a=e.colorbar={},s=t.colorbar||{},l=i("thicknessmode");i("thickness","fraction"===l?30/(r.width-r.margin.l-r.margin.r):30);var u=i("lenmode");i("len","fraction"===u?1:r.height-r.margin.t-r.margin.b),i("x"),i("xanchor"),i("xpad"),i("y"),i("yanchor"),i("ypad"),n.Lib.noneOrAll(s,a,["x","y"]),i("outlinecolor"),i("outlinewidth"),i("bordercolor"),i("borderwidth"),i("bgcolor"),n.Axes.handleTickValueDefaults(s,a,i,"linear"),n.Axes.handleTickDefaults(s,a,i,"linear",{outerTicks:!1,font:r.font,noHover:!0}),i("title"),n.Lib.coerceFont(i,"titlefont",r.font),i("titleside")},o.traceColorbar=function(t,e){var r=e[0].trace,s="cb"+r.uid,l=n.Colorscale.getScale(r.colorscale),u=r.zmin,c=r.zmax;if(a(u)||(u=n.Lib.aggNums(Math.min,null,r.z)),a(c)||(c=n.Lib.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.Plots.autoMargin(t,s);var h=e[0].t.cb=o(t,s);h.fillcolor(i.scale.linear().domain(l.map(function(t){return u+t[0]*(c-u)})).range(l.map(function(t){return t[1]}))).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)(),n.Lib.markTime("done colorbar")}},{"../../plotly":336,"./attributes":285,d3:53,"fast-isnumeric":58}],287:[function(t,e,r){e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0},_deprecated:{scl:{valType:"colorscale"},reversescl:{valType:"boolean"}}}},{}],288:[function(t,e,r){"use strict";function n(t){var e,r=!0,n=0;if(Array.isArray(t)){if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var i=0;i=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n},l.hasColorscale=function(t,e){var r=e?i.Lib.nestedProperty(t,e).get()||{}:t,n=r.color,a=!1;if(Array.isArray(n))for(var o=0;ob,n(p+g+"auto",!o),n(p+g+"min"),n(p+g+"max"),void 0!==_&&(u=!l.isValidScale(_)),n(p+"autocolorscale",u),h=n(p+"colorscale"),f=n(p+"reversescale"),f&&(y.colorscale=l.flipScale(h)),"marker.line."!==p&&(p&&(c=l.hasColorbar(m)),d=n(p+"showscale",c),d&&i.Colorbar.supplyDefaults(m,y,r))},l.calc=function(t,e,r,n){var a,o;r?(a=i.Lib.nestedProperty(t,r).get(),o=i.Lib.nestedProperty(t._input,r).get()):(a=t,o=t._input);var s=a[n+"auto"],u=a[n+"min"],c=a[n+"max"],h=a.colorscale;(s!==!1||void 0===u)&&(u=i.Lib.aggNums(Math.min,null,e)),(s!==!1||void 0===c)&&(c=i.Lib.aggNums(Math.max,null,e)),u===c&&(u-=.5,c+=.5),a[n+"min"]=u,a[n+"max"]=c,o[n+"min"]=u,o[n+"max"]=c,a.autocolorscale&&(h=0>u*c?l.scales.RdBu:u>=0?l.scales.Reds:l.scales.Blues,o.colorscale=h,a.reversescale&&(h=l.flipScale(h)),a.colorscale=h)},l.makeScaleFunction=function(t,e,r){for(var n,l=t.length,u=new Array(l),c=new Array(l),h=0;l>h;h++)n=t[h],u[h]=e+n[0]*(r-e),c[h]=n[1];var f=a.scale.linear().domain(u).interpolate(a.interpolateRgb).range(c);return function(t){return s(t)?f(t):o(t).isValid()?t:i.Color.defaultLine}}},{"../../plotly":336,"./attributes":287,"./scales":289,d3:53,"fast-isnumeric":58,tinycolor2:213}],289:[function(t,e,r){e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YIGnBu:[[0,"rgb(8, 29, 88)"],[.125,"rgb(37, 52, 148)"],[.25,"rgb(34, 94, 168)"],[.375,"rgb(29, 145, 192)"],[.5,"rgb(65, 182, 196)"],[.625,"rgb(127, 205, 187)"],[.75,"rgb(199, 233, 180)"],[.875,"rgb(237, 248, 217)"],[1,"rgb(255, 255, 217)"]],Greens:[[0,"rgb(0, 68, 27)"],[.125,"rgb(0, 109, 44)"],[.25,"rgb(35, 139, 69)"],[.375,"rgb(65, 171, 93)"],[.5,"rgb(116, 196, 118)"],[.625,"rgb(161, 217, 155)"],[.75,"rgb(199, 233, 192)"],[.875,"rgb(229, 245, 224)"],[1,"rgb(247, 252, 245)"]],YIOrRd:[[0,"rgb(128, 0, 38)"],[.125,"rgb(189, 0, 38)"],[.25,"rgb(227, 26, 28)"],[.375,"rgb(252, 78, 42)"],[.5,"rgb(253, 141, 60)"],[.625,"rgb(254, 178, 76)"],[.75,"rgb(254, 217, 118)"],[.875,"rgb(255, 237, 160)"],[1,"rgb(255, 255, 204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5, 10, 172)"],[.35,"rgb(106, 137, 247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220, 170, 132)"],[.7,"rgb(230, 145, 90)"],[1,"rgb(178, 10, 28)"]],Reds:[[0,"rgb(220, 220, 220)"],[.2,"rgb(245, 195, 157)"],[.4,"rgb(245, 160, 105)"],[1,"rgb(178, 10, 28)"]],Blues:[[0,"rgb(5, 10, 172)"],[.35,"rgb(40, 60, 190)"],[.5,"rgb(70, 100, 245)"],[.6,"rgb(90, 120, 245)"],[.7,"rgb(106, 137, 247)"],[1,"rgb(220, 220, 220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0, 0, 200)"],[.25,"rgb(0, 25, 255)"],[.375,"rgb(0, 152, 255)"],[.5,"rgb(44, 255, 150)"],[.625,"rgb(151, 255, 0)"],[.75,"rgb(255, 234, 0)"],[.875,"rgb(255, 111, 0)"],[1,"rgb(255, 0, 0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,d/2),c=Math.pow(s*s+l*l,d/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,p=3*c*(u+c),g=3*u*(u+c);return[[a.round(e[0]+(p&&h/p),2),a.round(e[1]+(p&&f/p),2)],[a.round(e[0]-(g&&h/g),2),a.round(e[1]-(g&&f/g),2)]]}var i=t("../../plotly"),a=t("d3"),o=t("fast-isnumeric"),s=e.exports={};s.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(i.Color.fill,n)},s.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},s.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},s.setRect=function(t,e,r,n,i){t.call(s.setPosition,e,r).call(s.setSize,n,i)},s.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),i=t.yp||r.c2p(t.y),s=a.select(this);o(n)&&o(i)?"text"===this.nodeName?s.attr("x",n).attr("y",i):s.attr("transform","translate("+n+","+i+")"):s.remove()})},s.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},s.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},s.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},l=e||o.width||0,u=n||o.dash||"";a.select(this).call(i.Color.stroke,r||o.color).call(s.dashLine,u,l)})},s.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},s.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(i.Color.fill,e[0].trace.fillcolor)}catch(n){console.log(n,t),r.remove()}})};var l=t("./symbol_defs");s.symbolNames=[],s.symbolFuncs=[],s.symbolNeedLines={},s.symbolNoDot={},s.symbolList=[],Object.keys(l).forEach(function(t){var e=l[t];s.symbolList=s.symbolList.concat([e.n,t,e.n+100,t+"-open"]),s.symbolNames[e.n]=t,s.symbolFuncs[e.n]=e.f,e.needLine&&(s.symbolNeedLines[e.n]=!0),e.noDot?s.symbolNoDot[e.n]=!0:s.symbolList=s.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var u=s.symbolNames.length,c="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";s.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=s.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=u||t>=400?0:Math.floor(Math.max(t,0))},s.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(i.Plots.traceIs(e,"symbols")){var o=i.Scatter.getBubbleSizeFn(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:i.Scatter.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var a=s.symbolNumber(t.mx||r.symbol)||0,l=a%100;return t.om=a%200>=100,s.symbolFuncs[l](n)+(a>=200?c:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=s.tryColorscale(r,l,""),h=s.tryColorscale(r,l,"line.");t.each(function(t){var e,o,s;t.so?(s=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(s=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=h(t.mlc):Array.isArray(n.color)?i.Color.defaultLine:n.color,e="mc"in t?t.mcc=u(t.mc):Array.isArray(r.color)?i.Color.defaultLine:r.color||"rgba(0,0,0,0)");var l=a.select(this);t.om?l.call(i.Color.stroke,e).style({"stroke-width":(s||1)+"px",fill:"none"}):(l.style("stroke-width",s+"px").call(i.Color.fill,e),s&&l.call(i.Color.stroke,o))})}},s.tryColorscale=function(t,e,r){var n=i.Lib.nestedProperty(t,r+"color").get(),a=i.Lib.nestedProperty(t,r+"colorscale").get(),s=i.Lib.nestedProperty(t,r+"cauto").get(),l=i.Lib.nestedProperty(t,r+"cmin"),u=i.Lib.nestedProperty(t,r+"cmax"),c=l.get(),h=u.get();return a&&Array.isArray(n)?(!s&&o(c)&&o(h)||(c=1/0,h=-(1/0),n.forEach(function(t){o(t)&&(c>t&&(c=+t),t>h&&(h=+t))}),c>h&&(c=0,h=1),l.set(c),u.set(h),i.Lib.nestedProperty(e,r+"cmin").set(c),i.Lib.nestedProperty(e,r+"cmax").set(h)),i.Colorscale.makeScaleFunction(a,c,h)):i.Lib.identity};var h={start:1,end:-1,middle:0,bottom:1,top:-1},f=1.3;s.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var l=t.tp||e.textposition,u=-1!==l.indexOf("top")?"top":-1!==l.indexOf("bottom")?"bottom":"middle",c=-1!==l.indexOf("left")?"end":-1!==l.indexOf("right")?"start":"middle",d=t.ts||e.textfont.size,p=t.mrc?t.mrc/.8+1:0;d=o(d)&&d>0?d:0,r.call(s.font,t.tf||e.textfont.family,d,t.tc||e.textfont.color).attr("text-anchor",c).text(n).call(i.util.convertToTspans);var g=a.select(this.parentNode),v=r.selectAll("tspan.line"),m=((v[0].length||1)-1)*f+1,y=h[c]*p,b=.75*d+h[u]*p+(h[u]-1)*m*d/2;g.attr("transform","translate("+y+","+b+")"),m>1&&v.attr({x:r.attr("x"),y:r.attr("y")})})};var d=.5;s.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],a=[];for(r=1;rr;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return i+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var p={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},g=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};s.steps=function(t){var e=p[t]||g;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n=m&&(a.selectAll("[data-bb]").attr("data-bb",null),v=[]),t.setAttribute("data-bb",v.length),v.push(u),i.Lib.extendFlat({},u)},s.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../plotly":336,"./symbol_defs":291,d3:53,"fast-isnumeric":58}],291:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+h+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:53}],292:[function(t,e,r){e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],293:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&-1!==["linear","log"].indexOf(r.type),u=[];if(l){for(var c=s(a),h=0;ho;o++)a[o]={x:r[o],y:n[o]};return a[0].trace=t,s.calc({calcdata:[a],_fullLayout:e}),a},s.plot=function(t,e,r){var s=e.x(),l=e.y();e.plot.select(".errorlayer").selectAll("g.errorbars").remove();var u;e.plot.select(".errorlayer").selectAll("g.errorbars").data(r).enter().append("g").attr("class","errorbars").each(function(t){var e=t[0].trace,r=e.error_x,c=e.error_y,h=i.Scatter.hasMarkers(e)&&e.marker.maxdisplayed>0;(c.visible||r.visible)&&a.select(this).selectAll("g").data(i.Lib.identity).enter().append("g").each(function(t){u=n(t,s,l);var e,i=a.select(this);if(!h||t.vis){if(c.visible&&o(u.x)&&o(u.yh)&&o(u.ys)){var f=c.width;e="M"+(u.x-f)+","+u.yh+"h"+2*f+"m-"+f+",0V"+u.ys,u.noYS||(e+="m-"+f+",0h"+2*f),i.append("path").classed("yerror",!0).attr("d",e)}if(r.visible&&o(u.y)&&o(u.xh)&&o(u.xs)){var d=(r.copy_ystyle?c:r).width;e="M"+u.xh+","+(u.y-d)+"v"+2*d+"m0,-"+d+"H"+u.xs,u.noXS||(e+="m0,-"+d+"v"+2*d),i.append("path").classed("xerror",!0).attr("d",e)}}})})},s.style=function(t){a.select(t).selectAll("g.errorbars").each(function(t){var e=a.select(this),r=t[0].trace,n=r.error_y||{},o=r.error_x||{};e.selectAll("g path.yerror").style("stroke-width",n.thickness+"px").call(i.Color.stroke,n.color),o.copy_ystyle&&(o=n),e.selectAll("g path.xerror").style("stroke-width",o.thickness+"px").call(i.Color.stroke,o.color)})},s.hoverInfo=function(t,e,r){e.error_y.visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),e.error_x.visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"../../plotly":336,"./attributes":292,"./calc":293,"./defaults":295,d3:53,"fast-isnumeric":58}],297:[function(t,e,r){var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":316,"../../plots/font_attributes":342,"../color/attributes":283}],298:[function(t,e,r){"use strict";function n(t){return t.visible&&o.Plots.traceIs(t,"showLegend")}function i(t){return-1!==(t.traceorder||"").indexOf("grouped")}function a(t){return-1!==(t.traceorder||"").indexOf("reversed")}var o=t("../../plotly"),s=t("d3"),l=e.exports={};l.layoutAttributes=t("./attributes"),l.supplyLayoutDefaults=function(t,e,r){function s(t,e){return o.Lib.coerce(c,h,l.layoutAttributes,t,e)}for(var u,c=t.legend||{},h=e.legend={},f=0,d="normal",p=0;p1);g!==!1&&(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),o.Lib.coerceFont(s,"font",e.font),s("traceorder",d),i(e.legend)&&s("tracegroupgap"),s("x"),s("xanchor"),s("y"),s("yanchor"),o.Lib.noneOrAll(c,h,["x","y"]))},l.lines=function(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=o.Scatter.hasLines(e),i=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(o.Drawing.fillGroupStyle);var a=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(o.Drawing.lineGroupStyle)},l.points=function(t){function e(t,e,r){var n=o.Lib.nestedProperty(l,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],l=a.trace,u=o.Scatter.hasMarkers(l),c=o.Scatter.hasText(l),h=o.Scatter.hasLines(l);if(u||c||h){var f={},d={};u&&(f.mc=e("marker.color",r),f.mo=e("marker.opacity",o.Lib.mean,[.2,1]),f.ms=e("marker.size",o.Lib.mean,[2,16]),f.mlc=e("marker.line.color",r),f.mlw=e("marker.line.width",o.Lib.mean,[0,5]),d.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(d.line={width:e("line.width",r,[0,10])}),c&&(f.tx="Aa",f.tp=e("textposition",r),f.ts=10,f.tc=e("textfont.color",r),f.tf=e("textfont.family",r)),n=[o.Lib.minExtend(a,f)],i=o.Lib.minExtend(l,d)}var p=s.select(this).select("g.legendpoints"),g=p.selectAll("path.scatterpts").data(u?n:[]);g.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),g.exit().remove(),g.call(o.Drawing.pointStyle,i),u&&(n[0].mrc=3);var v=p.selectAll("g.pointtext").data(c?n:[]);v.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),v.exit().remove(),v.selectAll("text").call(o.Drawing.textPointStyle,i)},l.bars=function(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(o.Plots.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||n.width+1)-1,i=s.select(this);i.style("stroke-width",e+"px").call(o.Color.fill,t.mc||r.color),e&&i.call(o.Color.stroke,t.mlc||n.color)})},l.boxes=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(o.Plots.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=s.select(this);n.style("stroke-width",r+"px").call(o.Color.fill,t.fc||e.fillcolor),r&&n.call(o.Color.stroke,t.lc||e.line.color)})},l.pie=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(o.Plots.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(o.Pie.styleOne,t[0],e)},l.style=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(l.bars).each(l.boxes).each(l.pie).each(l.lines).each(l.points)},l.texts=function(t,e,r,n,i){function a(t){o.util.convertToTspans(t,function(){e.firstRender&&l.repositionLegend(e,i)}),t.selectAll("tspan.line").attr({x:t.attr("x")})}var u=e._fullLayout,c=r[0].trace,h=o.Plots.traceIs(c,"pie"),f=c.index,d=h?r[0].label:c.name,p=s.select(t).selectAll("text.legendtext").data([0]);p.enter().append("text").classed("legendtext",!0),p.attr({x:40,y:0}).style("text-anchor","start").call(o.Drawing.font,u.legend.font).text(d).attr({"data-unformatted":d}),e._context.editable&&!h?p.call(o.util.makeEditable).call(a).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(a),this.text()||(t=" "),o.restyle(e,"name",t,f)}):p.call(a)},l.getLegendData=function(t,e){function r(t,r){if(""!==t&&i(e))-1===g.indexOf(t)?(g.push(t),v=!0,p[t]=[[r]]):p[t].push([r]);else{var n="~~i"+y;g.push(n),p[n]=[[r]],y++}}var s,l,u,c,h,f,d,p={},g=[],v=!1,m={},y=0;for(h=0;hh;h++)b=p[g[h]],x[h]=a(e)?b.reverse():b;else{for(x=[new Array(_)],h=0;_>h;h++)b=p[g[h]][0],x[0][a(e)?_-h-1:h]=b;_=1}return e._lgroupsLength=_,x},l.draw=function(t){var e=t._fullLayout;if(e._infolayer&&t.calcdata){var r=e.legend,n=e.showlegend&&l.getLegendData(t.calcdata,r),a=e.hiddenlabels||[];if(!e.showlegend||!n.length)return e._infolayer.selectAll(".legend").remove(),void o.Plots.autoMargin(t,"legend");"undefined"==typeof t.firstRender?t.firstRender=!0:t.firstRender&&(t.firstRender=!1);var u=e._infolayer.selectAll("svg.legend").data([0]);u.enter(0).append("svg").attr("class","legend");var c=u.selectAll("rect.bg").data([0]);c.enter(0).append("rect").attr("class","bg"),c.call(o.Color.stroke,r.bordercolor).call(o.Color.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var h=u.selectAll("g.groups").data(n);h.enter().append("g").attr("class","groups"),h.exit().remove(),i(r)&&h.attr("transform",function(t,e){return"translate(0,"+e*r.tracegroupgap+")"});var f=h.selectAll("g.traces").data(o.Lib.identity);if(f.enter().append("g").attr("class","traces"),f.exit().remove(),f.call(l.style).style("opacity",function(t){var e=t[0].trace;return o.Plots.traceIs(e,"pie")?-1!==a.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(e,r){l.texts(this,t,e,r,f);var n=s.select(this).selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(o.Color.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!t._dragged){var r,n,i=t._fullData,s=e[0].trace,l=s.legendgroup,u=[];if(o.Plots.traceIs(s,"pie")){var c=e[0].label,h=a.slice(),f=h.indexOf(c);-1===f?h.push(c):h.splice(f,1),o.relayout(t,"hiddenlabels",h)}else{if(""===l)u=[s.index];else for(var d=0;dtspan"),p=1.3*a.font.size,g=d[0].length||1,v=f.node()&&o.Drawing.bBox(f.node()).width,m=i.select("g[class*=math-group]");if(!n.showlegend)return void i.remove();if(m.node()){var y=o.Drawing.bBox(m.node());p=y.height,v=y.width,m.attr("transform","translate(0,"+p/4+")")}else e=p*(.3+(1-g)/2),f.attr("y",e),d.attr("y",e);r=Math.max(p*g,16)+3,i.attr("transform","translate("+l+","+(5+l+c+r/2)+")"),h.attr({x:0,y:-r/2,height:r}),c+=r,u=Math.max(u,v||0)}),i(a)&&(c+=(a._lgroupsLength-1)*a.tracegroupgap),e.selectAll(".legendtoggle").attr("width",(t._context.editable?0:u)+40),u+=45+2*l,c+=10+2*l;var h=n.l+n.w*a.x,f=n.t+n.h*(1-a.y),d="left";"right"===a.xanchor||"auto"===a.xanchor&&a.x>=2/3?(h-=u,d="right"):("center"===a.xanchor||"auto"===a.xanchor&&a.x>1/3)&&(h-=u/2,d="center");var p="top";"bottom"===a.yanchor||"auto"===a.yanchor&&a.y<=1/3?(f-=c,p="bottom"):("middle"===a.yanchor||"auto"===a.yanchor&&a.y<2/3)&&(f-=c/2,p="middle"),u=Math.ceil(u),c=Math.ceil(c),h=Math.round(h),f=Math.round(f),r._infolayer.selectAll("svg.legend").call(o.Drawing.setRect,h,f,u,c),r._infolayer.selectAll("svg.legend .bg").call(o.Drawing.setRect,l/2,l/2,u-l,c-l),o.Plots.autoMargin(t,"legend",{x:a.x,y:a.y,l:u*({right:1,center:.5}[d]||0),r:u*({left:1,center:.5}[d]||0),b:c*({top:1,middle:.5}[p]||0),t:c*({bottom:1,middle:.5}[p]||0)})}},{"../../plotly":336,"./attributes":297,d3:53}],299:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n)for(var s,u,c,h="in"===i?.5:2,f=(1+h)/2,d=(1-h)/2,p=l.Axes.list(t,null,!0),g=0;gv;v++){var m=o[v];c=g[m]={};for(var y=0;yl;l++){var c=s[l],f={_fullLayout:e},d=u.Axes.coerceRef(t,n,f,c);if("path"!==o){var p=.25,g=.75;if("paper"!==d){var v=u.Axes.getFromId(f,d),m=a(v);p=m(v.range[0]+p*(v.range[1]-v.range[0])),g=m(v.range[0]+g*(v.range[1]-v.range[0]))}r(c+"0",p),r(c+"1",g)}}return"path"===o?r("path"):u.Lib.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function a(t){return"category"===t.type?t.l2c:t.l2d}function o(t){return function(e){return t(e.replace("_"," "))}}function s(t,e){var r,n,a,s,l=e.type,c=u.Axes.getFromId(t,e.xref),f=u.Axes.getFromId(t,e.yref),d=t._fullLayout._size;if(c?(r=i(c),n=function(t){return c._offset+c.l2p(r(t,!0))}):n=function(t){return d.l+d.w*t},f?(a=i(f),s=function(t){return f._offset+f.l2p(a(t,!0))}):s=function(t){return d.t+d.h*(1-t)},"path"===l)return c&&"date"===c.type&&(n=o(n)),f&&"date"===f.type&&(s=o(s)),h.convertPath(e.path,n,s);var p=n(e.x0),g=n(e.x1),v=s(e.y0),m=s(e.y1);if("line"===l)return"M"+p+","+v+"L"+g+","+m;if("rect"===l)return"M"+p+","+v+"H"+g+"V"+m+"H"+p+"Z";var y=(p+g)/2,b=(v+m)/2,x=Math.abs(y-p),_=Math.abs(b-v),w="A"+x+","+_,k=y+x+","+b,A=y+","+(b-_);return"M"+k+w+" 0 1,1 "+A+w+" 0 0,1 "+k+"Z"}function l(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var s,l,u,c,h,p=1/0,g=-(1/0),v=n.match(f);for("date"===t.type&&(a=o(a)),s=0;sh&&(p=h),h>g&&(g=h)));return g>=p?[p,g]:void 0}}var u=t("../../plotly"),c=t("fast-isnumeric"),h=e.exports={};h.layoutAttributes=t("./attributes"),h.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;ae;l--)d._shapelayer.selectAll('[data-index="'+(l-1)+'"]').attr("data-index",String(l)),h.draw(t,l)}}d._shapelayer.selectAll('[data-index="'+e+'"]').remove();var g=f.shapes[e];if(g){var v={xref:g.xref,yref:g.yref},m={};"string"==typeof r&&r?m[r]=o:u.Lib.isPlainObject(r)&&(m=r);var y=Object.keys(m);for(l=0;ll;l++){var _=x[l];if(void 0===m[_]&&void 0!==g[_]){var w,k=_.charAt(0),A=u.Axes.getFromId(t,u.Axes.coerceRef(v,{},t,k)),M=u.Axes.getFromId(t,u.Axes.coerceRef(g,{},t,k)),L=g[_];void 0!==m[k+"ref"]&&(A?(w=i(A)(L),L=(w-A.range[0])/(A.range[1]-A.range[0])):L=(L-M.domain[0])/(M.domain[1]-M.domain[0]),M?(w=M.range[0]+L*(M.range[1]-M.range[0]),L=a(M)(w)):L=A.domain[0]+L*(A.domain[1]-A.domain[0])),g[_]=L}}var T=n(g,d);d.shapes[e]=T;var E={"data-index":String(e),"fill-rule":"evenodd",d:s(t,T)},C=(T.xref+T.yref).replace(/paper/g,""),S=T.line.width?T.line.color:"rgba(0,0,0,0)",z=d._shapelayer.append("path").attr(E).style("opacity",T.opacity).call(u.Color.stroke,S).call(u.Color.fill,T.fillcolor).call(u.Drawing.dashLine,T.line.dash,T.line.width);C&&z.call(u.Drawing.setClipUrl,"clip"+d._uid+C)}};var f=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,d=/[^\s,]+/g,p={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},g={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},v={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};h.convertPath=function(t,e,r){return t.replace(f,function(t){var n=0,i=t.charAt(0),a=p[i],o=g[i],s=v[i],l=t.substr(1).replace(d,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+t)),i+l})},h.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;eh?r=h:(u.left-=z.offsetLeft,u.right-=z.offsetLeft,u.top-=z.offsetTop,u.bottom-=z.offsetTop,z.selection.each(function(){var t=n.Drawing.bBox(this);n.Lib.bBoxIntersect(u,t,l)&&(r=Math.max(r,s*(t[z.side]-u[o])+l))}),r=Math.min(h,r)),r>0||0>h){var f={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[z.side];e.attr("transform","translate("+f+")")}}}function c(){j=0,O=!0,I=N,p._infolayer.select("."+e).attr({"data-unformatted":I}).text(I).on("mouseover.opacity",function(){i.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){ -i.select(this).transition().duration(1e3).style("opacity",0)})}if(!e)return n.Axes.listIds(t).forEach(function(e){s.draw(t,e+"title")}),void s.draw(t,"gtitle");var h,f,d,p=t._fullLayout,g=p._size,v=e.charAt(0),m="cb"===e.substr(1,2);if(m){var y=e.substr(3).replace("title","");t._fullData.some(function(e,r){return e.uid===y?(h=r,f=t.calcdata[r][0].t.cb.axis,!0):void 0})}else f=p[n.Axes.id2name(e.replace("title",""))]||p;var b,x,_,w,k,A=f===p?"title":f._name+".title",M=m?"colorscale":(f._id||v).toUpperCase()+" axis",L=f.titlefont.family,T=f.titlefont.size,E=f.titlefont.color,C="",S={},z={selection:i.select(t).selectAll("g."+f._id+"tick"),side:f.side},P=m?0:1.5;m?(z.offsetLeft=g.l,z.offsetTop=g.t):z.selection.size()&&(k=i.select(z.selection.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/),k&&(z.offsetLeft=+k[1],z.offsetTop=+k[2])),m&&f.titleside?(b=g.l+f.titlex*g.w,x=g.t+(1-f.titley)*g.h+("top"===f.titleside?3+.75*T:-3-.25*T),d={x:b,y:x,"text-anchor":"start"},z={},e="h"+e):"x"===v?(_=f,w="free"===_.anchor?{_offset:g.t+(1-(_.position||0))*g.h,_length:0}:n.Axes.getFromId(t,_.anchor),b=_._offset+_._length/2,x=w._offset+("top"===_.side?-10-T*(P+(_.showticklabels?1:0)):w._length+10+T*(P+(_.showticklabels?1.5:.5))),d={x:b,y:x,"text-anchor":"middle"},z.side||(z.side="bottom")):"y"===v?(w=f,_="free"===w.anchor?{_offset:g.l+(w.position||0)*g.w,_length:0}:n.Axes.getFromId(t,w.anchor),x=w._offset+w._length/2,b=_._offset+("right"===w.side?_._length+10+T*(P+(w.showticklabels?1:.5)):-10-T*(P+(w.showticklabels?.5:0))),S={center:0},d={x:b,y:x,"text-anchor":"middle"},C={rotate:"-90",offset:0},z.side||(z.side="left")):(M="Plot",T=p.titlefont.size,b=p.width/2,x=p._size.t/2,d={x:b,y:x,"text-anchor":"middle"},z={});var j=1,O=!1,I=f.title.trim();""===I&&(j=0),I.match(/Click to enter .+ title/)&&(j=.2,O=!0);var D;if(m){D=i.select(t).selectAll("."+f._id.substr(1)+" .cbtitle");var R="h"===e.charAt(0)?e.substr(1):"h"+e;D.selectAll("."+R+",."+R+"-math-group").remove()}else D=p._infolayer.selectAll(".g-"+e).data([0]),D.enter().append("g").classed("g-"+e,!0);var F=D.selectAll("text").data([0]);F.enter().append("text"),F.text(I).attr("class",e),F.attr({"data-unformatted":I}).call(r);var N="Click to enter "+M.replace(/\d+/,"")+" title";t._context.editable?(I||c(),F.call(n.util.makeEditable).on("edit",function(e){if(m){var r=t._fullData[h];o.traceIs(r,"markerColorscale")?n.restyle(t,"marker.colorbar.title",e,h):n.restyle(t,"colorbar.title",e,h)}else n.relayout(t,A,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(r)}).on("input",function(t){this.text(t||" ").attr(d).selectAll("tspan.line").attr(d)})):(!I||I.match(/Click to enter .+ title/))&&F.remove(),F.classed("js-placeholder",O)}},{"../../plotly":336,d3:53,"fast-isnumeric":58}],305:[function(t,e,r){e.exports={DZA:"algeria",AGO:"angola",EGY:"egypt",BGD:"bangladesh|^(?=.*east).*paki?stan",NER:"\\bniger(?!ia)",LIE:"liechtenstein",NAM:"namibia",BGR:"bulgaria",BOL:"bolivia",GHA:"ghana|gold.?coast",CCK:"\\bcocos|keeling",PAK:"^(?!.*east).*paki?stan",CPV:"verde",JOR:"jordan",LBR:"liberia",LBY:"libya",MYS:"malaysia",IOT:"british.?indian.?ocean",PRI:"puerto.?rico",MYT:"mayotte",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k",PSE:"palestin|\\bgaza|west.?bank",TZA:"tanzania",BWA:"botswana|bechuana",KHM:"cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$",UMI:"minor.?outlying.?is",TTO:"trinidad|tobago",PRY:"paraguay",HKG:"hong.?kong",SAU:"\\bsa\\w*.?arabia",LBN:"lebanon",SVN:"slovenia",BFA:"burkina|\\bfaso|upper.?volta",SVK:"^(?!.*cze).*slovak",MRT:"mauritania",HRV:"croatia",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$",KNA:"kitts|\\bnevis",JAM:"jamaica",SMR:"san.?marino",GIB:"gibraltar",DJI:"djibouti",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",FIN:"finland",URY:"uruguay",VAT:"holy.?see|vatican|papal.?st",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SYC:"seychell",NPL:"nepal",CXR:"christmas",LAO:"\\blaos?\\b",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",BVT:"bouvet",ZAF:"\\bs\\w*.?africa",KIR:"kiribati",PHL:"philippines",SXM:"^(?!.*martin)(?!.*saba).*maarten",ROU:"r(o|u|ou)mania",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",SYR:"syria",MAC:"maca(o|u)",NFK:"norfolk",NIC:"nicaragua",MLT:"\\bmalta",KAZ:"kazak",TCA:"turks",PYF:"french.?polynesia|tahiti",NIU:"niue",DMA:"dominica(?!n)",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",BEN:"benin|dahome",GUF:"^(?=.*french).*guiana",BEL:"^(?!.*luxem).*belgium",MSR:"montserrat",TGO:"togo",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GUM:"\\bguam",LKA:"sri.?lanka|ceylon",SSD:"\\bs\\w*.?sudan",FLK:"falkland|malvinas",PCN:"pitcairn",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",GUY:"guyana|british.?guiana",CRI:"costa.?rica",COK:"\\bcook",MAR:"morocco|\\bmaroc",MNP:"mariana",LSO:"lesotho|basuto",HUN:"^(?!.*austr).*hungary",TKM:"turkmen",SUR:"surinam|dutch.?guiana",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",BMU:"bermuda",HMD:"heard.*mcdonald",TCD:"\\bchad",GEO:"^(?!.*south).*georgia",MNE:"^(?!.*serbia).*montenegro",MNG:"mongolia",MHL:"marshall",MTQ:"martinique",CSK:"czechoslovakia",BLZ:"belize|^(?=.*british).*honduras",DDR:"german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany",MMR:"myanmar|burma",AFG:"afghan",BDI:"burundi",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",BLR:"belarus|byelo",BLM:"barth(e|\xe9)lemy",GRD:"grenada",TKL:"tokelau",GRC:"greece|hellenic|hellas",GRL:"greenland",SHN:"helena",AND:"andorra",MOZ:"mozambique",TJK:"tajik",THA:"thailand|\\bsiam",HTI:"haiti",MEX:"\\bmexic",ANT:"^(?=.*\\bant).*(nether|dutch)",ZWE:"zimbabwe|^(?!.*northern).*rhodesia",LCA:"\\blucia",IND:"india(?!.*ocea)",LVA:"latvia",BTN:"bhutan",VCT:"vincent",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",NOR:"norway",CZE:"^(?=.*rep).*czech|czechia|bohemia",ATF:"french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt",ATG:"antigua",FJI:"fiji",HND:"^(?!.*brit).*honduras",MUS:"mauritius",DOM:"dominican",LUX:"^(?!.*belg).*luxem",ISR:"israel",YUG:"yugoslavia",FSM:"micronesia",PER:"peru",REU:"r(e|\xe9)union",IDN:"indonesia",VUT:"vanuatu|new.?hebrides",MKD:"macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo",ISL:"iceland",GLP:"guadeloupe",ETH:"ethiopia|abyssinia",COM:"comoro",COL:"colombia",NGA:"nigeria",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TWN:"taiwan|taipei|formosa",PRT:"portugal",MDA:"moldov|b(a|e)ssarabia",GGY:"guernsey",MDG:"madagascar|malagasy",ATA:"antarctica",ECU:"ecuador",SEN:"senegal",ESH:"sahara",MDV:"maldive",ASM:"^(?=.*americ).*samoa",SPM:"miquelon",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",LTU:"lithuania",RWA:"rwanda",ZMB:"zambia|northern.?rhodesia",GMB:"gambia",WLF:"futuna|wallis",JEY:"jersey",FRO:"faroe|faeroe",GTM:"guatemala",DNK:"denmark",IMN:"^(?=.*isle).*\\bman",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baust.*\\bemp",SJM:"svalbard",VEN:"venezuela",PLW:"palau",KEN:"kenya|british.?east.?africa|east.?africa.?prot",TUR:"turkey",ALB:"albania",OMN:"\\boman|trucial",TUV:"tuvalu",ALA:"\\b(a|\xe5)land",BRN:"brunei",TUN:"tunisia",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",BRB:"barbados",BRA:"brazil",CIV:"ivoire|ivory",SRB:"^(?!.*monte).*serbia",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",USA:"^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$",QAT:"qatar",WSM:"^(?!.*amer).*samoa",AZE:"azerbaijan",GNB:"bissau|^(?=.*portu).*guinea",SWZ:"swaziland",TON:"tonga",CAN:"canada",UKR:"ukrain",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b",AIA:"anguill?a",CAF:"\\bcen.*\\baf|^c\\.?a\\.?r\\.?$",CHE:"switz|swiss",CYP:"cyprus",BIH:"herzegovina|bosnia",SGP:"singapore",SGS:"south.?georgia|sandwich",SOM:"somali",UZB:"uzbek",CMR:"cameroon",POL:"poland",EAZ:"zanz",KWT:"kuwait",ERI:"eritrea",GAB:"gabon",CYM:"cayman",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",EST:"estonia",MWI:"malawi|nyasa",ESP:"spain",IRQ:"\\biraq|mesopotamia",SLV:"el.?salvador",MLI:"\\bmali\\b",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",IRL:"ireland",IRN:"\\biran|persia",ABW:"^(?!.*bonaire).*\\baruba",SLE:"sierra",PAN:"panama",SDN:"^(?!.*\\bs(?!u)).*sudan",SLB:"solomon",NZL:"new.?zealand",MCO:"monaco",ITA:"italy",JPN:"japan",KGZ:"kyrgyz|kirghiz",UGA:"uganda",NCL:"new.?caledonia",PNG:"papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea",ARG:"argentin",SWE:"sweden",BHS:"bahamas",BHR:"bahrain",ARM:"armenia",NRU:"nauru",CUB:"\\bcuba"}},{}],306:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],307:[function(t,e,r){e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],308:[function(t,e,r){e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],309:[function(t,e,r){e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],310:[function(t,e,r){"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],311:[function(t,e,r){var n=t("./plotly");r.version=t("../package.json").version,r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.setPlotConfig=t("./plot_api/set_plot_config"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"../package.json":279,"./plot_api/set_plot_config":335,"./plotly":336,d3:53}],312:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],313:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("./nested_property");Object.keys(t("../components/colorscale/scales"));r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,n){!i(t)||void 0!==n.min&&tn.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,n){t%1||!i(t)||void 0!==n.min&&tn.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if(n.strict===!0&&"string"!=typeof t)return void e.set(r);var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(n.Colorscale.getScale(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):i(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},axisid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.charAt(0)===r){var n=Number(t.substr(1));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},sceneid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,5)===r){var n=Number(t.substr(5));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},geoid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,3)===r){var n=Number(t.substr(3));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==n.extras.indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a2)return!1;var l=o[0].split("-");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(":"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof o)return void console.log("d3 is not defined");e||(e=0);var r=new Date(t),i=o.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var l={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},c=o.time.format.utc,h={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(c),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(c)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(c)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){h[t].D.push(c(e)),["H","I","D"].forEach(function(r){l[r].forEach(function(n){var i=h[t][r];i.push(c(e+"~"+n)),i.push(c(n+"~"+e))})})})});var f=/[a-z]*/g,d=function(t){return t.substr(0,3)},p=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,m=function(t,e){return e+"m "},y=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,x=/[ap]m/,_=/:/,w=/q([1-4])/,k=["31~mar","30~jun","30~sep","31~dec"],A=function(t,e){return k[e-1]},M=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(f,d).replace(p,"").replace(g,"~").replace(v,m).replace(w,A).trim().replace(M,"");var e,r,n=null,o=i(t),s=a(t);e=h[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{d3:53,"fast-isnumeric":58}],315:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof $&&$(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof $&&(n=$(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;lp;p++){o=t[p];for(s in o)l=f[s],u=o[s],e&&u&&(i(u)||(c=a(u)))?(c?(c=!1,h=l&&a(l)?l:[]):h=l&&i(l)?l:{},f[s]=n([h,u],e,r)):("undefined"!=typeof u||r)&&(f[s]=u)}return f}var i=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{"./is_plain_object.js":321}],317:[function(t,e,r){"use strict";function n(t,e){var r=u[t];return r(e)}function i(t){for(var e,r,n=0;ny;y++)c=l(p,y),d=u(e,y),m[y]=n(c,d);else m=n(p,e);return m}var s=t("../plotly"),l=t("tinycolor2"),u=t("fast-isnumeric"),c=t("./str2rgbarray"),h=t("../components/color/attributes").defaultLine,f=1;e.exports=o},{"../components/color/attributes":283,"../plotly":336,"./str2rgbarray":329,"fast-isnumeric":58,tinycolor2:213}],319:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=u[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":199}],320:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.parseDate=o.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.identity=function(t){return t},i.randstr=function h(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n-1||u!==1/0&&u>=Math.pow(2,e)?h(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.promiseError=function(t){console.log(t,t.stack)},i.syncOrAsync=function(t,e,r){function n(){return i.markTime("async done "+o.name),i.syncOrAsync(t,e,r)}for(var a,o;t.length;){if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);i.markTime("sync done "+o.name)}return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;nn;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],323:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)u(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;rt}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var l,u,c=0,h=e.length,f=0;for(u=e[e.length-1]>=e[0]?r?n:i:r?o:a;h>c&&f++<100;)l=Math.floor((c+h)/2),u(e[l],t)?c=l+1:h=l;return f>90&&console.log("Long binary search..."),c-1},r.sorterAsc=function(t,e){return t-e},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a>i&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"fast-isnumeric":58}],327:[function(t,e,r){"use strict";var n=t("../plotly");e.exports=function(t){var e=function(){};for(var r in t)"function"==typeof t[r]&&(t[r]=e);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement("div");return i.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=n.Color.defaults[0],t.container.appendChild(i),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../plotly":336}],328:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":58}],329:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:32,tinycolor2:213}],330:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+l.Lib.randstr([],64),a=u.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=u.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())console.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=h[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r){if(i)return"";if("href"!==a.substr(0,4).toLowerCase())return"";var s=document.createElement("a");return s.href=a.substr(4).replace(/["'=]/g,""),-1===f.indexOf(s.protocol)?"":'"}if("br"===r)return"
";if(i)return"sup"===r?'':"sub"===r?'':"";var u=""}return l.util.xml_entity_encode(t).replace(/");i>0;i=r.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,""),a+=2)});var o=r.join(""),s=o.split(/
/gi);return s.length>1&&(r=s.map(function(t,e){return''+t+""})),r.join("")}function s(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var l=t("../plotly"),u=t("d3"),c=e.exports={};u.selection.prototype.appendSVG=function(t){for(var e=''+t+"",r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(console.log(r.querySelector("parsererror div").textContent),null):u.select(this.node().lastChild)},c.html_entity_decode=function(t){var e=u.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},c.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},c.convertToTspans=function(t,e){function r(){d.empty()||(p=c.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),f=t.appendSVG(s),f||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(c)}var i=t.text(),s=o(i),c=t,h=!c.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),f=i,d=u.select(c.node().parentNode);if(!d.empty()){var p=c.attr("class")?c.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(h){var v=l.Lib.getPlotDiv(c.node());(v&&v._promises||[]).push(new Promise(function(t){c.style({visibility:"hidden"});var i={fontSize:parseInt(c.style("font-size"),10)};a(h[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=c.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var h=n(s,"width"),f=n(s,"height"),g=+c.attr("x")-h*{start:0,middle:.5,end:1}[c.attr("text-anchor")||"start"],v=parseInt(c.style("font-size"),10)||n(c,"height"),m=-v/4;"y"===p[0]?(l.attr({transform:"rotate("+[-90,+c.attr("x"),+c.attr("y")]+") translate("+[-h/2,m-f/2]+")"}),s.attr({x:+c.attr("x"),y:+c.attr("y")})):"l"===p[0]?s.attr({x:c.attr("x"),y:m-f/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+c.attr("y")+m-f/2}),e&&e.call(c,l),t(l)})}))}else r();return t}};var h={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},f=["http:","https:","mailto:"],d=new RegExp("]*)?/?>","g");c.plainText=function(t){return(t||"").replace(d," ")},c.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=f.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=u.select(l.Lib.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(s(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=u.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;u.select(this).transition().duration(0).remove(),u.select(document).on("mouseup",null),c.edit.call(o,r)}).on("focus",function(){var t=this;u.select(document).on("mouseup",function(){return u.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===u.event.which?(o.style({opacity:1}),u.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),c.cancel.call(o,this.textContent)):(c.input.call(o,this.textContent),u.select(this).call(s(o,e,r)))}).on("keydown",function(){13===u.event.which&&this.blur()}).call(i)}r||(r={});var o=this,c=u.dispatch("edit","input","cancel"),h=u.select(this.node()).style({"pointer-events":"all"}),f=e||h;return e&&h.style({"pointer-events":"none"}),r.immediate?n():f.on("click",n),u.rebind(this,c,"on")}},{"../plotly":336,d3:53}],331:[function(t,e,r){"use strict";var n=e.exports={},i=t("../constants/geo_constants").locationmodeToLayer,a=t("topojson").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../constants/geo_constants":306,topojson:214}],332:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),z.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=z.Lib.extendFlat({},z.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t){var e,r,n,i,a,o=t._fullLayout,s=t._fullData,l=R.getSubplotIds(o,"gl3d");for(o._paperdiv.style({width:o.width+"px",height:o.height+"px"}),t._context.setBackground(t,o.paper_bgcolor),e=0;ee;e++){var o=t.annotations[e];o.ref&&("paper"===o.ref?(o.xref="paper",o.yref="paper"):"data"===o.ref&&(o.xref="x",o.yref="y"),delete o.ref),h(o,"xref"),h(o,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(console.log("shapes must be an array"),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var l=t.shapes[e];h(l,"xref"),h(l,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var c,f,d,g,v,m,y,b=R.getSubplotIds(t,"gl3d");for(e=0;er;++r)y[r]=v[e]+g*m[2+4*r];c.camera={eye:{x:y[0],y:y[1],z:y[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:m[1],y:m[5],z:m[9]}},delete c.cameraposition}return z.Lib.markTime("finished rest of cleanLayout, starting color"),z.Color.clean(t),z.Lib.markTime("finished cleanLayout color.clean"),t}function h(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=z.Axes.cleanId(r,n))}function f(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;is&&(o=z.Lib.randstr(n),-1!==r.indexOf(o));s++);a.uid=z.Lib.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=z.Color.defaults,u=a.error_y.color||(R.traceIs(a,"bar")?z.Color.defaultLine:l[i%l.length]);a.error_y.color=z.Color.addOpacity(z.Color.rgb(u),z.Color.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}"bardir"in a&&("h"!==a.bardir||!R.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",k(a)),delete a.bardir),"histogramy"===a.type&&k(a),("histogramx"===a.type||"histogramy"===a.type)&&(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=z.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=z.Axes.cleanId(a.yaxis,"y")),a.scene&&(a.scene=z.Gl3dLayout.cleanId(a.scene)),R.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(d):a.textposition&&(a.textposition=d(a.textposition))),p(a,"line")&&delete a.line,"marker"in a&&(p(a.marker,"line")&&delete a.marker.line,p(a,"marker")&&delete a.marker),z.Lib.markTime("finished rest of cleanData, starting color"),z.Color.clean(a),z.Lib.markTime("finished cleanData color.clean")}}function d(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function p(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function g(t){var e,r,n,i,a=z.Axes.list(t),o=t._fullData,s=t._fullLayout,l=t.calcdata=new Array(o.length);for(t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,s._piecolormap={},s._piedefaultcolorcount=0,e=0;en?a.push(i+n):a.push(n);return a}function m(t,e,r){var n,i;for(n=0;n=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function y(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),m(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&m(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function b(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var s=A(t._boundingBoxMargins),l=s.left+s.right,u=s.bottom+s.top,c=a._container.node().getBoundingClientRect(),h=1-2*o.frameMargins;i=Math.round(h*(c.width-l)),n=Math.round(h*(c.height-u))}else r=window.getComputedStyle(t),n=parseFloat(r.height)||a.height,i=parseFloat(r.width)||a.width;return Math.abs(a.width-i)>1||Math.abs(a.height-n)>1?(a.height=t.layout.height=n,a.width=t.layout.width=i):"initial"!==a.autosize&&(delete e.autosize,a.autosize=t.layout.autosize=!0),R.sanitizeMargins(a),e}function L(t){var e=O.select(t),r=t._fullLayout;if(r._hasGL3D&&z.Gl3dLayout.initAxes(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(M(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];O.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=z.Lib.randstr(n)}r._paperdiv.selectAll(".main-svg").attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=z.Axes.getSubplots(t);i.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&T(t,i),r._hasCartesian&&E(t,i),r._shapelayer=r._paper.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var a=z.Lib.syncOrAsync([C,function(){return z.Axes.doTicks(t,"redraw")},z.Fx.init],t);return a&&a.then&&t._promises.push(a),a}function T(t,e){function r(e,r){return function(){return z.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o0;if(w){var k=z.Axes.getSubplots(t).join(""),A=Object.keys(t._fullLayout._plots||{}).join("");(t.framework!==L||_||A!==k)&&(t.framework=L,L(t))}else _&&L(t);var M=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&(g(t),(t._context.doubleClick!==!1||t._context.displayModeBar!==!1)&&z.Axes.saveRangeInitial(t));for(var E=0;EU.range[0]?[1,2]:[2,1]);else{var V=U.range[0],q=U.range[1];"log"===S?(0>=V&&0>=q&&i(F+".autorange",!0),0>=V?V=q/1e6:0>=q&&(q=V/1e6),i(F+".range[0]",Math.log(V)/Math.LN10),i(F+".range[1]",Math.log(q)/Math.LN10)):(i(F+".range[0]",Math.pow(10,V)),i(F+".range[1]",Math.pow(10,q)))}else i(F+".autorange",!0)}if("reverse"===I)N.range?N.range.reverse():(i(F+".autorange",!0),N.range=[1,0]),B.autorange?b=!0:y=!0;else if("annotations"===E.parts[0]||"shapes"===E.parts[0]){var G=E.parts[1],Y=E.parts[0],W=f[Y]||[],X=z[z.Lib.titleCase(Y)],Z=W[G]||{};2===E.parts.length&&("add"===p[T]||z.Lib.isPlainObject(p[T])?A[T]="remove":"remove"===p[T]?-1===G?(A[Y]=W,delete A[T]):A[T]=Z:console.log("???",p)),!a(Z,"x")&&!a(Z,"y")||z.Lib.containsAny(T,["color","opacity","align","dash"])||(b=!0),X.draw(t,G,E.parts.slice(2).join("."),p[T]),delete p[T]}else 0===E.parts[0].indexOf("scene")?y=!0:0===E.parts[0].indexOf("geo")?y=!0:!d._hasGL2D||-1===T.indexOf("axis")&&"plot_bgcolor"!==E.parts[0]?"hiddenlabels"===T?b=!0:-1!==E.parts[0].indexOf("legend")?g=!0:-1!==T.indexOf("title")?v=!0:-1!==E.parts[0].indexOf("bgcolor")?m=!0:E.parts.length>1&&z.Lib.containsAny(E.parts[1],["tick","exponent","grid","zeroline"])?v=!0:-1!==T.indexOf(".linewidth")&&-1!==T.indexOf("axis")?v=m=!0:E.parts.length>1&&-1!==E.parts[1].indexOf("line")?m=!0:E.parts.length>1&&"mirror"===E.parts[1]?v=m=!0:"margin.pad"===T?v=m=!0:"margin"===E.parts[0]||"autorange"===E.parts[1]||"rangemode"===E.parts[1]||"type"===E.parts[1]||"domain"===E.parts[1]||T.match(/^(bar|box|font)/)?b=!0:-1!==["hovermode","dragmode"].indexOf(T)?x=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(T)&&(y=!0):y=!0,E.set(S)}z.Queue&&z.Queue.add(t,H,[t,A],H,[t,k]),p.autosize&&(p=M(t,p)),(p.height||p.width||p.autosize)&&(b=!0);var Q=Object.keys(p),$=[R.previousPromises];if(y||b)$.push(function(){return t.layout=void 0,b&&(t.calcdata=void 0),z.plot(t,"",f)});else if(Q.length&&(R.supplyDefaults(t),d=t._fullLayout,g&&$.push(function(){return z.Legend.draw(t),R.previousPromises(t)}),m&&$.push(C),v&&$.push(function(){return z.Axes.doTicks(t,"redraw"),z.Titles.draw(t,"gtitle"),R.previousPromises(t)}),x)){j(t);var K;for(K=R.getSubplotIds(d,"gl3d"),_=0;_l&&u>e&&(void 0===i[r]?a[c]=E.tickText(t,e):a[c]=f(t,e,String(i[r])),c++);return c=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{T(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function h(t,e){var r=t.match(Y),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return L.time.format(t.replace(Y,a))(n)}return L.time.format(t)(n)}function f(t,e,r){var n=t.tickfont||t._td._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function d(t,e,r,n){var i,a=e.x,o=t._tickround,s=new Date(a),l="";r&&t.hoverformat?i=h(t.hoverformat,a):t.tickformat?i=h(t.tickformat,a):(n&&(T(o)?o+=2:o={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[o]),"y"===o?i=B(s):"m"===o?i=U(s):(a!==t._tmin||r||(l="
"+B(s)),"d"===o?i=V(s):"H"===o?i=q(s):(a!==t._tmin||r||(l="
"+V(s)+", "+B(s)),i=H(s),"M"!==o&&(i+=G(s),"S"!==o&&(i+=m(A(a/1e3,1),t,"none",r).substr(1)))))),e.text=i+l}function p(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=m(Math.pow(10,o),t,i,n);else if(T(a)||"D"===a.charAt(0)&&A(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=m(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,A(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);("0"===l||"1"===l)&&("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(0>o?.5:.25)))}}function g(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function v(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=m(e.x,t,i,n)}function m(t,e,r,n){var i=0>t,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:T(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};c(u),a=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return L.format(l)(t).replace(/-/g,"\u2212");var h=Math.pow(10,-a)/2;if("none"===o&&(s=0),t=Math.abs(t),h>t)t="0",i=!1;else{if(t+=h,s&&(t*=Math.pow(10,-s),a+=s),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var f=a;0>f;f++)t+="0"}else{t=String(t);var d=t.indexOf(".")+1;d&&(t=t.substr(0,d+a).replace(/\.?0+$/,""))}t=y(t,e._td._fullLayout.separators)}if(s&&"hide"!==o){var p;p=0>s?"\u2212"+-s:"power"!==o?"+"+s:String(s),"e"===o||("SI"===o||"B"===o)&&(s>12||-15>s)?t+="e"+p:"E"===o?t+="E"+p:"power"===o?t+="×10"+p+"":"B"===o&&9===s?t+="B":("SI"===o||"B"===o)&&(t+=W[s/3+5])}return i?"\u2212"+t:t}function y(t,e){var r=e.charAt(0),n=e.charAt(1),i=t.split("."),a=i[0],o=i.length>1?r+i[1]:"";if(n&&(i.length>1||a.length>4))for(;X.test(a);)a=a.replace(X,"$1"+n+"$2");return a+o}function b(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o1)for(n=1;nu[1]-.01&&(e.domain=[0,1]),M.Lib.noneOrAll(t.domain,e.domain,[0,1])}return e},E.coerceRef=function(t,e,r,n){var i=r._fullLayout._hasGL2D?[]:E.listIds(r,n),a=n+"ref",o={};return o[a]={valType:"enumerated",values:i.concat(["paper"]),dflt:i[0]||"paper"},M.Lib.coerce(t,e,o,a)},E.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(E.getFromId(t,r.xaxis)||{}).type,delete(E.getFromId(t,r.yaxis)||{}).type})};var z=/^[xyz][0-9]*$/,P=/^[xyz]axis[0-9]*$/;E.id2name=function(t){if("string"==typeof t&&t.match(z)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},E.name2id=function(t){if(t.match(P)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},E.cleanId=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},E.cleanName=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(5).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+"axis"+r}},E.counterLetter=function(t){return{x:"y",y:"x"}[t.charAt(0)]},E.autoType=function(t){return E.moreDates(t)?"date":E.category(t)?"category":s(t)?"linear":"-"},E.getShowAttrDflt=function(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};return r.every(n)||1===r.length?t[r[0]]:void 0},E.moreDates=function(t){for(var e,r=0,n=0,i=Math.max(1,(t.length-1)/1e3),a=0;a2*n},E.category=function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n},E.cleanDatum=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return M.Lib.ms2DateTime(t);if("string"!=typeof t&&!T(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){console.log(e,t)}return t},E.BADNUM=void 0,E.setConvert=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*i*Math.abs(n-a))}return E.BADNUM}function r(t){return Math.pow(10,t)}function n(t){return T(t)?Number(t):E.BADNUM}var i=10;if(t.c2l="log"===t.type?e:n,t.l2c="log"===t.type?r:n,t.l2d=function(e){return t.c2d(t.l2c(e))},t.setScale=function(){var e,r=t._td._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=E.getFromId(t._td,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)T(t.range[e])||(t.range[e]=T(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw M.Lib.notifier("Something went wrong with axis scaling","long"),t._td._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return T(e)?L.round(M.Lib.constrain(t._b+t._m*e,-i*t._length,(1+i)*t._length),2):E.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=n,t.d2c=function(t){return t=E.cleanDatum(t),T(t)?Number(t):E.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return T(t)?M.Lib.ms2DateTime(t):E.BADNUM},t.d2c=function(t){return T(t)?Number(t):M.Lib.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var a=t.range.map(M.Lib.dateTime2ms);!T(t.range[0])&&T(a[0])&&(t.range[0]=a[0]),!T(t.range[1])&&T(a[1])&&(t.range[1]=a[1])}catch(o){console.log(o,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?E.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;a2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.doAutoRange=function(t){if(t._length||t.setScale(),t.autorange&&t._min&&t._max&&t._min.length&&t._max.length){var e,r=t._min[0].val,n=t._max[0].val;for(e=1;e0&&u>0&&c/u>h&&(s=a,l=o,h=c/u);r===n?t.range=f?[r+1,"normal"!==t.rangemode?0:r-1]:["normal"!==t.rangemode?0:r-1,r+1]:h&&(("linear"===t.type||"-"===t.type)&&("tozero"===t.rangemode&&s.val>=0?s={val:0,pad:0}:"nonnegative"===t.rangemode&&(s.val-h*s.pad<0&&(s={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),h=(l.val-s.val)/(t._length-s.pad-l.pad)),t.range=[s.val-h*s.pad,l.val+h*l.pad],t.range[0]===t.range[1]&&(t.range=[t.range[0]-1,t.range[0]+1]),f&&t.range.reverse());var d=t._td.layout[t._name];d||(t._td.layout[t._name]=d={}),d!==t&&(d.range=t.range.slice(),d.autorange=t.autorange)}},E.saveRangeInitial=function(t,e){for(var r,n,i,a=E.list(t,"",!0),o=!1,s=0;sp&&(p=g/10),u=t.c2l(p),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if(t.autorange&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=v-1;a>5;a--)i(a)}},E.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/h.dtick)%100<2}var a=M.Lib.aggNums(Math.min,null,t),o=M.Lib.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=M.Lib.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*M.Lib.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*M.Lib.stdev(t)/Math.pow(t.length,n?.25:.4))}var h={type:"log"===e.type?"linear":e.type,range:[a,o]};E.autoTicks(h,s);var f,d=E.tickIncrement(E.tickFirst(h),h.dtick,"reverse");if("number"==typeof h.dtick){for(var p=0,g=0,v=0,m=0,y=0;yg&&(p>.3*b||i(a)||i(o))){var x=h.dtick/2;d+=a>d+x?x:-x}var _=1+Math.floor((o-d)/h.dtick);f=d+_*h.dtick}else for(f=d;o>=f;)f=E.tickIncrement(f,h.dtick);return{start:d,end:f,size:h.dtick}},E.calcTicks=function(t){if("array"===t.tickmode)return l(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=M.Lib.constrain(t._length/e,4,9)+1)),E.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),c(t),t._tmin=E.tickFirst(t);var n=t.range[1]=a:a>=o)&&(i.push(o),!(i.length>1e3));o=E.tickIncrement(o,t.dtick,n));t._tmax=i[i.length-1];for(var s=new Array(i.length),u=0;u157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*u(e,r,O)):e>12096e5?(e/=26298e5,t.dtick="M"+u(e,1,I)):e>432e5?(t.dtick=u(e,864e5,R),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=u(e,36e5,I):e>3e4?t.dtick=u(e,6e4,D):e>500?t.dtick=u(e,1e3,D):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,O));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+u(e,r,O)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,O));if(0===t.dtick&&(t.dtick=1),!T(t.dtick)&&"string"!=typeof t.dtick){var i=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(i)}},E.tickIncrement=function(t,e,r){var n=r?-1:1;if(T(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?N:F,l=t+.01*n,u=M.Lib.roundUp(A(l,1),s,r);return Math.floor(l)+Math.log(L.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},E.tickFirst=function(t){var e=t.range[1]n:n>u;)u=E.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-a)/h)*h+a)/Math.LN10;if("D"===c){var f="D2"===i?N:F,d=M.Lib.roundUp(A(n,1),f,e);return Math.floor(n)+Math.log(L.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var B=L.time.format("%Y"),U=L.time.format("%b %Y"),V=L.time.format("%b %-d"),q=L.time.format("%b %-d %Hh"),H=L.time.format("%H:%M"),G=L.time.format(":%S"),Y=/%(\d?)f/g;E.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,a=f(t,e),o="array"===t.tickmode,s=r||o;if(o&&Array.isArray(t.ticktext)){for(var l=Math.abs(t.range[1]-t.range[0])/1e4,u=0;u1&&ei&&(w=90),a(u,w)}l._lastangle=w}return r||M.Titles.draw(t,e+"title"),e+" done"}var u=n.selectAll("g."+x).data(y,b);if(!l.showticklabels||!T(i))return u.remove(),void M.Titles.draw(t,e+"title");var c,h,d,p;if("x"===v){var m="bottom"===P?1:-1;c=function(t){return t.dx},p=i+(A+k)*m,h=function(t){return t.dy+p+t.fontSize*("bottom"===P?1:-.5)},d=function(t){return T(t)&&0!==t&&180!==t?0>t*m?"end":"start":"middle"}}else h=function(t){return t.dy+t.fontSize/2},c=function(t){return t.dx+i+(A+k+(90===Math.abs(l.tickangle)?t.fontSize/2:0))*("right"===P?1:-1)},d=function(t){return T(t)&&90===Math.abs(t)?"middle":"right"===P?"start":"end"};var _=0,w=0,E=[];u.enter().append("g").classed(x,1).append("text").attr("text-anchor","middle").each(function(e){var r=L.select(this),n=t._promises.length;r.call(M.Drawing.setPosition,c(e),h(e)).call(M.Drawing.font,e.font,e.fontSize,e.fontColor).text(e.text).call(M.util.convertToTspans),n=t._promises[n],n?E.push(t._promises.pop().then(function(){a(r,l.tickangle)})):a(r,l.tickangle)}),u.exit().remove(),u.each(function(t){_=Math.max(_,t.fontSize)}),a(u,l._lastangle||l.tickangle);var C=M.Lib.syncOrAsync([o,s]);return C&&C.then&&t._promises.push(C),C}function o(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:M.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function s(e,r,i){var a=e.gridlayer,s=e.zerolinelayer,u=e["hidegrid"+v]?[]:O,c="M0,0"+("x"===v?"v":"h")+r._length,h=a.selectAll("path."+_).data(l.showgrid===!1?[]:u,b);h.enter().append("path").classed(_,1).classed("crisp",1).attr("d",c).each(function(t){l.zeroline&&("linear"===l.type||"-"===l.type)&&Math.abs(t.x)g;g++){var b=l.mirrors[o._id+h[g]];("ticks"===b||"labels"===b)&&(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=j[e];t&&T(r)&&(y+=d+(r+k*i)+p+i*l.ticklen)}),i(r,y),s(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return I.length?Promise.all(I):0},E.swap=function(t,e){for(var r=x(t,e),n=0;n0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nI||I>R.width||0>D||D>R.height)return f(t,e)}else I="xpx"in e?e.xpx:p[0]._length/2,D="ypx"in e?e.ypx:g[0]._length/2;if(m="xval"in e?n(d,e.xval):i(p,I),y="yval"in e?n(d,e.yval):i(g,D),!k(m[0])||!k(y[0]))return console.log("Plotly.Fx.hover failed",e,t),f(t,e)}var F=1/0;for(_=0;_1||-1!==L.hoverinfo.indexOf("name")?L.name:void 0,index:!1,distance:Math.min(F,M.MAXDIST),color:x.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},P=j.length,"array"===E){var N=e[_];"pointNumber"in N?(z.index=N.pointNumber,E="closest"):(E="","xval"in N&&(C=N.xval,E="x"),"yval"in N&&(S=N.yval,E=E?"closest":"y"))}else C=m[T],S=y[T];if(L._module&&L._module.hoverPoints){var B=L._module.hoverPoints(z,C,S,E);if(B)for(var U,V=0;VP&&(j.splice(0,P),F=j[0].distance)}if(0===j.length)return f(t,e);var q="y"===v&&O.length>1;j.sort(function(t,e){return t.distance-e.distance});var H={hovermode:v,rotateLabels:q,bgColor:x.Color.combine(a.plot_bgcolor,a.paper_bgcolor),container:a._hoverlayer,outerContainer:a._paperdiv},G=l(j,H);u(j,q?p[0]:g[0]),c(G,q);var Y=t._hoverdata,W=[];for(b=0;b128?"#000":x.Color.background;if(t.name&&void 0===t.zLabelVal){var f=document.createElement("p");f.innerHTML=t.name,r=f.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):b&&t[i+"Label"]===d?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var p=e.select("text.nums").style("fill",u).call(x.Drawing.setPosition,0,0).text(n).attr("data-notex",1).call(x.util.convertToTspans);p.selectAll("tspan.line").call(x.Drawing.setPosition,0,0);var g=e.select("text.name"),k=0;r&&r!==n?(g.style("fill",l).text(r).call(x.Drawing.setPosition,0,0).attr("data-notex",1).call(x.util.convertToTspans),g.selectAll("tspan.line").call(x.Drawing.setPosition,0,0),k=g.node().getBoundingClientRect().width+2*j):(g.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var A,M,L=p.node().getBoundingClientRect(),E=c._offset+(t.x0+t.x1)/2,C=h._offset+(t.y0+t.y1)/2,S=Math.abs(t.x1-t.x0),z=Math.abs(t.y1-t.y0),O=L.width+P+j+k;t.ty0=v-L.top,t.bx=L.width+2*j,t.by=L.height+2*j,t.anchor="start",t.txwidth=L.width,t.tx2width=k,t.offset=0,a?(t.pos=E,A=y>=C+z/2+O,M=C-z/2-O>=0,"top"!==t.idealAlign&&A||!M?A?(C+=z/2,t.anchor="start"):t.anchor="middle":(C-=z/2,t.anchor="end")):(t.pos=C,A=m>=E+S/2+O,M=E-S/2-O>=0,"left"!==t.idealAlign&&A||!M?A?(E+=S/2,t.anchor="start"):t.anchor="middle":(E-=S/2,t.anchor="end")),p.attr("text-anchor",t.anchor),k&&g.attr("text-anchor",t.anchor),e.attr("transform","translate("+E+","+C+")"+(a?"rotate("+T+")":""))}),L}function u(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=h-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-f,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;of&&u++;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos>f-1&&(l.del=!0,u--);for(o=0;o=u);o++)if(l=t[o],l.pos=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos+l.dp+l.size>f&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=e._offset,f=e._offset+e._length,d=t.map(function(t,r){return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===e._id.charAt(0)?C:1)/2 -}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(p.push.apply(p,g),d.splice(o+1,1),u=0,s=p.length-1;s>=0;s--)u+=p[s].dp;for(a=u/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}d.forEach(r)}for(o=d.length-1;o>=0;o--){var y=d[o];for(s=y.length-1;s>=0;s--){var b=y[s],x=t[b.i];x.offset=b.dp,x.del=b.del}}}function c(t,e){t.each(function(t){var r=_.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(P+j),s=o+a*(t.txwidth+j),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-z,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*P+l)+","+(P+u)+"v"+(t.by/2-P)+"h"+n*t.bx+"v-"+t.by+"H"+(n*P+l)+"V"+(u-P)+"Z"),i.call(x.Drawing.setPosition,o+l,u+t.ty0-t.by/2+j).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.Drawing.setPosition,s+a*j+l,u+t.ty0-t.by/2+j),r.select("rect").call(x.Drawing.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}function f(t,e){var r=t._fullLayout;e||(e={}),e.target&&A.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}function d(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function p(t,e,r,n,i,a,o,s){function l(t,e){for(E=0;E.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",Q+"Z"),tt=e.plot.append("path").attr("class","zoombox-corners").style({fill:x.Color.background,stroke:x.Color.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),E=0;E.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),tt.transition().style("opacity",1).duration(200),$=!0)}function f(t,e,r){var n,i,a;for(n=0;nzoom back out","long"),R=!1)))}function m(e,r){var n=1===(o+s).length;if(e)L();else if(2!==r||n)if(1===r&&n){var i=o?O[0]:j[0],a="s"===o||"w"===s?0:1,l=i._name+".range["+a+"]",u=g(i,a),c="left",h="middle";if(i.fixedrange)return;o?(h="n"===o?"top":"bottom","right"===i.side&&(c="right")):"e"===s&&(c="right"),q.call(x.util.makeEditable,null,{immediate:!0,background:z.paper_bgcolor,text:String(u),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:c,verticalAlign:h}).on("edit",function(e){var r="category"===i.type?i.c2l(e):i.d2l(e);void 0!==r&&x.relayout(t,l,r)})}else v(t);else A()}function b(e){function r(t,e,r){if(!t.fixedrange){u(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||z._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(rt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void console.log("did not find wheel motion attributes",e);var a,l=Math.exp(-Math.min(Math.max(i,-20),20)/100),c=it.draglayer.select(".nsewdrag").node().getBoundingClientRect(),h=(e.clientX-c.left)/c.width,f=et[0]+et[2]*h,d=(c.bottom-e.clientY)/c.height,p=et[1]+et[3]*(1-d);if(s){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;ot._lastHoverTime+D?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},D))},M.unhover=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),f(t,e,r)},M.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},M.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indexa?a:o>4/3-s?o:s};var F=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];M.dragCursors=function(t,e,r,n){return t="left"===r?0:"center"===r?1:"right"===r?2:x.Lib.constrain(Math.floor(3*t),0,2),e="bottom"===n?0:"middle"===n?1:"top"===n?2:x.Lib.constrain(Math.floor(3*e),0,2),F[e][t]},M.dragElement=function(t){function e(e){var h=document.querySelector(".plugin-editable");return h&&_.select(h).on("blur").call(h),u._dragged=!1,u._dragging=!0,i=e.clientX,a=e.clientY,l=e.target,o=(new Date).getTime(),o-u._mouseDownTimeM.DBLCLICKDELAY&&(c=Math.max(c-1,1)),t.doneFn&&t.doneFn(u._dragged,c),!u._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),l.dispatchEvent(r)}return m(u),u._dragged=!1,x.Lib.pauseEvent(e)}var i,a,o,s,l,u=x.Lib.getPlotDiv(t.element)||{},c=1;u._mouseDownTime||(u._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents="all"},M.setCursor=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)},M.inbox=function(t,e){return 0>t*e||0===t?M.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../lib/events":315,"../../plotly":336,d3:53,"fast-isnumeric":58,tinycolor2:213}],341:[function(t,e,r){var n=t("../../plotly"),i=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={title:{valType:"string"},titlefont:o({},i,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:o({},i,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":283,"../../lib/extend":316,"../../plotly":336,"../font_attributes":342}],342:[function(t,e,r){e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],343:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.container=t.container,this.topojsonURL=t.topojsonURL,h(),this.showHover="closest"===e.hovermode,this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework()}function i(t,e,r){return c.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=m.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("stroke","none").call(u.Color.fill,r[n+"color"])}function o(t,e,r){var n=m.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("fill","none").call(u.Color.stroke,r[n+"color"]).call(u.Drawing.dashLine,"",r[n+"width"])}function s(t,e,r){t.select("."+e+"graticule").selectAll("path").attr("fill","none").call(u.Color.stroke,r[e].gridcolor).call(u.Drawing.dashLine,"",r[e].gridwidth)}function l(t){var e={type:"linear",showexponent:"all",exponentformat:u.Axes.layoutAttributes.exponentformat.dflt,_td:{_fullLayout:t}};return u.Axes.setConvert(e),e}var u=t("../../plotly"),c=t("d3"),h=t("./projections"),f=t("./set_scale"),d=t("./zoom"),p=t("./zoom_reset"),g=t("../../traces/scattergeo/plot"),v=t("../../traces/choropleth/plot"),m=t("../../constants/geo_constants"),y=t("../../lib/topojson_utils"),b=t("topojson").feature;e.exports=n;var x=n.prototype;x.plot=function(t,e,r){var n,i,a=this,o=e[a.id],s=e._size;a.projection=null,a.setScale=f(o,s),a.makeProjection(o),a.makePath(),a.adjustLayout(o,s),a.zoom=d(a,o),a.zoomReset=p(a,o),a.mockAxis=l(e),a.framework.call(a.zoom).on("dblclick.zoom",a.zoomReset),n=y.getTopojsonName(o),null===a.topojson||n!==a.topojsonName?(a.topojsonName=n,void 0!==PlotlyGeoAssets.topojson[a.topojsonName]?(a.topojson=PlotlyGeoAssets.topojson[a.topojsonName],a.onceTopojsonIsLoaded(t,o)):(i=y.getTopojsonPath(a.topojsonURL,a.topojsonName),r.push(new Promise(function(e,r){c.json(i,function(n,s){return n?void r(404===n.status?new Error(["plotly.js could not find topojson file at",i,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",i].join(" "))):(a.topojson=s,PlotlyGeoAssets.topojson[a.topojsonName]=s,a.onceTopojsonIsLoaded(t,o),void e())})})))):a.onceTopojsonIsLoaded(t,o)},x.onceTopojsonIsLoaded=function(t,e){var r,n,i=[],a=[];this.drawLayout(e);for(var o=0;o0&&g.plot(this,i),a.length>0&&v.plot(this,a,e),this.render()},x.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=c.geo[m.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(m.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-m.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},x.makePath=function(){this.path=c.geo.path().projection(this.projection)},x.makeFramework=function(){var t=this.geoDiv=c.select(this.container).append("div");t.attr("id",this.id).style("position","absolute");var e=this.hoverContainer=t.append("svg");e.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}).style({position:"absolute","z-index":20,"pointer-events":"none"});var r=this.framework=t.append("svg");r.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",position:"absolute",preserveAspectRatio:"none"}),r.append("g").attr("class","bglayer").append("rect"),r.append("g").attr("class","baselayer"),r.append("g").attr("class","choroplethlayer"),r.append("g").attr("class","baselayeroverchoropleth"),r.append("g").attr("class","scattergeolayer"),r.on("dblclick.zoom",null)},x.adjustLayout=function(t,e){var r=t.domain;this.geoDiv.style({left:e.l+e.w*r.x[0]+t._marginX+"px",top:e.t+e.h*(1-r.y[1])+t._marginY+"px",width:t._width+"px",height:t._height+"px"}),this.hoverContainer.attr({width:t._width,height:t._height}),this.framework.attr({width:t._width,height:t._height}),this.framework.select(".bglayer").select("rect").attr({width:t._width,height:t._height}).style({fill:t.bgcolor,"stroke-width":0})},x.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?m.sphereSVG:b(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},x.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=m.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},x.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=m.baseLayers,i=m.axesNames;r.selectAll("*").remove();for(var a=0;an?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",o),r.selectAll("path.graticulepath").attr("d",o),n.selectAll("path.choroplethlocation").attr("d",o),n.selectAll("path.basepath").attr("d",o),i.selectAll("path.js-line").attr("d",o),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../constants/geo_constants":306,"../../lib/topojson_utils":331,"../../plotly":336,"../../traces/choropleth/plot":390,"../../traces/scattergeo/plot":413,"./projections":350,"./set_scale":351,"./zoom":352,"./zoom_reset":353,d3:53,topojson:214}],344:[function(t,e,r){e.exports={geo:{valType:"geoid",dflt:"geo"}}},{}],345:[function(t,e,r){var n=t("../../../components/color/attributes");e.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":283}],346:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("../../../constants/geo_constants"),a=t("./axis_attributes");e.exports=function(t,e){function r(t,e){return n.Lib.coerce(c,h,a,t,e)}function o(t){var r,n,a,o,s,l,u=e.scope;return"world"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+"Span"],l=void 0!==s[n]?s[n]/2:s["*"]/2,o="lonaxis"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+"Range"]}for(var s=i.axesNames,l=0;lu;u++){var c=s[u],h=t[c]||{},f={};a("domain.x"),a("domain.y",[u/l,(u+1)/l]),n(h,f,a),e[c]=f}}},{"../../../constants/geo_constants":306,"../../../plotly":336,"./axis_defaults":346,"./layout_attributes":349}],348:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./attributes");n.Plots.registerSubplot("geo","geo","geo",i),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./defaults")},{"../../../plotly":336,"./attributes":344,"./defaults":347,"./layout_attributes":349}],349:[function(t,e,r){var n=t("../../../components/color/attributes"),i=t("../../../constants/geo_constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.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,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":283,"../../../constants/geo_constants":306,"./axis_attributes":345}],350:[function(t,e,r){function n(){function t(t,r){return{type:"Feature",id:t.id,properties:t.properties,geometry:e(t.geometry,r)}}function e(t,r){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return e(t,r)})};if(!A.hasOwnProperty(t.type))return null;var n=A[t.type];return i.geo.stream(t,r(n)),n.result()}function r(){}function n(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r=n}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;o>a;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&(f-u)*(n-c)/(d-c)+u>r&&(i=!i)}return i}function o(t){return t>1?E:-1>t?-E:Math.asin(t)}function s(t,e){var r=(2+E)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>M;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function l(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?c:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function u(){var t=2,e=P(l),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function c(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function h(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function f(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function d(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>M&&--i>0);return e/2}}function p(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=d(r);return n.invert=function(n,i){var a=o(i/e);return[n/(t*Math.cos(a)),o((2*a+Math.sin(2*a))/r)]},n}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function v(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=I[i])[0],s=r[1],l=(r=I[++i])[0],u=r[1],c=(r=I[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?E:-E)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function m(t,e){return[t*Math.cos(e),e]}i.geo.project=function(t,r){var n=r.stream;if(!n)throw new Error("not yet supported");return(t&&y.hasOwnProperty(t.type)?y[t.type]:e)(t,n)};var y={Feature:t,FeatureCollection:function(e,r){ -return{type:"FeatureCollection",features:e.features.map(function(e){return t(e,r)})}}},b=[],x=[],_={point:function(t,e){b.push([t,e])},result:function(){var t=b.length?b.length<2?{type:"Point",coordinates:b[0]}:{type:"MultiPoint",coordinates:b}:null;return b=[],t}},w={lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){b.length&&(x.push(b),b=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},k={polygonStart:r,lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){var t=b.length;if(t){do b.push(b[0].slice());while(++t<4);x.push(b),b=[]}},polygonEnd:r,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){n(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return a(t[0],r)?(t.push(e),!0):void 0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},A={Point:_,MultiPoint:_,LineString:w,MultiLineString:w,Polygon:k,MultiPolygon:k,Sphere:k},M=1e-6,L=M*M,T=Math.PI,E=T/2,C=(Math.sqrt(T),T/180),S=180/T,z=i.geo.projection,P=i.geo.projectionMutator;i.geo.interrupt=function(t){function e(e,r){for(var n=0>r?-1:1,i=l[+(0>r)],a=0,o=i.length-1;o>a&&e>i[a][2][0];++a);var s=t(e-i[a][1][0],r);return s[0]+=t(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function r(){s=l.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function n(){for(var t=1e-6,e=[],r=0,n=l[0].length;n>r;++r){var o=l[0][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,h=180*o[2][0]/T,f=180*o[2][1]/T;e.push(a([[s+t,u+t],[s+t,c-t],[h-t,c-t],[h-t,f+t]],30))}for(var r=l[1].length-1;r>=0;--r){var o=l[1][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,h=180*o[2][0]/T,f=180*o[2][1]/T;e.push(a([[h-t,f-t],[h-t,c+t],[s+t,c+t],[s+t,u-t]],30))}return{type:"Polygon",coordinates:[i.merge(e)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++au;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])n)],a=l[+(0>n)],u=0,c=i.length;c>u;++u){var h=i[u];if(h[0][0]<=r&&rM&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(i.geo.naturalEarth=function(){return z(g)}).raw=g;var I=[[.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]];I.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var r=e/E,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,g=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],n-=(p=(e>=0?E:-E)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*S;while(Math.abs(p)>L&&--g>0);break}}while(--a>=0);var v=I[a][0],m=I[a+1][0],y=I[Math.min(19,a+2)][0];return[t/(m+d*(y-v)/2+d*d*(y-2*m+v)/2),n*C]},(i.geo.robinson=function(){return z(v)}).raw=v,m.invert=function(t,e){return[t/Math.cos(e),e]},(i.geo.sinusoidal=function(){return z(m)}).raw=m}var i=t("d3");e.exports=n},{d3:53}],351:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,g=o.range[1]-s,v=n._fullRange[0]+s,m=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=d-f,_=g-p,w=[f+x/2,p+_/2],k=r._rotate;r._center=[w[0]+k[0],w[1]+k[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,k=i(f,p,d,g),A=i(v,y,m,b);l=a(e,k),o=n(l),x=a(e,A),r._fullScale=n(x),e.scale(o),l=a(e,k),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,k),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("../../constants/geo_constants").clipPad;e.exports=n},{"../../constants/geo_constants":306,d3:53}],352:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(M)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),u=v.rotate(),c=v.translate(),h=u,f=r(l)}function o(){return d=_.mouse(this),n(l)?(m.scale(v.scale()),void m.translate(v.translate())):(v.scale(_.event.scale),v.translate([c[0],_.event.translate[1]]),f?r(d)&&(g=r(d),p=[h[0]+(g[0]-f[0]),u[1],u[2]],v.rotate(p),h=p):(l=d,f=r(l)),void t.render())}function s(){_.select(this).style(M)}var l,u,c,h,f,d,p,g,v=t.projection,m=i(v,e),y=2;return m.on("zoomstart",a).on("zoom",o).on("zoomend",s),m}function s(t,e){function r(t){m++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--m||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),g=x(p,"zoomstart","zoom","zoomend"),m=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),m=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=v(c(m,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(M),y.call(p,"zoom",null),a(g.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,g,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&m(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=g(e,2,t[0]);n=g(n,1,t[1]),n=g(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*k,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*k-f,i=Math.sqrt(p*p-c*c));var v=180-a-2*f,m=(Math.atan2(h,u)-Math.atan2(l,i))*k,y=(Math.atan2(h,u)-Math.atan2(l,-i))*k,b=d(r[0],r[1],a,m),x=d(r[0],r[1],v,y);return x>=b?[a,m,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function m(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=t.length,i=0;n>r;++r)i+=t[r]*e[r];return i}function b(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 x(t){for(var e=0,r=arguments.length,n=[];++ed;++d){for(e=u[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;2>=p;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=o(n),this.labelColor[d+p]=s(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=s((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:-r.tickangle,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=s(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=s(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;c=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!c,l=this.hasAxisInAltrPos(e,r)&&!c,i=r.mirror||!1,h=c?-1!==String(i).indexOf("all"):!!i,f=c?"allticks"===i:-1!==String(i).indexOf("ticks"),a?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(l||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=s(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=s(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=a.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=a.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":319,"../../lib/str2rgbarray":329,"../../plotly":336}],356:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullLayout=e,this.updateAxes(e),this.makeFramework(),this.glplotOptions=h(this),this.glplotOptions.merge(e),this.glplot=l(this.glplotOptions),this.camera=f(this),this.traces={},this.spikes=u(this.glplot),this.selectBox=c(this.glplot,{innerFill:!1,outerFill:!0}),this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;2>r;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;ao;++o,--s)for(var l=0;r>l;++l)for(var u=0;4>u;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},m.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.Axes.calcTicks(this.xaxis),s.Axes.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;rw;++w)_[w]=Math.min(_[w],p.bounds[w]),_[w+2]=Math.max(_[w+2],p.bounds[w+2])}var k;for(r=0;2>r;++r)_[r]>_[r+2]&&(_[r]=-1,_[r+2]=1),k=this[v[r]],k._length=m.viewBox[r+2]-m.viewBox[r],s.Axes.doAutoRange(k);m.ticks=this.computeTickMarks();var A=this.xaxis.range,M=this.yaxis.range;m.dataBox=[A[0],M[0],A[1],M[1]],m.merge(e),i.update(m)},m.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=this.fullLayout;this.cameraChanged();var i=r.x*t.pixelRatio,a=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===n.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var o=n._size,l=this.xaxis.domain,u=this.yaxis.domain,c=t.pick(i/t.pixelRatio+o.l+l[0]*o.w,a/t.pixelRatio-(o.t+(1-u[1])*o.h));if(c&&n.hovermode){var h=c.object._trace.handlePick(c);if(h&&(!this.lastPickResult||this.lastPickResult.trace!==h.trace||this.lastPickResult.dataCoord[0]!==h.dataCoord[0]||this.lastPickResult.dataCoord[1]!==h.dataCoord[1])){var f=this.lastPickResult=h;this.spikes.update({center:c.dataCoord}),f.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(c.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(c.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio];var d=f.hoverinfo;if("all"!==d){var p=d.split("+");-1===p.indexOf("x")&&(f.traceCoord[0]=void 0),-1===p.indexOf("y")&&(f.traceCoord[1]=void 0),-1===p.indexOf("text")&&(f.textLabel=void 0),-1===p.indexOf("name")&&(f.name=void 0)}s.Fx.loneHover({x:f.screenCoord[0],y:f.screenCoord[1],xLabel:this.hoverFormatter("xaxis",f.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",f.traceCoord[1]),text:f.textLabel,name:f.name,color:f.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:c.dataCoord}}}else!c&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,s.Fx.loneUnhover(this.svgContainer))}t.draw()}},m.hoverFormatter=function(t,e){if(void 0===e)return void 0;var r=this[t];return s.Axes.tickText(r,r.c2l(e),"hover").text}},{"../../lib/html2unicode":319,"../../lib/show_no_webgl_msg":327,"../../plotly":336,"../../traces/scattergl/convert":415,"./camera":354,"./convert":355,"gl-plot2d":106,"gl-select-box":136,"gl-spikes2d":147}],357:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;16>f;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s="rotate"===f.keyBindingMode,l="pan"===f.keyBindingMode,c="zoom"===f.keyBindingMode,h=!!o.control,g=!!o.alt,v=!!o.shift,m=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-d),w=x*(a-p),k=f.flipX?1:-1,A=f.flipY?1:-1,M=i(),L=Math.PI*f.rotateSpeed;if((s&&m&&!h&&!g&&!v||m&&!h&&!g&&v)&&n.rotate(M,k*L*_,-A*L*w,0),(l&&m&&!h&&!g&&!v||y||m&&h&&!g&&!v)&&n.pan(M,-f.translateSpeed*_*u,f.translateSpeed*w*u,0),c&&m&&!h&&!g&&!v||b||m&&!h&&g&&!v){var T=-f.zoomSpeed*w/window.innerHeight*(M-n.lastT())*100;n.pan(M,0,0,u*(Math.exp(T)-1))}return d=r,p=a,!0}),s(t,function(t,e){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":22,"mouse-change":173,"mouse-wheel":177,"right-now":191}],358:[function(t,e,r){e.exports={scene:{valType:"sceneid",dflt:"scene"}}},{}],359:[function(t,e,r){var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:"rgb(0,0,0)"},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},title:n.title,titlefont:n.titlefont,type:n.type,autorange:n.autorange,rangemode:n.rangemode,range:n.range,fixedrange:n.fixedrange,tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth}},{"../../../lib/extend":316,"../../cartesian/layout_attributes":341}],360:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./axis_attributes"),a=["xaxis","yaxis","zaxis"],o=function(){};e.exports=function(t,e,r){function s(t,e){return n.Lib.coerce(l,u,i,t,e)}for(var l,u,c=n.Axes,h=0;hr;++r){var n=t[u[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:n.tickangle),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1; -}},e.exports=i},{"../../../lib/html2unicode":319,"../../../lib/str2rgbarray":329,arraytools:32}],362:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./layout_attributes"),a=t("./axis_defaults");e.exports=function(t,e,r){function o(t,e){return n.Lib.coerce(c,f,i,t,e)}if(e._hasGL3D){var s,l=n.Plots.getSubplotIdsInData(r,"gl3d");delete e.xaxis,delete e.yaxis;var u=l.length;for(s=0;u>s;++s){var c,h=l[s];void 0!==t[h]?c=t[h]:t[h]=c={};var f=e[h]||{};o("bgcolor");for(var d=Object.keys(i.camera),p=0;pl;++l){var u=a[l],c=s[u];c._td=t}}},{"../../../plotly":336,"./attributes":358,"./defaults":362,"./layout_attributes":364}],364:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":316,"./axis_attributes":359}],365:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"],s=n.prototype;s.merge=function(t){for(var e=0;3>e;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":329}],366:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),a=0;ac;++c){var h=i[s[c]];if(h._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(h._length)===1/0)u[c]=[];else{h.range[0]=(r[c].lo+t.dataCenter[c])/t.dataScale[c],h.range[1]=(r[c].hi+t.dataCenter[c])/t.dataScale[c],h._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var d=h.nticks||a.Lib.constrain(h._length/40,4,9);a.Axes.autoTicks(h,Math.abs(h.range[1]-h.range[0])/d)}for(var p=a.Axes.calcTicks(h),g=0;gc;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var g=0;2>g;++g)e.bounds[g][c]=t.glplot.bounds[g][c]}t.contourLevels=n(u)}e.exports=i;var a=t("../../../plotly"),o=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":319,"../../../plotly":336}],367:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],368:[function(t,e,r){"use strict";function n(t){function e(e,r){if(void 0===r)return void 0;if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return c.Axes.tickText(n,n.c2l(r),"hover").text}var r=t.svgContainer,n=t.container.getBoundingClientRect(),i=n.width,a=n.height;r.setAttributeNS(null,"viewBox","0 0 "+i+" "+a),r.setAttributeNS(null,"width",i),r.setAttributeNS(null,"height",a),p(t),t.glplot.axes.update(t.axesOptions);for(var o=Object.keys(t.traces),s=null,l=null,u=t.glplot.selection,h=0;ha;++a){var h=l[k[a]];c.Gl3dLayout.setConvert(h)}t?Array.isArray(t)||(t=[t]):t=[];for(var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],a=0;ao;++o)f[0][o]>f[1][o]?(d[o]=1,p[o]=0):(f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]),p[o]=.5*(f[0][o]+f[1][o])*d[o]);this.dataScale=d,this.dataCenter=p;for(var a=0;aa;++a){var h=l[k[a]],A=h.type;if(A in w?(w[A].acc*=d[a],w[A].count+=1):w[A]={acc:d[a],count:1},h.autorange){for(b[0][a]=1/0,b[1][a]=-(1/0),o=0;ob[1][a])b[0][a]=-1,b[1][a]=1;else{var L=b[1][a]-b[0][a];b[0][a]-=L/32,b[1][a]+=L/32}}else{var T=l[k[a]].range;b[0][a]=T[0],b[1][a]=T[1]}b[0][a]===b[1][a]&&(b[0][a]-=1,b[1][a]+=1),_[a]=b[1][a]-b[0][a],this.glplot.bounds[0][a]=b[0][a]*d[a]-p[a],this.glplot.bounds[1][a]=b[1][a]*d[a]-p[a]}for(var E=[1,1,1],a=0;3>a;++a){var h=l[k[a]],A=h.type,C=w[A];E[a]=Math.pow(C.acc,1/C.count)/d[a]}var S,z=4;if("auto"===l.aspectmode)S=Math.max.apply(null,E)/Math.min.apply(null,E)<=z?E:[1,1,1];else if("cube"===l.aspectmode)S=[1,1,1];else if("data"===l.aspectmode)S=E;else{if("manual"!==l.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=l.aspectratio;S=[P.x,P.y,P.z]}l.aspectratio.x=u.aspectratio.x=S[0],l.aspectratio.y=u.aspectratio.y=S[1],l.aspectratio.z=u.aspectratio.z=S[2],this.glplot.aspect=S;var j=l.domain||null,O=e._size||null;if(j&&O){var I=this.container.style;I.position="absolute",I.left=O.l+j.x[0]*O.w+"px",I.top=O.t+(1-j.y[1])*O.h+"px",I.width=O.w*(j.x[1]-j.x[0])+"px",I.height=O.h*(j.y[1]-j.y[0])+"px"}}},w.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},w.setCameraToDefault=function(){this.glplot.camera.lookAt([1.25,1.25,1.25],[0,0,0],[0,0,1])},w.getCamera=function(){this.glplot.camera.view.recalcMatrix(this.camera.view.lastT());var t=this.glplot.camera.up,e=this.glplot.camera.center,r=this.glplot.camera.eye;return{up:{x:t[0],y:t[1],z:t[2]},center:{x:e[0],y:e[1],z:e[2]},eye:{x:r[0],y:r[1],z:r[2]}}},w.setCamera=function(t){var e=t.up,r=t.center,n=t.eye;this.glplot.camera.lookAt([n.x,n.y,n.z],[r.x,r.y,r.z],[e.x,e.y,e.z])},w.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=c.Lib.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;3>o;o++)for(var s=0;3>s;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},w.handleDragmode=function(t){var e=this.camera;e&&("orbit"===t?(e.mode="orbit",e.keyBindingMode="rotate"):"turntable"===t?(e.up=[0,0,1],e.mode="turntable",e.keyBindingMode="rotate"):e.keyBindingMode=t)},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;o>a;++a,--o)for(var s=0;r>s;++s)for(var u=0;4>u;++u){var c=i[4*(r*a+s)+u];i[4*(r*a+s)+u]=i[4*(r*o+s)+u],i[4*(r*o+s)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(l),p},e.exports=a},{"../../lib/show_no_webgl_msg":327,"../../lib/str2rgbarray":329,"../../plotly":336,"../../traces/mesh3d/convert":398,"../../traces/scatter3d/convert":407,"../../traces/surface/convert":419,"./camera":357,"./layout/convert":361,"./layout/spikes":365,"./layout/tick_marks":366,"./project":367,"gl-plot3d":124}],369:[function(t,e,r){var n=t("../plotly"),i=t("./font_attributes"),a=t("../components/color/attributes"),o=n.Lib.extendFlat;e.exports={font:{family:o({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:o({},i.size,{dflt:12}),color:o({},i.color,{dflt:a.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:o({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:a.background},plot_bgcolor:{valType:"color",dflt:a.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_hasCartesian:{valType:"boolean",dflt:!1},_hasGL3D:{valType:"boolean",dflt:!1},_hasGeo:{valType:"boolean",dflt:!1},_hasPie:{valType:"boolean",dflt:!1},_hasGL2D:{valType:"boolean",dflt:!1},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"Gl3dLayout",geo:"GeoLayout",legend:"Legend",annotations:"Annotations",shapes:"Shapes"}}},{"../components/color/attributes":283,"../plotly":336,"./font_attributes":342}],370:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=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)r.on("click",function(){c.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function a(t,e){for(var r,n=c.getSubplotIds(e,"gl3d"),i=0;i=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),u=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,o),u.text(o.text()&&c.text()?" - ":"")},c.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=c.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},c.supplyDefaults=function(t){var e,r,n,i,l,u,h=t._fullLayout||{},f=t._fullLayout={},d=t.layout||{},p=t._fullData||[],g=t._fullData=[],v=t.data||[],m=t._modules=[];for(c.supplyLayoutGlobalDefaults(d,f),f._dataLength=v.length,e=0;ea&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>o&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},c.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=r.pad||12;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||c.doAutoMargin(t)}},c.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),c=e._pushmargin;return e.margin.autoexpand!==!1&&(c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:l}},Object.keys(c).forEach(function(t){var r=c[t].l||{},n=c[t].b||{},s=r.val,h=r.size,f=n.val,d=n.size;Object.keys(c).forEach(function(t){if(u(h)&&c[t].r){var r=c[t].r.val,n=c[t].r.size;if(r>s){var p=(h*r+(n-e.width)*s)/(r-s),g=(n*(1-s)+(h-e.width)*(1-r))/(r-s);p>=0&&g>=0&&p+g>i+a&&(i=p,a=g)}}if(u(d)&&c[t].t){var v=c[t].t.val,m=c[t].t.size;if(v>f){var y=(d*v+(m-e.height)*f)/(v-f),b=(m*(1-f)+(d-e.height)*(1-v))/(v-f);y>=0&&b>=0&&y+b>l+o&&(l=y,o=b)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:s.plot(t)},c.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(s.Lib.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!s.Lib.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):t&&t.getTime?s.Lib.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&c.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(l)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),"object"===n?u:JSON.stringify(u)}},{"../plotly":336,"./attributes":337,"./font_attributes":342,"./layout_attributes":369,d3:53,"fast-isnumeric":58}],371:[function(t,e,r){var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":403}],372:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":316,"../cartesian/layout_attributes":341}],373:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),a=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},o=n.Lib.extendDeepAll;a.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:a.util.cloneJson(u),layout:a.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,g=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=a.util.sumArrays(t.r,r)}),t.values});d=i.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;b=Math.max(10,b);var x,_=[h.margin.left+b,h.margin.top+b];if(p){var w=i.max(a.util.sumArrays(a.util.arrayLast(d).r[0],a.util.arrayLast(m)));x=[0,w]}else x=i.extent(a.util.flattenArray(d.map(function(t,e){return t.r})));h.radialAxis.domain!=a.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(h.radialAxis.domain!=a.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=n.domain();var k,A=a.util.flattenArray(d.map(function(t,e){return t.t})),M="string"==typeof A[0];M&&(A=a.util.deduplicate(A),k=A.slice(),A=i.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var L=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,T=null===h.needsEndSpacing?M||!L:h.needsEndSpacing,E=h.angularAxis.domain&&h.angularAxis.domain!=a.DATAEXTENT&&!M&&h.angularAxis.domain[0]>=0,C=E?h.angularAxis.domain:i.extent(A),S=Math.abs(A[1]-A[0]);L&&!M&&(S=0);var z=C.slice();T&&M&&(z[1]+=S);var P=h.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),h.angularAxis.ticksStep&&(P=(z[1]-z[0])/P);var j=h.angularAxis.ticksStep||(z[1]-z[0])/(P*(h.minorTicks+1));k&&(j=Math.max(Math.round(j),1)),z[2]||(z[2]=j);var O=i.range.apply(this,z);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(z.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=T?S:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",D=(new DOMParser).parseFromString(I,"application/xml"),R=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=i.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=a.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});a.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},a.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=F.node().getBBox();b=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],n.range([0,b]),c.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({ -display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(h.width-(h.margin.left+h.margin.right+2*b+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),h.title){var G=e.select("g.title-group text").style(U).text(h.title),Y=G.node().getBBox();G.attr({x:_[0]-Y.width/2,y:_[1]-b-20})}var W=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var X=W.selectAll("circle.grid-circle").data(n.ticks(5));X.enter().append("circle").attr({"class":"grid-circle"}).style(B),X.attr("r",n),X.exit().remove()}W.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);W.call(Q).attr({transform:"rotate("+h.radialAxis.orientation+")"}),W.selectAll(".domain").style(B),W.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),W.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(O),K=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),$.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),K.selectAll(".minor").style({stroke:h.minorTickColor}),$.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(U);var J=$.select("text.axis-text").attr({x:b+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":k?k[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return o(a[r].defaultConfig(),t)});a[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=a.tooltipPanel().config({container:ut,fontSize:8})(),ht=a.tooltipPanel().config({container:ut,fontSize:8})(),ft=a.tooltipPanel().config({container:ut,hasTick:!0})();if(!M){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=a.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;ot=s.invert(n);var i=a.util.convertToCartesian(b+12,r+180);ct.text(a.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=a.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=n.invert(a.util.getMousePos(Z).radius);var i=a.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(a.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),o=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=o){n.attr({"data-fill":o}),s=i.hsl(o).darker().toString(),n.style({fill:s,opacity:1});var u={t:a.util.round(t[0]),r:a.util.round(t[1])};M&&(u.t=k[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ft.config({color:s}).text(c),ft.move(d)}else o=n.style("stroke"),n.attr({"data-stroke":o}),s=i.hsl(o).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,n,s,l={data:[],layout:{}},u={},c={},h=i.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),o(l.data[e],a.Axis.defaultConfig().data[0]),o(l.data[e],t)}),o(l.layout,a.Axis.defaultConfig().layout),o(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return n},f.angularScale=function(t){return s},f.svg=function(){return e},i.rebind(f,h,"on"),f},a.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},a.util.dataFromEquation=function(t,e,r){var n=e||6,a=[],o=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},a.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-->=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],a={};return a.x=r,a.y=n,a.pos=e,a.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+n*n),a},a.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;a>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},a.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,n,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=a(n(s));return"translate("+[r.x,r.y]+")"}})};var f=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,n,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(i.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,n,a)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,n,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,n,a)},"stroke-width":function(t,e){return v["stroke-width"](r,n,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,n,a)},opacity:function(t,e){return v.opacity(r,n,a)},display:function(t,e){return v.display(r,n,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,g=i.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},m=i.select(this).selectAll("g.layer").data(l);m.enter().append("g").attr({"class":"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e,r=[a.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],a.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},a.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=o({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=i.merge(n);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=a.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof a[0]:r.isContinuous,h=c?r.height:u*a.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=i.range(a.length),v=i.scale[c?"linear":"ordinal"]().domain(g).range(l),m=i.scale[c?"linear":"ordinal"]().domain(g)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=i.svg.axis().scale(m).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return a[e].name}),t}var e=a.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},i.rebind(t,r,"on"),t},a.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},a.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(a){var o=i.hsl(n.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",h=a||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(h);var f=n.padding,d=e.node().getBBox(),p={fill:n.color,stroke:s,"stroke-width":"2px"},g=d.width+2*f+l,v=d.height+2*f;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[n.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return o(n,t),u},u},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=o({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};i.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":336,"./micropolar_manager":374,d3:53}],374:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),a=t("./undo_manager"),o=e.exports={},s=n.Lib.extendDeepAll;o.framework=function(t){function e(e,a){return a&&(h=a),i.select(i.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(h),t.data=r.data,t.layout=r.layout,o.fillLayout(t),r}var r,l,u,c,h,f=new a;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},o.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../plotly":336,"./undo_manager":375,d3:53}],375:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1}var a=t("../plotly"),o=a.Lib.extendFlat,s=a.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),h=s({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;ro;o++)a(r[o])&&a(i[o])&&h.push({p:r[o],s:i[o],b:0});return n.Colorscale.hasColorscale(e,"marker")&&n.Colorscale.calc(e,e.marker.color,"marker","c"),n.Colorscale.hasColorscale(e,"marker.line")&&n.Colorscale.calc(e,e.marker.line.color,"marker.line","c"),h},o.setPositions=function(t,e){var r,i,o=t._fullLayout,s=e.x(),l=e.y();["v","h"].forEach(function(u){function c(e){function r(t){t[f]=t.p+d}var i=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){i.push(t.p)})});var a=n.Lib.distinctVals(i),s=a.vals,l=a.minDiff,u=!1,c=[];"group"===o.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||c.forEach(function(e){Math.abs(t.p-e)y&&(L=!0,w=y),y>_+C&&(L=!0,_=y))}n.Axes.expand(g,[w,_],{tozero:!0,padded:L})}else{var S=function(t){return t[d]=t.s,t.s};for(r=0;r=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var f,d,p,g;if("h"===c.orientation?(p=l.c2p(r.poffset+e.p,!0),g=l.c2p(r.poffset+e.p+r.barwidth,!0),f=s.c2p(e.b,!0),d=s.c2p(e.s+e.b,!0)):(f=s.c2p(r.poffset+e.p,!0),d=s.c2p(r.poffset+e.p+r.barwidth,!0),g=l.c2p(e.s+e.b,!0),p=l.c2p(e.b,!0)),!(a(f)&&a(d)&&a(p)&&a(g)&&f!==d&&p!==g))return void i.select(this).remove();var v=(e.mlw+1||c.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,m=i.round(v/2%1,2);if(!t._context.staticPlot){var y=n.Color.opacity(e.mc||c.marker.color),b=1>y||v>.01?o:h;f=b(f,d),d=b(d,f),p=b(p,g),g=b(g,p)}i.select(this).attr("d","M"+f+","+p+"V"+g+"H"+d+"V"+p+"Z")})})},o.style=function(t){var e=i.select(t).selectAll("g.trace.bars"),r=e.size(),a=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&i.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,a=r.line,o=(e._input||{}).marker||{},s=n.Drawing.tryColorscale(r,o,""),l=n.Drawing.tryColorscale(r,o,"line.");i.select(this).selectAll("path").each(function(t){var e,o,u=(t.mlw+1||a.width+1)-1,c=i.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?n.Color.defaultLine:r.color,c.style("stroke-width",u+"px").call(n.Color.fill,e),u&&(o="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(a.color)?n.Color.defaultLine:a.color,c.call(n.Color.stroke,o))})})},o.hoverPoints=function(t,e,r,i){var a,o=t.cd,s=o[0].trace,l=o[0].t,u=t.xa,c=t.ya,h="closest"===i?l.barwidth/2:l.dbar*(1-u._td._fullLayout.bargap)/2;a="closest"!==i?function(t){return t.p}:"h"===s.orientation?function(t){return t.y}:function(t){return t.x};var f,d;"h"===s.orientation?(f=function(t){return n.Fx.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},d=function(t){var e=a(t)-r;return n.Fx.inbox(e-h,e+h)}):(d=function(t){return n.Fx.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},f=function(t){var r=a(t)-e;return n.Fx.inbox(r-h,r+h)});var p=n.Fx.getDistanceFunction(i,f,d);if(n.Fx.getClosest(o,p,t),t.index!==!1){var g=o[t.index],v=g.mcc||s.marker.color,m=g.mlcc||s.marker.line.color,y=g.mlw||s.marker.line.width;return n.Color.opacity(v)?t.color=v:n.Color.opacity(m)&&y&&(t.color=m),"h"===s.orientation?(t.x0=t.x1=u.c2p(g.x,!0),t.xLabelVal=g.s,t.y0=c.c2p(a(g)-h,!0),t.y1=c.c2p(a(g)+h,!0),t.yLabelVal=g.p):(t.y0=t.y1=c.c2p(g.y,!0),t.yLabelVal=g.s,t.x0=u.c2p(a(g)-h,!0),t.x1=u.c2p(a(g)+h,!0),t.xLabelVal=g.p),g.tx&&(t.text=g.tx),n.ErrorBars.hoverInfo(g,s,t),[t]}}},{"../../plotly":336,"./attributes":381,"./layout_attributes":383,d3:53,"fast-isnumeric":58}],383:[function(t,e,r){e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],384:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":283,"../../lib/extend":316,"../scatter/attributes":403}],385:[function(t,e,r){"use strict";function n(){u=2e9}function i(){var t=u;return u=(69069*u+1)%4294967296,Math.abs(u-t)<429496729?i():u/4294967296}var a=t("../../plotly"),o=t("d3"),s=t("fast-isnumeric"),l=e.exports={};a.Plots.register(l,"box",["cartesian","symbols","oriented","box","showLegend"],{}),l.attributes=t("./attributes"),l.layoutAttributes=t("./layout_attributes"),l.supplyDefaults=function(t,e,r){function n(r,n){return a.Lib.coerce(t,e,l.attributes,r,n)}var i,o=n("y"),s=n("x");if(o&&o.length)i="v",s||n("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",n("y0")}n("orientation",i),n("line.color",(t.marker||{}).color||r),n("line.width",2),n("fillcolor",a.Color.addOpacity(e.line.color,.5)),n("whiskerwidth"),n("boxmean");var u=a.Lib.coerce2(t,e,l.attributes,"marker.outliercolor"),c=n("marker.line.outliercolor"),h=u||c?n("boxpoints","suspectedoutliers"):n("boxpoints");h&&(n("jitter","all"===h?.3:0),n("pointpos","all"===h?-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"===h&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")))},l.supplyLayoutDefaults=function(t,e,r){function n(r,n){return a.Lib.coerce(t,e,l.layoutAttributes,r,n)}for(var i,o=0;oo;++o)l=n[o],t[o]={pos:l},p[o]=l-i,d[o]=[];for(p.push(n[h-1]+i),o=0;f>o;++o)c=e[o],s(c)&&(u=a.Lib.findBin(r[o],p),u>=0&&f>u&&d[u].push(c));return d}function i(t,e){var r,n,i,o;for(o=0;o1,v=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(g?t.numboxes:1),m=g?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-u.boxgap):0,y=v*p.whiskerwidth;return p.visible!==!0||r.emptybox?void o.select(this).remove():("h"===p.orientation?(s=d,l=f):(s=f,l=d),r.bPos=m,r.bdPos=v,n(),o.select(this).selectAll("path.box").data(a.Lib.identity).enter().append("path").attr("class","box").each(function(t){var e=s.c2p(t.pos+m,!0),r=s.c2p(t.pos+m-v,!0),n=s.c2p(t.pos+m+v,!0),i=s.c2p(t.pos+m-y,!0),u=s.c2p(t.pos+m+y,!0),c=l.c2p(t.q1,!0),h=l.c2p(t.q3,!0),f=a.Lib.constrain(l.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),d=l.c2p(p.boxpoints===!1?t.min:t.lf,!0),g=l.c2p(p.boxpoints===!1?t.max:t.uf,!0);"h"===p.orientation?o.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+d+"M"+h+","+e+"H"+g+(0===p.whiskerwidth?"":"M"+d+","+i+"V"+u+"M"+g+","+i+"V"+u)):o.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+d+"M"+e+","+h+"V"+g+(0===p.whiskerwidth?"":"M"+i+","+d+"H"+u+"M"+i+","+g+"H"+u))}),p.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,o,s,l,u,f="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),d=(t.q3-t.q1)*h,g=[],y=0;if(p.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(a.Drawing.translatePoints,f,d),void(p.boxmean&&o.select(this).selectAll("path.mean").data(a.Lib.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=s.c2p(t.pos+m,!0),r=s.c2p(t.pos+m-v,!0),n=s.c2p(t.pos+m+v,!0),i=l.c2p(t.mean,!0),a=l.c2p(t.mean-t.sd,!0),u=l.c2p(t.mean+t.sd,!0);"h"===p.orientation?o.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+a+","+e+"L"+i+","+r+"L"+u+","+e+"Z")):o.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+a+"L"+r+","+i+"L"+e+","+u+"Z"))})))})},l.style=function(t){var e=o.select(t).selectAll("g.trace.boxes");e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;o.select(this).selectAll("path.box").style("stroke-width",r+"px").call(a.Color.stroke,e.line.color).call(a.Color.fill,e.fillcolor),o.select(this).selectAll("path.mean").style({"stroke-width":r,"stroke-dasharray":2*r+"px,"+r+"px"}).call(a.Color.stroke,e.line.color),o.select(this).selectAll("g.points path").call(a.Drawing.pointStyle,e)})},l.hoverPoints=function(t,e,r,n){var i,o,s,l,u,c,h,f,d,p,g=t.cd,v=g[0].trace,m=g[0].t,y=t.xa,b=t.ya,x=[];if(l="closest"===n?2.5*m.bdPos:m.bdPos,"h"===v.orientation?(i=function(t){return a.Fx.inbox(t.min-e,t.max-e)},o=function(t){var e=t.pos+m.bPos-r;return a.Fx.inbox(e-l,e+l)},u="y",c=b,d="x",p=y):(i=function(t){var r=t.pos+m.bPos-e;return a.Fx.inbox(r-l,r+l)},o=function(t){return a.Fx.inbox(t.min-r,t.max-r)},u="x",c=y,d="y",p=b),s=a.Fx.getDistanceFunction(n,i,o),a.Fx.getClosest(g,s,t),t.index!==!1){var _=g[t.index],w=v.line.color,k=(v.marker||{}).color;a.Color.opacity(w)&&v.line.width?t.color=w:a.Color.opacity(k)&&v.boxpoints?t.color=k:t.color=v.fillcolor,t[u+"0"]=c.c2p(_.pos+m.bPos-m.bdPos,!0),t[u+"1"]=c.c2p(_.pos+m.bPos+m.bdPos,!0),h=a.Axes.tickText(c,c.c2l(_.pos),"hover").text,t[u+"LabelVal"]=_.pos;var A,M,L={},T=["med","min","q1","q3","max"];v.boxmean&&T.push("mean"),v.boxpoints&&[].push.apply(T,["lf","uf"]);for(var E=0;El&&(e.z=u.slice(0,l)),o("locationmode"),o("text"),o("marker.line.color"),o("marker.line.width"),n.Colorscale.handleDefaults(t,e,a,o,{prefix:"",cLetter:"z"}),void o("hoverinfo",1===a._dataLength?"location+z+text":void 0)):void(e.visible=!1)):void(e.visible=!1)}},{"../../plotly":336,"./":389}],389:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"choropleth",["geo","noOpacity"],{}),i.attributes=t("./attributes"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Colorbar.traceColorbar,i.calc=function(t,e){n.Colorscale.calc(e,e.z,"","z")}},{"../../plotly":336,"./attributes":387,"./defaults":388}],390:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return i.Axes.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var a="all"===n?i.Choropleth.attributes.hoverinfo.flags:n.split("+"),o=-1!==a.indexOf("name"),s=-1!==a.indexOf("location"),l=-1!==a.indexOf("z"),u=-1!==a.indexOf("text"),c=!o&&s;return function(t){var n=[];c?t.nameLabel=t.id:(o&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("
")}}var i=t("../../plotly"),a=t("d3"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/array_to_calc_item"),u=t("../../constants/geo_constants"),c=e.exports={};c.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,u=o(t,e),c=(t.marker||{}).line||{},h=0;a>h;h++)r=s(t.locationmode,i[h],u),void 0!==r&&(r.z=t.z[h],void 0!==t.text&&(r.tx=t.text[h]),l(c.color,r,"mlc",h),l(c.width,r,"mlw",h),n.push(r));return n.length>0&&(n[0].trace=t),n},c.plot=function(t,e,r){var o,s=t.framework,l=t.topojson,h=s.select("g.choroplethlayer"),f=s.select("g.baselayer"),d=s.select("g.baselayeroverchoropleth"),p=u.baseLayersOverChoropleth;h.selectAll("*").remove(),d.selectAll("*").remove();var g=h.selectAll("g.trace.scatter").data(e);g.enter().append("g").attr("class","trace choropleth"),g.each(function(e){function r(e){if(t.showHover){var r=t.projection(e.properties.ct);s(e),i.Fx.loneHover({x:r[0],y:r[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()})}}if(e.visible===!0){var o=c.calcGeoJSON(e,l),s=n(t,e);a.select(this).selectAll("path.choroplethlocation").data(o).enter().append("path").attr("class","choroplethlocation").on("mouseover",r).on("mouseout",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r)}});for(var v=0;vt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function o(t){var e,r,n,i,o,s,l,u,c,h=t[0].z,f=h.length,d=h[0].length,p=2===f||2===d;for(r=0;f-1>r;r++)for(i=[],0===r&&(i=i.concat(k)),r===f-2&&(i=i.concat(A)),e=0;d-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(M)),e===d-2&&(n=n.concat(L)),o=e+","+r,s=[[h[r][e],h[r][e+1]],[h[r+1][e],h[r+1][e+1]]],c=0;cv;v++){if(o>20?(o=E[o][(s[0]||s[1])<0?0:1],t.crossings[a]=C[o]):delete t.crossings[a],s=T[o],!s){console.log("found bad marching index",o,e,t.level);break}if(l.push(f(t,e,s)),e[0]+=s[0],e[1]+=s[1],c(l[l.length-1],l[l.length-2])&&l.pop(),a=e.join(","),a===i&&s.join(",")===d||r&&(s[0]&&(e[0]<0||e[0]>g-2)||s[1]&&(e[1]<0||e[1]>p-2)))break;o=t.crossings[a]}1e4===v&&console.log("Infinite loop in contour?");var m,y,b,x,_,w,k,A=c(l[0],l[l.length-1]),M=0,L=.2*t.smoothing,S=[],z=0;for(v=1;v=z;v--)if(m=S[v],P>m){for(b=0,y=v-1;y>=z&&m+S[y]b&&m+S[b]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&console.log("Infinite loop in contour?")}}function u(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==k.indexOf(t)?i=1:-1!==M.indexOf(t)?n=1:-1!==A.indexOf(t)?i=-1:n=-1,[n,i]}function c(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function h(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function f(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}function d(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function p(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=v(t,r);e?_.select(this).attr("d",e).style("stroke","none"):_.select(this).remove()})}function v(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,u,c,h,f=t.edgepaths.length||t.z[0][0]l;l++){if(!o){console.log("missing end?",d,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),c=0;c=0&&(s=v,u=c):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-v[1])<.01&&(v[0]-o[0])*(s[0]-v[0])>=0&&(s=v,u=c):console.log("endpt to newendpt is not vert. or horz.",o,s,v)}if(o=s,u>=0)break;f+="L"+s}if(u===t.edgepaths.length){console.log("unclosed perimeter path");break}d=u,g=-1===p.indexOf(d),g&&(d=p[0],f+="Z")}for(d=0;de;e++)s.push(1);for(e=0;a>e;e++)i.push(s.slice());for(e=0;e0&&(n=!0);for(var o=0;o=d))return c?e.slice(0,i):e.slice(0,i+1);if(c)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;d>l;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[d-1]-.5*e[d-2])}if(i>d){var p=u[u.length-1],g=p-u[u.length-2];for(l=d;i>l;l++)p+=g,u.push(p)}}else for(s=n||1,o=void 0===r?0:h||"category"===a.type?r:a.d2c(r),l=c?0:-.5;i>l;l++)u.push(o+s*l);return u}function s(t){return.5-.25*Math.min(1,.5*t)}function l(t,e,r){var n,i,a=1;if(Array.isArray(r))for(n=0;nn&&a>m;n++)a=c(t,e,s(a));return a>m&&console.log("interp2d didn't converge quickly",a),t}function u(t){var e,r,n,i,a,o,s,l,u=[],c={},h=[],f=t[0],d=[],p=[0,0,0],g=v.maxRowLength(t);for(r=0;rn;n++)void 0===d[n]&&(o=(void 0!==d[n-1]?1:0)+(void 0!==d[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==f[n]?1:0),o?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===d.length-1&&o++,4>o&&(c[[r,n]]=[r,n,o]),u.push([r,n,o])):h.push([r,n]));for(;h.length;){for(s={},l=!1,a=h.length-1;a>=0;a--)i=h[a],r=i[0],n=i[1],o=((c[[r-1,n]]||p)[2]+(c[[r+1,n]]||p)[2]+(c[[r,n-1]]||p)[2]+(c[[r,n+1]]||p)[2])/20,o&&(s[i]=[r,n,o],h.splice(a,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}function c(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,g,v=0;for(o=0;os;s++)l=y[s],u=t[i+l[0]],u&&(c=u[a+l[1]],void 0!==c&&(0===f?p=g=c:(p=Math.min(p,c),g=Math.max(g,c)),h++,f+=c));if(0===h)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=f/h,void 0===d?4>h&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*d,g>p&&(v=Math.max(v,Math.abs(t[i][a]-d)/(g-p))))}return v}function h(t,e,r){function n(t,e){var r=e.length-2,n=f.Lib.constrain(f.Lib.findBin(t,e),0,r),i=e[n],a=e[n+1],o=f.Lib.constrain(n+(t-i)/(a-i)-.5,0,r),s=Math.round(o),l=Math.abs(o-s);return o&&o!==r&&l?{bin0:s,frac:l,bin1:Math.round(s+l/(o-s))}:{bin0:s,bin1:s,frac:0}}function i(t,e){if(void 0!==t){var r=G((t-M)/(L-M));return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),rt+=e,nt+=r[0]*e,it+=r[1]*e,at+=r[2]*e,r}return[0,0,0,0]}function a(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}function o(t,e,r,n){var a=t[r.bin0];if(void 0===a)return i(void 0,1);var o,s=t[r.bin1],l=e[r.bin0],u=e[r.bin1],c=s-a||0,h=l-a||0;return o=void 0===s?void 0===u?0:void 0===l?2*(u-a):2*(2*u-l-a)/3:void 0===u?void 0===l?0:2*(2*a-s-l)/3:void 0===l?2*(2*u-s-a)/3:u+a-s-l,i(a+r.frac*c+n.frac*(h+r.frac*o))}f.Lib.markTime("in Heatmap.plot");var s=r[0].trace,l=s.uid,u=e.x(),c=e.y(),h=t._fullLayout,g="hm"+l,m="cb"+l;if(h._paper.selectAll(".contour"+l).remove(),s.visible!==!0)return h._paper.selectAll("."+g).remove(),void h._paper.selectAll("."+m).remove();var y,b,x,_,w,k,A=r[0].z,M=s.zmin,L=s.zmax,T=f.Colorscale.getScale(s.colorscale),E=r[0].x,C=r[0].y,S=f.Plots.traceIs(s,"contour"),z=S?"best":s.zsmooth,P=A.length,j=v.maxRowLength(A),O=!1,I=!1;for(k=0;void 0===y&&k0;)b=u.c2p(E[k]),k--;for(y>b&&(x=b,b=y,y=x,O=!0),k=0;void 0===_&&k0;)w=c.c2p(C[k]),k--;if(_>w&&(x=_,_=w,w=x,I=!0),S&&(E=r[0].xfill,C=r[0].yfill),"fast"!==z){var D="best"===z?0:.5;y=Math.max(-D*u._length,y),b=Math.min((1+D)*u._length,b),_=Math.max(-D*c._length,_),w=Math.min((1+D)*c._length,w)}var R=Math.round(b-y),F=Math.round(w-_);if(!(0>=R||0>=F)){var N,B;"fast"===z?(N=j,B=P):(N=R,B=F);var U=document.createElement("canvas");U.width=N,U.height=B;var V,q,H=U.getContext("2d"),G=d.scale.linear().domain(T.map(function(t){return t[0]})).range(T.map(function(t){var e=p(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===z?(V=O?function(t){return j-1-t}:f.Lib.identity,q=I?function(t){return P-1-t}:f.Lib.identity):(V=function(t){return f.Lib.constrain(Math.round(u.c2p(E[t])-y),0,R)},q=function(t){return f.Lib.constrain(Math.round(c.c2p(C[t])-_),0,F)}),f.Lib.markTime("done init png");var Y,W,X,Z,Q,$,K=q(0),J=[K,K],tt=O?0:1,et=I?0:1,rt=0,nt=0,it=0,at=0;if(z){var ot=0,st=new Uint8Array(R*F*4);if("best"===z){var lt,ut,ct,ht=new Array(E.length),ft=new Array(C.length),dt=new Array(R);for(k=0;kk;k++)dt[k]=n(k,ht);for(W=0;F>W;W++)for(lt=n(W,ft),ut=A[lt.bin0],ct=A[lt.bin1],k=0;R>k;k++,ot+=4)$=o(ut,ct,dt[k],lt),a(st,ot,$)}else for(W=0;P>W;W++)for(Q=A[W],J=q(W),k=0;j>k;k++)$=i(Q[k],1),ot=4*(J*R+V(k)),a(st,ot,$);var pt=H.createImageData(R,F);pt.data.set(st),H.putImageData(pt,0,0)}else for(W=0;P>W;W++)if(Q=A[W],J.reverse(),J[et]=q(W+1),J[0]!==J[1]&&void 0!==J[0]&&void 0!==J[1])for(X=V(0),Y=[X,X],k=0;j>k;k++)Y.reverse(),Y[tt]=V(k+1),Y[0]!==Y[1]&&void 0!==Y[0]&&void 0!==Y[1]&&(Z=Q[k],$=i(Z,(Y[1]-Y[0])*(J[1]-J[0])),H.fillStyle="rgba("+$.join(",")+")",H.fillRect(Y[0],J[0],Y[1]-Y[0],J[1]-J[0]));f.Lib.markTime("done filling png"),nt=Math.round(nt/rt),it=Math.round(it/rt),at=Math.round(at/rt);var gt=p("rgb("+nt+","+it+","+at+")");t._hmpixcount=(t._hmpixcount||0)+rt,t._hmlumcount=(t._hmlumcount||0)+rt*gt.getLuminance(),h._paper.selectAll("."+g).remove(),e.plot.select(".maplayer").append("svg:image").classed(g,!0).datum(r[0]).attr({xmlns:"http://www.w3.org/2000/svg","xlink:xlink:href":U.toDataURL("image/png"),height:F,width:R,x:y,y:_,preserveAspectRatio:"none"}),f.Lib.markTime("done showing png")}}var f=t("../../plotly"),d=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),v=e.exports={};f.Plots.register(v,"heatmap",["cartesian","2dMap"],{}),v.attributes=t("./attributes"),v.supplyDefaults=function(t,e,r,n){function i(r,n){return f.Lib.coerce(t,e,v.attributes,r,n)}var a=f.Plots.traceIs(e,"contour");if(a||i("zsmooth"),f.Plots.traceIs(e,"histogram")){if(f.Histogram.supplyDefaults(t,e),e.visible===!1)return}else{var o=v.handleXYZDefaults(t,e,i);if(!o)return void(e.visible=!1);i("text");var s=v.hasColumns(e);s||i("transpose"),i("connectgaps",s&&(a||e.zsmooth!==!1))}a&&"none"===(e.contours||{}).coloring||f.Colorscale.handleDefaults(t,e,n,i,{prefix:"",cLetter:"z"})},v.handleXYZDefaults=function(t,e,r){var a,o,s=r("z");if(void 0===s||!s.length)return 0;if(v.hasColumns(t)){if(a=r("x"),o=r("y"),!a||!o)return 0}else if(a=n("x",r),o=n("y",r),!i(s))return 0;return e.z.length},v.hasColumns=function(t){return!Array.isArray(t.z[0])},v.convertColumnXYZ=function(t,e,r){var n,i=t.x.slice(),a=t.y.slice(),o=t.z,s=t.text,l=Math.min(i.length,a.length,o.length),u=void 0!==s&&!Array.isArray(s[0]);for(ln;n++)i[n]=e.d2c(i[n]),a[n]=r.d2c(a[n]);var c,h,d,p=f.Lib.distinctVals(i),g=p.vals,v=f.Lib.distinctVals(a),m=v.vals,y=f.Lib.init2dArray(m.length,g.length);for(u&&(d=f.Lib.init2dArray(m.length,g.length)),n=0;l>n;n++)c=f.Lib.findBin(i[n]+p.minDiff/2,g),h=f.Lib.findBin(a[n]+v.minDiff/2,m),y[h][c]=o[n],u&&(d[h][c]=s[n]);t.x=g,t.y=m,t.z=y,u&&(t.text=d)},v.calc=function(t,e){function r(t){x=e._input.zsmooth=e.zsmooth=!1,f.Lib.notifier("cannot fast-zsmooth: "+t)}f.Lib.markTime("start convert x&y");var n,i,a,s,c,h,d,p,g=f.Axes.getFromId(t,e.xaxis||"x"),m=f.Axes.getFromId(t,e.yaxis||"y"),y=f.Plots.traceIs(e,"contour"),b=f.Plots.traceIs(e,"histogram"),x=y?"best":e.zsmooth;if(g._minDtick=0,m._minDtick=0,f.Lib.markTime("done convert x&y"),b){var _=f.Histogram.calc2d(t,e);n=_.x,i=_.x0,a=_.dx,s=_.y,c=_.y0,h=_.dy,d=_.z}else v.hasColumns(e)&&v.convertColumnXYZ(e,g,m),n=e.x?g.makeCalcdata(e,"x"):[],s=e.y?m.makeCalcdata(e,"y"):[],i=e.x0||0,a=e.dx||1,c=e.y0||0,h=e.dy||1,d=v.cleanZ(e),(y||e.connectgaps)&&(e._emptypoints=u(d),e._interpz=l(d,e._emptypoints,e._interpz));if("fast"===x)if("log"===g.type||"log"===m.type)r("log axis found");else if(!b){if(n.length){var w=(n[n.length-1]-n[0])/(n.length-1),k=Math.abs(w/100);for(p=0;pk){r("x scale is not linear");break}}if(s.length&&"fast"===x){var A=(s[s.length-1]-s[0])/(s.length-1),M=Math.abs(A/100);for(p=0;pM){r("y scale is not linear");break}}}var L=v.maxRowLength(d),T="scaled"===e.xtype?"":e.x,E=o(e,T,i,a,L,g),C="scaled"===e.ytype?"":e.y,S=o(e,C,c,h,d.length,m);f.Axes.expand(g,E),f.Axes.expand(m,S);var z={x:E,y:S,z:d};if(f.Colorscale.calc(e,d,"","z"),y&&e.contours&&"heatmap"===e.contours.coloring){var P="contour"===e.type?"heatmap":"histogram2d";z.xfill=o(P,T,i,a,L,g),z.yfill=o(P,C,c,h,d.length,m)}return[z]},v.cleanZ=function(t){var e,r,n,i,o,s,l=t.z;if(t.transpose){for(e=0,o=0;oo;o++)for(r=n(l,o),u[o]=new Array(r),s=0;r>s;s++)u[o][s]=a(i(l,o,s));return u};var m=.01,y=[[-1,0],[1,0],[0,-1],[0,1]];v.maxRowLength=function(t){for(var e=0,r=0;rs||s>=v[0].length||0>l||l>v.length)return}else{if(f.Fx.inbox(e-p[0],e-p[p.length-1])>f.Fx.MAXDIST||f.Fx.inbox(r-g[0],r-g[g.length-1])>f.Fx.MAXDIST)return;if(i){y=[2*p[0]-p[1]];for(var _=1;_i;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}var i=t("../../plotly"),a=t("fast-isnumeric"),o=e.exports={};i.Plots.register(i.Bars,"histogram",["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],{}),i.Plots.register(i.Heatmap,"histogram2d",["cartesian","2dMap","histogram"],{}),o.attributes=t("./attributes"),o.supplyDefaults=function(t,e){function r(r,n){return i.Lib.coerce(t,e,o.attributes,r,n)}var n,a=["x"],s=r("x"),l=r("y");if(i.Plots.traceIs(e,"2dMap")){if(!(s&&s.length&&l&&l.length))return void(e.visible=!1);n=r("z")||r("marker.color"),a=["x","y"]}else{var u=r("orientation",l&&!s?"h":"v"),c=e["v"===u?"x":"y"];if(!c||!c.length)return void(e.visible=!1);"h"===u&&(a=["y"]),n=e["h"===u?"x":"y"]}n&&r("histfunc"),r("histnorm"),a.forEach(function(n){var a=i.Lib.coerce(t,e,o.attributes,n+"bins.start"),s=i.Lib.coerce(t,e,o.attributes,n+"bins.end"),l=a&&s?r("autobin"+n,!1):r("autobin"+n);r(l?"nbins"+n:n+"bins.size")})};var s={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,n){var i=n[e];return a(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,n,i){var o=n[e];return a(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min:function(t,e,r,n){var i=n[e];if(a(i)){if(i=Number(i),!a(r[t]))return r[t]=i,i;if(r[t]>i)return r[t]=i,i-r[t]}return 0},max:function(t,e,r,n){var i=n[e];if(a(i)){if(i=Number(i),!a(r[t]))return r[t]=i,i;if(r[t]i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;i>a;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;i>a;a++)t[a]*=r[a]/e}};o.calc=function(t,e){if(e.visible===!0){var r,o=[],u=[],c=i.Axes.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),h="h"===e.orientation?"y":"x",f={x:"y",y:"x"}[h],d=c.makeCalcdata(e,h);e["autobin"+h]===!1&&h+"bins"in e||(e[h+"bins"]=i.Axes.autoBin(d,c,e["nbins"+h]),e._input[h+"bins"]=e[h+"bins"]);var p,g,v,m,y=e[h+"bins"],b="string"==typeof y.size,x=b?[]:y,_=[],w=[],k=0,A=e.histnorm,M=e.histfunc,L=-1!==A.indexOf("density"),T="max"===M||"min"===M,E=T?null:0,C=s.count,S=l[A],z=!1;for(Array.isArray(e[f])&&"count"!==M&&(m=e[f],z="avg"===M,C=s[M]),r=y.start,g=y.end+(y.start-i.Axes.tickIncrement(y.start,y.size))/1e6;g>r&&o.length<5e3;)p=i.Axes.tickIncrement(r,y.size),o.push((r+p)/2),u.push(E),b&&x.push(r),L&&_.push(1/(p-r)),z&&w.push(0),r=p;var P=u.length;for(r=0;r=0&&P>v&&(k+=C(v,r,u,m,w));z&&(k=n(u,w)),S&&S(u,k,_);var j=Math.min(o.length,u.length),O=[],I=0,D=j-1;for(r=0;j>r;r++)if(u[r]){I=r;break}for(r=j-1;r>I;r--)if(u[r]){D=r;break}for(r=I;D>=r;r++)a(o[r])&&a(u[r])&&O.push({p:o[r],s:u[r],b:0});return O}},o.calc2d=function(t,e){var r,a,o,u,c,h,f=i.Axes.getFromId(t,e.xaxis||"x"),d=e.x?f.makeCalcdata(e,"x"):[],p=i.Axes.getFromId(t,e.yaxis||"y"),g=e.y?p.makeCalcdata(e,"y"):[],v=Math.min(d.length,g.length);d.length>v&&d.splice(v,d.length-v),g.length>v&&g.splice(v,g.length-v),i.Lib.markTime("done convert data"),!e.autobinx&&"xbins"in e||(e.xbins=i.Axes.autoBin(d,f,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.Axes.autoBin(g,p,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),i.Lib.markTime("done autoBin"),c=[];var m,y,b=[],x=[],_="string"==typeof e.xbins.size?[]:e.xbins,w="string"==typeof e.xbins.size?[]:e.ybins,k=0,A=[],M=e.histnorm,L=e.histfunc,T=-1!==M.indexOf("density"),E="max"===L||"min"===L,C=E?null:0,S=s.count,z=l[M],P=!1,j=[],O=[],I="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";I&&"count"!==L&&(P="avg"===L,S=s[L]);var D=e.xbins,R=D.end+(D.start-i.Axes.tickIncrement(D.start,D.size))/1e6;for(h=D.start;R>h;h=i.Axes.tickIncrement(h,D.size))b.push(C),Array.isArray(_)&&_.push(h),P&&x.push(0);Array.isArray(_)&&_.push(h);var F=b.length;for(r=e.xbins.start,a=(h-r)/F,r+=a/2,D=e.ybins,R=D.end+(D.start-i.Axes.tickIncrement(D.start,D.size))/1e6,h=D.start;R>h;h=i.Axes.tickIncrement(h,D.size))c.push(b.concat()),Array.isArray(w)&&w.push(h),P&&A.push(x.concat());Array.isArray(w)&&w.push(h);var N=c.length;for(o=e.ybins.start,u=(h-o)/N,o+=u/2,T&&(j=b.map(function(t,e){return Array.isArray(_)?1/(_[e+1]-_[e]):1/a}),O=c.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/u})),i.Lib.markTime("done making bins"),h=0;v>h;h++)m=i.Lib.findBin(d[h],_),y=i.Lib.findBin(g[h],w),m>=0&&F>m&&y>=0&&N>y&&(k+=S(m,h,c[y],I,A[y]));if(P)for(y=0;N>y;y++)k+=n(c[y],A[y]);if(z)for(y=0;N>y;y++)z(c[y],k,j,O[y]);return i.Lib.markTime("done binning"),{x:d,x0:r,dx:a,y:g,y0:o,dy:u,z:c}}},{"../../plotly":336,"./attributes":395,"fast-isnumeric":58}],397:[function(t,e,r){var n=t("../../components/colorscale/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:{valType:"number",min:0,max:1,dflt:1},flatshading:{valType:"boolean",dflt:!1},contour:{show:{valType:"boolean",dflt:!1},color:{valType:"color",dflt:"#000"},width:{valType:"number",min:1,max:16,dflt:2}},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":287}],398:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexColor?(this.color=t.vertexColor[0],p.vertexColors=a(t.vertexColor)):t.faceColor?(this.color=t.faceColor[0],p.cellColors=a(t.faceColor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":329,"alpha-shape":23,"convex-hull":42,"delaunay-triangulate":54,"gl-mesh3d":91,tinycolor2:213}],399:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}function s(t){var e=t.map(function(t){var e=o(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var l=s(["x","y","z"]),u=s(["i","j","k"]);return l?(u&&u.forEach(function(t){for(var e=0;e=1)return u;var c=i+1/(2*Math.tan(a)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(i*i+s/2)+i)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/i,p=d+1/(2*Math.tan(a)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>f.scale?v:f;return u.scale<1&&m.scale>u.scale?m:u}function l(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return 0>r&&(i*=-1),0>n&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function u(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,f,d,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),b=g-v;if(b*h>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*h>0?(s=a.cyFinal+u(a.px0[1],a.px1[1]),b=s-v-t.labelExtraY,b*h>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-p.indexOf(t)),f=a.cxFinal+l(a.px0[0],a.px1[0]),d=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*c>0&&(t.labelExtraX+=d)))}var a,o,s,l,u,c,h,f,d,p,g,v,m;for(o=0;2>o;o++)for(s=o?r:n,u=o?Math.max:Math.min,h=o?1:-1,a=0;2>a;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(s),d=t[1-o][a],p=d.concat(f),v=[],g=0;gu&&(u=s.pull[a]);o.r=Math.min(r/f(s.tilt,Math.sin(l),s.depth),n/f(s.tilt,Math.cos(l),s.depth))/(2+2*u),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;ah.vTotal/2?1:0)}function f(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var d=t("../../plotly"),p=t("d3"),g=t("fast-isnumeric"),v=t("tinycolor2"),m=e.exports={};d.Plots.register(m,"pie",["pie","showLegend"],{}),m.attributes=t("./attributes"),m.supplyDefaults=function(t,e,r,n){function i(r,n){return d.Lib.coerce(t,e,m.attributes,r,n)}var a=d.Lib.coerceFont,o=i("values");if(!Array.isArray(o)||!o.length)return void(e.visible=!1);var s=i("labels");Array.isArray(s)||(i("label0"),i("dlabel"));var l=i("marker.line.width");l&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var c=i("text"),h=i("textinfo",Array.isArray(c)?"text+percent":"percent");if(i("hoverinfo",1===n._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var f=i("textposition"),p=Array.isArray(f)||"auto"===f,g=p||"inside"===f,v=p||"outside"===f;if(g||v){var y=a(i,"textfont",n.font);g&&a(i,"insidetextfont",y),v&&a(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")},m.layoutAttributes={hiddenlabels:{valType:"data_array"}},m.supplyLayoutDefaults=function(t,e){function r(r,n){return d.Lib.coerce(t,e,m.layoutAttributes,r,n)}r("hiddenlabels")},m.calc=function(t,e){var r,o,s,l,u,c,h=e.values,f=e.labels,p=[],m=t._fullLayout,y=m._piecolormap,b={},x=!1,_=0,w=m.hiddenlabels||[];if(e.dlabel)for(f=new Array(h.length),r=0;ro||(s=f[r],(void 0===s||""===s)&&(s=r),s=String(s),void 0===b[s]&&(b[s]=!0,l=v(e.marker.colors[r]),l.isValid()?(l=d.Color.addOpacity(l,l.getAlpha()),y[s]||(y[s]=l)):y[s]?l=y[s]:(l=!1,x=!0),u=-1!==w.indexOf(s),u||(_+=o),p.push({v:o,label:s,color:l,i:r,hidden:u}))));if(e.sort&&p.sort(function(t,e){return e.v-t.v}),x)for(r=0;r")}return p};var y;m.plot=function(t,e){var r=t._fullLayout;c(e,r._size);var a=r._pielayer.selectAll("g.trace").data(e);a.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),a.exit().remove(),a.order(),a.each(function(e){var a=p.select(this),c=e[0],f=c.trace,g=0,v=(f.depth||0)*c.r*Math.sin(g)/2,m=f.tiltaxis||0,y=m*Math.PI/180,b=[v*Math.sin(y),v*Math.cos(y)],x=c.r*Math.cos(g),_=a.selectAll("g.part").data(f.tilt?["top","sides"]:["top"]);_.enter().append("g").attr("class",function(t){return t+" part"}),_.exit().remove(),_.order(),h(e),a.selectAll(".top").each(function(){var a=p.select(this).selectAll("g.slice").data(e);a.enter().append("g").classed("slice",!0),a.exit().remove();var h=[[[],[]],[[],[]]],g=!1;a.each(function(e){function a(){var r=t._fullLayout,a=t._fullData[f.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&r.hovermode!==!1&&"none"!==s&&s){var l=o(e,c),u=y+e.pxmid[0]*(1-l),h=_+e.pxmid[1]*(1-l),p=[];-1!==s.indexOf("label")&&p.push(e.label),a.text&&a.text[e.i]&&-1!==s.indexOf("text")&&p.push(a.text[e.i]),-1!==s.indexOf("value")&&p.push(i(e.v)),-1!==s.indexOf("percent")&&p.push(n(e.v/c.vTotal)),d.Fx.loneHover({x0:u-l*c.r,x1:u+l*c.r,y:h,text:p.join("
"),name:-1!==s.indexOf("name")?a.name:void 0,color:e.color,idealAlign:e.pxmid[0]<0?"left":"right"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()}),A=!0}}function u(){A&&(d.Fx.loneUnhover(r._hoverlayer.node()),A=!1)}function v(t,r,n,i){return"a"+i*c.r+","+i*x+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void p.select(this).selectAll("path,g").remove();h[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var y=c.cx+b[0],_=c.cy+b[1],w=p.select(this),k=w.selectAll("path.surface").data([e]),A=!1;if(k.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),w.select("path.textline").remove(),w.on("mouseover",a).on("mouseout",u),f.pull){var M=+(Array.isArray(f.pull)?f.pull[e.i]:f.pull)||0;M>0&&(y+=M*e.pxmid[0],_+=M*e.pxmid[1])}e.cxFinal=y,e.cyFinal=_;var L=f.hole;if(e.v===c.vTotal){var T="M"+(y+e.px0[0])+","+(_+e.px0[1])+v(e.px0,e.pxmid,!0,1)+v(e.pxmid,e.px0,!0,1)+"Z";L?k.attr("d","M"+(y+L*e.px0[0])+","+(_+L*e.px0[1])+v(e.px0,e.pxmid,!1,L)+v(e.pxmid,e.px0,!1,L)+"Z"+T):k.attr("d",T); -}else{var E=v(e.px0,e.px1,!0,1);if(L){var C=1-L;k.attr("d","M"+(y+L*e.px1[0])+","+(_+L*e.px1[1])+v(e.px1,e.px0,!1,L)+"l"+C*e.px0[0]+","+C*e.px0[1]+E+"Z")}else k.attr("d","M"+y+","+_+"l"+e.px0[0]+","+e.px0[1]+E+"Z")}var S=Array.isArray(f.textposition)?f.textposition[e.i]:f.textposition,z=w.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);z.enter().append("g").classed("slicetext",!0),z.exit().remove(),z.each(function(){var t=p.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.Drawing.font,"outside"===S?f.outsidetextfont:f.insidetextfont).call(d.util.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,n=d.Drawing.bBox(t.node());"outside"===S?r=l(n,e):(r=s(n,e,c),"auto"===S&&r.scale<1&&(t.call(d.Drawing.font,f.outsidetextfont),(f.outsidetextfont.family!==f.insidetextfont.family||f.outsidetextfont.size!==f.insidetextfont.size)&&(t.attr({"data-bb":""}),n=d.Drawing.bBox(t.node())),r=l(n,e)));var i=y+e.pxmid[0]*r.rCenter+(r.x||0),a=_+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=a-n.height/2,e.yLabelMid=a,e.yLabelMax=a+n.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),t.attr("transform","translate("+i+","+a+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(n.left+n.right)/2+","+-(n.top+n.bottom)/2+")")})}),g&&u(h,f),a.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=p.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.Color.stroke,f.outsidetextfont.color).attr({"stroke-width":Math.min(2,f.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){a.selectAll("tspan").each(function(){var t=p.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},m.style=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,n=p.select(this);n.style({opacity:r.opacity}),n.selectAll(".top path.surface").each(function(t){p.select(this).call(m.styleOne,t,r)})})},m.styleOne=function(t,e,r){var n=r.marker.line.color;Array.isArray(n)&&(n=n[e.i]||d.Color.defaultLine);var i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i,fill:e.color}).call(d.Color.stroke,n)}},{"../../plotly":336,"./attributes":401,d3:53,"fast-isnumeric":58,tinycolor2:213}],403:[function(t,e,r){var n=t("../../plotly");e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:n.Drawing.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../plotly":336}],404:[function(t,e,r){"use strict";function n(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}var i=t("../../plotly"),a=t("d3"),o=t("fast-isnumeric"),s=e.exports={};i.Plots.register(s,"scatter",["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],{}),s.PTS_LINESONLY=20,s.attributes=t("./attributes"),s.handleXYDefaults=function(t,e,r){var n,i=r("x"),a=r("y");if(i)a?(n=Math.min(i.length,a.length),n=0;i--)if(a=t[i],"scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}},s.hasLines=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},s.hasMarkers=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},s.hasText=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},s.isBubble=function(t){return"object"==typeof t.marker&&Array.isArray(t.marker.size)},s.colorbar=function(t,e){var r=e[0].trace,n=r.marker,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),void 0===n||!n.showscale)return void i.Plots.autoMargin(t,s);var l=i.Colorscale.getScale(n.colorscale),u=n.color,c=n.cmin,h=n.cmax;o(c)||(c=i.Lib.aggNums(Math.min,null,u)),o(h)||(h=i.Lib.aggNums(Math.max,null,u));var f=e[0].t.cb=i.Colorbar(t,s);f.fillcolor(a.scale.linear().domain(l.map(function(t){return c+t[0]*(h-c)})).range(l.map(function(t){return t[1]}))).filllevels({start:c,end:h,size:(h-c)/254}).options(n.colorbar)(),i.Lib.markTime("done colorbar")},s.getBubbleSizeFn=function(t){var e=t.marker,r=e.sizeref||1,n=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return o(e)&&e>0?Math.max(e,n):0}},s.calc=function(t,e){var r=i.Axes.getFromId(t,e.xaxis||"x"),n=i.Axes.getFromId(t,e.yaxis||"y");i.Lib.markTime("in Scatter.calc");var a=r.makeCalcdata(e,"x");i.Lib.markTime("finished convert x");var l=n.makeCalcdata(e,"y");i.Lib.markTime("finished convert y");var u,c,h,f=Math.min(a.length,l.length);r._minDtick=0,n._minDtick=0,a.length>f&&a.splice(f,a.length-f),l.length>f&&l.splice(f,l.length-f);var d={padded:!0},p={padded:!0};if(s.hasMarkers(e)){if(u=e.marker,c=u.size,Array.isArray(c)){var g={type:"linear"};i.Axes.setConvert(g),c=g.makeCalcdata(e.marker,"size"),c.length>f&&c.splice(f,c.length-f)}var v,m=1.6*(e.marker.sizeref||1);v="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/m),3)}:function(t){return Math.max((t||0)/m,3)},d.ppad=p.ppad=Array.isArray(c)?c.map(v):v(c)}s.calcMarkerColorscales(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||a[0]===a[f-1]&&l[0]===l[f-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(d.padded=!1,d.ppad=0):d.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||a[0]===a[f-1]&&l[0]===l[f-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(p.padded=!1):p.tozero=!0,i.Lib.markTime("ready for Axes.expand"),i.Axes.expand(r,a,d),i.Lib.markTime("done expand x"),i.Axes.expand(n,l,p),i.Lib.markTime("done expand y");var y=new Array(f);for(h=0;f>h;h++)y[h]=o(a[h])&&o(l[h])?{x:a[h],y:l[h]}:{x:!1,y:!1};return void 0!==typeof c&&i.Lib.mergeArray(c,y,"ms"),t.firstscatter=!1,y},s.calcMarkerColorscales=function(t){if(s.hasMarkers(t)){var e=t.marker;i.Colorscale.hasColorscale(t,"marker")&&i.Colorscale.calc(t,e.color,"marker","c"),i.Colorscale.hasColorscale(t,"marker.line")&&i.Colorscale.calc(t,e.line.color,"marker.line","c")}},s.selectMarkers=function(t,e,r){var n=e.x(),i=e.y(),o=a.extent(n.range.map(n.l2c)),l=a.extent(i.range.map(i.l2c));r.forEach(function(t,e){var n=t[0].trace;if(s.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var a=t.filter(function(t){return t.x>=o[0]&&t.x<=o[1]&&t.y>=l[0]&&t.y<=l[1]}),u=Math.ceil(a.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;s.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var h=Math.round(c*u/3+Math.floor(c/3)*u/7.1);t.forEach(function(t){delete t.vis}),a.forEach(function(t,e){0===Math.round((e+h)%u)&&(t.vis=!0)})}}})},s.arraysToCalcdata=function(t){var e=t[0].trace,r=e.marker;if(i.Lib.mergeArray(e.text,t,"tx"),i.Lib.mergeArray(e.textposition,t,"tp"),e.textfont&&(i.Lib.mergeArray(e.textfont.size,t,"ts"),i.Lib.mergeArray(e.textfont.color,t,"tc"),i.Lib.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var n=r.line;i.Lib.mergeArray(r.opacity,t,"mo"),i.Lib.mergeArray(r.symbol,t,"mx"),i.Lib.mergeArray(r.color,t,"mc"),i.Lib.mergeArray(n.color,t,"mlc"),i.Lib.mergeArray(n.width,t,"mlw")}},s.plot=function(t,e,r){function n(t){return t.filter(function(t){return t.vis})}s.selectMarkers(t,e,r);var o=e.x(),l=e.y(),u=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);u.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2);var c,h,f,d="";u.each(function(t){var e=t[0].trace,r=e.line;if(e.visible===!0&&(s.arraysToCalcdata(t),s.hasLines(e)||"none"!==e.fill)){var n,u,p,g,v=a.select(this),m="",y="";c="tozero"===e.fill.substr(0,6)||"to"===e.fill.substr(0,2)&&!d?v.append("path").classed("js-fill",!0):null,f&&(h=f.datum(t)),f=v.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(u=i.Drawing.steps(r.shape),p=i.Drawing.steps(r.shape.split("").reverse().join(""))):u=p="spline"===r.shape?function(t){return i.Drawing.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},g=function(t){return"L"+p(t.reverse()).substr(1)};var b=s.linePoints(t,{xaxis:o,yaxis:l,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape});if(b.length){for(var x=b[0][0],_=b[b.length-1],w=_[_.length-1],k=0;k1&&v.append("path").classed("js-line",!0).attr("d",n)}c?x&&w&&("y"===e.fill.charAt(e.fill.length-1)?x[1]=w[1]=l.c2p(0,!0):x[0]=w[0]=o.c2p(0,!0),c.attr("d",m+"L"+w+"L"+x+"Z")):"tonext"===e.fill.substr(0,6)&&m&&d&&h.attr("d",m+d+"Z"),d=y}}}),u.selectAll("path:not([d])").remove(),u.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=a.select(this),u=s.hasMarkers(e),c=s.hasText(e);!u&&!c||e.visible!==!0?r.remove():(u&&r.selectAll("path.point").data(e.marker.maxdisplayed?n:i.Lib.identity).enter().append("path").classed("point",!0).call(i.Drawing.translatePoints,o,l),c&&r.selectAll("g").data(e.marker.maxdisplayed?n:i.Lib.identity).enter().append("g").append("text").call(i.Drawing.translatePoints,o,l))})},s.linePoints=function(t,e){function r(e){var r=w.c2p(t[e].x),n=k.c2p(t[e].y);return r===E||n===E?!1:[r,n]}function n(t){var e=t[0]/w._length,r=t[1]/k._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*M}function a(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var o,s,l,u,c,h,f,d,p,g,v,m,y,b,x,_,w=e.xaxis,k=e.yaxis,A=e.connectGaps,M=e.baseTolerance,L=e.linear,T=[],E=i.Axes.BADNUM,C=.2,S=new Array(t.length),z=0;for(o=0;on(h))break;l=h,y=g[0]*p[0]+g[1]*p[1],y>v?(v=y,u=h,d=!1):m>y&&(m=y,c=h,d=!0)}if(d?(S[z++]=u,l!==c&&(S[z++]=c)):(c!==s&&(S[z++]=c),l!==u&&(S[z++]=u)),S[z++]=l,o>=t.length||!h)break;S[z++]=h,s=h}}else S[z++]=u}T.push(S.slice(0,z))}return T},s.style=function(t){var e=a.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){a.select(this).selectAll("path.point").call(i.Drawing.pointStyle,t.trace||t[0].trace),a.select(this).selectAll("text").call(i.Drawing.textPointStyle,t.trace||t[0].trace)}),e.selectAll("g.trace path.js-line").call(i.Drawing.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.Drawing.fillGroupStyle)},s.getTraceColor=function(t,e){var r,n;if("lines"===t.mode)return r=t.line.color,r&&i.Color.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var a=e.mcc||(t.marker||{}).color,o=e.mlcc||((t.marker||{}).line||{}).color;return n=a&&i.Color.opacity(a)?a:o&&i.Color.opacity(o)&&(e.mlw||((t.marker||{}).line||{}).width)?o:"",n?i.Color.opacity(n)<.3?i.Color.addOpacity(n,.3):n:(r=(t.line||{}).color,r&&i.Color.opacity(r)&&s.hasLines(t)&&t.line.width?r:t.fillcolor)},s.hoverPoints=function(t,e,r,n){var a=t.cd,o=a[0].trace,l=t.xa,u=t.ya,c=function(t){var r=Math.max(3,t.mrc||0);return Math.max(Math.abs(l.c2p(t.x)-l.c2p(e))-r,1-3/r)},h=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.y)-u.c2p(r))-e,1-3/e)},f=function(t){var n=Math.max(3,t.mrc||0),i=Math.abs(l.c2p(t.x)-l.c2p(e)),a=Math.abs(u.c2p(t.y)-u.c2p(r));return Math.max(Math.sqrt(i*i+a*a)-n,1-3/n)},d=i.Fx.getDistanceFunction(n,c,h,f);if(i.Fx.getClosest(a,d,t),t.index!==!1){var p=a[t.index],g=l.c2p(p.x,!0),v=u.c2p(p.y,!0),m=p.mrc||1;return t.color=s.getTraceColor(o,p),t.x0=g-m,t.x1=g+m,t.xLabelVal=p.x,t.y0=v-m,t.y1=v+m,t.yLabelVal=p.y,p.tx?t.text=p.tx:o.text&&(t.text=o.text),i.ErrorBars.hoverInfo(p,o,t),[t]}}},{"../../plotly":336,"./attributes":403,d3:53,"fast-isnumeric":58}],405:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),a=t("../../constants/gl_markers.json"),o=t("../../lib/extend").extendFlat,s=i.line,l=i.marker,u=l.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:o({},i.text,{}),mode:o({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},line:{color:s.color,width:s.width,dash:s.dash},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:o({},l.size,{dflt:8}),sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:u.color,width:o({},u.width,{arrayOk:!1}),colorscale:u.colorscale,cauto:u.cauto,cmax:u.cmax,cmin:u.cmin,autocolorscale:u.autocolorscale,reversescale:u.reversescale}},textposition:o({},i.textposition,{dflt:"top center"}),textfont:i.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl_markers.json":309,"../../lib/extend":316,"../scatter/attributes":403}],406:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=o(e),i=new Array(t.length),a=0;as;s++){for(var l=[[0,0,0],[0,0,0]],u=0;3>u;u++)if(r[u])for(var c=0;2>c;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":294}],407:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;ni;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return w[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;e>o;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,d.Lib.identity);return a}function c(t,e){var r,n,i,c,h,f,p=[],g=t.fullSceneLayout,v=t.dataScale,m=t.dataCenter,y=g.xaxis,_=g.yaxis,w=g.zaxis,A=e.marker,M=e.line,L=e.x||[],T=e.y||[],E=e.z||[],C=L.length;for(n=0;C>n;n++)i=y.d2l(L[n])*v[0]-m[0],c=_.d2l(T[n])*v[1]-m[1],h=w.d2l(E[n])*v[2]-m[2],p[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(C),n=0;C>n;n++)f[n]=e.text;if(r={position:p,mode:e.mode,text:f},"line"in e&&(r.lineColor=b(M.color),r.lineWidth=M.width,r.lineDashes=M.dash),"marker"in e){var S=d.Scatter.getBubbleSizeFn(e);r.scatterColor=x(A,1,C),r.scatterSize=u(A.size,C,s,20,S),r.scatterMarker=u(A.symbol,C,l,"\u25cf"),r.scatterLineWidth=A.line.width,r.scatterLineColor=x(A.line,1,C),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,C),r.textSize=u(e.textfont.size,C,d.Lib.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var z=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var P=e.projection[z[n]];(r.project[n]=P.show)&&(r.projectOpacity[n]=P.opacity,r.projectScale[n]=P.scale)}r.errorBounds=k(e,v);var j=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=j.color,r.errorLineWidth=j.lineWidth,r.errorCapSize=j.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("../../plotly"),p=t("gl-line3d"),g=t("gl-scatter3d"),v=t("gl-error3d"),m=t("gl-mesh3d"),y=t("delaunay-triangulate"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../../constants/gl3d_dashes.json"),w=t("../../constants/gl_markers.json"),k=t("./calc_errors"),A=n.prototype;A.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},A.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=_.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in _&&(s=_[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=p(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&"number"==typeof t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=g(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=g(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=v(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=m(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.textMarkers),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes.json":308,"../../constants/gl_markers.json":309,"../../lib/gl_format_color":318,"../../lib/str2rgbarray":329,"../../plotly":336,"./calc_errors":406,"delaunay-triangulate":54,"gl-error3d":62,"gl-line3d":68,"gl-mesh3d":91,"gl-scatter3d":134}],408:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),a=r("y"),o=r("z");return i&&a&&o&&(n=Math.min(i.length,a.length,o.length),n=0&&s("surfacecolor",c||h);for(var f=["x","y","z"],d=0;3>d;++d){var p="projection."+f[d];s(p+".show")&&(s(p+".opacity"),s(p+".scale"))}i.ErrorBars.supplyDefaults(t,e,r,{axis:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"y",inherit:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"x",inherit:"z"})}},{"../../plotly":336,"./":409}],409:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"scatter3d",["gl3d","symbols","markerColorscale","showLegend"],{}),i.attributes=t("./attributes"),i.markerSymbols=t("../../constants/gl_markers.json"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Scatter.colorbar,i.calc=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n.Scatter.arraysToCalcdata(r),n.Scatter.calcMarkerColorscales(e),r}},{"../../constants/gl_markers.json":309,"../../plotly":336,"./attributes":405,"./defaults":408}],410:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=n.line,l=o.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:s.color,width:s.width,dash:s.dash},marker:{symbol:o.symbol,opacity:o.opacity,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,color:o.color,colorscale:o.colorscale,cauto:o.cauto,cmax:o.cmax,cmin:o.cmin,autocolorscale:o.autocolorscale,reversescale:o.reversescale,showscale:o.showscale,line:{color:l.color,width:l.width,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale}},textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":316,"../../plots/attributes":337,"../scatter/attributes":403}],411:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),an;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function a(t,e){function r(e){var r=t.mockAxis;return o.Axes.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?o.ScatterGeo.attributes.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("location")&&Array.isArray(e.locations),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),u=-1!==i.indexOf("text");return function(t){var n=[];a?n.push(t.location):s&&l?n.push("("+r(t.lon)+", "+r(t.lat)+")"):s?n.push("lon: "+r(t.lon)):l&&n.push("lat: "+r(t.lat)),u&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}var o=t("../../plotly"),s=t("d3"),l=t("../../lib/topojson_utils").getTopojsonFeatures,u=t("../../lib/geo_location_utils").locationToFeature,c=t("../../lib/array_to_calc_item"),h=e.exports={};h.calcGeoJSON=function(t,e){var r,i,a,o,s,c,h=[],f=Array.isArray(t.locations);f?(s=t.locations,r=s.length,i=l(t,e),a=function(t,e){var r=u(t.locationmode,s[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,a=function(t,e){return[t.lon[e],t.lat[e]]});for(var d=0;r>d;d++)o=a(t,d),o&&(c={lon:o[0],lat:o[1],location:f?t.locations[d]:null},n(t,c,d),h.push(c));return h.length>0&&(h[0].trace=t),h},h.plot=function(t,e){var r=t.framework.select("g.scattergeolayer"),n=o.Scatter,l=t.topojson;r.selectAll("*").remove();var u=r.selectAll("g.trace.scatter").data(e);u.enter().append("g").attr("class","trace scattergeo"),u.each(function(t){n.hasLines(t)&&t.visible===!0&&s.select(this).append("path").datum(i(t)).attr("class","js-line")}),u.append("g").attr("class","points").each(function(e){function r(r){if(t.showHover){var n=t.projection([r.lon,r.lat]);d(r),o.Fx.loneHover({x:n[0],y:n[1],name:g?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()})}}var i=s.select(this),u=n.hasMarkers(e),c=n.hasText(e);if(!u&&!c||e.visible!==!0)return void i.remove();var f=h.calcGeoJSON(e,l),d=a(t,e),p=e.hoverinfo,g="all"===p||-1!==p.indexOf("name");u&&i.selectAll("path.point").data(f).enter().append("path").attr("class","point").on("mouseover",r).on("mouseout",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r),c&&i.selectAll("g").data(f).enter().append("g").append("text")}),h.style(t)},h.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.selectAll("g.points").each(function(t){s.select(this).selectAll("path.point").call(o.Drawing.pointStyle,t),s.select(this).selectAll("text").call(o.Drawing.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(o.Color.stroke,r.color).call(o.Drawing.dashLine,r.dash||"",r.width||0)})}},{"../../lib/array_to_calc_item":312,"../../lib/geo_location_utils":317, -"../../lib/topojson_utils":331,"../../plotly":336,d3:53}],414:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../constants/gl2d_dashes.json"),a=t("../../constants/gl_markers.json"),o=t("../../lib/extend").extendFlat,s=n.line,l=n.marker,u=l.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:o({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:s.color,width:s.width,dash:{valType:"enumerated",values:Object.keys(i),dflt:"solid"}},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:u.color,width:u.width,colorscale:u.colorscale,cauto:u.cauto,cmax:u.cmax,cmin:u.cmin,autocolorscale:u.autocolorscale,reversescale:u.reversescale}},fill:o({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes.json":307,"../../constants/gl_markers.json":309,"../../lib/extend":316,"../scatter/attributes":403}],415:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array,color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=p(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=g(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=g(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array,sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=f(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=d(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;r>a;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(A(t,r),k(e,r),r)}function s(t,e,r,n){var i=y(t,e,n);return i=Array.isArray(i[0])?i:a(h.Lib.identity,[i],n),l(i,k(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var a=0;3>a;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][a]*e[i]}return n}function u(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("../../plotly"),f=t("gl-scatter2d"),d=t("gl-scatter2d-fancy"),p=t("gl-line2d"),g=t("gl-error2d"),v=t("fast-isnumeric"),m=t("../../lib/str2rgbarray"),y=t("../../lib/gl_format_color"),b=t("../../constants/gl_markers.json"),x=t("../../constants/gl2d_dashes.json"),_=["xaxis","yaxis"],w=n.prototype;w.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:[this.xData[e],this.yData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},w.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.line.width)||Array.isArray(e.opacity))return!0;var r=e.color;if(Array.isArray(r))return!0;var n=Array.isArray(e.line.color);return Array.isArray(n)?!0:this.hasErrorX?!0:this.hasErrorY?!0:!1};var k=i.bind(null,function(t){return+t}),A=i.bind(null,m),M=i.bind(null,function(t){return b[t]||"\u25cf"});w.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=h.Scatter.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=h.Scatter.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=h.Scatter.getTraceColor(t,{})},w.updateFast=function(t){for(var e,r,n=this.xData=t.x,i=this.yData=t.y,a=n.length,o=new Array(a),s=new Float32Array(2*a),l=this.bounds,c=0,h=0,f=0;a>f;++f)e=n[f],r=i[f],v(e)&&v(r)&&(o[c++]=f,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=u(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var d;if(this.hasMarkers){this.scatterOptions.positions=s;var p=m(t.marker.color),g=m(t.marker.line.color),y=t.opacity*t.marker.opacity;p[3]*=y,this.scatterOptions.color=p,g[3]*=y,this.scatterOptions.borderColor=g,d=t.marker.size,this.scatterOptions.size=d,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,d)},w.updateFancy=function(t){var e,r,n,a,o,l,c,f,d=this.scene,p=d.xaxis,g=d.yaxis,v=this.bounds,m=this.xData=p.makeCalcdata(t,"x"),y=this.yData=g.makeCalcdata(t,"y"),b=h.ErrorBars.calcFromTrace(t,d.fullLayout),x=m.length,_=new Array(x),w=new Float32Array(2*x),A=new Float32Array(4*x),L=new Float32Array(4*x),T=0,E=0,C=0,S=0,z="log"===p.type?function(t){return p.d2l(t)}:function(t){return t},P="log"===g.type?function(t){return g.d2l(t)}:function(t){return t};for(e=0;x>e;++e)n=z(m[e]),a=P(y[e]),isNaN(n)||isNaN(a)||(_[T++]=e,w[E++]=n,w[E++]=a,o=A[C++]=n-b[e].xs||0,l=A[C++]=b[e].xh-n||0,A[C++]=0,A[C++]=0,L[S++]=0,L[S++]=0,c=L[S++]=a-b[e].ys||0,f=L[S++]=b[e].yh-a||0,v[0]=Math.min(v[0],n-o),v[1]=Math.min(v[1],a-c),v[2]=Math.max(v[2],n+l),v[3]=Math.max(v[3],a+f));w=u(w,E),this.idToIndex=_,this.updateLines(t,w),this.updateError("X",t,w,A),this.updateError("Y",t,w,L);var j;if(this.hasMarkers){this.scatterOptions.positions=w,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var O,I=h.Scatter.getBubbleSizeFn(t),D=t.marker,R=D.opacity,F=t.opacity,N=s(D,R,F,x),B=M(D.symbol,x),U=k(D.line.width,x),V=s(D.line,R,F,x);for(j=i(I,D.size,x),e=0;T>e;++e)for(O=_[e],this.scatterOptions.sizes[e]=4*j[O],this.scatterOptions.glyphs[e]=B[O],this.scatterOptions.borderWidths[e]=.5*U[O],r=0;4>r;++r)this.scatterOptions.colors[4*e+r]=N[4*O+r],this.scatterOptions.borderColors[4*e+r]=V[4*O+r];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(m,y,j)},w.updateLines=function(t,e){if(this.hasLines){this.lineOptions.positions=e;var r=m(t.line.color);this.hasMarkers&&(r[3]*=t.marker.opacity);for(var n=Math.round(.5*this.lineOptions.width),i=(x[t.line.dash]||[1]).slice(),a=0;ao;o++)r=this.scene[_[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},w.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};h.Axes.expand(n.xaxis,t,i),h.Axes.expand(n.yaxis,e,i)},w.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../constants/gl2d_dashes.json":307,"../../constants/gl_markers.json":309,"../../lib/gl_format_color":318,"../../lib/str2rgbarray":329,"../../plotly":336,"fast-isnumeric":58,"gl-error2d":60,"gl-line2d":66,"gl-scatter2d":131,"gl-scatter2d-fancy":126}],416:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}var s=n.Scatter,l=s.handleXYDefaults(t,e,o);return l?(o("text"),o("mode",le){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],o=0;3>o;++o){var s=a(t[o]),l=u(new Float32Array(i),n);c(l,s,[r,0,0,0,r,0,0,0,1]),t[o]=l}return r}return 1}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var l=t("gl-surface3d"),u=t("ndarray"),c=t("ndarray-homography"),h=t("ndarray-fill"),f=t("ndarray-ops"),d=t("tinycolor2"),p=t("../../lib/str2rgbarray"),g=128,v=n.prototype;v.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0])*this.scene.dataScale[0]-this.scene.dataCenter[0],n.yaxis.d2l(r[1])*this.scene.dataScale[1]-this.scene.dataCenter[1],n.zaxis.d2l(r[2])*this.scene.dataScale[2]-this.scene.dataCenter[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},v.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;3>r;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,f=t.x,d=t.y,g=n.xaxis,v=n.yaxis,m=n.zaxis,y=r.dataScale,b=r.dataCenter,x=c[0].length,_=c.length,w=[u(new Float32Array(x*_),[x,_]),u(new Float32Array(x*_),[x,_]),u(new Float32Array(x*_),[x,_])],k=w[0],A=w[1],M=r.contourLevels;this.data=t,h(w[2],function(t,e){return m.d2l(c[e][t])*y[2]-b[2]}),Array.isArray(f[0])?h(k,function(t,e){return g.d2l(f[e][t])*y[0]-b[0]}):h(k,function(t){return g.d2l(f[t])*y[0]-b[0]}),Array.isArray(d[0])?h(A,function(t,e){return v.d2l(d[e][t])*y[1]-b[1]}):h(A,function(t,e){return v.d2l(d[e])*y[1]-b[1]}),this.dataScale=o(w);var L={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};"opacity"in t&&t.opacity<1&&(L.opacity=.25*t.opacity);var T=[!0,!0,!0],E=[!0,!0,!0],C=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[C[e]];T[e]=S.highlight,E[e]=S.show,L.showContour[e]=S.show||S.highlight,L.showContour[e]&&(L.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,L.levels[e]=M[e],a.highlightColor[e]=L.contourColor[e]=p(S.color),S.usecolormap?a.highlightTint[e]=L.contourTint[e]=0:a.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(L.dynamicColor[e]=p(S.highlightColor),L.dynamicWidth[e]=S.highlightWidth))}L.coords=w,a.update(L),a.highlightEnable=T,a.contourEnable=E,a.visible=t.visible,a.snapToData=!0,"lighting"in t&&(a.ambientLight=t.lighting.ambient,a.diffuseLight=t.lighting.diffuse,a.specularLight=t.lighting.specular,a.roughness=t.lighting.roughness,a.fresnel=t.lighting.fresnel),s&&1>s&&(a.supportsTransparency=!0)},v.dispose=function(){this.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":329,"gl-surface3d":161,ndarray:189,"ndarray-fill":178,"ndarray-homography":183,"ndarray-ops":184,tinycolor2:213}],420:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}var s,l,u=o("z");if(!u)return void(e.visible=!1);var c=u[0].length,h=u.length;if(o("x"),o("y"),!Array.isArray(e.x))for(e.x=[],s=0;c>s;++s)e.x[s]=s;if(o("text"),!Array.isArray(e.y))for(e.y=[],s=0;h>s;++s)e.y[s]=s;o("lighting.ambient"),o("lighting.diffuse"),o("lighting.specular"),o("lighting.roughness"),o("lighting.fresnel"),o("hidesurface"),o("opacity"),o("colorscale");var f=["x","y","z"];for(s=0;3>s;++s){var d="contours."+f[s],p=o(d+".show"),g=o(d+".highlight");if(p||g)for(l=0;3>l;++l)o(d+".project."+f[l]);p&&(o(d+".color"),o(d+".width"),o(d+".usecolormap")),g&&(o(d+".highlightColor"),o(d+".highlightWidth"))}n.Colorscale.handleDefaults(t,e,a,o,{prefix:"",cLetter:"z"})}},{"../../plotly":336,"./":421}],421:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"surface",["gl3d","noOpacity"],{}),i.attributes=t("./attributes"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Colorbar.traceColorbar,i.calc=function(t,e){n.Colorscale.calc(e,e.z,"","z")}},{"../../plotly":336,"./attributes":418,"./defaults":420}]},{},[311])(311)}); \ No newline at end of file +case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(0>t)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>=a&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),0>a&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=0>=a?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=0>a?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=0>=i?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=0>=n?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],272:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]s)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;e>a;++a){var l=t[a],u=l[0][0]a;){for(var v=i[a].x,m=[];r>a;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]e)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":270,"binary-search-bounds":268,"functional-red-black-tree":271,"robust-orientation":195}],273:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return i?!!i.queryPoint(r,n):!1}}function a(t){for(var e={},r=0;rn)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]s)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(0>s))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;e>i;++i)for(var c=t[i],h=c.length,d=h-1,p=0;h>p;d=p++){var g=c[d],v=c[p];g[0]===v[0]?n.push([g,v]):r.push([g,v])}if(0===r.length)return 0===n.length?s:l(a(n));var m=f(r),y=o(m.slabs,m.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":268,"interval-tree-1d":269,"robust-orientation":195,"slab-decomposition":272}],274:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;t>n;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;t>r;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;r>i;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;e>r;++r)if(!O[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,g=(t.length,o(t,e.length)),v=0;p>v;++v)if(g[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var m=s(t,e);m=m.filter(r);for(var y=m.length,b=new Array(y),x=new Array(y),v=0;y>v;++v){b[v]=v;var _=new Array(y),w=m[v].map(function(t){return e[t]}),k=l([w]),A=0;t:for(var M=0;y>M;++M)if(_[M]=0,v!==M){for(var L=m[M],T=L.length,E=0;T>E;++E){var C=k(e[L[E]]);if(0!==C){0>C&&(_[M]=1,A+=1);continue t}}_[M]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;y>v;++v)for(var _=x[v],S=_[1],z=_[2],M=0;y>M;++M)z[M]&&(b[M]=S);for(var P=i(y),v=0;y>v;++v)P[v].push(b[v]),P[b[v]].push(v);for(var j={},O=n(p,!1),v=0;y>v;++v)for(var L=m[v],T=L.length,M=0;T>M;++M){var I=L[M],D=L[(M+1)%T],R=Math.min(I,D)+":"+Math.max(I,D);if(R in j){var F=j[R];P[F].push(v),P[v].push(F),O[I]=O[D]=!0}else j[R]=v}for(var N=[],B=n(y,-1),v=0;y>v;++v)b[v]!==v||a(m[v])?B[v]=-1:(N.push(v),B[v]=0);for(var d=[];N.length>0;){var U=N.pop(),V=P[U];h(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var L=m[U];q=[L]}for(var v=0;H>v;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,N.push(Y),0===G)){var L=m[Y];a(L)||(L.reverse(),q.push(L))}}0===G&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":262,"edges-to-adjacency-list":263,"planar-dual":264,"point-in-big-polygon":273,"robust-sum":198,"two-product":215,uniq:218}],275:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],276:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;t>e;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];s>o?a[r]=n:o>s?a[n]=r:(a[n]=r,++i[r])}}},{}],277:[function(t,e,r){arguments[4][171][0].apply(r,arguments)},{"bit-twiddle":275,dup:171,"union-find":276}],278:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=m[t],i=y[t];return 0>r||0>i?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=M[t],n=M[e];M[t]=n,M[e]=r,L[r]=e,L[n]=t}function s(t){return b[M[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(E>n){var l=s(n);r>l&&(o=n,r=l)}if(E>i){var u=s(i);r>u&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(n>e){a(t,r),t=r;continue}}return t}}function h(){if(E>0){var t=M[0];return a(0,E-1),E-=1,u(0),t}return-1}function f(t,e){var r=M[t];return b[r]===e?t:(b[r]=-(1/0),c(t),h(),b[r]=e,E+=1,c(E-1))}function d(t){if(!x[t]){x[t]=!0;var e=m[t],r=y[t];m[r]>=0&&(m[r]=e),y[e]>=0&&(y[e]=r),L[e]>=0&&f(L[e],i(e)),L[r]>=0&&f(L[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||0>i||i===n)break;if(n=i,i=t[n],!x[n]||0>i||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var g=e.length,v=t.length,m=new Array(g),y=new Array(g),b=new Array(g),x=new Array(g),_=0;g>_;++_)m[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;v>_;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var k=w[1],A=w[0];-1!==y[A]?y[A]=-2:y[A]=k,-1!==m[k]?m[k]=-2:m[k]=A}for(var M=[],L=new Array(g),_=0;g>_;++_){var T=b[_]=i(_);1/0>T?(L[_]=M.length,M.push(_)):L[_]=-1}for(var E=M.length,_=E>>1;_>=0;--_)u(_);for(;;){var C=h();if(0>C||b[C]>r)break;d(C)}for(var S=[],_=0;g>_;++_)x[_]||(L[_]=S.length,S.push(e[_].slice()));var z=(S.length,[]);return t.forEach(function(t){var e=p(m,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=L[e],i=L[r];n!==i&&z.push([n,i])}}),o.unique(o.normalize(z)),{positions:S,edges:z}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":195,"simplicial-complex":277}],279:[function(t,e,r){e.exports={name:"plotly.js",version:"1.1.1",description:"The open source javascript graphing library that powers plotly",license:"MIT",main:"./src/index.js",repository:{type:"git",url:"https://github.com/plotly/plotly.js.git"},bugs:{url:"https://github.com/plotly/plotly.js/issues"},author:"Plotly, Inc.",keywords:["graphing","plotting","data","visualization","plotly"],scripts:{preprocess:"node tasks/preprocess.js",postinstall:"npm run preprocess",bundle:"node tasks/bundle.js",header:"node tasks/header.js",build:"npm run preprocess && npm run bundle && npm run header",cibuild:"node tasks/cibundle.js",watch:"node tasks/watch_plotly.js",lint:"cd src && jshint . || true","test-jasmine":"karma start test/jasmine/karma.conf.js","citest-jasmine":"karma start test/jasmine/karma.ciconf.js","test-image":"./tasks/test_image.sh",test:"npm run test-jasmine && npm test-image","start-test_dashboard":"node devtools/test_dashboard/server.js","start-image_viewer":"node devtools/image_viewer/server.js",baseline:"./tasks/baseline.sh",version:"npm run build && git add -A dist",postversion:"git push && git push --tags"},dependencies:{"3d-view":"^2.0.0","alpha-shape":"^1.0.0",arraytools:"^1.0.0","convex-hull":"^1.0.3",d3:"3.5.6","delaunay-triangulate":"^1.1.6","es6-promise":"^3.0.2","fast-isnumeric":"^1.1.1","fs-extra":"^0.26.2","gl-error2d":"^1.0.0","gl-error3d":"^1.0.0","gl-line2d":"^1.2.1","gl-line3d":"^1.0.1","gl-mat4":"^1.1.2","gl-mesh3d":"^1.0.4","gl-plot2d":"^1.1.6","gl-plot3d":"^1.3.0","gl-scatter2d":"^1.0.5","gl-scatter2d-fancy":"^1.1.1","gl-scatter3d":"^1.0.4","gl-select-box":"^1.0.1","gl-spikes2d":"^1.0.1","gl-surface3d":"^1.0.6","mouse-change":"^1.1.1","mouse-wheel":"^1.0.2",ndarray:"^1.0.16","ndarray-fill":"^1.0.1","ndarray-homography":"^1.0.0","ndarray-ops":"^1.2.2","node-sass":"^3.4.1","right-now":"^1.0.0","robust-orientation":"^1.1.3","sane-topojson":"^1.2.0","superscript-text":"^1.0.0",tinycolor2:"1.1.2",topojson:"^1.6.19",xml2js:"^0.4.15"},devDependencies:{brfs:"^1.4.1",browserify:"^12.0.1","browserify-transform-tools":"^1.5.0",ecstatic:"^1.2.0","jasmine-core":"^2.3.4",jshint:"^2.8.0",karma:"^0.13.15","karma-browserify":"^4.4.1","karma-chrome-launcher":"^0.2.1","karma-coverage":"^0.5.3","karma-firefox-launcher":"^0.1.6","karma-jasmine":"^0.3.6",open:"0.0.5","prepend-file":"^1.3.0",prettysize:"0.0.3",through2:"^2.0.0","uglify-js":"^2.5.0",watchify:"^3.6.0"}}},{}],280:[function(t,e,r){e.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],281:[function(t,e,r){var n=t("../../plotly"),i=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},a,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:i.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":313,"../../plotly":333,"../../plots/font_attributes":339,"./arrow_paths":280}],282:[function(t,e,r){"use strict";function n(t,e){function r(e,r){return o.Lib.coerce(t,n,u.layoutAttributes,e,r)}var n={};r("opacity"),r("align"),r("bgcolor");var i=r("bordercolor"),a=o.Color.opacity(i);r("borderpad");var s=r("borderwidth"),l=r("showarrow");l&&(r("arrowcolor",a?n.bordercolor:o.Color.defaultLine),r("arrowhead"),r("arrowsize"),r("arrowwidth",2*(a&&s||1)),r("ax"),r("ay"),o.Lib.noneOrAll(t,n,["ax","ay"])),r("text",l?" ":"new text"),r("textangle"),o.Lib.coerceFont(r,"font",e.font);for(var c=["x","y"],h=0;2>h;h++){var f=c[h],d={_fullLayout:e},p=o.Axes.coerceRef(t,n,d,f),g=.5;if("paper"!==p){var v=o.Axes.getFromId(d,p);if(g=v.range[0]+g*(v.range[1]-v.range[0]),-1!==["date","category"].indexOf(v.type)&&"string"==typeof t[f]){var m;"date"===v.type?(m=o.Lib.dateTime2ms(t[f]),m!==!1&&(t[f]=m)):(v._categories||[]).length&&(m=v._categories.indexOf(t[f]),-1!==m&&(t[f]=m))}}r(f,g),l||r(f+"anchor")}return o.Lib.noneOrAll(t,n,["x","y"]),n}function i(t){var e=t._fullLayout;e.annotations.forEach(function(e){var r=o.Axes.getFromId(t,e.xref),n=o.Axes.getFromId(t,e.yref);if(r||n){var i=(e._xsize||0)/2,a=e._xshift||0,s=(e._ysize||0)/2,l=e._yshift||0,u=i-a,c=i+a,h=s-l,f=s+l;if(e.showarrow){var d=3*e.arrowsize*e.arrowwidth;u=Math.max(u,d),c=Math.max(c,d),h=Math.max(h,d),f=Math.max(f,d)}r&&r.autorange&&o.Axes.expand(r,[r.l2c(e.x)],{ppadplus:c,ppadminus:u}),n&&n.autorange&&o.Axes.expand(n,[n.l2c(e.y)],{ppadplus:f,ppadminus:h})}})}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var g=(u*d-c*f)/p,v=(u*h-l*f)/p;return 0>v||v>1||0>g||g>1?null:{x:t+l*g,y:e+h*g}}var o=t("../../plotly"),s=t("d3"),l=t("fast-isnumeric"),u=e.exports={};u.ARROWPATHS=t("./arrow_paths"),u.layoutAttributes=t("./attributes"),u.supplyLayoutDefaults=function(t,e){for(var r=t.annotations||[],i=e.annotations=[],a=0;at?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}W.selectAll("tspan.line").attr({y:0,x:0});var n=U.select(".annotation-math-group"),i=!n.empty(),l=o.Drawing.bBox((i?n:W).node()),c=l.width,h=l.height,f=Math.round(c+2*H),d=Math.round(h+2*H);O._w=c,O._h=h;var g=!1;if(["x","y"].forEach(function(e){var n,i=o.Axes.getFromId(t,O[e+"ref"]||e),a=(F+("x"===e?0:90))*Math.PI/180,s=f*Math.abs(Math.cos(a))+d*Math.abs(Math.sin(a)),l=O[e+"anchor"];if(i){if(!i.autorange&&(O[e]-i.range[0])*(O[e]-i.range[1])>0)return void(g=!0);R[e]=i._offset+i.l2p(O[e]),n=.5}else n=O[e],"y"===e&&(n=1-n),R[e]="x"===e?w.l+w.w*n:w.t+w.h*n;var u=0;u=O.showarrow?O["a"+e]:s*r(n,l),R[e]+=u,O["_"+e+"type"]=i&&i.type,O["_"+e+"size"]=s,O["_"+e+"shift"]=u}),g)return void U.remove();var v,m;O.showarrow&&(v=o.Lib.constrain(R.x-O.ax,1,p.width-1),m=o.Lib.constrain(R.y-O.ay,1,p.height-1)),R.x=o.Lib.constrain(R.x,1,p.width-1),R.y=o.Lib.constrain(R.y,1,p.height-1);var y=H-l.top,b=H-l.left;i?n.select("svg").attr({x:H-1,y:H}):(W.attr({x:b,y:y}),W.selectAll("tspan.line").attr({y:y,x:b})),G.call(o.Drawing.setRect,V/2,V/2,f-V,d-V),U.call(o.Drawing.setRect,Math.round(R.x-f/2),Math.round(R.y-d/2),f,d);var x="annotations["+e+"]",_=function(r,n){s.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=R.x+r,l=R.y+n,c=o.Lib.rotationXYMatrix(F,i,l),h=o.Lib.apply2DTransform(c),f=o.Lib.apply2DTransform2(c),d=G.attr("width")/2,p=G.attr("height")/2,g=[[i-d,l-p,i-d,l+p],[i-d,l+p,i+d,l+p],[i+d,l+p,i+d,l-p],[i+d,l-p,i-d,l-p]].map(f);if(!g.reduce(function(t,e){return t^!!a(v,m,v+1e6,m+1e6,e[0],e[1],e[2],e[3])},!1)){g.forEach(function(t){var e=a(i,l,v,m,t[0],t[1],t[2],t[3]);e&&(i=e.x,l=e.y)});var y=O.arrowwidth,b=O.arrowcolor,_=N.append("g").style({opacity:o.Color.opacity(b)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),k=_.append("path").attr("d","M"+i+","+l+"L"+v+","+m).style("stroke-width",y+"px").call(o.Color.stroke,o.Color.rgb(b));u.arrowhead(k,O.arrowhead,"end",O.arrowsize);var A=_.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(i-v)+","+(l-m),transform:"translate("+v+","+m+")"}).style("stroke-width",y+6+"px").call(o.Color.stroke,"rgba(0,0,0,0)").call(o.Color.fill,"rgba(0,0,0,0)");if(t._context.editable){var M,L,T;o.Fx.dragElement({element:A.node(),prepFn:function(){L=Number(U.attr("x")),T=Number(U.attr("y")),M={},I&&I.autorange&&(M[I._name+".autorange"]=!0),D&&D.autorange&&(M[D._name+".autorange"]=!0)},moveFn:function(t,e){_.attr("transform","translate("+t+","+e+")");var r=h(L,T),n=r[0]+t,i=r[1]+e;U.call(o.Drawing.setPosition,n,i),M[x+".x"]=I?O.x+t/I._m:(v+t-w.l)/w.w,M[x+".y"]=D?O.y+e/D._m:1-(m+e-w.t)/w.h,B.attr({transform:"rotate("+F+","+n+","+i+")"})},doneFn:function(e){if(e){o.relayout(t,M);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};O.showarrow&&_(0,0);var k=o.Lib.rotationXYMatrix(F,R.x,R.y),A=o.Lib.apply2DTransform(k);if(t._context.editable){var M,L,T;o.Fx.dragElement({element:U.node(),prepFn:function(){M=Number(U.attr("x")),L=Number(U.attr("y")),T={}},moveFn:function(t,e){U.call(o.Drawing.setPosition,M+t,L+e);var r="pointer";if(O.showarrow)T[x+".ax"]=O.ax+t,T[x+".ay"]=O.ay+e,_(t,e);else{if(I)T[x+".x"]=O.x+t/I._m;else{var n=O._xsize/w.w,i=O.x+O._xshift/w.w-n/2;T[x+".x"]=o.Fx.dragAlign(i+t/w.w,n,0,1,O.xanchor)}if(D)T[x+".y"]=O.y+e/D._m;else{var a=O._ysize/w.h,s=O.y-O._yshift/w.h-a/2;T[x+".y"]=o.Fx.dragAlign(s-e/w.h,a,0,1,O.yanchor)}I&&D||(r=o.Fx.dragCursors(I?.5:T[x+".x"],D?.5:T[x+".y"],O.xanchor,O.yanchor))}var l=A(M,L),u=l[0]+t,c=l[1]+e;U.call(o.Drawing.setPosition,u,c),B.attr({transform:"rotate("+F+","+u+","+c+")"}),o.Fx.setCursor(U,r)},doneFn:function(e){if(o.Fx.setCursor(U),e){o.relayout(t,T);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var f,d=t.layout,p=t._fullLayout;if(!l(e)||-1===e){if(!e&&Array.isArray(i))return d.annotations=i,u.supplyLayoutDefaults(d,p),void u.drawAll(t);if("remove"===i)return delete d.annotations,p.annotations=[],void u.drawAll(t);if(r&&"add"!==i){for(f=0;fe;f--)p._infolayer.selectAll('.annotation[data-index="'+(f-1)+'"]').attr("data-index",String(f)),u.draw(t,f)}}p._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var v=d.annotations[e],m=p.annotations[e];if(v){var y={xref:v.xref,yref:v.yref},b={};"string"==typeof r&&r?b[r]=i:o.Lib.isPlainObject(r)&&(b=r);var x=Object.keys(b);for(f=0;ff;f++){var A=k[f];if(void 0===b[A]&&void 0!==v[A]){var M=o.Axes.getFromId(t,o.Axes.coerceRef(y,{},t,A)),L=o.Axes.getFromId(t,o.Axes.coerceRef(v,{},t,A)),T=v[A],E=m["_"+A+"type"];if(void 0!==b[A+"ref"]){var C="auto"===v[A+"anchor"],S="x"===A?w.w:w.h,z=(m["_"+A+"size"]||0)/(2*S);if(M&&L)T=(T-M.range[0])/(M.range[1]-M.range[0]),T=L.range[0]+T*(L.range[1]-L.range[0]);else if(M){if(T=(T-M.range[0])/(M.range[1]-M.range[0]),T=M.domain[0]+T*(M.domain[1]-M.domain[0]),C){var P=T+z,j=T-z;2/3>T+j?T=j:T+P>4/3&&(T=P)}}else L&&(C&&(1/3>T?T+=z:T>2/3&&(T-=z)),T=(T-L.domain[0])/(L.domain[1]-L.domain[0]),T=L.range[0]+T*(L.range[1]-L.range[0]))}L&&L===M&&E&&("log"===E&&"log"!==L.type?T=Math.pow(10,T):"log"!==E&&"log"===L.type&&(T=T>0?Math.log(T)/Math.LN10:void 0)),v[A]=T}}var O=n(v,p);p.annotations[e]=O;var I=o.Axes.getFromId(t,O.xref),D=o.Axes.getFromId(t,O.yref),R={x:0,y:0},F=+O.textangle||0,N=p._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",O.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:v,fullAnnotation:O})}),B=N.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),U=B.append("svg").call(o.Drawing.setPosition,0,0),V=O.borderwidth,q=O.borderpad,H=V+q,G=U.append("rect").attr("class","bg").style("stroke-width",V+"px").call(o.Color.stroke,O.bordercolor).call(o.Color.fill,O.bgcolor),Y=O.font,W=U.append("text").classed("annotation",!0).attr("data-unformatted",O.text).text(O.text);t._context.editable?W.call(o.util.makeEditable,U).call(c).on("edit",function(r){O.text=r,this.attr({"data-unformatted":O.text}),this.call(c);var n={};n["annotations["+e+"].text"]=O.text,I&&I.autorange&&(n[I._name+".autorange"]=!0),D&&D.autorange&&(n[D._name+".autorange"]=!0),o.relayout(t,n)}):W.call(c),B.attr({transform:"rotate("+F+","+R.x+","+R.y+")"}).call(o.Drawing.setPosition,R.x,R.y)}},u.arrowhead=function(t,e,r,n){l(n)||(n=1);var i=t.node(),a=u.ARROWPATHS[e||0];if(a){"string"==typeof r&&r||(r="end");var c,h,f,d,p=(o.Drawing.getPx(t,"stroke-width")||1)*n,g=t.style("stroke")||o.Color.defaultLine,v=t.style("stroke-opacity")||1,m=r.indexOf("start")>=0,y=r.indexOf("end")>=0,b=a.backoff*p;if("line"===i.nodeName){if(c={x:+t.attr("x1"),y:+t.attr("y1")},h={x:+t.attr("x2"),y:+t.attr("y2")},f=Math.atan2(c.y-h.y,c.x-h.x),d=f+Math.PI,b){var x=b*Math.cos(f),_=b*Math.sin(f);m&&(c.x-=x,c.y-=_,t.attr({x1:c.x,y1:c.y})),y&&(h.x+=x,h.y+=_,t.attr({x2:h.x,y2:h.y}))}}else if("path"===i.nodeName){var w=i.getTotalLength(),k="";if(m){var A=i.getPointAtLength(0),M=i.getPointAtLength(.1);f=Math.atan2(A.y-M.y,A.x-M.x),c=i.getPointAtLength(Math.min(b,w)),b&&(k="0px,"+b+"px,")}if(y){var L=i.getPointAtLength(w),T=i.getPointAtLength(w-.1);if(d=Math.atan2(L.y-T.y,L.x-T.x),h=i.getPointAtLength(Math.max(0,w-b)),b){var E=k?2*b:b;k+=w-E+"px,"+w+"px"}}else k&&(k+=w+"px");k&&t.style("stroke-dasharray",k)}var C=function(r,n){e>5&&(n=0),s.select(i.parentElement).append("path").attr({"class":t.attr("class"),d:a.path,transform:"translate("+r.x+","+r.y+")rotate("+180*n/Math.PI+")scale("+p+")"}).style({fill:g,opacity:v,"stroke-width":0})};m&&C(c,f),y&&C(h,d)}},u.calcAutorange=function(t){var e=t._fullLayout,r=e.annotations;if(r.length&&t._fullData.length){var n={};r.forEach(function(t){n[t.xref]=!0,n[t.yref]=!0});var a=o.Axes.list(t).filter(function(t){return t.autorange&&n[t._id]});if(a.length)return o.Lib.syncOrAsync([u.drawAll,i],t)}}},{"../../plotly":333,"./arrow_paths":280,"./attributes":281,d3:53,"fast-isnumeric":58}],283:[function(t,e,r){r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff"},{}],284:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;el&&(o[1]-=(H-l)/2)):r.node()&&!r.classed("js-placeholder")&&(H=n.Drawing.bBox(e.node()).height),H){if(H+=5,"top"===a.titleside)D.domain[1]-=H/u._size.h,o[1]*=-1;else{D.domain[0]+=H/u._size.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),D.setScale()}}V.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(u._size.h*(1-D.domain[1]))+")");var v=V.select(".cbfills").selectAll("rect.cbfill").data(d);v.enter().append("rect").classed("cbfill",!0).style("stroke","none"),v.exit().remove(),v.each(function(t,e){var r=[0===e?h[0]:(d[e]+d[e-1])/2,e===d.length-1?h[1]:(d[e]+d[e+1])/2].map(D.c2p).map(Math.round);e!==d.length-1&&(r[1]+=r[1]>r[0]?1:-1),i.select(this).attr({x:S,width:Math.max(k,2),y:i.min(r),height:Math.max(i.max(r)-i.min(r),2)}).style("fill",g(t))});var m=V.select(".cblines").selectAll("path.cbline").data(a.line.color&&a.line.width?f:[]);return m.enter().append("path").classed("cbline",!0),m.exit().remove(),m.each(function(t){i.select(this).attr("d","M"+S+","+(Math.round(D.c2p(t))+a.line.width/2%1)+"h"+k).call(n.Drawing.lineGroupStyle,a.line.width,p(t),a.line.dash)}),D._axislayer.selectAll("g."+D._id+"tick,path").remove(),D._pos=S+k+(a.outlinewidth||0)/2-("outside"===a.ticks?1:0),D.side="right",n.Axes.doTicks(t,D)}function l(){var r=k+a.outlinewidth/2+n.Drawing.bBox(D._axislayer.node()).width;if(x=q.select("text"),x.node()&&!x.classed("js-placeholder")){var i,o=q.select(".h"+D._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(a.titleside)?n.Drawing.bBox(o).width:n.Drawing.bBox(q.node()).right-S-u._size.l,r=Math.max(r,i)}var s=2*a.xpad+r+a.borderwidth+a.outlinewidth/2,l=j-O;V.select(".cbbg").attr({x:S-a.xpad-(a.borderwidth+a.outlinewidth)/2,y:O-E,width:Math.max(s,2),height:Math.max(l+2*E,2)}).call(n.Color.fill,a.bgcolor).call(n.Color.stroke,a.bordercolor).style({"stroke-width":a.borderwidth}),V.selectAll(".cboutline").attr({x:S,y:O+a.ypad+("top"===a.titleside?H:0),width:Math.max(k,2),height:Math.max(l-2*a.ypad-H,2)}).call(n.Color.stroke,a.outlinecolor).style({fill:"None","stroke-width":a.outlinewidth});var c=({center:.5,right:1}[a.xanchor]||0)*s;V.attr("transform","translate("+(u._size.l-c)+","+u._size.t+")"),n.Plots.autoMargin(t,e,{x:a.x,y:a.y,l:s*({right:1,center:.5}[a.xanchor]||0),r:s*({left:1,center:.5}[a.xanchor]||0),t:l*({bottom:1,middle:.5}[a.yanchor]||0),b:l*({top:1,middle:.5}[a.yanchor]||0)})}var u=t._fullLayout;if("function"!=typeof a.fillcolor&&"function"!=typeof a.line.color)return void u._infolayer.selectAll("g."+e).remove();var c,h=i.extent(("function"==typeof a.fillcolor?a.fillcolor:a.line.color).domain()),f=[],d=[],p="function"==typeof a.line.color?a.line.color:function(){return a.line.color},g="function"==typeof a.fillcolor?a.fillcolor:function(){return a.fillcolor},v=a.levels.end+a.levels.size/100,m=a.levels.size,y=1.001*h[0]-.001*h[1],b=1.001*h[1]-.001*h[0];for(c=a.levels.start;0>(c-v)*m;c+=m)c>y&&b>c&&f.push(c);if("function"==typeof a.fillcolor)if(a.filllevels)for(v=a.filllevels.end+a.filllevels.size/100,m=a.filllevels.size,c=a.filllevels.start;0>(c-v)*m;c+=m)c>h[0]&&c1){var U=Math.pow(10,Math.floor(Math.log(B)/Math.LN10));F*=U*n.Lib.roundUp(B/U,[2,5,10]),(Math.abs(a.levels.start)/a.levels.size+1e-6)%1<2e-6&&(D.tick0=0)}D.dtick=F}D.domain=[P+C,P+L-C],D.setScale();var V=u._infolayer.selectAll("g."+e).data([0]);V.enter().append("g").classed(e,!0).each(function(){var t=i.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0)}),V.attr("transform","translate("+Math.round(u._size.l)+","+Math.round(u._size.t)+")");var q=V.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(u._size.l)+",-"+Math.round(u._size.t)+")");D._axislayer=V.select(".cbaxis");var H=0;-1!==["top","bottom"].indexOf(a.titleside)&&n.Titles.draw(t,D._id+"title");var G=n.Lib.syncOrAsync([n.Plots.previousPromises,s,n.Plots.previousPromises,l],t);if(G&&G.then&&(t._promises||[]).push(G),t._context.editable){var Y,W,X;n.Fx.dragElement({element:V.node(),prepFn:function(){Y=V.attr("transform"),n.Fx.setCursor(V)},moveFn:function(e,r){var i=t._fullLayout._size;V.attr("transform",Y+" translate("+e+","+r+")"),W=n.Fx.dragAlign(z+e/i.w,A,0,1,a.xanchor),X=n.Fx.dragAlign(P-r/i.h,L,0,1,a.yanchor);var o=n.Fx.dragCursors(W,X,a.xanchor,a.yanchor);n.Fx.setCursor(V,o)},doneFn:function(r){if(n.Fx.setCursor(V),r&&void 0!==W&&void 0!==X){var i,a=e.substr(2);t._fullData.some(function(t){return t.uid===a?(i=t.index,!0):void 0}),n.restyle(t,{"colorbar.x":W,"colorbar.y":X},i)}}})}return G}var a={};return Object.keys(o.attributes).forEach(function(t){a[t]=null}),a.fillcolor=null,a.line={color:null,width:null,dash:null},a.levels={start:null,end:null,size:null},a.filllevels=null,Object.keys(a).forEach(function(t){r[t]=function(e){return arguments.length?(a[t]=n.Lib.isPlainObject(a[t])?n.Lib.extendFlat(a[t],e):e,r):a[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=a,r};o.attributes=t("./attributes"),o.supplyDefaults=function(t,e,r){function i(t,e){return n.Lib.coerce(s,a,o.attributes,t,e)}var a=e.colorbar={},s=t.colorbar||{},l=i("thicknessmode");i("thickness","fraction"===l?30/(r.width-r.margin.l-r.margin.r):30);var u=i("lenmode");i("len","fraction"===u?1:r.height-r.margin.t-r.margin.b),i("x"),i("xanchor"),i("xpad"),i("y"),i("yanchor"),i("ypad"),n.Lib.noneOrAll(s,a,["x","y"]),i("outlinecolor"),i("outlinewidth"),i("bordercolor"),i("borderwidth"),i("bgcolor"),n.Axes.handleTickValueDefaults(s,a,i,"linear"),n.Axes.handleTickDefaults(s,a,i,"linear",{outerTicks:!1,font:r.font,noHover:!0}),i("title"),n.Lib.coerceFont(i,"titlefont",r.font),i("titleside")},o.traceColorbar=function(t,e){var r=e[0].trace,s="cb"+r.uid,l=n.Colorscale.getScale(r.colorscale),u=r.zmin,c=r.zmax;if(a(u)||(u=n.Lib.aggNums(Math.min,null,r.z)),a(c)||(c=n.Lib.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.Plots.autoMargin(t,s);var h=e[0].t.cb=o(t,s);h.fillcolor(i.scale.linear().domain(l.map(function(t){return u+t[0]*(c-u)})).range(l.map(function(t){return t[1]}))).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)(),n.Lib.markTime("done colorbar")}},{"../../plotly":333,"./attributes":285,d3:53,"fast-isnumeric":58}],287:[function(t,e,r){e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0},_deprecated:{scl:{valType:"colorscale"},reversescl:{valType:"boolean"}}}},{}],288:[function(t,e,r){"use strict";function n(t){var e,r=!0,n=0;if(Array.isArray(t)){if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var i=0;i=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n},l.hasColorscale=function(t,e){var r=e?i.Lib.nestedProperty(t,e).get()||{}:t,n=r.color,a=!1;if(Array.isArray(n))for(var o=0;ob,n(p+g+"auto",!o),n(p+g+"min"),n(p+g+"max"),void 0!==_&&(u=!l.isValidScale(_)),n(p+"autocolorscale",u),h=n(p+"colorscale"),f=n(p+"reversescale"),f&&(y.colorscale=l.flipScale(h)),"marker.line."!==p&&(p&&(c=l.hasColorbar(m)),d=n(p+"showscale",c),d&&i.Colorbar.supplyDefaults(m,y,r))},l.calc=function(t,e,r,n){var a,o;r?(a=i.Lib.nestedProperty(t,r).get(),o=i.Lib.nestedProperty(t._input,r).get()):(a=t,o=t._input);var s=a[n+"auto"],u=a[n+"min"],c=a[n+"max"],h=a.colorscale;(s!==!1||void 0===u)&&(u=i.Lib.aggNums(Math.min,null,e)),(s!==!1||void 0===c)&&(c=i.Lib.aggNums(Math.max,null,e)),u===c&&(u-=.5,c+=.5),a[n+"min"]=u,a[n+"max"]=c,o[n+"min"]=u,o[n+"max"]=c,a.autocolorscale&&(h=0>u*c?l.scales.RdBu:u>=0?l.scales.Reds:l.scales.Blues,o.colorscale=h,a.reversescale&&(h=l.flipScale(h)),a.colorscale=h)},l.makeScaleFunction=function(t,e,r){for(var n,l=t.length,u=new Array(l),c=new Array(l),h=0;l>h;h++)n=t[h],u[h]=e+n[0]*(r-e),c[h]=n[1];var f=a.scale.linear().domain(u).interpolate(a.interpolateRgb).range(c);return function(t){return s(t)?f(t):o(t).isValid()?t:i.Color.defaultLine}}},{"../../plotly":333,"./attributes":287,"./scales":289,d3:53,"fast-isnumeric":58,tinycolor2:213}],289:[function(t,e,r){e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YIGnBu:[[0,"rgb(8, 29, 88)"],[.125,"rgb(37, 52, 148)"],[.25,"rgb(34, 94, 168)"],[.375,"rgb(29, 145, 192)"],[.5,"rgb(65, 182, 196)"],[.625,"rgb(127, 205, 187)"],[.75,"rgb(199, 233, 180)"],[.875,"rgb(237, 248, 217)"],[1,"rgb(255, 255, 217)"]],Greens:[[0,"rgb(0, 68, 27)"],[.125,"rgb(0, 109, 44)"],[.25,"rgb(35, 139, 69)"],[.375,"rgb(65, 171, 93)"],[.5,"rgb(116, 196, 118)"],[.625,"rgb(161, 217, 155)"],[.75,"rgb(199, 233, 192)"],[.875,"rgb(229, 245, 224)"],[1,"rgb(247, 252, 245)"]],YIOrRd:[[0,"rgb(128, 0, 38)"],[.125,"rgb(189, 0, 38)"],[.25,"rgb(227, 26, 28)"],[.375,"rgb(252, 78, 42)"],[.5,"rgb(253, 141, 60)"],[.625,"rgb(254, 178, 76)"],[.75,"rgb(254, 217, 118)"],[.875,"rgb(255, 237, 160)"],[1,"rgb(255, 255, 204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5, 10, 172)"],[.35,"rgb(106, 137, 247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220, 170, 132)"],[.7,"rgb(230, 145, 90)"],[1,"rgb(178, 10, 28)"]],Reds:[[0,"rgb(220, 220, 220)"],[.2,"rgb(245, 195, 157)"],[.4,"rgb(245, 160, 105)"],[1,"rgb(178, 10, 28)"]],Blues:[[0,"rgb(5, 10, 172)"],[.35,"rgb(40, 60, 190)"],[.5,"rgb(70, 100, 245)"],[.6,"rgb(90, 120, 245)"],[.7,"rgb(106, 137, 247)"],[1,"rgb(220, 220, 220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0, 0, 200)"],[.25,"rgb(0, 25, 255)"],[.375,"rgb(0, 152, 255)"],[.5,"rgb(44, 255, 150)"],[.625,"rgb(151, 255, 0)"],[.75,"rgb(255, 234, 0)"],[.875,"rgb(255, 111, 0)"],[1,"rgb(255, 0, 0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,d/2),c=Math.pow(s*s+l*l,d/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,p=3*c*(u+c),g=3*u*(u+c);return[[a.round(e[0]+(p&&h/p),2),a.round(e[1]+(p&&f/p),2)],[a.round(e[0]-(g&&h/g),2),a.round(e[1]-(g&&f/g),2)]]}var i=t("../../plotly"),a=t("d3"),o=t("fast-isnumeric"),s=e.exports={};s.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(i.Color.fill,n)},s.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},s.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},s.setRect=function(t,e,r,n,i){t.call(s.setPosition,e,r).call(s.setSize,n,i)},s.translatePoints=function(t,e,r){t.each(function(t){var n=t.xp||e.c2p(t.x),i=t.yp||r.c2p(t.y),s=a.select(this);o(n)&&o(i)?"text"===this.nodeName?s.attr("x",n).attr("y",i):s.attr("transform","translate("+n+","+i+")"):s.remove()})},s.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},s.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:1>e?1:Math.round(e):r||0},s.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},l=e||o.width||0,u=n||o.dash||"";a.select(this).call(i.Color.stroke,r||o.color).call(s.dashLine,u,l)})},s.dashLine=function(t,e,r){var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},s.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(i.Color.fill,e[0].trace.fillcolor)}catch(n){console.log(n,t),r.remove()}})};var l=t("./symbol_defs");s.symbolNames=[],s.symbolFuncs=[],s.symbolNeedLines={},s.symbolNoDot={},s.symbolList=[],Object.keys(l).forEach(function(t){var e=l[t];s.symbolList=s.symbolList.concat([e.n,t,e.n+100,t+"-open"]),s.symbolNames[e.n]=t,s.symbolFuncs[e.n]=e.f,e.needLine&&(s.symbolNeedLines[e.n]=!0),e.noDot?s.symbolNoDot[e.n]=!0:s.symbolList=s.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var u=s.symbolNames.length,c="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";s.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=s.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=u||t>=400?0:Math.floor(Math.max(t,0))},s.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=r.line;if(i.Plots.traceIs(e,"symbols")){var o=i.Scatter.getBubbleSizeFn(e);t.attr("d",function(t){var n;n="various"===t.ms||"various"===r.size?3:i.Scatter.isBubble(e)?o(t.ms):(r.size||6)/2,t.mrc=n;var a=s.symbolNumber(t.mx||r.symbol)||0,l=a%100;return t.om=a%200>=100,s.symbolFuncs[l](n)+(a>=200?c:"")}).style("opacity",function(t){return(t.mo+1||r.opacity+1)-1})}var l=(e._input||{}).marker||{},u=s.tryColorscale(r,l,""),h=s.tryColorscale(r,l,"line.");t.each(function(t){var e,o,s;t.so?(s=n.outlierwidth,o=n.outliercolor,e=r.outliercolor):(s=(t.mlw+1||n.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,o="mlc"in t?t.mlcc=h(t.mlc):Array.isArray(n.color)?i.Color.defaultLine:n.color,e="mc"in t?t.mcc=u(t.mc):Array.isArray(r.color)?i.Color.defaultLine:r.color||"rgba(0,0,0,0)");var l=a.select(this);t.om?l.call(i.Color.stroke,e).style({"stroke-width":(s||1)+"px",fill:"none"}):(l.style("stroke-width",s+"px").call(i.Color.fill,e),s&&l.call(i.Color.stroke,o))})}},s.tryColorscale=function(t,e,r){var n=i.Lib.nestedProperty(t,r+"color").get(),a=i.Lib.nestedProperty(t,r+"colorscale").get(),s=i.Lib.nestedProperty(t,r+"cauto").get(),l=i.Lib.nestedProperty(t,r+"cmin"),u=i.Lib.nestedProperty(t,r+"cmax"),c=l.get(),h=u.get();return a&&Array.isArray(n)?(!s&&o(c)&&o(h)||(c=1/0,h=-(1/0),n.forEach(function(t){o(t)&&(c>t&&(c=+t),t>h&&(h=+t))}),c>h&&(c=0,h=1),l.set(c),u.set(h),i.Lib.nestedProperty(e,r+"cmin").set(c),i.Lib.nestedProperty(e,r+"cmax").set(h)),i.Colorscale.makeScaleFunction(a,c,h)):i.Lib.identity};var h={start:1,end:-1,middle:0,bottom:1,top:-1},f=1.3;s.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var l=t.tp||e.textposition,u=-1!==l.indexOf("top")?"top":-1!==l.indexOf("bottom")?"bottom":"middle",c=-1!==l.indexOf("left")?"end":-1!==l.indexOf("right")?"start":"middle",d=t.ts||e.textfont.size,p=t.mrc?t.mrc/.8+1:0;d=o(d)&&d>0?d:0,r.call(s.font,t.tf||e.textfont.family,d,t.tc||e.textfont.color).attr("text-anchor",c).text(n).call(i.util.convertToTspans);var g=a.select(this.parentNode),v=r.selectAll("tspan.line"),m=((v[0].length||1)-1)*f+1,y=h[c]*p,b=.75*d+h[u]*p+(h[u]-1)*m*d/2;g.attr("transform","translate("+y+","+b+")"),m>1&&v.attr({x:r.attr("x"),y:r.attr("y")})})};var d=.5;s.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,i="M"+t[0],a=[];for(r=1;rr;r++)o.push(n(t[r-1],t[r],t[r+1],e));for(o.push(n(t[a-1],t[a],t[0],e)),r=1;a>=r;r++)i+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return i+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var p={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},g=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};s.steps=function(t){var e=p[t]||g;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n=m&&(a.selectAll("[data-bb]").attr("data-bb",null),v=[]),t.setAttribute("data-bb",v.length),v.push(u),i.Lib.extendFlat({},u)},s.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href+r),t.attr("clip-path","url("+r+")")}},{"../../plotly":333,"./symbol_defs":291,d3:53,"fast-isnumeric":58}],291:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+h+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:53}],292:[function(t,e,r){e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],293:[function(t,e,r){"use strict";function n(t,e,r){return"percent"===t?Math.abs(e*r/100):"constant"===t?Math.abs(r):"sqrt"===t?Math.sqrt(Math.abs(e)):0}function i(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),s(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),s(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t("../../plotly"),o=t("d3"),s=t("fast-isnumeric"),l=e.exports={};l.attributes=t("./attributes"),l.supplyDefaults=function(t,e,r,n){function i(t,e){return a.Lib.coerce(c,u,l.attributes,t,e)}var o="error_"+n.axis,u=e[o]={},c=t[o]||{},h=i("visible","array"in c||"value"in c);if(h){var f=i("type","array"in c?"data":"percent"),d=!0;if("sqrt"!==f&&(d=i("symmetric",!(("data"===f?"arrayminus":"valueminus")in c))),"data"===f){var p=i("array");if(p||(u.array=[]),i("traceref"),!d){var g=i("arrayminus");g||(u.arrayminus=[]),i("tracerefminus")}}else("percent"===f||"constant"===f)&&(i("value"),d||i("valueminus"));var v="copy_"+n.inherit+"style";if(n.inherit){var m=e["error_"+n.inherit];(m||{}).visible&&i(v,!(c.color||s(c.thickness)||s(c.width)))}n.inherit&&u[v]||(i("color",r),i("thickness"),i("width",a.Plots.traceIs(e,"gl3d")?0:4))}},l.pushRef2GDC=function(t,e,r,n){function i(e){var r=t.data[e][l];r["tracerefminus"===u?"arrayminus":"array"]=h}var a,o=!1,s=r.split("."),l=s[0],u=s[1],c=l.charAt(l.length-1);"type"===u?("various"===e&&(o=!0,e=0),a=Number(t.calcdata[Number(e)][0].trace["error_"+c].traceref)||0):("traceref"===u||"tracerefminus"===u)&&("various"===e&&(o=!0),a=Number(n)||0);var h=t.data[a][c].map(Number);if(o)for(var f=0;fo;o++)a[o]={x:r[o],y:n[o]};return a[0].trace=t,l.calc({calcdata:[a],_fullLayout:e}),a},l.plot=function(t,e,r){var n=e.x(),l=e.y();e.plot.select(".errorlayer").selectAll("g.errorbars").remove();var u;e.plot.select(".errorlayer").selectAll("g.errorbars").data(r).enter().append("g").attr("class","errorbars").each(function(t){var e=t[0].trace,r=e.error_x,c=e.error_y,h=a.Scatter.hasMarkers(e)&&e.marker.maxdisplayed>0;(c.visible||r.visible)&&o.select(this).selectAll("g").data(a.Lib.identity).enter().append("g").each(function(t){u=i(t,n,l);var e,a=o.select(this);if(!h||t.vis){if(c.visible&&s(u.x)&&s(u.yh)&&s(u.ys)){var f=c.width;e="M"+(u.x-f)+","+u.yh+"h"+2*f+"m-"+f+",0V"+u.ys,u.noYS||(e+="m-"+f+",0h"+2*f),a.append("path").classed("yerror",!0).attr("d",e)}if(r.visible&&s(u.y)&&s(u.xh)&&s(u.xs)){var d=(r.copy_ystyle?c:r).width;e="M"+u.xh+","+(u.y-d)+"v"+2*d+"m0,-"+d+"H"+u.xs,u.noXS||(e+="m0,-"+d+"v"+2*d),a.append("path").classed("xerror",!0).attr("d",e)}}})})},l.style=function(t){o.select(t).selectAll("g.errorbars").each(function(t){var e=o.select(this),r=t[0].trace,n=r.error_y||{},i=r.error_x||{};e.selectAll("g path.yerror").style("stroke-width",n.thickness+"px").call(a.Color.stroke,n.color),i.copy_ystyle&&(i=n),e.selectAll("g path.xerror").style("stroke-width",i.thickness+"px").call(a.Color.stroke,i.color)})},l.hoverInfo=function(t,e,r){e.error_y.visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),e.error_x.visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"../../plotly":333,"./attributes":292,d3:53,"fast-isnumeric":58}],294:[function(t,e,r){var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":313,"../../plots/font_attributes":339,"../color/attributes":283}],295:[function(t,e,r){"use strict";function n(t){return t.visible&&o.Plots.traceIs(t,"showLegend")}function i(t){return-1!==(t.traceorder||"").indexOf("grouped")}function a(t){return-1!==(t.traceorder||"").indexOf("reversed")}var o=t("../../plotly"),s=t("d3"),l=e.exports={};l.layoutAttributes=t("./attributes"),l.supplyLayoutDefaults=function(t,e,r){function s(t,e){return o.Lib.coerce(c,h,l.layoutAttributes,t,e)}for(var u,c=t.legend||{},h=e.legend={},f=0,d="normal",p=0;p1);g!==!1&&(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),o.Lib.coerceFont(s,"font",e.font),s("traceorder",d),i(e.legend)&&s("tracegroupgap"),s("x"),s("xanchor"),s("y"),s("yanchor"),o.Lib.noneOrAll(c,h,["x","y"]))},l.lines=function(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=o.Scatter.hasLines(e),i=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(o.Drawing.fillGroupStyle);var a=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(o.Drawing.lineGroupStyle)},l.points=function(t){function e(t,e,r){var n=o.Lib.nestedProperty(l,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(ir[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],l=a.trace,u=o.Scatter.hasMarkers(l),c=o.Scatter.hasText(l),h=o.Scatter.hasLines(l);if(u||c||h){var f={},d={};u&&(f.mc=e("marker.color",r),f.mo=e("marker.opacity",o.Lib.mean,[.2,1]),f.ms=e("marker.size",o.Lib.mean,[2,16]),f.mlc=e("marker.line.color",r),f.mlw=e("marker.line.width",o.Lib.mean,[0,5]),d.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(d.line={width:e("line.width",r,[0,10])}),c&&(f.tx="Aa",f.tp=e("textposition",r),f.ts=10,f.tc=e("textfont.color",r),f.tf=e("textfont.family",r)),n=[o.Lib.minExtend(a,f)],i=o.Lib.minExtend(l,d)}var p=s.select(this).select("g.legendpoints"),g=p.selectAll("path.scatterpts").data(u?n:[]);g.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),g.exit().remove(),g.call(o.Drawing.pointStyle,i),u&&(n[0].mrc=3);var v=p.selectAll("g.pointtext").data(c?n:[]);v.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),v.exit().remove(),v.selectAll("text").call(o.Drawing.textPointStyle,i)},l.bars=function(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(o.Plots.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=(t.mlw+1||n.width+1)-1,i=s.select(this);i.style("stroke-width",e+"px").call(o.Color.fill,t.mc||r.color),e&&i.call(o.Color.stroke,t.mlc||n.color)})},l.boxes=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(o.Plots.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(t){var r=(t.lw+1||e.line.width+1)-1,n=s.select(this);n.style("stroke-width",r+"px").call(o.Color.fill,t.fc||e.fillcolor),r&&n.call(o.Color.stroke,t.lc||e.line.color)})},l.pie=function(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(o.Plots.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(o.Pie.styleOne,t[0],e)},l.style=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.legendfill").data([t]);r.enter().append("g").classed("legendfill",!0);var n=e.selectAll("g.legendlines").data([t]);n.enter().append("g").classed("legendlines",!0);var i=e.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.style("opacity",t[0].trace.opacity),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(l.bars).each(l.boxes).each(l.pie).each(l.lines).each(l.points)},l.texts=function(t,e,r,n,i){function a(t){o.util.convertToTspans(t,function(){e.firstRender&&l.repositionLegend(e,i)}),t.selectAll("tspan.line").attr({x:t.attr("x")})}var u=e._fullLayout,c=r[0].trace,h=o.Plots.traceIs(c,"pie"),f=c.index,d=h?r[0].label:c.name,p=s.select(t).selectAll("text.legendtext").data([0]);p.enter().append("text").classed("legendtext",!0),p.attr({x:40,y:0}).style("text-anchor","start").call(o.Drawing.font,u.legend.font).text(d).attr({"data-unformatted":d}),e._context.editable&&!h?p.call(o.util.makeEditable).call(a).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(a),this.text()||(t=" "),o.restyle(e,"name",t,f)}):p.call(a)},l.getLegendData=function(t,e){function r(t,r){if(""!==t&&i(e))-1===g.indexOf(t)?(g.push(t),v=!0,p[t]=[[r]]):p[t].push([r]);else{var n="~~i"+y;g.push(n),p[n]=[[r]],y++}}var s,l,u,c,h,f,d,p={},g=[],v=!1,m={},y=0;for(h=0;hh;h++)b=p[g[h]],x[h]=a(e)?b.reverse():b;else{for(x=[new Array(_)],h=0;_>h;h++)b=p[g[h]][0],x[0][a(e)?_-h-1:h]=b;_=1}return e._lgroupsLength=_,x},l.draw=function(t){var e=t._fullLayout;if(e._infolayer&&t.calcdata){var r=e.legend,n=e.showlegend&&l.getLegendData(t.calcdata,r),a=e.hiddenlabels||[];if(!e.showlegend||!n.length)return e._infolayer.selectAll(".legend").remove(),void o.Plots.autoMargin(t,"legend");"undefined"==typeof t.firstRender?t.firstRender=!0:t.firstRender&&(t.firstRender=!1);var u=e._infolayer.selectAll("svg.legend").data([0]);u.enter(0).append("svg").attr("class","legend");var c=u.selectAll("rect.bg").data([0]);c.enter(0).append("rect").attr("class","bg"),c.call(o.Color.stroke,r.bordercolor).call(o.Color.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var h=u.selectAll("g.groups").data(n);h.enter().append("g").attr("class","groups"),h.exit().remove(),i(r)&&h.attr("transform",function(t,e){return"translate(0,"+e*r.tracegroupgap+")"});var f=h.selectAll("g.traces").data(o.Lib.identity);if(f.enter().append("g").attr("class","traces"),f.exit().remove(),f.call(l.style).style("opacity",function(t){var e=t[0].trace;return o.Plots.traceIs(e,"pie")?-1!==a.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(e,r){l.texts(this,t,e,r,f);var n=s.select(this).selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(o.Color.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!t._dragged){var r,n,i=t._fullData,s=e[0].trace,l=s.legendgroup,u=[];if(o.Plots.traceIs(s,"pie")){var c=e[0].label,h=a.slice(),f=h.indexOf(c);-1===f?h.push(c):h.splice(f,1),o.relayout(t,"hiddenlabels",h)}else{if(""===l)u=[s.index];else for(var d=0;dtspan"),p=1.3*a.font.size,g=d[0].length||1,v=f.node()&&o.Drawing.bBox(f.node()).width,m=i.select("g[class*=math-group]");if(!n.showlegend)return void i.remove();if(m.node()){var y=o.Drawing.bBox(m.node());p=y.height,v=y.width,m.attr("transform","translate(0,"+p/4+")")}else e=p*(.3+(1-g)/2),f.attr("y",e),d.attr("y",e);r=Math.max(p*g,16)+3,i.attr("transform","translate("+l+","+(5+l+c+r/2)+")"),h.attr({x:0,y:-r/2,height:r}),c+=r,u=Math.max(u,v||0)}),i(a)&&(c+=(a._lgroupsLength-1)*a.tracegroupgap),e.selectAll(".legendtoggle").attr("width",(t._context.editable?0:u)+40),u+=45+2*l,c+=10+2*l;var h=n.l+n.w*a.x,f=n.t+n.h*(1-a.y),d="left";"right"===a.xanchor||"auto"===a.xanchor&&a.x>=2/3?(h-=u,d="right"):("center"===a.xanchor||"auto"===a.xanchor&&a.x>1/3)&&(h-=u/2,d="center");var p="top";"bottom"===a.yanchor||"auto"===a.yanchor&&a.y<=1/3?(f-=c,p="bottom"):("middle"===a.yanchor||"auto"===a.yanchor&&a.y<2/3)&&(f-=c/2,p="middle"),u=Math.ceil(u),c=Math.ceil(c),h=Math.round(h),f=Math.round(f),r._infolayer.selectAll("svg.legend").call(o.Drawing.setRect,h,f,u,c),r._infolayer.selectAll("svg.legend .bg").call(o.Drawing.setRect,l/2,l/2,u-l,c-l),o.Plots.autoMargin(t,"legend",{x:a.x,y:a.y,l:u*({right:1,center:.5}[d]||0),r:u*({left:1,center:.5}[d]||0),b:c*({top:1,middle:.5}[p]||0),t:c*({bottom:1,middle:.5}[p]||0)})}},{"../../plotly":333,"./attributes":294,d3:53}],296:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n)for(var s,u,c,h="in"===i?.5:2,f=(1+h)/2,d=(1-h)/2,p=l.Axes.list(t,null,!0),g=0;gv;v++){var m=o[v];c=g[m]={};for(var y=0;yl;l++){var c=s[l],f={_fullLayout:e},d=u.Axes.coerceRef(t,n,f,c);if("path"!==o){var p=.25,g=.75;if("paper"!==d){var v=u.Axes.getFromId(f,d),m=a(v);p=m(v.range[0]+p*(v.range[1]-v.range[0])),g=m(v.range[0]+g*(v.range[1]-v.range[0]))}r(c+"0",p),r(c+"1",g)}}return"path"===o?r("path"):u.Lib.noneOrAll(t,n,["x0","x1","y0","y1"]),n}function i(t){return"category"===t.type?t.c2l:t.d2l}function a(t){return"category"===t.type?t.l2c:t.l2d}function o(t){return function(e){return t(e.replace("_"," "))}}function s(t,e){var r,n,a,s,l=e.type,c=u.Axes.getFromId(t,e.xref),f=u.Axes.getFromId(t,e.yref),d=t._fullLayout._size;if(c?(r=i(c),n=function(t){return c._offset+c.l2p(r(t,!0))}):n=function(t){return d.l+d.w*t},f?(a=i(f),s=function(t){return f._offset+f.l2p(a(t,!0))}):s=function(t){return d.t+d.h*(1-t)},"path"===l)return c&&"date"===c.type&&(n=o(n)),f&&"date"===f.type&&(s=o(s)),h.convertPath(e.path,n,s);var p=n(e.x0),g=n(e.x1),v=s(e.y0),m=s(e.y1);if("line"===l)return"M"+p+","+v+"L"+g+","+m;if("rect"===l)return"M"+p+","+v+"H"+g+"V"+m+"H"+p+"Z";var y=(p+g)/2,b=(v+m)/2,x=Math.abs(y-p),_=Math.abs(b-v),w="A"+x+","+_,k=y+x+","+b,A=y+","+(b-_);return"M"+k+w+" 0 1,1 "+A+w+" 0 0,1 "+k+"Z"}function l(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var s,l,u,c,h,p=1/0,g=-(1/0),v=n.match(f);for("date"===t.type&&(a=o(a)),s=0;sh&&(p=h),h>g&&(g=h)));return g>=p?[p,g]:void 0}}var u=t("../../plotly"),c=t("fast-isnumeric"),h=e.exports={};h.layoutAttributes=t("./attributes"),h.supplyLayoutDefaults=function(t,e){for(var r=t.shapes||[],i=e.shapes=[],a=0;ae;l--)d._shapelayer.selectAll('[data-index="'+(l-1)+'"]').attr("data-index",String(l)),h.draw(t,l)}}d._shapelayer.selectAll('[data-index="'+e+'"]').remove();var g=f.shapes[e];if(g){var v={xref:g.xref,yref:g.yref},m={};"string"==typeof r&&r?m[r]=o:u.Lib.isPlainObject(r)&&(m=r);var y=Object.keys(m);for(l=0;ll;l++){var _=x[l];if(void 0===m[_]&&void 0!==g[_]){var w,k=_.charAt(0),A=u.Axes.getFromId(t,u.Axes.coerceRef(v,{},t,k)),M=u.Axes.getFromId(t,u.Axes.coerceRef(g,{},t,k)),L=g[_];void 0!==m[k+"ref"]&&(A?(w=i(A)(L),L=(w-A.range[0])/(A.range[1]-A.range[0])):L=(L-M.domain[0])/(M.domain[1]-M.domain[0]),M?(w=M.range[0]+L*(M.range[1]-M.range[0]),L=a(M)(w)):L=A.domain[0]+L*(A.domain[1]-A.domain[0])),g[_]=L}}var T=n(g,d);d.shapes[e]=T;var E={"data-index":String(e),"fill-rule":"evenodd",d:s(t,T)},C=(T.xref+T.yref).replace(/paper/g,""),S=T.line.width?T.line.color:"rgba(0,0,0,0)",z=d._shapelayer.append("path").attr(E).style("opacity",T.opacity).call(u.Color.stroke,S).call(u.Color.fill,T.fillcolor).call(u.Drawing.dashLine,T.line.dash,T.line.width);C&&z.call(u.Drawing.setClipUrl,"clip"+d._uid+C)}};var f=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,d=/[^\s,]+/g,p={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},g={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},v={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};h.convertPath=function(t,e,r){return t.replace(f,function(t){var n=0,i=t.charAt(0),a=p[i],o=g[i],s=v[i],l=t.substr(1).replace(d,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+t)),i+l})},h.calcAutorange=function(t){var e,r,n,i,a,o=t._fullLayout,s=o.shapes;if(s.length&&t._fullData.length)for(e=0;eh?r=h:(u.left-=z.offsetLeft,u.right-=z.offsetLeft,u.top-=z.offsetTop,u.bottom-=z.offsetTop,z.selection.each(function(){var t=n.Drawing.bBox(this);n.Lib.bBoxIntersect(u,t,l)&&(r=Math.max(r,s*(t[z.side]-u[o])+l))}),r=Math.min(h,r)),r>0||0>h){var f={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[z.side];e.attr("transform","translate("+f+")")}}}function c(){j=0,O=!0,I=N,p._infolayer.select("."+e).attr({"data-unformatted":I}).text(I).on("mouseover.opacity",function(){i.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){i.select(this).transition().duration(1e3).style("opacity",0)})}if(!e)return n.Axes.listIds(t).forEach(function(e){s.draw(t,e+"title")}),void s.draw(t,"gtitle");var h,f,d,p=t._fullLayout,g=p._size,v=e.charAt(0),m="cb"===e.substr(1,2);if(m){var y=e.substr(3).replace("title",""); +t._fullData.some(function(e,r){return e.uid===y?(h=r,f=t.calcdata[r][0].t.cb.axis,!0):void 0})}else f=p[n.Axes.id2name(e.replace("title",""))]||p;var b,x,_,w,k,A=f===p?"title":f._name+".title",M=m?"colorscale":(f._id||v).toUpperCase()+" axis",L=f.titlefont.family,T=f.titlefont.size,E=f.titlefont.color,C="",S={},z={selection:i.select(t).selectAll("g."+f._id+"tick"),side:f.side},P=m?0:1.5;m?(z.offsetLeft=g.l,z.offsetTop=g.t):z.selection.size()&&(k=i.select(z.selection.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/),k&&(z.offsetLeft=+k[1],z.offsetTop=+k[2])),m&&f.titleside?(b=g.l+f.titlex*g.w,x=g.t+(1-f.titley)*g.h+("top"===f.titleside?3+.75*T:-3-.25*T),d={x:b,y:x,"text-anchor":"start"},z={},e="h"+e):"x"===v?(_=f,w="free"===_.anchor?{_offset:g.t+(1-(_.position||0))*g.h,_length:0}:n.Axes.getFromId(t,_.anchor),b=_._offset+_._length/2,x=w._offset+("top"===_.side?-10-T*(P+(_.showticklabels?1:0)):w._length+10+T*(P+(_.showticklabels?1.5:.5))),d={x:b,y:x,"text-anchor":"middle"},z.side||(z.side="bottom")):"y"===v?(w=f,_="free"===w.anchor?{_offset:g.l+(w.position||0)*g.w,_length:0}:n.Axes.getFromId(t,w.anchor),x=w._offset+w._length/2,b=_._offset+("right"===w.side?_._length+10+T*(P+(w.showticklabels?1:.5)):-10-T*(P+(w.showticklabels?.5:0))),S={center:0},d={x:b,y:x,"text-anchor":"middle"},C={rotate:"-90",offset:0},z.side||(z.side="left")):(M="Plot",T=p.titlefont.size,b=p.width/2,x=p._size.t/2,d={x:b,y:x,"text-anchor":"middle"},z={});var j=1,O=!1,I=f.title.trim();""===I&&(j=0),I.match(/Click to enter .+ title/)&&(j=.2,O=!0);var D;if(m){D=i.select(t).selectAll("."+f._id.substr(1)+" .cbtitle");var R="h"===e.charAt(0)?e.substr(1):"h"+e;D.selectAll("."+R+",."+R+"-math-group").remove()}else D=p._infolayer.selectAll(".g-"+e).data([0]),D.enter().append("g").classed("g-"+e,!0);var F=D.selectAll("text").data([0]);F.enter().append("text"),F.text(I).attr("class",e),F.attr({"data-unformatted":I}).call(r);var N="Click to enter "+M.replace(/\d+/,"")+" title";t._context.editable?(I||c(),F.call(n.util.makeEditable).on("edit",function(e){if(m){var r=t._fullData[h];o.traceIs(r,"markerColorscale")?n.restyle(t,"marker.colorbar.title",e,h):n.restyle(t,"colorbar.title",e,h)}else n.relayout(t,A,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(r)}).on("input",function(t){this.text(t||" ").attr(d).selectAll("tspan.line").attr(d)})):(!I||I.match(/Click to enter .+ title/))&&F.remove(),F.classed("js-placeholder",O)}},{"../../plotly":333,d3:53,"fast-isnumeric":58}],302:[function(t,e,r){e.exports={DZA:"algeria",AGO:"angola",EGY:"egypt",BGD:"bangladesh|^(?=.*east).*paki?stan",NER:"\\bniger(?!ia)",LIE:"liechtenstein",NAM:"namibia",BGR:"bulgaria",BOL:"bolivia",GHA:"ghana|gold.?coast",CCK:"\\bcocos|keeling",PAK:"^(?!.*east).*paki?stan",CPV:"verde",JOR:"jordan",LBR:"liberia",LBY:"libya",MYS:"malaysia",IOT:"british.?indian.?ocean",PRI:"puerto.?rico",MYT:"mayotte",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k",PSE:"palestin|\\bgaza|west.?bank",TZA:"tanzania",BWA:"botswana|bechuana",KHM:"cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$",UMI:"minor.?outlying.?is",TTO:"trinidad|tobago",PRY:"paraguay",HKG:"hong.?kong",SAU:"\\bsa\\w*.?arabia",LBN:"lebanon",SVN:"slovenia",BFA:"burkina|\\bfaso|upper.?volta",SVK:"^(?!.*cze).*slovak",MRT:"mauritania",HRV:"croatia",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$",KNA:"kitts|\\bnevis",JAM:"jamaica",SMR:"san.?marino",GIB:"gibraltar",DJI:"djibouti",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",FIN:"finland",URY:"uruguay",VAT:"holy.?see|vatican|papal.?st",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SYC:"seychell",NPL:"nepal",CXR:"christmas",LAO:"\\blaos?\\b",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",BVT:"bouvet",ZAF:"\\bs\\w*.?africa",KIR:"kiribati",PHL:"philippines",SXM:"^(?!.*martin)(?!.*saba).*maarten",ROU:"r(o|u|ou)mania",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",SYR:"syria",MAC:"maca(o|u)",NFK:"norfolk",NIC:"nicaragua",MLT:"\\bmalta",KAZ:"kazak",TCA:"turks",PYF:"french.?polynesia|tahiti",NIU:"niue",DMA:"dominica(?!n)",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",BEN:"benin|dahome",GUF:"^(?=.*french).*guiana",BEL:"^(?!.*luxem).*belgium",MSR:"montserrat",TGO:"togo",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GUM:"\\bguam",LKA:"sri.?lanka|ceylon",SSD:"\\bs\\w*.?sudan",FLK:"falkland|malvinas",PCN:"pitcairn",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",GUY:"guyana|british.?guiana",CRI:"costa.?rica",COK:"\\bcook",MAR:"morocco|\\bmaroc",MNP:"mariana",LSO:"lesotho|basuto",HUN:"^(?!.*austr).*hungary",TKM:"turkmen",SUR:"surinam|dutch.?guiana",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",BMU:"bermuda",HMD:"heard.*mcdonald",TCD:"\\bchad",GEO:"^(?!.*south).*georgia",MNE:"^(?!.*serbia).*montenegro",MNG:"mongolia",MHL:"marshall",MTQ:"martinique",CSK:"czechoslovakia",BLZ:"belize|^(?=.*british).*honduras",DDR:"german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany",MMR:"myanmar|burma",AFG:"afghan",BDI:"burundi",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",BLR:"belarus|byelo",BLM:"barth(e|\xe9)lemy",GRD:"grenada",TKL:"tokelau",GRC:"greece|hellenic|hellas",GRL:"greenland",SHN:"helena",AND:"andorra",MOZ:"mozambique",TJK:"tajik",THA:"thailand|\\bsiam",HTI:"haiti",MEX:"\\bmexic",ANT:"^(?=.*\\bant).*(nether|dutch)",ZWE:"zimbabwe|^(?!.*northern).*rhodesia",LCA:"\\blucia",IND:"india(?!.*ocea)",LVA:"latvia",BTN:"bhutan",VCT:"vincent",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",NOR:"norway",CZE:"^(?=.*rep).*czech|czechia|bohemia",ATF:"french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt",ATG:"antigua",FJI:"fiji",HND:"^(?!.*brit).*honduras",MUS:"mauritius",DOM:"dominican",LUX:"^(?!.*belg).*luxem",ISR:"israel",YUG:"yugoslavia",FSM:"micronesia",PER:"peru",REU:"r(e|\xe9)union",IDN:"indonesia",VUT:"vanuatu|new.?hebrides",MKD:"macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo",ISL:"iceland",GLP:"guadeloupe",ETH:"ethiopia|abyssinia",COM:"comoro",COL:"colombia",NGA:"nigeria",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TWN:"taiwan|taipei|formosa",PRT:"portugal",MDA:"moldov|b(a|e)ssarabia",GGY:"guernsey",MDG:"madagascar|malagasy",ATA:"antarctica",ECU:"ecuador",SEN:"senegal",ESH:"sahara",MDV:"maldive",ASM:"^(?=.*americ).*samoa",SPM:"miquelon",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",LTU:"lithuania",RWA:"rwanda",ZMB:"zambia|northern.?rhodesia",GMB:"gambia",WLF:"futuna|wallis",JEY:"jersey",FRO:"faroe|faeroe",GTM:"guatemala",DNK:"denmark",IMN:"^(?=.*isle).*\\bman",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baust.*\\bemp",SJM:"svalbard",VEN:"venezuela",PLW:"palau",KEN:"kenya|british.?east.?africa|east.?africa.?prot",TUR:"turkey",ALB:"albania",OMN:"\\boman|trucial",TUV:"tuvalu",ALA:"\\b(a|\xe5)land",BRN:"brunei",TUN:"tunisia",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",BRB:"barbados",BRA:"brazil",CIV:"ivoire|ivory",SRB:"^(?!.*monte).*serbia",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",USA:"^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$",QAT:"qatar",WSM:"^(?!.*amer).*samoa",AZE:"azerbaijan",GNB:"bissau|^(?=.*portu).*guinea",SWZ:"swaziland",TON:"tonga",CAN:"canada",UKR:"ukrain",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b",AIA:"anguill?a",CAF:"\\bcen.*\\baf|^c\\.?a\\.?r\\.?$",CHE:"switz|swiss",CYP:"cyprus",BIH:"herzegovina|bosnia",SGP:"singapore",SGS:"south.?georgia|sandwich",SOM:"somali",UZB:"uzbek",CMR:"cameroon",POL:"poland",EAZ:"zanz",KWT:"kuwait",ERI:"eritrea",GAB:"gabon",CYM:"cayman",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",EST:"estonia",MWI:"malawi|nyasa",ESP:"spain",IRQ:"\\biraq|mesopotamia",SLV:"el.?salvador",MLI:"\\bmali\\b",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",IRL:"ireland",IRN:"\\biran|persia",ABW:"^(?!.*bonaire).*\\baruba",SLE:"sierra",PAN:"panama",SDN:"^(?!.*\\bs(?!u)).*sudan",SLB:"solomon",NZL:"new.?zealand",MCO:"monaco",ITA:"italy",JPN:"japan",KGZ:"kyrgyz|kirghiz",UGA:"uganda",NCL:"new.?caledonia",PNG:"papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea",ARG:"argentin",SWE:"sweden",BHS:"bahamas",BHR:"bahrain",ARM:"armenia",NRU:"nauru",CUB:"\\bcuba"}},{}],303:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],304:[function(t,e,r){e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],305:[function(t,e,r){e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],306:[function(t,e,r){e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],307:[function(t,e,r){"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],308:[function(t,e,r){var n=t("./plotly");r.version=t("../package.json").version,r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.setPlotConfig=t("./plot_api/set_plot_config"),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=n.Snapshot,r.PlotSchema=n.PlotSchema,r.Queue=n.Queue,r.d3=t("d3")},{"../build/ploticon":2,"../package.json":279,"./plot_api/set_plot_config":332,"./plotly":333,d3:53}],309:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],310:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("./nested_property");Object.keys(t("../components/colorscale/scales"));r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)}},"boolean":{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,n){!i(t)||void 0!==n.min&&tn.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,n){t%1||!i(t)||void 0!==n.min&&tn.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if(n.strict===!0&&"string"!=typeof t)return void e.set(r);var i=String(t);void 0===t||n.noBlank===!0&&!i?e.set(r):e.set(i)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(n.Colorscale.getScale(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):i(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},axisid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.charAt(0)===r){var n=Number(t.substr(1));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},sceneid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,5)===r){var n=Number(t.substr(5));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},geoid:{coerceFunction:function(t,e,r){if("string"==typeof t&&t.substr(0,3)===r){var n=Number(t.substr(3));if(n%1===0&&n>1)return void e.set(t)}e.set(r)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==n.extras.indexOf(t))return void e.set(t);for(var i=t.split("+"),a=0;a2)return!1;var l=o[0].split("-");if(l.length>3||3!==l.length&&o[1])return!1;if(4===l[0].length)r=Number(l[0]);else{if(2!==l[0].length)return!1;var u=(new Date).getFullYear();r=((Number(l[0])-u+70)%100+200)%100+u-70}return s(r)?1===l.length?new Date(r,0,1).getTime():(n=Number(l[1])-1,l[1].length>2||!(n>=0&&11>=n)?!1:2===l.length?new Date(r,n,1).getTime():(i=Number(l[2]),l[2].length>2||!(i>=1&&31>=i)?!1:(i=new Date(r,n,i).getTime(),o[1]?(l=o[1].split(":"),l.length>3?!1:(a=Number(l[0]),l[0].length>2||!(a>=0&&23>=a)?!1:(i+=36e5*a,1===l.length?i:(n=Number(l[1]),l[1].length>2||!(n>=0&&59>=n)?!1:(i+=6e4*n,2===l.length?i:(t=Number(l[2]),t>=0&&60>t?i+1e3*t:!1)))))):i))):!1},r.isDateTime=function(t){return r.dateTime2ms(t)!==!1},r.ms2DateTime=function(t,e){if("undefined"==typeof o)return void console.log("d3 is not defined");e||(e=0);var r=new Date(t),i=o.time.format("%Y-%m-%d")(r);return 7776e6>e?(i+=" "+n(r.getHours(),2),432e6>e&&(i+=":"+n(r.getMinutes(),2),108e5>e&&(i+=":"+n(r.getSeconds(),2),3e5>e&&(i+="."+n(r.getMilliseconds(),3)))),i.replace(/([:\s]00)*\.?[0]*$/,"")):i};var l={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},u={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},c=o.time.format.utc,h={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(c),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(c)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(c)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(t){u[t].forEach(function(e){h[t].D.push(c(e)),["H","I","D"].forEach(function(r){l[r].forEach(function(n){var i=h[t][r];i.push(c(e+"~"+n)),i.push(c(n+"~"+e))})})})});var f=/[a-z]*/g,d=function(t){return t.substr(0,3)},p=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,g=/[\s,\/\-\.\(\)]+/g,v=/~?([ap])~?m(~|$)/,m=function(t,e){return e+"m "},y=/\d\d\d\d/,b=/(^|~)[a-z]{3}/,x=/[ap]m/,_=/:/,w=/q([1-4])/,k=["31~mar","30~jun","30~sep","31~dec"],A=function(t,e){return k[e-1]},M=/ ?([+\-]\d\d:?\d\d|Z)$/;r.parseDate=function(t){if(t.getTime)return t;if("string"!=typeof t)return!1;t=t.toLowerCase().replace(f,d).replace(p,"").replace(g,"~").replace(v,m).replace(w,A).trim().replace(M,"");var e,r,n=null,o=i(t),s=a(t);e=h[o][s],r=e.length;for(var l=0;r>l&&!(n=e[l].parse(t));l++);if(!(n instanceof Date))return!1;var u=n.getTimezoneOffset();return n.setTime(n.getTime()+60*u*1e3),n}},{d3:53,"fast-isnumeric":58}],312:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n;return t._ev=e,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t.emit=function(r,n){"undefined"!=typeof $&&$(t).trigger(r,n),e.emit(r,n)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof $&&(n=$(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;lp;p++){o=t[p];for(s in o)l=f[s],u=o[s],e&&u&&(i(u)||(c=a(u)))?(c?(c=!1,h=l&&a(l)?l:[]):h=l&&i(l)?l:{},f[s]=n([h,u],e,r)):("undefined"!=typeof u||r)&&(f[s]=u)}return f}var i=t("./is_plain_object.js"),a=Array.isArray;r.extendFlat=function(){return n(arguments,!1,!1)},r.extendDeep=function(){return n(arguments,!0,!1)},r.extendDeepAll=function(){return n(arguments,!0,!0)}},{"./is_plain_object.js":318}],314:[function(t,e,r){"use strict";function n(t,e){var r=u[t];return r(e)}function i(t){for(var e,r,n=0;ny;y++)c=l(p,y),d=u(e,y),m[y]=n(c,d);else m=n(p,e);return m}var s=t("../plotly"),l=t("tinycolor2"),u=t("fast-isnumeric"),c=t("./str2rgbarray"),h=t("../components/color/attributes").defaultLine,f=1;e.exports=o},{"../components/color/attributes":283,"../plotly":333,"./str2rgbarray":326,"fast-isnumeric":58,tinycolor2:213}],316:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(e>r)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=0;(e=t.indexOf("&",e))>=0;){var r=t.indexOf(";",e);if(e>r)e+=1;else{var n=u[t.slice(e+1,r)];t=n?t.slice(0,e)+n+t.slice(r+1):t.slice(0,e)+t.slice(r+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u={mu:"\u03bc",amp:"&",lt:"<",gt:">"};e.exports=s},{"superscript-text":199}],317:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.parseDate=o.parseDate;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.notifier=t("./notifier"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;ar?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.identity=function(t){return t},i.randstr=function h(t,e,r){if(r||(r=16),void 0===e&&(e=24),0>=e)return"0";var n,i,a,o=Math.log(Math.pow(2,e))/Math.log(r),s="";for(n=2;o===1/0;n*=2)o=Math.log(Math.pow(2,e/n))/Math.log(r)*n;var l=o-Math.floor(o);for(n=0;n-1||u!==1/0&&u>=Math.pow(2,e)?h(t,e,r):s},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,2>e)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;l>r;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;o>r;r++){for(a=0,n=0;l>n;n++)i=r+n+1-e,-o>i?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),0>i?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.promiseError=function(t){console.log(t,t.stack)},i.syncOrAsync=function(t,e,r){function n(){return i.markTime("async done "+o.name),i.syncOrAsync(t,e,r)}for(var a,o;t.length;){if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);i.markTime("sync done "+o.name)}return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;ni;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;nn;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;i>e;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;n>e;e++)for(a[e]=new Array(i),r=0;i>r;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;a>i;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;ii;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],320:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o=0;e--){if(n=t[e],o=!1,Array.isArray(n))for(r=n.length-1;r>=0;r--)u(n[r])?o?n[r]=void 0:n.pop():o=!0;else if("object"==typeof n&&null!==n)for(a=Object.keys(n),o=!1,r=a.length-1;r>=0;r--)u(n[a[r]])&&!i(n[a[r]],a[r])?delete n[a[r]]:o=!0;if(o)return}}function u(t){return void 0===t||null===t?!0:"object"!=typeof t?!1:Array.isArray(t)?!t.length:!Object.keys(t).length}function c(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;rt}function i(t,e){return e>=t}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var l,u,c=0,h=e.length,f=0;for(u=e[e.length-1]>=e[0]?r?n:i:r?o:a;h>c&&f++<100;)l=Math.floor((c+h)/2),u(e[l],t)?c=l+1:h=l;return f>90&&console.log("Long binary search..."),c-1},r.sorterAsc=function(t,e){return t-e},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;n>s;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a>i&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"fast-isnumeric":58}],324:[function(t,e,r){"use strict";var n=t("../plotly");e.exports=function(t){var e=function(){};for(var r in t)"function"==typeof t[r]&&(t[r]=e);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement("div");return i.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=n.Color.defaults[0],t.container.appendChild(i),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../plotly":333}],325:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;a>o;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;a>o;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,0>e)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":58}],326:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:32,tinycolor2:213}],327:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+l.Lib.randstr([],64),a=u.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=u.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())console.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t){for(var e=l.util.html_entity_decode(t),r=e.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),r=e&&e[2].toLowerCase(),n=h[r];if(void 0!==n){var i=e[1],a=e[3],o=a.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===r)return i?"
":"href"!==a.substr(0,4).toLowerCase()?"":'";if("br"===r)return"
";if(i)return"sup"===r?'':"sub"===r?'':"";var s=""}return l.util.xml_entity_encode(t).replace(/");i>0;i=r.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var e=t+a,n=r.slice(0,e),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(r.splice(e+1,0,i),r.splice(e,0,""),a+=2)});var o=r.join(""),s=o.split(/
/gi);return s.length>1&&(r=s.map(function(t,e){return''+t+""})),r.join("")}function s(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var l=t("../plotly"),u=t("d3"),c=e.exports={};u.selection.prototype.appendSVG=function(t){for(var e=''+t+"",r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(console.log(r.querySelector("parsererror div").textContent),null):u.select(this.node().lastChild)},c.html_entity_decode=function(t){var e=u.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":e.html(t).text()});return e.remove(),r},c.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},c.convertToTspans=function(t,e){function r(){d.empty()||(p=c.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"visible","white-space":"pre"}),f=t.appendSVG(s),f||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(c)}var i=t.text(),s=o(i),c=t,h=!c.attr("data-notex")&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),f=i,d=u.select(c.node().parentNode);if(!d.empty()){var p=c.attr("class")?c.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(h){var v=l.Lib.getPlotDiv(c.node());(v&&v._promises||[]).push(new Promise(function(t){c.style({visibility:"hidden"});var i={fontSize:parseInt(c.style("font-size"),10)};a(h[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var s=i&&i.select("svg");if(!s||!s.node())return r(),void t();var l=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({"class":p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=c.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var h=n(s,"width"),f=n(s,"height"),g=+c.attr("x")-h*{start:0,middle:.5,end:1}[c.attr("text-anchor")||"start"],v=parseInt(c.style("font-size"),10)||n(c,"height"),m=-v/4;"y"===p[0]?(l.attr({transform:"rotate("+[-90,+c.attr("x"),+c.attr("y")]+") translate("+[-h/2,m-f/2]+")"}),s.attr({x:+c.attr("x"),y:+c.attr("y")})):"l"===p[0]?s.attr({x:c.attr("x"),y:m-f/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+c.attr("y")+m-f/2}),e&&e.call(c,l),t(l)})}))}else r();return t}};var h={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},f=new RegExp("]*)?/?>","g");c.plainText=function(t){return(t||"").replace(f," ")},c.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=f.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=u.select(l.Lib.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(s(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=u.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&u.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;u.select(this).transition().duration(0).remove(),u.select(document).on("mouseup",null),c.edit.call(o,r)}).on("focus",function(){var t=this;u.select(document).on("mouseup",function(){return u.event.target===t?!1:void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===u.event.which?(o.style({opacity:1}),u.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),c.cancel.call(o,this.textContent)):(c.input.call(o,this.textContent),u.select(this).call(s(o,e,r)))}).on("keydown",function(){13===u.event.which&&this.blur()}).call(i)}r||(r={});var o=this,c=u.dispatch("edit","input","cancel"),h=u.select(this.node()).style({"pointer-events":"all"}),f=e||h;return e&&h.style({"pointer-events":"none"}),r.immediate?n():f.on("click",n),u.rebind(this,c,"on")}},{"../plotly":333,d3:53}],328:[function(t,e,r){"use strict";var n=e.exports={},i=t("../constants/geo_constants").locationmodeToLayer,a=t("topojson").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../constants/geo_constants":303,topojson:214}],329:[function(t,e,r){"use strict";function n(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exits on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}function i(t,e){t._fullLayout._paperdiv.style("background","white"),z.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=z.Lib.extendFlat({},z.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=i:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t){var e,r,n,i,a,o=t._fullLayout,s=t._fullData,l=R.getSubplotIds(o,"gl3d");for(o._paperdiv.style({width:o.width+"px",height:o.height+"px"}),t._context.setBackground(t,o.paper_bgcolor),e=0;ee;e++){var o=t.annotations[e];o.ref&&("paper"===o.ref?(o.xref="paper",o.yref="paper"):"data"===o.ref&&(o.xref="x",o.yref="y"),delete o.ref),h(o,"xref"),h(o,"yref")}void 0===t.shapes||Array.isArray(t.shapes)||(console.log("shapes must be an array"),delete t.shapes);var s=(t.shapes||[]).length;for(e=0;s>e;e++){var l=t.shapes[e];h(l,"xref"),h(l,"yref")}var u=t.legend;u&&(u.x>3?(u.x=1.02,u.xanchor="left"):u.x<-2&&(u.x=-.02,u.xanchor="right"),u.y>3?(u.y=1.02,u.yanchor="bottom"):u.y<-2&&(u.y=-.02,u.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var c,f,d,g,v,m,y,b=R.getSubplotIds(t,"gl3d");for(e=0;er;++r)y[r]=v[e]+g*m[2+4*r];c.camera={eye:{x:y[0],y:y[1],z:y[2]},center:{x:v[0],y:v[1],z:v[2]},up:{x:m[1],y:m[5],z:m[9]}},delete c.cameraposition}return z.Lib.markTime("finished rest of cleanLayout, starting color"),z.Color.clean(t),z.Lib.markTime("finished cleanLayout color.clean"),t}function h(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=z.Axes.cleanId(r,n))}function f(t,e){for(var r=[],n=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),i=0;is&&(o=z.Lib.randstr(n),-1!==r.indexOf(o));s++);a.uid=z.Lib.randstr(n),n.push(a.uid)}if(r.push(a.uid),"histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=z.Color.defaults,u=a.error_y.color||(R.traceIs(a,"bar")?z.Color.defaultLine:l[i%l.length]);a.error_y.color=z.Color.addOpacity(z.Color.rgb(u),z.Color.opacity(u)*a.error_y.opacity),delete a.error_y.opacity}"bardir"in a&&("h"!==a.bardir||!R.traceIs(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",k(a)),delete a.bardir),"histogramy"===a.type&&k(a),("histogramx"===a.type||"histogramy"===a.type)&&(a.type="histogram"),"scl"in a&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=z.Axes.cleanId(a.xaxis,"x")),a.yaxis&&(a.yaxis=z.Axes.cleanId(a.yaxis,"y")),a.scene&&(a.scene=z.Gl3dLayout.cleanId(a.scene)),R.traceIs(a,"pie")||(Array.isArray(a.textposition)?a.textposition=a.textposition.map(d):a.textposition&&(a.textposition=d(a.textposition))),p(a,"line")&&delete a.line,"marker"in a&&(p(a.marker,"line")&&delete a.marker.line,p(a,"marker")&&delete a.marker),z.Lib.markTime("finished rest of cleanData, starting color"),z.Color.clean(a),z.Lib.markTime("finished cleanData color.clean")}}function d(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function p(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function g(t){var e,r,n,i,a=z.Axes.list(t),o=t._fullData,s=t._fullLayout,l=t.calcdata=new Array(o.length);for(t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,s._piecolormap={},s._piedefaultcolorcount=0,e=0;en?a.push(i+n):a.push(n);return a}function m(t,e,r){var n,i;for(n=0;n=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||0>i&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function y(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),m(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&m(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function b(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&l0){var o=A(t._boundingBoxMargins),s=o.left+o.right,l=o.bottom+o.top,u=i._container.node().getBoundingClientRect(),c=1-2*a.frameMargins;n=Math.round(c*(u.width-s)),r=Math.round(c*(u.height-l))}else r=parseFloat(window.getComputedStyle(t).height)||i.height,n=parseFloat(window.getComputedStyle(t).width)||i.width;return Math.abs(i.width-n)>1||Math.abs(i.height-r)>1?(i.height=t.layout.height=r,i.width=t.layout.width=n):"initial"!==i.autosize&&(delete e.autosize,i.autosize=t.layout.autosize=!0),R.sanitizeMargins(i),e}function L(t){var e=O.select(t),r=t._fullLayout;if(r._hasGL3D&&z.Gl3dLayout.initAxes(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===r.autosize&&(M(t,{}),r.autosize=!0,t.layout.autosize=!0),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._geocontainer=r._paperdiv.selectAll(".geo-container").data([0]),r._geocontainer.enter().append("div").classed("geo-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];O.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=z.Lib.randstr(n)}r._paperdiv.selectAll(".main-svg").attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=z.Axes.getSubplots(t);i.join("")!==Object.keys(t._fullLayout._plots||{}).join("")&&T(t,i),r._hasCartesian&&E(t,i),r._shapelayer=r._paper.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._geoimages=r._paper.append("g").classed("geoimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework");var a=z.Lib.syncOrAsync([C,function(){return z.Axes.doTicks(t,"redraw")},z.Fx.init],t);return a&&a.then&&t._promises.push(a),a}function T(t,e){function r(e,r){return function(){return z.Axes.getFromId(t,e,r)}}for(var n,i,a=t._fullLayout._plots={},o=0;o0;if(w){var k=z.Axes.getSubplots(t).join(""),A=Object.keys(t._fullLayout._plots||{}).join("");(t.framework!==L||_||A!==k)&&(t.framework=L,L(t))}else _&&L(t);var M=t._fullLayout,T=!t.calcdata||t.calcdata.length!==(t.data||[]).length;T&&(g(t),(t._context.doubleClick!==!1||t._context.displayModeBar!==!1)&&z.Axes.saveRangeInitial(t));for(var E=0;EU.range[0]?[1,2]:[2,1]);else{var V=U.range[0],q=U.range[1];"log"===S?(0>=V&&0>=q&&i(F+".autorange",!0),0>=V?V=q/1e6:0>=q&&(q=V/1e6),i(F+".range[0]",Math.log(V)/Math.LN10),i(F+".range[1]",Math.log(q)/Math.LN10)):(i(F+".range[0]",Math.pow(10,V)),i(F+".range[1]",Math.pow(10,q)))}else i(F+".autorange",!0)}if("reverse"===I)N.range?N.range.reverse():(i(F+".autorange",!0),N.range=[1,0]),B.autorange?b=!0:y=!0;else if("annotations"===E.parts[0]||"shapes"===E.parts[0]){var G=E.parts[1],Y=E.parts[0],W=f[Y]||[],X=z[z.Lib.titleCase(Y)],Z=W[G]||{};2===E.parts.length&&("add"===p[T]||z.Lib.isPlainObject(p[T])?A[T]="remove":"remove"===p[T]?-1===G?(A[Y]=W,delete A[T]):A[T]=Z:console.log("???",p)),!a(Z,"x")&&!a(Z,"y")||z.Lib.containsAny(T,["color","opacity","align","dash"])||(b=!0),X.draw(t,G,E.parts.slice(2).join("."),p[T]),delete p[T]}else 0===E.parts[0].indexOf("scene")?y=!0:0===E.parts[0].indexOf("geo")?y=!0:!d._hasGL2D||-1===T.indexOf("axis")&&"plot_bgcolor"!==E.parts[0]?"hiddenlabels"===T?b=!0:-1!==E.parts[0].indexOf("legend")?g=!0:-1!==T.indexOf("title")?v=!0:-1!==E.parts[0].indexOf("bgcolor")?m=!0:E.parts.length>1&&z.Lib.containsAny(E.parts[1],["tick","exponent","grid","zeroline"])?v=!0:-1!==T.indexOf(".linewidth")&&-1!==T.indexOf("axis")?v=m=!0:E.parts.length>1&&-1!==E.parts[1].indexOf("line")?m=!0:E.parts.length>1&&"mirror"===E.parts[1]?v=m=!0:"margin.pad"===T?v=m=!0:"margin"===E.parts[0]||"autorange"===E.parts[1]||"rangemode"===E.parts[1]||"type"===E.parts[1]||"domain"===E.parts[1]||T.match(/^(bar|box|font)/)?b=!0:-1!==["hovermode","dragmode"].indexOf(T)?x=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(T)&&(y=!0):y=!0,E.set(S)}z.Queue&&z.Queue.add(t,H,[t,A],H,[t,k]),p.autosize&&(p=M(t,p)),(p.height||p.width||p.autosize)&&(b=!0);var Q=Object.keys(p),$=[R.previousPromises];if(y||b)$.push(function(){return t.layout=void 0,b&&(t.calcdata=void 0),z.plot(t,"",f)});else if(Q.length&&(R.supplyDefaults(t),d=t._fullLayout,g&&$.push(function(){return z.Legend.draw(t),R.previousPromises(t)}),m&&$.push(C),v&&$.push(function(){return z.Axes.doTicks(t,"redraw"),z.Titles.draw(t,"gtitle"),R.previousPromises(t)}),x)){j(t);var K;for(K=R.getSubplotIds(d,"gl3d"),_=0;_l&&u>e&&(void 0===i[r]?a[c]=E.tickText(t,e):a[c]=f(t,e,String(i[r])),c++);return c=864e5?t._tickround="d":r>=36e5?t._tickround="H":r>=6e4?t._tickround="M":r>=1e3?t._tickround="S":t._tickround=3-Math.round(Math.log(r/2)/Math.LN10);else{T(r)||(r=Number(r.substr(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01),e="log"===t.type?Math.pow(10,Math.max(t.range[0],t.range[1])):Math.max(Math.abs(t.range[0]),Math.abs(t.range[1]));var n=Math.floor(Math.log(e)/Math.LN10+.01);Math.abs(n)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((n-1)/3):t._tickexponent=n)}else"M"===r.charAt(0)?t._tickround=2===r.length?"m":"y":t._tickround=null}function h(t,e){var r=t.match(Y),n=new Date(e);if(r){var i=Math.min(+r[1]||6,6),a=String(e/1e3%1+2.0000005).substr(2,i).replace(/0+$/,"")||"0";return L.time.format(t.replace(Y,a))(n)}return L.time.format(t)(n)}function f(t,e,r){var n=t.tickfont||t._td._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function d(t,e,r,n){var i,a=e.x,o=t._tickround,s=new Date(a),l="";r&&t.hoverformat?i=h(t.hoverformat,a):t.tickformat?i=h(t.tickformat,a):(n&&(T(o)?o+=2:o={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[o]),"y"===o?i=B(s):"m"===o?i=U(s):(a!==t._tmin||r||(l="
"+B(s)),"d"===o?i=V(s):"H"===o?i=q(s):(a!==t._tmin||r||(l="
"+V(s)+", "+B(s)),i=H(s),"M"!==o&&(i+=G(s),"S"!==o&&(i+=m(A(a/1e3,1),t,"none",r).substr(1)))))),e.text=i+l}function p(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=m(Math.pow(10,o),t,i,n);else if(T(a)||"D"===a.charAt(0)&&A(o+.01,1)<.1)if(-1!==["e","E","power"].indexOf(t.exponentformat)){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=m(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,A(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);("0"===l||"1"===l)&&("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(0>o?.5:.25)))}}function g(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function v(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=m(e.x,t,i,n)}function m(t,e,r,n){var i=0>t,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=e.tickformat;if(n){var u={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:T(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range:[0,t||1]};c(u),a=(Number(u._tickround)||0)+4,s=u._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return L.format(l)(t).replace(/-/g,"\u2212");var h=Math.pow(10,-a)/2;if("none"===o&&(s=0),t=Math.abs(t),h>t)t="0",i=!1;else{if(t+=h,s&&(t*=Math.pow(10,-s),a+=s),0===a)t=String(Math.floor(t));else if(0>a){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var f=a;0>f;f++)t+="0"}else{t=String(t);var d=t.indexOf(".")+1;d&&(t=t.substr(0,d+a).replace(/\.?0+$/,""))}t=y(t,e._td._fullLayout.separators)}if(s&&"hide"!==o){var p;p=0>s?"\u2212"+-s:"power"!==o?"+"+s:String(s),"e"===o||("SI"===o||"B"===o)&&(s>12||-15>s)?t+="e"+p:"E"===o?t+="E"+p:"power"===o?t+="×10"+p+"":"B"===o&&9===s?t+="B":("SI"===o||"B"===o)&&(t+=W[s/3+5])}return i?"\u2212"+t:t}function y(t,e){var r=e.charAt(0),n=e.charAt(1),i=t.split("."),a=i[0],o=i.length>1?r+i[1]:"";if(n&&(i.length>1||a.length>4))for(;X.test(a);)a=a.replace(X,"$1"+n+"$2");return a+o}function b(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o1)for(n=1;nu[1]-.01&&(e.domain=[0,1]),M.Lib.noneOrAll(t.domain,e.domain,[0,1])}return e},E.coerceRef=function(t,e,r,n){var i=r._fullLayout._hasGL2D?[]:E.listIds(r,n),a=n+"ref",o={};return o[a]={valType:"enumerated",values:i.concat(["paper"]),dflt:i[0]||"paper"},M.Lib.coerce(t,e,o,a)},E.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(E.getFromId(t,r.xaxis)||{}).type,delete(E.getFromId(t,r.yaxis)||{}).type})};var z=/^[xyz][0-9]*$/,P=/^[xyz]axis[0-9]*$/;E.id2name=function(t){if("string"==typeof t&&t.match(z)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},E.name2id=function(t){if(t.match(P)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},E.cleanId=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},E.cleanName=function(t,e){if(t.match(z)&&(!e||t.charAt(0)===e)){var r=t.substr(5).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+"axis"+r}},E.counterLetter=function(t){return{x:"y",y:"x"}[t.charAt(0)]},E.autoType=function(t){return E.moreDates(t)?"date":E.category(t)?"category":s(t)?"linear":"-"},E.getShowAttrDflt=function(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};return r.every(n)||1===r.length?t[r[0]]:void 0},E.moreDates=function(t){for(var e,r=0,n=0,i=Math.max(1,(t.length-1)/1e3),a=0;a2*n},E.category=function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n},E.cleanDatum=function(t){try{if("object"==typeof t&&null!==t&&t.getTime)return M.Lib.ms2DateTime(t);if("string"!=typeof t&&!T(t))return"";t=t.toString().replace(/['"%,$# ]/g,"")}catch(e){console.log(e,t)}return t},E.BADNUM=void 0,E.setConvert=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(0>=e&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*i*Math.abs(n-a))}return E.BADNUM}function r(t){return Math.pow(10,t)}function n(t){return T(t)?Number(t):E.BADNUM}var i=10;if(t.c2l="log"===t.type?e:n,t.l2c="log"===t.type?r:n,t.l2d=function(e){return t.c2d(t.l2c(e))},t.setScale=function(){var e,r=t._td._fullLayout._size;if(t._categories||(t._categories=[]),t.overlaying){var n=E.getFromId(t._td,t.overlaying);t.domain=n.domain}for(t.range&&2===t.range.length&&t.range[0]!==t.range[1]||(t.range=[-1,1]),e=0;2>e;e++)T(t.range[e])||(t.range[e]=T(t.range[1-e])?t.range[1-e]*(e?10:.1):e?1:-1),t.range[e]<-(Number.MAX_VALUE/2)?t.range[e]=-(Number.MAX_VALUE/2):t.range[e]>Number.MAX_VALUE/2&&(t.range[e]=Number.MAX_VALUE/2);if("y"===t._id.charAt(0)?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[0]-t.range[1]),t._b=-t._m*t.range[1]):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(t.range[1]-t.range[0]),t._b=-t._m*t.range[0]),!isFinite(t._m)||!isFinite(t._b))throw M.Lib.notifier("Something went wrong with axis scaling","long"),t._td._replotting=!1,new Error("axis scaling")},t.l2p=function(e){return T(e)?L.round(M.Lib.constrain(t._b+t._m*e,-i*t._length,(1+i)*t._length),2):E.BADNUM},t.p2l=function(e){return(e-t._b)/t._m},t.c2p=function(e,r){return t.l2p(t.c2l(e,r))},t.p2c=function(e){return t.l2c(t.p2l(e))},-1!==["linear","log","-"].indexOf(t.type))t.c2d=n,t.d2c=function(t){return t=E.cleanDatum(t),T(t)?Number(t):E.BADNUM},t.d2l=function(e,r){return"log"===t.type?t.c2l(t.d2c(e),r):t.d2c(e)};else if("date"===t.type){if(t.c2d=function(t){return T(t)?M.Lib.ms2DateTime(t):E.BADNUM},t.d2c=function(t){return T(t)?Number(t):M.Lib.dateTime2ms(t)},t.d2l=t.d2c,t.range&&t.range.length>1)try{var a=t.range.map(M.Lib.dateTime2ms);!T(t.range[0])&&T(a[0])&&(t.range[0]=a[0]),!T(t.range[1])&&T(a[1])&&(t.range[1]=a[1])}catch(o){console.log(o,t.range)}}else"category"===t.type&&(t.c2d=function(e){return t._categories[Math.round(e)]},t.d2c=function(e){-1===t._categories.indexOf(e)&&t._categories.push(e);var r=t._categories.indexOf(e);return-1===r?E.BADNUM:r},t.d2l=t.d2c);t.makeCalcdata=function(e,r){var n,i,a;if(r in e)for(n=e[r],i=new Array(n.length),a=0;a2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},E.doAutoRange=function(t){if(t._length||t.setScale(),t.autorange&&t._min&&t._max&&t._min.length&&t._max.length){var e,r=t._min[0].val,n=t._max[0].val;for(e=1;e0&&u>0&&c/u>h&&(s=a,l=o,h=c/u);r===n?t.range=f?[r+1,"normal"!==t.rangemode?0:r-1]:["normal"!==t.rangemode?0:r-1,r+1]:h&&(("linear"===t.type||"-"===t.type)&&("tozero"===t.rangemode&&s.val>=0?s={val:0,pad:0}:"nonnegative"===t.rangemode&&(s.val-h*s.pad<0&&(s={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),h=(l.val-s.val)/(t._length-s.pad-l.pad)),t.range=[s.val-h*s.pad,l.val+h*l.pad],t.range[0]===t.range[1]&&(t.range=[t.range[0]-1,t.range[0]+1]),f&&t.range.reverse());var d=t._td.layout[t._name];d||(t._td.layout[t._name]=d={}),d!==t&&(d.range=t.range.slice(),d.autorange=t.autorange)}},E.saveRangeInitial=function(t,e){for(var r,n,i,a=E.list(t,"",!0),o=!1,s=0;sp&&(p=g/10),u=t.c2l(p),c=t.c2l(g),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if(t.autorange&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;6>a;a++)i(a);for(a=v-1;a>5;a--)i(a)}},E.autoBin=function(t,e,r,n){function i(t){return(1+100*(t-d)/h.dtick)%100<2}var a=M.Lib.aggNums(Math.min,null,t),o=M.Lib.aggNums(Math.max,null,t);if("category"===e.type)return{start:a-.5,end:o+.5,size:1};var s;if(r)s=(o-a)/r;else{var l=M.Lib.distinctVals(t),u=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),c=u*M.Lib.roundUp(l.minDiff/u,[.9,1.9,4.9,9.9],!0);s=Math.max(c,2*M.Lib.stdev(t)/Math.pow(t.length,n?.25:.4))}var h={type:"log"===e.type?"linear":e.type,range:[a,o]};E.autoTicks(h,s);var f,d=E.tickIncrement(E.tickFirst(h),h.dtick,"reverse");if("number"==typeof h.dtick){for(var p=0,g=0,v=0,m=0,y=0;yg&&(p>.3*b||i(a)||i(o))){var x=h.dtick/2;d+=a>d+x?x:-x}var _=1+Math.floor((o-d)/h.dtick);f=d+_*h.dtick}else for(f=d;o>=f;)f=E.tickIncrement(f,h.dtick);return{start:d,end:f,size:h.dtick}},E.calcTicks=function(t){if("array"===t.tickmode)return l(t);if("auto"===t.tickmode||!t.dtick){var e,r=t.nticks;r||("category"===t.type?(e=t.tickfont?1.2*(t.tickfont.size||12):15,r=t._length/e):(e="y"===t._id.charAt(0)?40:80,r=M.Lib.constrain(t._length/e,4,9)+1)),E.autoTicks(t,Math.abs(t.range[1]-t.range[0])/r),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t._forceTick0)}t.tick0||(t.tick0="date"===t.type?new Date(2e3,0,1).getTime():0),c(t),t._tmin=E.tickFirst(t);var n=t.range[1]=a:a>=o)&&(i.push(o),!(i.length>1e3));o=E.tickIncrement(o,t.dtick,n));t._tmax=i[i.length-1];for(var s=new Array(i.length),u=0;u157788e5?(e/=315576e5,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*u(e,r,O)):e>12096e5?(e/=26298e5,t.dtick="M"+u(e,1,I)):e>432e5?(t.dtick=u(e,864e5,R),t.tick0=new Date(2e3,0,2).getTime()):e>18e5?t.dtick=u(e,36e5,I):e>3e4?t.dtick=u(e,6e4,D):e>500?t.dtick=u(e,1e3,D):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,O));else if("log"===t.type)if(t.tick0=0,e>.7)t.dtick=Math.ceil(e);else if(Math.abs(t.range[1]-t.range[0])<1){var n=1.5*Math.abs((t.range[1]-t.range[0])/e);e=Math.abs(Math.pow(10,t.range[1])-Math.pow(10,t.range[0]))/n,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+u(e,r,O)}else t.dtick=e>.3?"D2":"D1";else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=u(e,r,O));if(0===t.dtick&&(t.dtick=1),!T(t.dtick)&&"string"!=typeof t.dtick){var i=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(i)}},E.tickIncrement=function(t,e,r){var n=r?-1:1;if(T(e))return t+n*e;var i=e.charAt(0),a=n*Number(e.substr(1));if("M"===i){var o=new Date(t);return o.setMonth(o.getMonth()+a)}if("L"===i)return Math.log(Math.pow(10,t)+a)/Math.LN10;if("D"===i){var s="D2"===e?N:F,l=t+.01*n,u=M.Lib.roundUp(A(l,1),s,r);return Math.floor(l)+Math.log(L.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},E.tickFirst=function(t){var e=t.range[1]n:n>u;)u=E.tickIncrement(u,i,e);return u}if("L"===c)return Math.log(r((Math.pow(10,n)-a)/h)*h+a)/Math.LN10;if("D"===c){var f="D2"===i?N:F,d=M.Lib.roundUp(A(n,1),f,e);return Math.floor(n)+Math.log(L.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(i)};var B=L.time.format("%Y"),U=L.time.format("%b %Y"),V=L.time.format("%b %-d"),q=L.time.format("%b %-d %Hh"),H=L.time.format("%H:%M"),G=L.time.format(":%S"),Y=/%(\d?)f/g;E.tickText=function(t,e,r){function n(n){var i;return void 0===n?!0:r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i)}var i,a=f(t,e),o="array"===t.tickmode,s=r||o;if(o&&Array.isArray(t.ticktext)){for(var l=Math.abs(t.range[1]-t.range[0])/1e4,u=0;u1&&ei&&(w=90),a(u,w)}l._lastangle=w}return r||M.Titles.draw(t,e+"title"),e+" done"}var u=n.selectAll("g."+x).data(y,b);if(!l.showticklabels||!T(i))return u.remove(),void M.Titles.draw(t,e+"title");var c,h,d,p;if("x"===v){var m="bottom"===P?1:-1;c=function(t){return t.dx},p=i+(A+k)*m,h=function(t){return t.dy+p+t.fontSize*("bottom"===P?1:-.5)},d=function(t){return T(t)&&0!==t&&180!==t?0>t*m?"end":"start":"middle"}}else h=function(t){return t.dy+t.fontSize/2},c=function(t){return t.dx+i+(A+k+(90===Math.abs(l.tickangle)?t.fontSize/2:0))*("right"===P?1:-1)},d=function(t){return T(t)&&90===Math.abs(t)?"middle":"right"===P?"start":"end"};var _=0,w=0,E=[];u.enter().append("g").classed(x,1).append("text").attr("text-anchor","middle").each(function(e){var r=L.select(this),n=t._promises.length;r.call(M.Drawing.setPosition,c(e),h(e)).call(M.Drawing.font,e.font,e.fontSize,e.fontColor).text(e.text).call(M.util.convertToTspans),n=t._promises[n],n?E.push(t._promises.pop().then(function(){a(r,l.tickangle)})):a(r,l.tickangle)}),u.exit().remove(),u.each(function(t){_=Math.max(_,t.fontSize)}),a(u,l._lastangle||l.tickangle);var C=M.Lib.syncOrAsync([o,s]);return C&&C.then&&t._promises.push(C),C}function o(t,e){return t.visible!==!0||t.xaxis+t.yaxis!==e?!1:M.Plots.traceIs(t,"bar")&&t.orientation==={x:"h",y:"v"}[v]?!0:t.fill&&t.fill.charAt(t.fill.length-1)===v}function s(e,r,i){var a=e.gridlayer,s=e.zerolinelayer,u=e["hidegrid"+v]?[]:O,c="M0,0"+("x"===v?"v":"h")+r._length,h=a.selectAll("path."+_).data(l.showgrid===!1?[]:u,b);h.enter().append("path").classed(_,1).classed("crisp",1).attr("d",c).each(function(t){l.zeroline&&("linear"===l.type||"-"===l.type)&&Math.abs(t.x)g;g++){var b=l.mirrors[o._id+h[g]];("ticks"===b||"labels"===b)&&(f[g]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],i=j[e];t&&T(r)&&(y+=d+(r+k*i)+p+i*l.ticklen)}),i(r,y),s(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return I.length?Promise.all(I):0},E.swap=function(t,e){for(var r=x(t,e),n=0;n0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;nI||I>R.width||0>D||D>R.height)return f(t,e)}else I="xpx"in e?e.xpx:p[0]._length/2,D="ypx"in e?e.ypx:g[0]._length/2;if(m="xval"in e?n(d,e.xval):i(p,I),y="yval"in e?n(d,e.yval):i(g,D),!k(m[0])||!k(y[0]))return console.log("Plotly.Fx.hover failed",e,t),f(t,e)}var F=1/0;for(_=0;_1||-1!==L.hoverinfo.indexOf("name")?L.name:void 0,index:!1,distance:Math.min(F,M.MAXDIST),color:x.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},P=j.length,"array"===E){var N=e[_];"pointNumber"in N?(z.index=N.pointNumber,E="closest"):(E="","xval"in N&&(C=N.xval,E="x"),"yval"in N&&(S=N.yval,E=E?"closest":"y"))}else C=m[T],S=y[T];if(L._module&&L._module.hoverPoints){var B=L._module.hoverPoints(z,C,S,E);if(B)for(var U,V=0;VP&&(j.splice(0,P),F=j[0].distance)}if(0===j.length)return f(t,e);var q="y"===v&&O.length>1;j.sort(function(t,e){return t.distance-e.distance});var H={hovermode:v,rotateLabels:q,bgColor:x.Color.combine(a.plot_bgcolor,a.paper_bgcolor),container:a._hoverlayer,outerContainer:a._paperdiv},G=l(j,H);u(j,q?p[0]:g[0]),c(G,q);var Y=t._hoverdata,W=[];for(b=0;b128?"#000":x.Color.background;if(t.name&&void 0===t.zLabelVal){var f=document.createElement("p");f.innerHTML=t.name,r=f.textContent||"",r.length>15&&(r=r.substr(0,12)+"...")}void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):b&&t[i+"Label"]===d?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var p=e.select("text.nums").style("fill",u).call(x.Drawing.setPosition,0,0).text(n).attr("data-notex",1).call(x.util.convertToTspans);p.selectAll("tspan.line").call(x.Drawing.setPosition,0,0);var g=e.select("text.name"),k=0;r&&r!==n?(g.style("fill",l).text(r).call(x.Drawing.setPosition,0,0).attr("data-notex",1).call(x.util.convertToTspans),g.selectAll("tspan.line").call(x.Drawing.setPosition,0,0),k=g.node().getBoundingClientRect().width+2*j):(g.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var A,M,L=p.node().getBoundingClientRect(),E=c._offset+(t.x0+t.x1)/2,C=h._offset+(t.y0+t.y1)/2,S=Math.abs(t.x1-t.x0),z=Math.abs(t.y1-t.y0),O=L.width+P+j+k;t.ty0=v-L.top,t.bx=L.width+2*j,t.by=L.height+2*j,t.anchor="start",t.txwidth=L.width,t.tx2width=k,t.offset=0,a?(t.pos=E,A=y>=C+z/2+O,M=C-z/2-O>=0,"top"!==t.idealAlign&&A||!M?A?(C+=z/2,t.anchor="start"):t.anchor="middle":(C-=z/2,t.anchor="end")):(t.pos=C,A=m>=E+S/2+O,M=E-S/2-O>=0,"left"!==t.idealAlign&&A||!M?A?(E+=S/2,t.anchor="start"):t.anchor="middle":(E-=S/2,t.anchor="end")),p.attr("text-anchor",t.anchor),k&&g.attr("text-anchor",t.anchor),e.attr("transform","translate("+E+","+C+")"+(a?"rotate("+T+")":""))}),A}function u(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=h-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-f,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(.01>a)){if(-.01>i){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;of&&u++;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos>f-1&&(l.del=!0,u--);for(o=0;o=u);o++)if(l=t[o],l.pos=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(0>=u);o--)l=t[o],l.pos+l.dp+l.size>f&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=e._offset,f=e._offset+e._length,d=t.map(function(t,r){return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===e._id.charAt(0)?C:1)/2}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o.01){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(p.push.apply(p,g),d.splice(o+1,1),u=0,s=p.length-1;s>=0;s--)u+=p[s].dp;for(a=u/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}d.forEach(r)}for(o=d.length-1;o>=0;o--){var y=d[o];for(s=y.length-1;s>=0;s--){var b=y[s],x=t[b.i];x.offset=b.dp,x.del=b.del}}}function c(t,e){t.each(function(t){var r=_.select(this);if(t.del)return void r.remove(); +var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(P+j),s=o+a*(t.txwidth+j),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-z,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*P+l)+","+(P+u)+"v"+(t.by/2-P)+"h"+n*t.bx+"v-"+t.by+"H"+(n*P+l)+"V"+(u-P)+"Z"),i.call(x.Drawing.setPosition,o+l,u+t.ty0-t.by/2+j).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.Drawing.setPosition,s+a*j+l,u+t.ty0-t.by/2+j),r.select("rect").call(x.Drawing.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function h(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}function f(t,e){var r=t._fullLayout;e||(e={}),e.target&&A.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}function d(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function p(t,e,r,n,i,a,o,s){function l(t,e){for(E=0;E.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",Q+"Z"),tt=e.plot.append("path").attr("class","zoombox-corners").style({fill:x.Color.background,stroke:x.Color.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),E=0;E.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),tt.transition().style("opacity",1).duration(200),$=!0)}function f(t,e,r){var n,i,a;for(n=0;nzoom back out","long"),R=!1)))}function m(e,r){var n=1===(o+s).length;if(e)L();else if(2!==r||n)if(1===r&&n){var i=o?O[0]:j[0],a="s"===o||"w"===s?0:1,l=i._name+".range["+a+"]",u=g(i,a),c="left",h="middle";if(i.fixedrange)return;o?(h="n"===o?"top":"bottom","right"===i.side&&(c="right")):"e"===s&&(c="right"),q.call(x.util.makeEditable,null,{immediate:!0,background:z.paper_bgcolor,text:String(u),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:c,verticalAlign:h}).on("edit",function(e){var r="category"===i.type?i.c2l(e):i.d2l(e);void 0!==r&&x.relayout(t,l,r)})}else v(t);else A()}function b(e){function r(t,e,r){if(!t.fixedrange){u(t.range);var n=t.range,i=n[0]+(n[1]-n[0])*e;t.range=[i+(n[0]-i)*r,i+(n[1]-i)*r]}}if(t._context.scrollZoom||z._enablescrollzoom){var n=t.querySelector(".plotly");if(!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(rt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void console.log("did not find wheel motion attributes",e);var a,l=Math.exp(-Math.min(Math.max(i,-20),20)/100),c=it.draglayer.select(".nsewdrag").node().getBoundingClientRect(),h=(e.clientX-c.left)/c.width,f=et[0]+et[2]*h,d=(c.bottom-e.clientY)/c.height,p=et[1]+et[3]*(1-d);if(s){for(a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function i(t,e,r){for(var i=1-e,a=0,o=0;ot._lastHoverTime+D?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},D))},M.unhover=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),f(t,e,r)},M.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},M.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.indexa?a:o>4/3-s?o:s};var F=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];M.dragCursors=function(t,e,r,n){return t="left"===r?0:"center"===r?1:"right"===r?2:x.Lib.constrain(Math.floor(3*t),0,2),e="bottom"===n?0:"middle"===n?1:"top"===n?2:x.Lib.constrain(Math.floor(3*e),0,2),F[e][t]},M.dragElement=function(t){function e(e){var h=document.querySelector(".plugin-editable");return h&&_.select(h).on("blur").call(h),u._dragged=!1,u._dragging=!0,i=e.clientX,a=e.clientY,l=e.target,o=(new Date).getTime(),o-u._mouseDownTimeM.DBLCLICKDELAY&&(c=Math.max(c-1,1)),t.doneFn&&t.doneFn(u._dragged,c),!u._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),l.dispatchEvent(r)}return m(u),u._dragged=!1,x.Lib.pauseEvent(e)}var i,a,o,s,l,u=x.Lib.getPlotDiv(t.element)||{},c=1;u._mouseDownTime||(u._mouseDownTime=0),t.element.onmousedown=e,t.element.style.pointerEvents="all"},M.setCursor=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)},M.inbox=function(t,e){return 0>t*e||0===t?M.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../lib/events":312,"../../plotly":333,d3:53,"fast-isnumeric":58,tinycolor2:213}],338:[function(t,e,r){var n=t("../../plotly"),i=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={title:{valType:"string"},titlefont:o({},i,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:o({},i,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",n.Plots.subplotsRegistry.cartesian.idRegex.x.toString(),n.Plots.subplotsRegistry.cartesian.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":283,"../../lib/extend":313,"../../plotly":333,"../font_attributes":339}],339:[function(t,e,r){e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],340:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.container=t.container,this.topojsonURL=t.topojsonURL,h(),this.showHover="closest"===e.hovermode,this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework()}function i(t,e,r){return c.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=m.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("stroke","none").call(u.Color.fill,r[n+"color"])}function o(t,e,r){var n=m.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("fill","none").call(u.Color.stroke,r[n+"color"]).call(u.Drawing.dashLine,"",r[n+"width"])}function s(t,e,r){t.select("."+e+"graticule").selectAll("path").attr("fill","none").call(u.Color.stroke,r[e].gridcolor).call(u.Drawing.dashLine,"",r[e].gridwidth)}function l(t){var e={type:"linear",showexponent:"all",exponentformat:u.Axes.layoutAttributes.exponentformat.dflt,_td:{_fullLayout:t}};return u.Axes.setConvert(e),e}var u=t("../../plotly"),c=t("d3"),h=t("./projections"),f=t("./set_scale"),d=t("./zoom"),p=t("./zoom_reset"),g=t("../../traces/scattergeo/plot"),v=t("../../traces/choropleth/plot"),m=t("../../constants/geo_constants"),y=t("../../lib/topojson_utils"),b=t("topojson").feature;e.exports=n;var x=n.prototype;x.plot=function(t,e){var r,n,i=this,a=e[i.id],o=e._size;i.projection=null,i.setScale=f(a,o),i.makeProjection(a),i.makePath(),i.adjustLayout(a,o),i.zoom=d(i,a),i.zoomReset=p(i,a),i.mockAxis=l(e),i.framework.call(i.zoom).on("dblclick.zoom",i.zoomReset),r=y.getTopojsonName(a),null===i.topojson||r!==i.topojsonName?(i.topojsonName=r,void 0!==PlotlyGeoAssets.topojson[i.topojsonName]?(i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.onceTopojsonIsLoaded(t,a)):(n=y.getTopojsonPath(i.topojsonURL,i.topojsonName),c.json(n,function(e,r){i.topojson=r,PlotlyGeoAssets.topojson[i.topojsonName]=r,i.onceTopojsonIsLoaded(t,a)}))):i.onceTopojsonIsLoaded(t,a)},x.onceTopojsonIsLoaded=function(t,e){var r,n,i=[],a=[];this.drawLayout(e);for(var o=0;o0&&g.plot(this,i),a.length>0&&v.plot(this,a,e),this.render()},x.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=c.geo[m.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(m.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-m.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},x.makePath=function(){this.path=c.geo.path().projection(this.projection)},x.makeFramework=function(){var t=this.geoDiv=c.select(this.container).append("div");t.attr("id",this.id).style("position","absolute");var e=this.hoverContainer=t.append("svg");e.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink"}).style({position:"absolute","z-index":20,"pointer-events":"none"});var r=this.framework=t.append("svg");r.attr({xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",position:"absolute",preserveAspectRatio:"none"}),r.append("g").attr("class","bglayer").append("rect"),r.append("g").attr("class","baselayer"),r.append("g").attr("class","choroplethlayer"),r.append("g").attr("class","baselayeroverchoropleth"),r.append("g").attr("class","scattergeolayer"),r.on("dblclick.zoom",null)},x.adjustLayout=function(t,e){var r=t.domain;this.geoDiv.style({left:e.l+e.w*r.x[0]+t._marginX+"px",top:e.t+e.h*(1-r.y[1])+t._marginY+"px",width:t._width+"px",height:t._height+"px"}),this.hoverContainer.attr({width:t._width,height:t._height}),this.framework.attr({width:t._width,height:t._height}),this.framework.select(".bglayer").select("rect").attr({width:t._width,height:t._height}).style({fill:t.bgcolor,"stroke-width":0})},x.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?m.sphereSVG:b(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},x.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=m.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},x.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=m.baseLayers,i=m.axesNames;r.selectAll("*").remove();for(var a=0;an?"0":"1.0"}var r=this.framework,n=r.select("g.choroplethlayer"),i=r.select("g.scattergeolayer"),a=this.projection,o=this.path,s=this.clipAngle;r.selectAll("path.basepath").attr("d",o),r.selectAll("path.graticulepath").attr("d",o),n.selectAll("path.choroplethlocation").attr("d",o),n.selectAll("path.basepath").attr("d",o),i.selectAll("path.js-line").attr("d",o),null!==s?(i.selectAll("path.point").style("opacity",e).attr("transform",t),i.selectAll("text").style("opacity",e).attr("transform",t)):(i.selectAll("path.point").attr("transform",t),i.selectAll("text").attr("transform",t))}},{"../../constants/geo_constants":303,"../../lib/topojson_utils":328,"../../plotly":333,"../../traces/choropleth/plot":387,"../../traces/scattergeo/plot":410,"./projections":347,"./set_scale":348,"./zoom":349,"./zoom_reset":350,d3:53,topojson:214}],341:[function(t,e,r){e.exports={geo:{valType:"geoid",dflt:"geo"}}},{}],342:[function(t,e,r){var n=t("../../../components/color/attributes");e.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":283}],343:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("../../../constants/geo_constants"),a=t("./axis_attributes");e.exports=function(t,e){function r(t,e){return n.Lib.coerce(c,h,a,t,e)}function o(t){var r,n,a,o,s,l,u=e.scope;return"world"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+"Span"],l=void 0!==s[n]?s[n]/2:s["*"]/2,o="lonaxis"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+"Range"]}for(var s=i.axesNames,l=0;lu;u++){var c=s[u],h=t[c]||{},f={};a("domain.x"),a("domain.y",[u/l,(u+1)/l]),n(h,f,a),e[c]=f}}},{"../../../constants/geo_constants":303,"../../../plotly":333,"./axis_defaults":343,"./layout_attributes":346}],345:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./attributes");n.Plots.registerSubplot("geo","geo","geo",i),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./defaults")},{"../../../plotly":333,"./attributes":341,"./defaults":344,"./layout_attributes":346}],346:[function(t,e,r){var n=t("../../../components/color/attributes"),i=t("../../../constants/geo_constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.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,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":283,"../../../constants/geo_constants":303,"./axis_attributes":342}],347:[function(t,e,r){function n(){function t(t,r){return{type:"Feature",id:t.id,properties:t.properties,geometry:e(t.geometry,r)}}function e(t,r){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return e(t,r)})};if(!A.hasOwnProperty(t.type))return null;var n=A[t.type];return i.geo.stream(t,r(n)),n.result()}function r(){}function n(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r=n}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;o>a;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&(f-u)*(n-c)/(d-c)+u>r&&(i=!i)}return i}function o(t){return t>1?E:-1>t?-E:Math.asin(t)}function s(t,e){var r=(2+E)*Math.sin(e);e/=2;for(var n=0,i=1/0;10>n&&Math.abs(i)>M;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function l(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?c:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function u(){var t=2,e=P(l),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function c(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function h(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function f(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function d(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>M&&--i>0);return e/2}}function p(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=d(r);return n.invert=function(n,i){var a=o(i/e);return[n/(t*Math.cos(a)),o((2*a+Math.sin(2*a))/r)]},n}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function v(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=I[i])[0],s=r[1],l=(r=I[++i])[0],u=r[1],c=(r=I[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?E:-E)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function m(t,e){return[t*Math.cos(e),e]}i.geo.project=function(t,r){var n=r.stream;if(!n)throw new Error("not yet supported");return(t&&y.hasOwnProperty(t.type)?y[t.type]:e)(t,n)};var y={Feature:t,FeatureCollection:function(e,r){return{type:"FeatureCollection",features:e.features.map(function(e){return t(e,r)})}}},b=[],x=[],_={point:function(t,e){b.push([t,e])},result:function(){var t=b.length?b.length<2?{type:"Point",coordinates:b[0]}:{type:"MultiPoint",coordinates:b}:null;return b=[],t}},w={lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){b.length&&(x.push(b),b=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},k={polygonStart:r,lineStart:r,point:function(t,e){b.push([t,e])},lineEnd:function(){var t=b.length;if(t){do b.push(b[0].slice());while(++t<4);x.push(b),b=[]}},polygonEnd:r,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){n(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){return a(t[0],r)?(t.push(e), +!0):void 0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},A={Point:_,MultiPoint:_,LineString:w,MultiLineString:w,Polygon:k,MultiPolygon:k,Sphere:k},M=1e-6,L=M*M,T=Math.PI,E=T/2,C=(Math.sqrt(T),T/180),S=180/T,z=i.geo.projection,P=i.geo.projectionMutator;i.geo.interrupt=function(t){function e(e,r){for(var n=0>r?-1:1,i=l[+(0>r)],a=0,o=i.length-1;o>a&&e>i[a][2][0];++a);var s=t(e-i[a][1][0],r);return s[0]+=t(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function r(){s=l.map(function(e){return e.map(function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function n(){for(var t=1e-6,e=[],r=0,n=l[0].length;n>r;++r){var o=l[0][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,h=180*o[2][0]/T,f=180*o[2][1]/T;e.push(a([[s+t,u+t],[s+t,c-t],[h-t,c-t],[h-t,f+t]],30))}for(var r=l[1].length-1;r>=0;--r){var o=l[1][r],s=180*o[0][0]/T,u=180*o[0][1]/T,c=180*o[1][1]/T,h=180*o[2][0]/T,f=180*o[2][1]/T;e.push(a([[h-t,f-t],[h-t,c+t],[s+t,c+t],[s+t,u-t]],30))}return{type:"Polygon",coordinates:[i.merge(e)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++au;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])n)],a=l[+(0>n)],u=0,c=i.length;c>u;++u){var h=i[u];if(h[0][0]<=r&&rM&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(i.geo.naturalEarth=function(){return z(g)}).raw=g;var I=[[.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]];I.forEach(function(t){t[1]*=1.0144}),v.invert=function(t,e){var r=e/E,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,g=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=I[a][1],s=I[a+1][1],l=I[Math.min(19,a+2)][1],n-=(p=(e>=0?E:-E)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*S;while(Math.abs(p)>L&&--g>0);break}}while(--a>=0);var v=I[a][0],m=I[a+1][0],y=I[Math.min(19,a+2)][0];return[t/(m+d*(y-v)/2+d*d*(y-2*m+v)/2),n*C]},(i.geo.robinson=function(){return z(v)}).raw=v,m.invert=function(t,e){return[t/Math.cos(e),e]},(i.geo.sinusoidal=function(){return z(m)}).raw=m}var i=t("d3");e.exports=n},{d3:53}],348:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,g=o.range[1]-s,v=n._fullRange[0]+s,m=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=d-f,_=g-p,w=[f+x/2,p+_/2],k=r._rotate;r._center=[w[0]+k[0],w[1]+k[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,k=i(f,p,d,g),A=i(v,y,m,b);l=a(e,k),o=n(l),x=a(e,A),r._fullScale=n(x),e.scale(o),l=a(e,k),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,k),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("../../constants/geo_constants").clipPad;e.exports=n},{"../../constants/geo_constants":303,d3:53}],349:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(M)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),u=v.rotate(),c=v.translate(),h=u,f=r(l)}function o(){return d=_.mouse(this),n(l)?(m.scale(v.scale()),void m.translate(v.translate())):(v.scale(_.event.scale),v.translate([c[0],_.event.translate[1]]),f?r(d)&&(g=r(d),p=[h[0]+(g[0]-f[0]),u[1],u[2]],v.rotate(p),h=p):(l=d,f=r(l)),void t.render())}function s(){_.select(this).style(M)}var l,u,c,h,f,d,p,g,v=t.projection,m=i(v,e),y=2;return m.on("zoomstart",a).on("zoom",o).on("zoomend",s),m}function s(t,e){function r(t){m++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--m||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),g=x(p,"zoomstart","zoom","zoomend"),m=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),m=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=v(c(m,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(g.of(this,arguments))}),r(g.of(this,arguments))}).on("zoomend",function(){_.select(this).style(M),y.call(p,"zoom",null),a(g.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,g,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&m(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=g(e,2,t[0]);n=g(n,1,t[1]),n=g(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*k,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*k-f,i=Math.sqrt(p*p-c*c));var v=180-a-2*f,m=(Math.atan2(h,u)-Math.atan2(l,i))*k,y=(Math.atan2(h,u)-Math.atan2(l,-i))*k,b=d(r[0],r[1],a,m),x=d(r[0],r[1],v,y);return x>=b?[a,m,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function g(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function m(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=t.length,i=0;n>r;++r)i+=t[r]*e[r];return i}function b(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 x(t){for(var e=0,r=arguments.length,n=[];++ed;++d){for(e=u[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;2>=p;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=o(n),this.labelColor[d+p]=s(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=s((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:-r.tickangle,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=s(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=s(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;c=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!c,l=this.hasAxisInAltrPos(e,r)&&!c,i=r.mirror||!1,h=c?-1!==String(i).indexOf("all"):!!i,f=c?"allticks"===i:-1!==String(i).indexOf("ticks"),a?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(l||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=s(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=s(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},l.hasSharedAxis=function(t){var e=this.scene,r=a.Plots.getSubplotIds(e.fullLayout,"gl2d"),n=a.Axes.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},l.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},l.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},l.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},l.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},l.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":316,"../../lib/str2rgbarray":326,"../../plotly":333}],353:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullLayout=e,this.updateAxes(e),this.makeFramework(),this.glplotOptions=h(this),this.glplotOptions.merge(e),this.glplot=l(this.glplotOptions),this.camera=f(this),this.traces={},this.spikes=u(this.glplot),this.selectBox=c(this.glplot,{innerFill:!1,outerFill:!0}),this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;2>r;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;ao;++o,--s)for(var l=0;r>l;++l)for(var u=0;4>u;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},m.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[s.Axes.calcTicks(this.xaxis),s.Axes.calcTicks(this.yaxis)],e=0;2>e;++e)for(var r=0;rw;++w)_[w]=Math.min(_[w],p.bounds[w]),_[w+2]=Math.max(_[w+2],p.bounds[w+2])}var k;for(r=0;2>r;++r)_[r]>_[r+2]&&(_[r]=-1,_[r+2]=1),k=this[v[r]],k._length=m.viewBox[r+2]-m.viewBox[r],s.Axes.doAutoRange(k);m.ticks=this.computeTickMarks();var A=this.xaxis.range,M=this.yaxis.range;m.dataBox=[A[0],M[0],A[1],M[1]],m.merge(e),i.update(m)},m.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=this.fullLayout;this.cameraChanged();var i=r.x*t.pixelRatio,a=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===n.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var o=n._size,l=this.xaxis.domain,u=this.yaxis.domain,c=t.pick(i/t.pixelRatio+o.l+l[0]*o.w,a/t.pixelRatio-(o.t+(1-u[1])*o.h));if(c&&n.hovermode){var h=c.object._trace.handlePick(c);if(h&&(!this.lastPickResult||this.lastPickResult.trace!==h.trace||this.lastPickResult.dataCoord[0]!==h.dataCoord[0]||this.lastPickResult.dataCoord[1]!==h.dataCoord[1])){var f=this.lastPickResult=h;this.spikes.update({center:c.dataCoord}),f.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(c.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(c.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio];var d=f.hoverinfo;if("all"!==d){var p=d.split("+");-1===p.indexOf("x")&&(f.traceCoord[0]=void 0),-1===p.indexOf("y")&&(f.traceCoord[1]=void 0),-1===p.indexOf("text")&&(f.textLabel=void 0),-1===p.indexOf("name")&&(f.name=void 0)}s.Fx.loneHover({x:f.screenCoord[0],y:f.screenCoord[1],xLabel:this.hoverFormatter("xaxis",f.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",f.traceCoord[1]),text:f.textLabel,name:f.name,color:f.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:c.dataCoord}}}else!c&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,s.Fx.loneUnhover(this.svgContainer))}t.draw()}},m.hoverFormatter=function(t,e){if(void 0===e)return void 0;var r=this[t];return s.Axes.tickText(r,r.c2l(e),"hover").text}},{"../../lib/html2unicode":316,"../../lib/show_no_webgl_msg":324,"../../plotly":333,"../../traces/scattergl/convert":412,"./camera":351,"./convert":352,"gl-plot2d":106,"gl-select-box":136,"gl-spikes2d":147}],354:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;16>f;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s="rotate"===f.keyBindingMode,l="pan"===f.keyBindingMode,c="zoom"===f.keyBindingMode,h=!!o.control,g=!!o.alt,v=!!o.shift,m=!!(1&e),y=!!(2&e),b=!!(4&e),x=1/t.clientHeight,_=x*(r-d),w=x*(a-p),k=f.flipX?1:-1,A=f.flipY?1:-1,M=i(),L=Math.PI*f.rotateSpeed;if((s&&m&&!h&&!g&&!v||m&&!h&&!g&&v)&&n.rotate(M,k*L*_,-A*L*w,0),(l&&m&&!h&&!g&&!v||y||m&&h&&!g&&!v)&&n.pan(M,-f.translateSpeed*_*u,f.translateSpeed*w*u,0),c&&m&&!h&&!g&&!v||b||m&&!h&&g&&!v){var T=-f.zoomSpeed*w/window.innerHeight*(M-n.lastT())*100;n.pan(M,0,0,u*(Math.exp(T)-1))}return d=r,p=a,!0}),s(t,function(t,e){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":22,"mouse-change":173,"mouse-wheel":177,"right-now":191}],355:[function(t,e,r){e.exports={scene:{valType:"sceneid",dflt:"scene"}}},{}],356:[function(t,e,r){var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:"rgb(0,0,0)"},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},title:n.title,titlefont:n.titlefont,type:n.type,autorange:n.autorange,rangemode:n.rangemode,range:n.range,fixedrange:n.fixedrange,tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth}},{"../../../lib/extend":313,"../../cartesian/layout_attributes":338}],357:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./axis_attributes"),a=["xaxis","yaxis","zaxis"],o=function(){};e.exports=function(t,e,r){function s(t,e){return n.Lib.coerce(l,u,i,t,e)}for(var l,u,c=n.Axes,h=0;hr;++r){var n=t[u[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:n.tickangle),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?-1!==["ticks","all","allticks"].indexOf(n.mirror)?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":316,"../../../lib/str2rgbarray":326,arraytools:32}],359:[function(t,e,r){"use strict";var n=t("../../../plotly"),i=t("./layout_attributes"),a=t("./axis_defaults");e.exports=function(t,e,r){function o(t,e){return n.Lib.coerce(c,f,i,t,e)}if(e._hasGL3D){var s,l=n.Plots.getSubplotIdsInData(r,"gl3d");delete e.xaxis,delete e.yaxis;var u=l.length;for(s=0;u>s;++s){var c,h=l[s];void 0!==t[h]?c=t[h]:t[h]=c={};var f=e[h]||{};o("bgcolor");for(var d=Object.keys(i.camera),p=0;pl;++l){var u=a[l],c=s[u];c._td=t}}},{"../../../plotly":333,"./attributes":355,"./defaults":359,"./layout_attributes":361}],361:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":313,"./axis_attributes":356}],362:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"],s=n.prototype;s.merge=function(t){for(var e=0;3>e;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":326}],363:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;3>r;++r){for(var n=t[r],i=new Array(n.length),a=0;ac;++c){var h=i[s[c]];if(h._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(h._length)===1/0)u[c]=[];else{h.range[0]=(r[c].lo+t.dataCenter[c])/t.dataScale[c],h.range[1]=(r[c].hi+t.dataCenter[c])/t.dataScale[c],h._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var d=h.nticks||a.Lib.constrain(h._length/40,4,9);a.Axes.autoTicks(h,Math.abs(h.range[1]-h.range[0])/d)}for(var p=a.Axes.calcTicks(h),g=0;gc;++c){l[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var g=0;2>g;++g)e.bounds[g][c]=t.glplot.bounds[g][c]}t.contourLevels=n(u)}e.exports=i;var a=t("../../../plotly"),o=t("../../../lib/html2unicode"),s=["xaxis","yaxis","zaxis"],l=[0,0,0]},{"../../../lib/html2unicode":316,"../../../plotly":333}],364:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;4>r;++r)for(n=0;4>n;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],365:[function(t,e,r){"use strict";function n(t){function e(e,r){if(void 0===r)return void 0;if("string"==typeof r)return r;var n=t.fullSceneLayout[e];return c.Axes.tickText(n,n.c2l(r),"hover").text}var r=t.svgContainer,n=t.container.getBoundingClientRect(),i=n.width,a=n.height;r.setAttributeNS(null,"viewBox","0 0 "+i+" "+a),r.setAttributeNS(null,"width",i),r.setAttributeNS(null,"height",a),p(t),t.glplot.axes.update(t.axesOptions);for(var o=Object.keys(t.traces),s=null,l=null,u=t.glplot.selection,h=0;ha;++a){var h=l[k[a]];c.Gl3dLayout.setConvert(h)}t?Array.isArray(t)||(t=[t]):t=[];for(var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],a=0;ao;++o)f[0][o]>f[1][o]?(d[o]=1,p[o]=0):(f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]),p[o]=.5*(f[0][o]+f[1][o])*d[o]);this.dataScale=d,this.dataCenter=p;for(var a=0;aa;++a){var h=l[k[a]],A=h.type;if(A in w?(w[A].acc*=d[a],w[A].count+=1):w[A]={acc:d[a],count:1},h.autorange){for(b[0][a]=1/0,b[1][a]=-(1/0),o=0;ob[1][a])b[0][a]=-1,b[1][a]=1;else{var L=b[1][a]-b[0][a];b[0][a]-=L/32,b[1][a]+=L/32}}else{var T=l[k[a]].range;b[0][a]=T[0],b[1][a]=T[1]}b[0][a]===b[1][a]&&(b[0][a]-=1,b[1][a]+=1),_[a]=b[1][a]-b[0][a],this.glplot.bounds[0][a]=b[0][a]*d[a]-p[a],this.glplot.bounds[1][a]=b[1][a]*d[a]-p[a]}for(var E=[1,1,1],a=0;3>a;++a){var h=l[k[a]],A=h.type,C=w[A];E[a]=Math.pow(C.acc,1/C.count)/d[a]}var S,z=4;if("auto"===l.aspectmode)S=Math.max.apply(null,E)/Math.min.apply(null,E)<=z?E:[1,1,1];else if("cube"===l.aspectmode)S=[1,1,1];else if("data"===l.aspectmode)S=E;else{if("manual"!==l.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=l.aspectratio;S=[P.x,P.y,P.z]}l.aspectratio.x=u.aspectratio.x=S[0],l.aspectratio.y=u.aspectratio.y=S[1],l.aspectratio.z=u.aspectratio.z=S[2],this.glplot.aspect=S;var j=l.domain||null,O=e._size||null;if(j&&O){var I=this.container.style;I.position="absolute",I.left=O.l+j.x[0]*O.w+"px",I.top=O.t+(1-j.y[1])*O.h+"px",I.width=O.w*(j.x[1]-j.x[0])+"px",I.height=O.h*(j.y[1]-j.y[0])+"px"}}},w.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},w.setCameraToDefault=function(){this.glplot.camera.lookAt([1.25,1.25,1.25],[0,0,0],[0,0,1])},w.getCamera=function(){this.glplot.camera.view.recalcMatrix(this.camera.view.lastT());var t=this.glplot.camera.up,e=this.glplot.camera.center,r=this.glplot.camera.eye;return{up:{x:t[0],y:t[1],z:t[2]},center:{x:e[0],y:e[1],z:e[2]},eye:{x:r[0],y:r[1],z:r[2]}}},w.setCamera=function(t){var e=t.up,r=t.center,n=t.eye;this.glplot.camera.lookAt([n.x,n.y,n.z],[r.x,r.y,r.z],[e.x,e.y,e.z])},w.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=c.Lib.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;3>o;o++)for(var s=0;3>s;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},w.handleDragmode=function(t){var e=this.camera;e&&("orbit"===t?(e.mode="orbit",e.keyBindingMode="rotate"):"turntable"===t?(e.up=[0,0,1],e.mode="turntable",e.keyBindingMode="rotate"):e.keyBindingMode=t)},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;o>a;++a,--o)for(var s=0;r>s;++s)for(var u=0;4>u;++u){var c=i[4*(r*a+s)+u];i[4*(r*a+s)+u]=i[4*(r*o+s)+u],i[4*(r*o+s)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(l),p},e.exports=a},{"../../lib/show_no_webgl_msg":324,"../../lib/str2rgbarray":326,"../../plotly":333,"../../traces/mesh3d/convert":395,"../../traces/scatter3d/convert":404,"../../traces/surface/convert":416,"./camera":354,"./layout/convert":358,"./layout/spikes":362,"./layout/tick_marks":363,"./project":364,"gl-plot3d":124}],366:[function(t,e,r){var n=t("../plotly"),i=t("./font_attributes"),a=t("../components/color/attributes"),o=n.Lib.extendFlat;e.exports={font:{family:o({},i.family,{dflt:'"Open sans", verdana, arial, sans-serif'}),size:o({},i.size,{dflt:12}),color:o({},i.color,{dflt:a.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:o({},i,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:a.background},plot_bgcolor:{valType:"color",dflt:a.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_hasCartesian:{valType:"boolean",dflt:!1},_hasGL3D:{valType:"boolean",dflt:!1},_hasGeo:{valType:"boolean",dflt:!1},_hasPie:{valType:"boolean",dflt:!1},_hasGL2D:{valType:"boolean",dflt:!1},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"Gl3dLayout",geo:"GeoLayout",legend:"Legend",annotations:"Annotations",shapes:"Shapes"}}},{"../components/color/attributes":283,"../plotly":333,"./font_attributes":339}],367:[function(t,e,r){"use strict";function n(t){return"object"==typeof t&&(t=t.type),t}function i(t,e){e.text("");var r=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)r.on("click",function(){c.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function a(t,e){for(var r,n=c.getSubplotIds(e,"gl3d"),i=0;i=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),u=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&i(t,o),u.text(o.text()&&c.text()?" - ":"")},c.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=c.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},c.supplyDefaults=function(t){var e,r,n,i,l,u,h=t._fullLayout||{},f=t._fullLayout={},d=t.layout||{},p=t._fullData||[],g=t._fullData=[],v=t.data||[],m=t._modules=[];for(c.supplyLayoutGlobalDefaults(d,f),f._dataLength=v.length,e=0;ea&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),0>o&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},c.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=r.pad||12;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||c.doAutoMargin(t)}},c.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),c=e._pushmargin;return e.margin.autoexpand!==!1&&(c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:l}},Object.keys(c).forEach(function(t){var r=c[t].l||{},n=c[t].b||{},s=r.val,h=r.size,f=n.val,d=n.size;Object.keys(c).forEach(function(t){if(u(h)&&c[t].r){var r=c[t].r.val,n=c[t].r.size;if(r>s){var p=(h*r+(n-e.width)*s)/(r-s),g=(n*(1-s)+(h-e.width)*(1-r))/(r-s);p>=0&&g>=0&&p+g>i+a&&(i=p,a=g)}}if(u(d)&&c[t].t){var v=c[t].t.val,m=c[t].t.size;if(v>f){var y=(d*v+(m-e.height)*f)/(v-f),b=(m*(1-f)+(d-e.height)*(1-v))/(v-f);y>=0&&b>=0&&y+b>l+o&&(l=y,o=b)}}})})),r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,t._replotting||"{}"===n||n===JSON.stringify(e._size)?void 0:s.plot(t)},c.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(s.Lib.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!s.Lib.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):t&&t.getTime?s.Lib.ms2DateTime(t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&c.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(l)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),"object"===n?u:JSON.stringify(u)}},{"../plotly":333,"./attributes":334,"./font_attributes":339,"./layout_attributes":366,d3:53,"fast-isnumeric":58}],368:[function(t,e,r){var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":400}],369:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":313,"../cartesian/layout_attributes":338}],370:[function(t,e,r){var n=t("../../plotly"),i=t("d3"),a=e.exports={version:"0.2.2",manager:t("./micropolar_manager")},o=n.Lib.extendDeepAll;a.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=i.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:a.util.cloneJson(u),layout:a.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:i.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,g=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=i.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=a.util.sumArrays(t.r,r)}),t.values});d=i.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;b=Math.max(10,b);var x,_=[h.margin.left+b,h.margin.top+b];if(p){var w=i.max(a.util.sumArrays(a.util.arrayLast(d).r[0],a.util.arrayLast(m)));x=[0,w]}else x=i.extent(a.util.flattenArray(d.map(function(t,e){return t.r})));h.radialAxis.domain!=a.DATAEXTENT&&(x[0]=0),n=i.scale.linear().domain(h.radialAxis.domain!=a.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=n.domain();var k,A=a.util.flattenArray(d.map(function(t,e){return t.t})),M="string"==typeof A[0];M&&(A=a.util.deduplicate(A),k=A.slice(),A=i.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var L=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,T=null===h.needsEndSpacing?M||!L:h.needsEndSpacing,E=h.angularAxis.domain&&h.angularAxis.domain!=a.DATAEXTENT&&!M&&h.angularAxis.domain[0]>=0,C=E?h.angularAxis.domain:i.extent(A),S=Math.abs(A[1]-A[0]);L&&!M&&(S=0);var z=C.slice();T&&M&&(z[1]+=S);var P=h.angularAxis.ticksCount||4;P>8&&(P=P/(P/8)+P%8),h.angularAxis.ticksStep&&(P=(z[1]-z[0])/P);var j=h.angularAxis.ticksStep||(z[1]-z[0])/(P*(h.minorTicks+1));k&&(j=Math.max(Math.round(j),1)),z[2]||(z[2]=j);var O=i.range.apply(this,z);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=i.scale.linear().domain(z.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=T?S:0,e=i.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var I="' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '",D=(new DOMParser).parseFromString(I,"application/xml"),R=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=i.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=a.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});a.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},a.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:h.legend.reverseOrder})})();var q=F.node().getBBox();b=Math.min(h.width-q.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],n.range([0,b]),c.layout.radialAxis.domain=n.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(h.width-(h.margin.left+h.margin.right+2*b+(q?q.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),h.title){var G=e.select("g.title-group text").style(U).text(h.title),Y=G.node().getBBox();G.attr({x:_[0]-Y.width/2,y:_[1]-b-20})}var W=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var X=W.selectAll("circle.grid-circle").data(n.ticks(5));X.enter().append("circle").attr({"class":"grid-circle"}).style(B),X.attr("r",n),X.exit().remove()}W.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({ +r:b}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Q=i.svg.axis().scale(n).ticks(5).tickSize(5);W.call(Q).attr({transform:"rotate("+h.radialAxis.orientation+")"}),W.selectAll(".domain").style(B),W.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),W.selectAll("g>line").style({stroke:"black"})}var $=e.select(".angular.axis-group").selectAll("g.angular-tick").data(O),K=$.enter().append("g").classed("angular-tick",!0);$.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),$.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),K.selectAll(".minor").style({stroke:h.minorTickColor}),$.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(U);var J=$.select("text.axis-text").attr({x:b+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?270>r&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(180>=r&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":k?k[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=i.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({"class":function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=n,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=i.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return o(a[r].defaultConfig(),t)});a[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=a.tooltipPanel().config({container:ut,fontSize:8})(),ht=a.tooltipPanel().config({container:ut,fontSize:8})(),ft=a.tooltipPanel().config({container:ut,hasTick:!0})();if(!M){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=a.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;ot=s.invert(n);var i=a.util.convertToCartesian(b+12,r+180);ct.text(a.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=a.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=n.invert(a.util.getMousePos(Z).radius);var i=a.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(a.util.round(st)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var n=i.select(this),o=n.style("fill"),s="black",l=n.style("opacity")||1;if(n.attr({"data-opacity":l}),"none"!=o){n.attr({"data-fill":o}),s=i.hsl(o).darker().toString(),n.style({fill:s,opacity:1});var u={t:a.util.round(t[0]),r:a.util.round(t[1])};M&&(u.t=k[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-H[0]-f.left,h.top+h.height/2-H[1]-f.top];ft.config({color:s}).text(c),ft.move(d)}else o=n.style("stroke"),n.attr({"data-stroke":o}),s=i.hsl(o).darker().toString(),n.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0!=i.event.which?!1:void(i.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=i.select(this),n=r.attr("data-fill");n?r.style({fill:n,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,n,s,l={data:[],layout:{}},u={},c={},h=i.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=a.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),o(l.data[e],a.Axis.defaultConfig().data[0]),o(l.data[e],t)}),o(l.layout,a.Axis.defaultConfig().layout),o(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return n},f.angularScale=function(t){return s},f.svg=function(){return e},i.rebind(f,h,"on"),f},a.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:i.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},a.util={},a.DATAEXTENT="dataExtent",a.AREA="AreaChart",a.LINE="LinePlot",a.DOT="DotPlot",a.BAR="BarChart",a.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},a.util._extend=function(t,e){for(var r in t)e[r]=t[r]},a.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},a.util.dataFromEquation2=function(t,e){var r=e||6,n=i.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return n},a.util.dataFromEquation=function(t,e,r){var n=e||6,a=[],o=[];i.range(0,360+n,n).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},a.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return i.range(e).map(function(t,e){return r[e]||r[0]})},a.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=a.util.ensureArray(t[e],r)}),t},a.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},a.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},a.util.sumArrays=function(t,e){return i.zip(t,e).map(function(t,e){return i.sum(t)})},a.util.arrayLast=function(t){return t[t.length-1]},a.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-->=0&&t[r]===e[r];);return-2===r},a.util.flattenArray=function(t){for(var e=[];!a.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},a.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},a.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},a.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},a.util.getMousePos=function(t){var e=i.mouse(t.node()),r=e[0],n=e[1],a={};return a.x=r,a.y=n,a.pos=e,a.angle=180*(Math.atan2(n,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+n*n),a},a.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;a>i;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},a.util.duplicates=function(t){return Object.keys(a.util.duplicatesCount(t))},a.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){return"undefined"!=typeof t?t[e]:void 0},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){return"undefined"!=typeof t?(n===e.length-1&&delete t[r],t[r]):void 0},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},a.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=i.select(e)),e.datum(r).each(function(e,r){function n(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?i.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):i.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,n,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;i.select(this).attr({"class":"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=i.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);i.select(this).attr({"class":"mark dot",d:l,transform:function(t,e){var r=a(n(s));return"translate("+[r.x,r.y]+")"}})};var f=i.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,n,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(i.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,n,a)}).attr({"class":"mark dot"}),!(n>0)){var s=i.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({"class":"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,n,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,n,a)},"stroke-width":function(t,e){return v["stroke-width"](r,n,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,n,a)},opacity:function(t,e){return v.opacity(r,n,a)},display:function(t,e){return v.display(r,n,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,g=i.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,n){i.select(this).attr({"class":"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},m=i.select(this).selectAll("g.layer").data(l);m.enter().append("g").attr({"class":"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({"class":"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e,r=[a.PolyChart.defaultConfig()],n=i.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),o(r[e],a.PolyChart.defaultConfig()),o(r[e],t)}),this):r},t.getColorScale=function(){return e},i.rebind(t,n,"on"),t},a.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:i.scale.category20()}};return t},a.BarChart=function(){return a.PolyChart()},a.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},a.AreaChart=function(){return a.PolyChart()},a.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},a.DotPlot=function(){return a.PolyChart()},a.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},a.LinePlot=function(){return a.PolyChart()},a.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},a.Legend=function(){function t(){var r=e.legendConfig,n=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=o({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),a=i.merge(n);a=a.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(a=a.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=i.select(s));var l=a.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof a[0]:r.isContinuous,h=c?r.height:u*a.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=i.range(a.length),v=i.scale[c?"linear":"ordinal"]().domain(g).range(l),m=i.scale[c?"linear":"ordinal"]().domain(g)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=i.svg.symbolTypes.indexOf(t)?i.svg.symbol().type(t).size(r)():i.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(a);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,m(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=i.svg.axis().scale(m).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return a[e].name}),t}var e=a.Legend.defaultConfig(),r=i.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},i.rebind(t,r,"on"),t},a.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},a.tooltipPanel=function(){var t,e,r,n={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+a.tooltipPanel.uid++,l=10,u=function(){t=n.container.selectAll("g."+s).data([0]);var i=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=i.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=i.append("text").attr({dx:n.padding+l,dy:.3*+n.fontSize}),u};return u.text=function(a){var o=i.hsl(n.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",h=a||"";e.style({fill:c,"font-size":n.fontSize+"px"}).text(h);var f=n.padding,d=e.node().getBBox(),p={fill:n.color,stroke:s,"stroke-width":"2px"},g=d.width+2*f+l,v=d.height+2*f;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[n.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){return t?(t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u):void 0},u.hide=function(){return t?(t.style({display:"none"}),u):void 0},u.show=function(){return t?(t.style({display:"block"}),u):void 0},u.config=function(t){return o(n,t),u},u},a.tooltipPanel.uid=1,a.adapter={},a.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var n=a.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var i=n.indexOf(t.geometry);-1!=i&&(r.data[e].groupId=i)})}if(t.layout){var s=o({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){a.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};i.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../plotly":333,"./micropolar_manager":371,d3:53}],371:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("d3"),a=t("./undo_manager"),o=e.exports={},s=n.Lib.extendDeepAll;o.framework=function(t){function e(e,a){return a&&(h=a),i.select(i.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,u||(u=n.micropolar.Axis()),c=n.micropolar.adapter.plotly().convert(r),u.config(c).render(h),t.data=r.data,t.layout=r.layout,o.fillLayout(t),r}var r,l,u,c,h,f=new a;return e.isPolar=!0,e.svg=function(){return u.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return n.micropolar.adapter.plotly().convert(u.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:u.angularScale(),r:u.radialScale()}},e.setUndoPoint=function(){var t=this,e=n.micropolar.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,l),l=n.micropolar.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},o.fillLayout=function(t){var e=i.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:n.Color.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../plotly":333,"./undo_manager":372,d3:53}],372:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n-1}var a=t("../plotly"),o=a.Lib.extendFlat,s=a.Lib.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,l=t.data,u=t.layout,c=s([],l),h=s({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;ro;o++)a(r[o])&&a(i[o])&&h.push({p:r[o],s:i[o],b:0});return n.Colorscale.hasColorscale(e,"marker")&&n.Colorscale.calc(e,e.marker.color,"marker","c"),n.Colorscale.hasColorscale(e,"marker.line")&&n.Colorscale.calc(e,e.marker.line.color,"marker.line","c"),h},o.setPositions=function(t,e){var r,i,o=t._fullLayout,s=e.x(),l=e.y();["v","h"].forEach(function(u){function c(e){function r(t){t[f]=t.p+d}var i=[];e.forEach(function(e){t.calcdata[e].forEach(function(t){i.push(t.p)})});var a=n.Lib.distinctVals(i),s=a.vals,l=a.minDiff,u=!1,c=[];"group"===o.barmode&&e.forEach(function(e){u||(t.calcdata[e].forEach(function(t){u||c.forEach(function(e){Math.abs(t.p-e)y&&(L=!0,w=y),y>_+C&&(L=!0,_=y))}n.Axes.expand(g,[w,_],{tozero:!0,padded:L})}else{var S=function(t){return t[d]=t.s,t.s};for(r=0;r=2?o(t):t>e?Math.ceil(t):Math.floor(t)}var f,d,p,g;if("h"===c.orientation?(p=l.c2p(r.poffset+e.p,!0),g=l.c2p(r.poffset+e.p+r.barwidth,!0),f=s.c2p(e.b,!0),d=s.c2p(e.s+e.b,!0)):(f=s.c2p(r.poffset+e.p,!0),d=s.c2p(r.poffset+e.p+r.barwidth,!0),g=l.c2p(e.s+e.b,!0),p=l.c2p(e.b,!0)),!(a(f)&&a(d)&&a(p)&&a(g)&&f!==d&&p!==g))return void i.select(this).remove();var v=(e.mlw+1||c.marker.line.width+1||(e.trace?e.trace.marker.line.width:0)+1)-1,m=i.round(v/2%1,2);if(!t._context.staticPlot){var y=n.Color.opacity(e.mc||c.marker.color),b=1>y||v>.01?o:h;f=b(f,d),d=b(d,f),p=b(p,g),g=b(g,p)}i.select(this).attr("d","M"+f+","+p+"V"+g+"H"+d+"V"+p+"Z")})})},o.style=function(t){var e=i.select(t).selectAll("g.trace.bars"),r=e.size(),a=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&i.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,a=r.line,o=(e._input||{}).marker||{},s=n.Drawing.tryColorscale(r,o,""),l=n.Drawing.tryColorscale(r,o,"line.");i.select(this).selectAll("path").each(function(t){var e,o,u=(t.mlw+1||a.width+1)-1,c=i.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?n.Color.defaultLine:r.color,c.style("stroke-width",u+"px").call(n.Color.fill,e),u&&(o="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(a.color)?n.Color.defaultLine:a.color,c.call(n.Color.stroke,o))})})},o.hoverPoints=function(t,e,r,i){var a,o=t.cd,s=o[0].trace,l=o[0].t,u=t.xa,c=t.ya,h="closest"===i?l.barwidth/2:l.dbar*(1-u._td._fullLayout.bargap)/2;a="closest"!==i?function(t){return t.p}:"h"===s.orientation?function(t){return t.y}:function(t){return t.x};var f,d;"h"===s.orientation?(f=function(t){return n.Fx.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},d=function(t){var e=a(t)-r;return n.Fx.inbox(e-h,e+h)}):(d=function(t){return n.Fx.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},f=function(t){var r=a(t)-e;return n.Fx.inbox(r-h,r+h)});var p=n.Fx.getDistanceFunction(i,f,d);if(n.Fx.getClosest(o,p,t),t.index!==!1){var g=o[t.index],v=g.mcc||s.marker.color,m=g.mlcc||s.marker.line.color,y=g.mlw||s.marker.line.width;return n.Color.opacity(v)?t.color=v:n.Color.opacity(m)&&y&&(t.color=m),"h"===s.orientation?(t.x0=t.x1=u.c2p(g.x,!0),t.xLabelVal=g.s,t.y0=c.c2p(a(g)-h,!0),t.y1=c.c2p(a(g)+h,!0),t.yLabelVal=g.p):(t.y0=t.y1=c.c2p(g.y,!0),t.yLabelVal=g.s,t.x0=u.c2p(a(g)-h,!0),t.x1=u.c2p(a(g)+h,!0),t.xLabelVal=g.p),g.tx&&(t.text=g.tx),n.ErrorBars.hoverInfo(g,s,t),[t]}}},{"../../plotly":333,"./attributes":378,"./layout_attributes":380,d3:53,"fast-isnumeric":58}],380:[function(t,e,r){e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],381:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":283,"../../lib/extend":313,"../scatter/attributes":400}],382:[function(t,e,r){"use strict";function n(){u=2e9}function i(){var t=u;return u=(69069*u+1)%4294967296,Math.abs(u-t)<429496729?i():u/4294967296}var a=t("../../plotly"),o=t("d3"),s=t("fast-isnumeric"),l=e.exports={};a.Plots.register(l,"box",["cartesian","symbols","oriented","box","showLegend"],{}),l.attributes=t("./attributes"),l.layoutAttributes=t("./layout_attributes"),l.supplyDefaults=function(t,e,r){function n(r,n){return a.Lib.coerce(t,e,l.attributes,r,n)}var i,o=n("y"),s=n("x");if(o&&o.length)i="v",s||n("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",n("y0")}n("orientation",i),n("line.color",(t.marker||{}).color||r),n("line.width",2),n("fillcolor",a.Color.addOpacity(e.line.color,.5)),n("whiskerwidth"),n("boxmean");var u=a.Lib.coerce2(t,e,l.attributes,"marker.outliercolor"),c=n("marker.line.outliercolor"),h=u||c?n("boxpoints","suspectedoutliers"):n("boxpoints");h&&(n("jitter","all"===h?.3:0),n("pointpos","all"===h?-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"===h&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")))},l.supplyLayoutDefaults=function(t,e,r){function n(r,n){return a.Lib.coerce(t,e,l.layoutAttributes,r,n)}for(var i,o=0;oo;++o)l=n[o],t[o]={pos:l},p[o]=l-i,d[o]=[];for(p.push(n[h-1]+i),o=0;f>o;++o)c=e[o],s(c)&&(u=a.Lib.findBin(r[o],p),u>=0&&f>u&&d[u].push(c));return d}function i(t,e){var r,n,i,o;for(o=0;o1,v=r.dPos*(1-u.boxgap)*(1-u.boxgroupgap)/(g?t.numboxes:1),m=g?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-u.boxgap):0,y=v*p.whiskerwidth;return p.visible!==!0||r.emptybox?void o.select(this).remove():("h"===p.orientation?(s=d,l=f):(s=f,l=d),r.bPos=m,r.bdPos=v,n(),o.select(this).selectAll("path.box").data(a.Lib.identity).enter().append("path").attr("class","box").each(function(t){var e=s.c2p(t.pos+m,!0),r=s.c2p(t.pos+m-v,!0),n=s.c2p(t.pos+m+v,!0),i=s.c2p(t.pos+m-y,!0),u=s.c2p(t.pos+m+y,!0),c=l.c2p(t.q1,!0),h=l.c2p(t.q3,!0),f=a.Lib.constrain(l.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),d=l.c2p(p.boxpoints===!1?t.min:t.lf,!0),g=l.c2p(p.boxpoints===!1?t.max:t.uf,!0);"h"===p.orientation?o.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+d+"M"+h+","+e+"H"+g+(0===p.whiskerwidth?"":"M"+d+","+i+"V"+u+"M"+g+","+i+"V"+u)):o.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+d+"M"+e+","+h+"V"+g+(0===p.whiskerwidth?"":"M"+i+","+d+"H"+u+"M"+i+","+g+"H"+u))}),p.boxpoints&&o.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=p}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,o,s,l,u,f="all"===p.boxpoints?t.val:t.val.filter(function(e){return et.uf}),d=(t.q3-t.q1)*h,g=[],y=0;if(p.jitter){for(e=0;et.lo&&(n.so=!0),n})}).enter().append("path").call(a.Drawing.translatePoints,f,d),void(p.boxmean&&o.select(this).selectAll("path.mean").data(a.Lib.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=s.c2p(t.pos+m,!0),r=s.c2p(t.pos+m-v,!0),n=s.c2p(t.pos+m+v,!0),i=l.c2p(t.mean,!0),a=l.c2p(t.mean-t.sd,!0),u=l.c2p(t.mean+t.sd,!0);"h"===p.orientation?o.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==p.boxmean?"":"m0,0L"+a+","+e+"L"+i+","+r+"L"+u+","+e+"Z")):o.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==p.boxmean?"":"m0,0L"+e+","+a+"L"+r+","+i+"L"+e+","+u+"Z"))})))})},l.style=function(t){var e=o.select(t).selectAll("g.trace.boxes");e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;o.select(this).selectAll("path.box").style("stroke-width",r+"px").call(a.Color.stroke,e.line.color).call(a.Color.fill,e.fillcolor),o.select(this).selectAll("path.mean").style({"stroke-width":r,"stroke-dasharray":2*r+"px,"+r+"px"}).call(a.Color.stroke,e.line.color),o.select(this).selectAll("g.points path").call(a.Drawing.pointStyle,e)})},l.hoverPoints=function(t,e,r,n){var i,o,s,l,u,c,h,f,d,p,g=t.cd,v=g[0].trace,m=g[0].t,y=t.xa,b=t.ya,x=[];if(l="closest"===n?2.5*m.bdPos:m.bdPos,"h"===v.orientation?(i=function(t){return a.Fx.inbox(t.min-e,t.max-e)},o=function(t){var e=t.pos+m.bPos-r;return a.Fx.inbox(e-l,e+l)},u="y",c=b,d="x",p=y):(i=function(t){var r=t.pos+m.bPos-e;return a.Fx.inbox(r-l,r+l)},o=function(t){return a.Fx.inbox(t.min-r,t.max-r)},u="x",c=y,d="y",p=b),s=a.Fx.getDistanceFunction(n,i,o),a.Fx.getClosest(g,s,t),t.index!==!1){var _=g[t.index],w=v.line.color,k=(v.marker||{}).color;a.Color.opacity(w)&&v.line.width?t.color=w:a.Color.opacity(k)&&v.boxpoints?t.color=k:t.color=v.fillcolor,t[u+"0"]=c.c2p(_.pos+m.bPos-m.bdPos,!0),t[u+"1"]=c.c2p(_.pos+m.bPos+m.bdPos,!0),h=a.Axes.tickText(c,c.c2l(_.pos),"hover").text,t[u+"LabelVal"]=_.pos;var A,M,L={},T=["med","min","q1","q3","max"];v.boxmean&&T.push("mean"),v.boxpoints&&[].push.apply(T,["lf","uf"]);for(var E=0;El&&(e.z=u.slice(0,l)),o("locationmode"),o("text"),o("marker.line.color"),o("marker.line.width"),n.Colorscale.handleDefaults(t,e,a,o,{prefix:"",cLetter:"z"}),void o("hoverinfo",1===a._dataLength?"location+z+text":void 0)):void(e.visible=!1)):void(e.visible=!1)}},{"../../plotly":333,"./":386}],386:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"choropleth",["geo","noOpacity"],{}),i.attributes=t("./attributes"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Colorbar.traceColorbar,i.calc=function(t,e){n.Colorscale.calc(e,e.z,"","z")}},{"../../plotly":333,"./attributes":384,"./defaults":385}],387:[function(t,e,r){"use strict";function n(t,e){function r(e){var r=t.mockAxis;return i.Axes.tickText(r,r.c2l(e),"hover").text}var n=e.hoverinfo;if("none"===n)return function(t){delete t.nameLabel,delete t.textLabel};var a="all"===n?i.Choropleth.attributes.hoverinfo.flags:n.split("+"),o=-1!==a.indexOf("name"),s=-1!==a.indexOf("location"),l=-1!==a.indexOf("z"),u=-1!==a.indexOf("text"),c=!o&&s;return function(t){var n=[];c?t.nameLabel=t.id:(o&&(t.nameLabel=e.name),s&&n.push(t.id)),l&&n.push(r(t.z)),u&&n.push(t.tx),t.textLabel=n.join("
")}}var i=t("../../plotly"),a=t("d3"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/array_to_calc_item"),u=t("../../constants/geo_constants"),c=e.exports={};c.calcGeoJSON=function(t,e){for(var r,n=[],i=t.locations,a=i.length,u=o(t,e),c=(t.marker||{}).line||{},h=0;a>h;h++)r=s(t.locationmode,i[h],u),void 0!==r&&(r.z=t.z[h],void 0!==t.text&&(r.tx=t.text[h]),l(c.color,r,"mlc",h),l(c.width,r,"mlw",h),n.push(r));return n.length>0&&(n[0].trace=t),n},c.plot=function(t,e,r){var o,s=t.framework,l=t.topojson,h=s.select("g.choroplethlayer"),f=s.select("g.baselayer"),d=s.select("g.baselayeroverchoropleth"),p=u.baseLayersOverChoropleth;h.selectAll("*").remove(),d.selectAll("*").remove();var g=h.selectAll("g.trace.scatter").data(e);g.enter().append("g").attr("class","trace choropleth"),g.each(function(e){function r(e){if(t.showHover){var r=t.projection(e.properties.ct);s(e),i.Fx.loneHover({x:r[0],y:r[1],name:e.nameLabel,text:e.textLabel},{container:t.hoverContainer.node()})}}if(e.visible===!0){var o=c.calcGeoJSON(e,l),s=n(t,e);a.select(this).selectAll("path.choroplethlocation").data(o).enter().append("path").attr("class","choroplethlocation").on("mouseover",r).on("mouseout",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){i.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r)}});for(var v=0;vt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}function o(t){var e,r,n,i,o,s,l,u,c,h=t[0].z,f=h.length,d=h[0].length,p=2===f||2===d;for(r=0;f-1>r;r++)for(i=[],0===r&&(i=i.concat(k)),r===f-2&&(i=i.concat(A)),e=0;d-1>e;e++)for(n=i.slice(),0===e&&(n=n.concat(M)),e===d-2&&(n=n.concat(L)),o=e+","+r,s=[[h[r][e],h[r][e+1]],[h[r+1][e],h[r+1][e+1]]],c=0;cv;v++){if(o>20?(o=E[o][(s[0]||s[1])<0?0:1],t.crossings[a]=C[o]):delete t.crossings[a],s=T[o],!s){console.log("found bad marching index",o,e,t.level);break}if(l.push(f(t,e,s)),e[0]+=s[0],e[1]+=s[1],c(l[l.length-1],l[l.length-2])&&l.pop(),a=e.join(","),a===i&&s.join(",")===d||r&&(s[0]&&(e[0]<0||e[0]>g-2)||s[1]&&(e[1]<0||e[1]>p-2)))break;o=t.crossings[a]}1e4===v&&console.log("Infinite loop in contour?");var m,y,b,x,_,w,k,A=c(l[0],l[l.length-1]),M=0,L=.2*t.smoothing,S=[],z=0;for(v=1;v=z;v--)if(m=S[v],P>m){for(b=0,y=v-1;y>=z&&m+S[y]b&&m+S[b]e;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),s(i,r);1e4===e&&console.log("Infinite loop in contour?")}}function u(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==k.indexOf(t)?i=1:-1!==M.indexOf(t)?n=1:-1!==A.indexOf(t)?i=-1:n=-1,[n,i]}function c(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function h(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function f(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}function d(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function p(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function g(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=v(t,r);e?_.select(this).attr("d",e).style("stroke","none"):_.select(this).remove()})}function v(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,u,c,h,f=t.edgepaths.length||t.z[0][0]l;l++){if(!o){console.log("missing end?",d,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),c=0;c=0&&(s=v,u=c):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-v[1])<.01&&(v[0]-o[0])*(s[0]-v[0])>=0&&(s=v,u=c):console.log("endpt to newendpt is not vert. or horz.",o,s,v)}if(o=s,u>=0)break;f+="L"+s}if(u===t.edgepaths.length){console.log("unclosed perimeter path");break}d=u,g=-1===p.indexOf(d),g&&(d=p[0],f+="Z")}for(d=0;de;e++)s.push(1);for(e=0;a>e;e++)i.push(s.slice());for(e=0;e0&&(n=!0);for(var o=0;o=d))return c?e.slice(0,i):e.slice(0,i+1);if(c)u=e.slice(0,i);else if(1===i)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],l=1;d>l;l++)u.push(.5*(e[l-1]+e[l]));u.push(1.5*e[d-1]-.5*e[d-2])}if(i>d){var p=u[u.length-1],g=p-u[u.length-2];for(l=d;i>l;l++)p+=g,u.push(p)}}else for(s=n||1,o=void 0===r?0:h||"category"===a.type?r:a.d2c(r),l=c?0:-.5;i>l;l++)u.push(o+s*l);return u}function s(t){return.5-.25*Math.min(1,.5*t)}function l(t,e,r){var n,i,a=1;if(Array.isArray(r))for(n=0;nn&&a>m;n++)a=c(t,e,s(a));return a>m&&console.log("interp2d didn't converge quickly",a),t}function u(t){var e,r,n,i,a,o,s,l,u=[],c={},h=[],f=t[0],d=[],p=[0,0,0],g=v.maxRowLength(t);for(r=0;rn;n++)void 0===d[n]&&(o=(void 0!==d[n-1]?1:0)+(void 0!==d[n+1]?1:0)+(void 0!==e[n]?1:0)+(void 0!==f[n]?1:0),o?(0===r&&o++,0===n&&o++,r===t.length-1&&o++,n===d.length-1&&o++,4>o&&(c[[r,n]]=[r,n,o]),u.push([r,n,o])):h.push([r,n]));for(;h.length;){for(s={},l=!1,a=h.length-1;a>=0;a--)i=h[a],r=i[0],n=i[1],o=((c[[r-1,n]]||p)[2]+(c[[r+1,n]]||p)[2]+(c[[r,n-1]]||p)[2]+(c[[r,n+1]]||p)[2])/20,o&&(s[i]=[r,n,o],h.splice(a,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(i in s)c[i]=s[i],u.push(s[i])}return u.sort(function(t,e){return e[2]-t[2]})}function c(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,g,v=0;for(o=0;os;s++)l=y[s],u=t[i+l[0]],u&&(c=u[a+l[1]],void 0!==c&&(0===f?p=g=c:(p=Math.min(p,c),g=Math.max(g,c)),h++,f+=c));if(0===h)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=f/h,void 0===d?4>h&&(v=1):(t[i][a]=(1+r)*t[i][a]-r*d,g>p&&(v=Math.max(v,Math.abs(t[i][a]-d)/(g-p))))}return v}function h(t,e,r){function n(t,e){var r=e.length-2,n=f.Lib.constrain(f.Lib.findBin(t,e),0,r),i=e[n],a=e[n+1],o=f.Lib.constrain(n+(t-i)/(a-i)-.5,0,r),s=Math.round(o),l=Math.abs(o-s);return o&&o!==r&&l?{bin0:s,frac:l,bin1:Math.round(s+l/(o-s))}:{bin0:s,bin1:s,frac:0}}function i(t,e){if(void 0!==t){var r=G((t-M)/(L-M));return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),rt+=e,nt+=r[0]*e,it+=r[1]*e,at+=r[2]*e,r}return[0,0,0,0]}function a(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}function o(t,e,r,n){var a=t[r.bin0];if(void 0===a)return i(void 0,1);var o,s=t[r.bin1],l=e[r.bin0],u=e[r.bin1],c=s-a||0,h=l-a||0;return o=void 0===s?void 0===u?0:void 0===l?2*(u-a):2*(2*u-l-a)/3:void 0===u?void 0===l?0:2*(2*a-s-l)/3:void 0===l?2*(2*u-s-a)/3:u+a-s-l,i(a+r.frac*c+n.frac*(h+r.frac*o))}f.Lib.markTime("in Heatmap.plot");var s=r[0].trace,l=s.uid,u=e.x(),c=e.y(),h=t._fullLayout,g="hm"+l,m="cb"+l;if(h._paper.selectAll(".contour"+l).remove(),s.visible!==!0)return h._paper.selectAll("."+g).remove(),void h._paper.selectAll("."+m).remove();var y,b,x,_,w,k,A=r[0].z,M=s.zmin,L=s.zmax,T=f.Colorscale.getScale(s.colorscale),E=r[0].x,C=r[0].y,S=f.Plots.traceIs(s,"contour"),z=S?"best":s.zsmooth,P=A.length,j=v.maxRowLength(A),O=!1,I=!1;for(k=0;void 0===y&&k0;)b=u.c2p(E[k]),k--;for(y>b&&(x=b,b=y,y=x,O=!0),k=0;void 0===_&&k0;)w=c.c2p(C[k]),k--;if(_>w&&(x=_,_=w,w=x,I=!0),S&&(E=r[0].xfill,C=r[0].yfill),"fast"!==z){var D="best"===z?0:.5;y=Math.max(-D*u._length,y),b=Math.min((1+D)*u._length,b),_=Math.max(-D*c._length,_),w=Math.min((1+D)*c._length,w)}var R=Math.round(b-y),F=Math.round(w-_);if(!(0>=R||0>=F)){var N,B;"fast"===z?(N=j,B=P):(N=R,B=F);var U=document.createElement("canvas");U.width=N,U.height=B;var V,q,H=U.getContext("2d"),G=d.scale.linear().domain(T.map(function(t){return t[0]})).range(T.map(function(t){var e=p(t[1]).toRgb();return[e.r,e.g,e.b,e.a]})).clamp(!0);"fast"===z?(V=O?function(t){return j-1-t}:f.Lib.identity,q=I?function(t){return P-1-t}:f.Lib.identity):(V=function(t){return f.Lib.constrain(Math.round(u.c2p(E[t])-y),0,R)},q=function(t){return f.Lib.constrain(Math.round(c.c2p(C[t])-_),0,F)}),f.Lib.markTime("done init png");var Y,W,X,Z,Q,$,K=q(0),J=[K,K],tt=O?0:1,et=I?0:1,rt=0,nt=0,it=0,at=0;if(z){var ot=0,st=new Uint8Array(R*F*4);if("best"===z){var lt,ut,ct,ht=new Array(E.length),ft=new Array(C.length),dt=new Array(R);for(k=0;kk;k++)dt[k]=n(k,ht);for(W=0;F>W;W++)for(lt=n(W,ft),ut=A[lt.bin0],ct=A[lt.bin1],k=0;R>k;k++,ot+=4)$=o(ut,ct,dt[k],lt),a(st,ot,$)}else for(W=0;P>W;W++)for(Q=A[W],J=q(W),k=0;j>k;k++)$=i(Q[k],1),ot=4*(J*R+V(k)),a(st,ot,$);var pt=H.createImageData(R,F);pt.data.set(st),H.putImageData(pt,0,0)}else for(W=0;P>W;W++)if(Q=A[W],J.reverse(),J[et]=q(W+1),J[0]!==J[1]&&void 0!==J[0]&&void 0!==J[1])for(X=V(0),Y=[X,X],k=0;j>k;k++)Y.reverse(),Y[tt]=V(k+1),Y[0]!==Y[1]&&void 0!==Y[0]&&void 0!==Y[1]&&(Z=Q[k],$=i(Z,(Y[1]-Y[0])*(J[1]-J[0])),H.fillStyle="rgba("+$.join(",")+")",H.fillRect(Y[0],J[0],Y[1]-Y[0],J[1]-J[0]));f.Lib.markTime("done filling png"),nt=Math.round(nt/rt),it=Math.round(it/rt),at=Math.round(at/rt);var gt=p("rgb("+nt+","+it+","+at+")");t._hmpixcount=(t._hmpixcount||0)+rt,t._hmlumcount=(t._hmlumcount||0)+rt*gt.getLuminance(),h._paper.selectAll("."+g).remove(),e.plot.select(".maplayer").append("svg:image").classed(g,!0).datum(r[0]).attr({xmlns:"http://www.w3.org/2000/svg","xlink:xlink:href":U.toDataURL("image/png"),height:F,width:R,x:y,y:_,preserveAspectRatio:"none"}),f.Lib.markTime("done showing png")}}var f=t("../../plotly"),d=t("d3"),p=t("tinycolor2"),g=t("fast-isnumeric"),v=e.exports={};f.Plots.register(v,"heatmap",["cartesian","2dMap"],{}),v.attributes=t("./attributes"),v.supplyDefaults=function(t,e,r,n){function i(r,n){return f.Lib.coerce(t,e,v.attributes,r,n)}var a=f.Plots.traceIs(e,"contour");if(a||i("zsmooth"),f.Plots.traceIs(e,"histogram")){if(f.Histogram.supplyDefaults(t,e),e.visible===!1)return}else{var o=v.handleXYZDefaults(t,e,i);if(!o)return void(e.visible=!1);i("text");var s=v.hasColumns(e);s||i("transpose"),i("connectgaps",s&&(a||e.zsmooth!==!1))}a&&"none"===(e.contours||{}).coloring||f.Colorscale.handleDefaults(t,e,n,i,{prefix:"",cLetter:"z"})},v.handleXYZDefaults=function(t,e,r){var a,o,s=r("z");if(void 0===s||!s.length)return 0;if(v.hasColumns(t)){if(a=r("x"),o=r("y"),!a||!o)return 0}else if(a=n("x",r),o=n("y",r),!i(s))return 0;return e.z.length},v.hasColumns=function(t){return!Array.isArray(t.z[0])},v.convertColumnXYZ=function(t,e,r){var n,i=t.x.slice(),a=t.y.slice(),o=t.z,s=t.text,l=Math.min(i.length,a.length,o.length),u=void 0!==s&&!Array.isArray(s[0]);for(ln;n++)i[n]=e.d2c(i[n]),a[n]=r.d2c(a[n]);var c,h,d,p=f.Lib.distinctVals(i),g=p.vals,v=f.Lib.distinctVals(a),m=v.vals,y=f.Lib.init2dArray(m.length,g.length);for(u&&(d=f.Lib.init2dArray(m.length,g.length)),n=0;l>n;n++)c=f.Lib.findBin(i[n]+p.minDiff/2,g),h=f.Lib.findBin(a[n]+v.minDiff/2,m),y[h][c]=o[n],u&&(d[h][c]=s[n]);t.x=g,t.y=m,t.z=y,u&&(t.text=d)},v.calc=function(t,e){function r(t){x=e._input.zsmooth=e.zsmooth=!1,f.Lib.notifier("cannot fast-zsmooth: "+t)}f.Lib.markTime("start convert x&y");var n,i,a,s,c,h,d,p,g=f.Axes.getFromId(t,e.xaxis||"x"),m=f.Axes.getFromId(t,e.yaxis||"y"),y=f.Plots.traceIs(e,"contour"),b=f.Plots.traceIs(e,"histogram"),x=y?"best":e.zsmooth;if(g._minDtick=0,m._minDtick=0,f.Lib.markTime("done convert x&y"),b){var _=f.Histogram.calc2d(t,e);n=_.x,i=_.x0,a=_.dx,s=_.y,c=_.y0,h=_.dy,d=_.z}else v.hasColumns(e)&&v.convertColumnXYZ(e,g,m),n=e.x?g.makeCalcdata(e,"x"):[],s=e.y?m.makeCalcdata(e,"y"):[],i=e.x0||0,a=e.dx||1,c=e.y0||0,h=e.dy||1,d=v.cleanZ(e),(y||e.connectgaps)&&(e._emptypoints=u(d),e._interpz=l(d,e._emptypoints,e._interpz));if("fast"===x)if("log"===g.type||"log"===m.type)r("log axis found");else if(!b){if(n.length){var w=(n[n.length-1]-n[0])/(n.length-1),k=Math.abs(w/100);for(p=0;pk){r("x scale is not linear");break}}if(s.length&&"fast"===x){var A=(s[s.length-1]-s[0])/(s.length-1),M=Math.abs(A/100);for(p=0;pM){r("y scale is not linear");break}}}var L=v.maxRowLength(d),T="scaled"===e.xtype?"":e.x,E=o(e,T,i,a,L,g),C="scaled"===e.ytype?"":e.y,S=o(e,C,c,h,d.length,m);f.Axes.expand(g,E),f.Axes.expand(m,S);var z={x:E,y:S,z:d};if(f.Colorscale.calc(e,d,"","z"),y&&e.contours&&"heatmap"===e.contours.coloring){var P="contour"===e.type?"heatmap":"histogram2d";z.xfill=o(P,T,i,a,L,g),z.yfill=o(P,C,c,h,d.length,m)}return[z]},v.cleanZ=function(t){var e,r,n,i,o,s,l=t.z;if(t.transpose){for(e=0,o=0;oo;o++)for(r=n(l,o),u[o]=new Array(r),s=0;r>s;s++)u[o][s]=a(i(l,o,s));return u};var m=.01,y=[[-1,0],[1,0],[0,-1],[0,1]];v.maxRowLength=function(t){for(var e=0,r=0;rs||s>=v[0].length||0>l||l>v.length)return}else{if(f.Fx.inbox(e-p[0],e-p[p.length-1])>f.Fx.MAXDIST||f.Fx.inbox(r-g[0],r-g[g.length-1])>f.Fx.MAXDIST)return;if(i){y=[2*p[0]-p[1]];for(var _=1;_i;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}var i=t("../../plotly"),a=t("fast-isnumeric"),o=e.exports={};i.Plots.register(i.Bars,"histogram",["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],{}),i.Plots.register(i.Heatmap,"histogram2d",["cartesian","2dMap","histogram"],{}),o.attributes=t("./attributes"),o.supplyDefaults=function(t,e){function r(r,n){return i.Lib.coerce(t,e,o.attributes,r,n)}var n,a=["x"],s=r("x"),l=r("y");if(i.Plots.traceIs(e,"2dMap")){if(!(s&&s.length&&l&&l.length))return void(e.visible=!1);n=r("z")||r("marker.color"),a=["x","y"]}else{var u=r("orientation",l&&!s?"h":"v"),c=e["v"===u?"x":"y"];if(!c||!c.length)return void(e.visible=!1);"h"===u&&(a=["y"]),n=e["h"===u?"x":"y"]}n&&r("histfunc"),r("histnorm"),a.forEach(function(n){var a=i.Lib.coerce(t,e,o.attributes,n+"bins.start"),s=i.Lib.coerce(t,e,o.attributes,n+"bins.end"),l=a&&s?r("autobin"+n,!1):r("autobin"+n);r(l?"nbins"+n:n+"bins.size")})};var s={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,n){var i=n[e];return a(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,n,i){var o=n[e];return a(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min:function(t,e,r,n){var i=n[e];if(a(i)){if(i=Number(i),!a(r[t]))return r[t]=i,i;if(r[t]>i)return r[t]=i,i-r[t]}return 0},max:function(t,e,r,n){var i=n[e];if(a(i)){if(i=Number(i),!a(r[t]))return r[t]=i,i;if(r[t]i;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;r>n;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;i>a;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;i>a;a++)t[a]*=r[a]/e}};o.calc=function(t,e){if(e.visible===!0){var r,o=[],u=[],c=i.Axes.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),h="h"===e.orientation?"y":"x",f={x:"y",y:"x"}[h],d=c.makeCalcdata(e,h);e["autobin"+h]===!1&&h+"bins"in e||(e[h+"bins"]=i.Axes.autoBin(d,c,e["nbins"+h]),e._input[h+"bins"]=e[h+"bins"]);var p,g,v,m,y=e[h+"bins"],b="string"==typeof y.size,x=b?[]:y,_=[],w=[],k=0,A=e.histnorm,M=e.histfunc,L=-1!==A.indexOf("density"),T="max"===M||"min"===M,E=T?null:0,C=s.count,S=l[A],z=!1;for(Array.isArray(e[f])&&"count"!==M&&(m=e[f],z="avg"===M,C=s[M]),r=y.start,g=y.end+(y.start-i.Axes.tickIncrement(y.start,y.size))/1e6;g>r&&o.length<5e3;)p=i.Axes.tickIncrement(r,y.size),o.push((r+p)/2),u.push(E),b&&x.push(r),L&&_.push(1/(p-r)),z&&w.push(0),r=p;var P=u.length;for(r=0;r=0&&P>v&&(k+=C(v,r,u,m,w));z&&(k=n(u,w)),S&&S(u,k,_);var j=Math.min(o.length,u.length),O=[],I=0,D=j-1;for(r=0;j>r;r++)if(u[r]){I=r;break}for(r=j-1;r>I;r--)if(u[r]){D=r;break}for(r=I;D>=r;r++)a(o[r])&&a(u[r])&&O.push({p:o[r],s:u[r],b:0});return O}},o.calc2d=function(t,e){var r,a,o,u,c,h,f=i.Axes.getFromId(t,e.xaxis||"x"),d=e.x?f.makeCalcdata(e,"x"):[],p=i.Axes.getFromId(t,e.yaxis||"y"),g=e.y?p.makeCalcdata(e,"y"):[],v=Math.min(d.length,g.length);d.length>v&&d.splice(v,d.length-v),g.length>v&&g.splice(v,g.length-v),i.Lib.markTime("done convert data"),!e.autobinx&&"xbins"in e||(e.xbins=i.Axes.autoBin(d,f,e.nbinsx,"2d"),"histogram2dcontour"===e.type&&(e.xbins.start-=e.xbins.size,e.xbins.end+=e.xbins.size),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.Axes.autoBin(g,p,e.nbinsy,"2d"),"histogram2dcontour"===e.type&&(e.ybins.start-=e.ybins.size,e.ybins.end+=e.ybins.size),e._input.ybins=e.ybins),i.Lib.markTime("done autoBin"),c=[];var m,y,b=[],x=[],_="string"==typeof e.xbins.size?[]:e.xbins,w="string"==typeof e.xbins.size?[]:e.ybins,k=0,A=[],M=e.histnorm,L=e.histfunc,T=-1!==M.indexOf("density"),E="max"===L||"min"===L,C=E?null:0,S=s.count,z=l[M],P=!1,j=[],O=[],I="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";I&&"count"!==L&&(P="avg"===L,S=s[L]);var D=e.xbins,R=D.end+(D.start-i.Axes.tickIncrement(D.start,D.size))/1e6;for(h=D.start;R>h;h=i.Axes.tickIncrement(h,D.size))b.push(C),Array.isArray(_)&&_.push(h),P&&x.push(0);Array.isArray(_)&&_.push(h);var F=b.length;for(r=e.xbins.start,a=(h-r)/F,r+=a/2,D=e.ybins,R=D.end+(D.start-i.Axes.tickIncrement(D.start,D.size))/1e6,h=D.start;R>h;h=i.Axes.tickIncrement(h,D.size))c.push(b.concat()),Array.isArray(w)&&w.push(h),P&&A.push(x.concat());Array.isArray(w)&&w.push(h);var N=c.length;for(o=e.ybins.start,u=(h-o)/N,o+=u/2,T&&(j=b.map(function(t,e){return Array.isArray(_)?1/(_[e+1]-_[e]):1/a}),O=c.map(function(t,e){return Array.isArray(w)?1/(w[e+1]-w[e]):1/u})),i.Lib.markTime("done making bins"),h=0;v>h;h++)m=i.Lib.findBin(d[h],_),y=i.Lib.findBin(g[h],w),m>=0&&F>m&&y>=0&&N>y&&(k+=S(m,h,c[y],I,A[y]));if(P)for(y=0;N>y;y++)k+=n(c[y],A[y]);if(z)for(y=0;N>y;y++)z(c[y],k,j,O[y]);return i.Lib.markTime("done binning"),{x:d,x0:r,dx:a,y:g,y0:o,dy:u,z:c}}},{"../../plotly":333,"./attributes":392,"fast-isnumeric":58}],394:[function(t,e,r){var n=t("../../components/colorscale/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:{valType:"number",min:0,max:1,dflt:1},flatshading:{valType:"boolean",dflt:!1},contour:{show:{valType:"boolean",dflt:!1},color:{valType:"color",dflt:"#000"},width:{valType:"number",min:1,max:16,dflt:2}},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":287}],395:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexColor?(this.color=t.vertexColor[0],p.vertexColors=a(t.vertexColor)):t.faceColor?(this.color=t.faceColor[0],p.cellColors=a(t.faceColor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":326,"alpha-shape":23,"convex-hull":42,"delaunay-triangulate":54,"gl-mesh3d":91,tinycolor2:213}],396:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}function s(t){var e=t.map(function(t){var e=o(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var l=s(["x","y","z"]),u=s(["i","j","k"]);return l?(u&&u.forEach(function(t){for(var e=0;e=1)return u;var c=i+1/(2*Math.tan(a)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(i*i+s/2)+i)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/i,p=d+1/(2*Math.tan(a)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>f.scale?v:f;return u.scale<1&&m.scale>u.scale?m:u}function l(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return 0>r&&(i*=-1),0>n&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function u(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,f,d,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),b=g-v;if(b*h>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*h>0?(s=a.cyFinal+u(a.px0[1],a.px1[1]),b=s-v-t.labelExtraY,b*h>0&&(t.labelExtraY+=b)):(m+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-p.indexOf(t)),f=a.cxFinal+l(a.px0[0],a.px1[0]),d=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*c>0&&(t.labelExtraX+=d)))}var a,o,s,l,u,c,h,f,d,p,g,v,m;for(o=0;2>o;o++)for(s=o?r:n,u=o?Math.max:Math.min,h=o?1:-1,a=0;2>a;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(s),d=t[1-o][a],p=d.concat(f),v=[],g=0;gu&&(u=s.pull[a]);o.r=Math.min(r/f(s.tilt,Math.sin(l),s.depth),n/f(s.tilt,Math.cos(l),s.depth))/(2+2*u),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===d.indexOf(s.scalegroup)&&d.push(s.scalegroup)}for(a=0;ah.vTotal/2?1:0)}function f(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var d=t("../../plotly"),p=t("d3"),g=t("fast-isnumeric"),v=t("tinycolor2"),m=e.exports={};d.Plots.register(m,"pie",["pie","showLegend"],{}),m.attributes=t("./attributes"),m.supplyDefaults=function(t,e,r,n){function i(r,n){return d.Lib.coerce(t,e,m.attributes,r,n)}var a=d.Lib.coerceFont,o=i("values");if(!Array.isArray(o)||!o.length)return void(e.visible=!1);var s=i("labels");Array.isArray(s)||(i("label0"),i("dlabel"));var l=i("marker.line.width");l&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var c=i("text"),h=i("textinfo",Array.isArray(c)?"text+percent":"percent");if(i("hoverinfo",1===n._dataLength?"label+text+value+percent":void 0),h&&"none"!==h){var f=i("textposition"),p=Array.isArray(f)||"auto"===f,g=p||"inside"===f,v=p||"outside"===f;if(g||v){var y=a(i,"textfont",n.font);g&&a(i,"insidetextfont",y),v&&a(i,"outsidetextfont",y)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")},m.layoutAttributes={hiddenlabels:{valType:"data_array"}},m.supplyLayoutDefaults=function(t,e){function r(r,n){return d.Lib.coerce(t,e,m.layoutAttributes,r,n)}r("hiddenlabels")},m.calc=function(t,e){var r,o,s,l,u,c,h=e.values,f=e.labels,p=[],m=t._fullLayout,y=m._piecolormap,b={},x=!1,_=0,w=m.hiddenlabels||[];if(e.dlabel)for(f=new Array(h.length),r=0;ro||(s=f[r],(void 0===s||""===s)&&(s=r),s=String(s),void 0===b[s]&&(b[s]=!0,l=v(e.marker.colors[r]),l.isValid()?(l=d.Color.tinyRGB(l),y[s]||(y[s]=l)):y[s]?l=y[s]:(l=!1,x=!0),u=-1!==w.indexOf(s),u||(_+=o),p.push({v:o,label:s,color:l,i:r,hidden:u}))));if(e.sort&&p.sort(function(t,e){return e.v-t.v}),x)for(r=0;r")}return p};var y;m.plot=function(t,e){var r=t._fullLayout;c(e,r._size);var a=r._pielayer.selectAll("g.trace").data(e);a.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),a.exit().remove(),a.order(),a.each(function(e){var a=p.select(this),c=e[0],f=c.trace,g=0,v=(f.depth||0)*c.r*Math.sin(g)/2,m=f.tiltaxis||0,y=m*Math.PI/180,b=[v*Math.sin(y),v*Math.cos(y)],x=c.r*Math.cos(g),_=a.selectAll("g.part").data(f.tilt?["top","sides"]:["top"]);_.enter().append("g").attr("class",function(t){return t+" part"}),_.exit().remove(),_.order(),h(e),a.selectAll(".top").each(function(){var a=p.select(this).selectAll("g.slice").data(e);a.enter().append("g").classed("slice",!0),a.exit().remove();var h=[[[],[]],[[],[]]],g=!1;a.each(function(e){function a(){var r=t._fullLayout,a=t._fullData[f.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&r.hovermode!==!1&&"none"!==s&&s){var l=o(e,c),u=y+e.pxmid[0]*(1-l),h=_+e.pxmid[1]*(1-l),p=[];-1!==s.indexOf("label")&&p.push(e.label),a.text&&a.text[e.i]&&-1!==s.indexOf("text")&&p.push(a.text[e.i]),-1!==s.indexOf("value")&&p.push(i(e.v)),-1!==s.indexOf("percent")&&p.push(n(e.v/c.vTotal)),d.Fx.loneHover({x0:u-l*c.r,x1:u+l*c.r,y:h,text:p.join("
"),name:-1!==s.indexOf("name")?a.name:void 0,color:e.color,idealAlign:e.pxmid[0]<0?"left":"right"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()}),A=!0}}function u(){A&&(d.Fx.loneUnhover(r._hoverlayer.node()),A=!1)}function v(t,r,n,i){return"a"+i*c.r+","+i*x+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void p.select(this).selectAll("path,g").remove();h[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var y=c.cx+b[0],_=c.cy+b[1],w=p.select(this),k=w.selectAll("path.surface").data([e]),A=!1;if(k.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),w.select("path.textline").remove(),w.on("mouseover",a).on("mouseout",u),f.pull){var M=+(Array.isArray(f.pull)?f.pull[e.i]:f.pull)||0;M>0&&(y+=M*e.pxmid[0],_+=M*e.pxmid[1])}e.cxFinal=y,e.cyFinal=_;var L=f.hole;if(e.v===c.vTotal){var T="M"+(y+e.px0[0])+","+(_+e.px0[1])+v(e.px0,e.pxmid,!0,1)+v(e.pxmid,e.px0,!0,1)+"Z";L?k.attr("d","M"+(y+L*e.px0[0])+","+(_+L*e.px0[1])+v(e.px0,e.pxmid,!1,L)+v(e.pxmid,e.px0,!1,L)+"Z"+T):k.attr("d",T)}else{var E=v(e.px0,e.px1,!0,1);if(L){var C=1-L;k.attr("d","M"+(y+L*e.px1[0])+","+(_+L*e.px1[1])+v(e.px1,e.px0,!1,L)+"l"+C*e.px0[0]+","+C*e.px0[1]+E+"Z")}else k.attr("d","M"+y+","+_+"l"+e.px0[0]+","+e.px0[1]+E+"Z")}var S=Array.isArray(f.textposition)?f.textposition[e.i]:f.textposition,z=w.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);z.enter().append("g").classed("slicetext",!0),z.exit().remove(),z.each(function(){var t=p.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.Drawing.font,"outside"===S?f.outsidetextfont:f.insidetextfont).call(d.util.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,n=d.Drawing.bBox(t.node());"outside"===S?r=l(n,e):(r=s(n,e,c), +"auto"===S&&r.scale<1&&(t.call(d.Drawing.font,f.outsidetextfont),(f.outsidetextfont.family!==f.insidetextfont.family||f.outsidetextfont.size!==f.insidetextfont.size)&&(t.attr({"data-bb":""}),n=d.Drawing.bBox(t.node())),r=l(n,e)));var i=y+e.pxmid[0]*r.rCenter+(r.x||0),a=_+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=a-n.height/2,e.yLabelMid=a,e.yLabelMax=a+n.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),t.attr("transform","translate("+i+","+a+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(n.left+n.right)/2+","+-(n.top+n.bottom)/2+")")})}),g&&u(h,f),a.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=p.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.Color.stroke,f.outsidetextfont.color).attr({"stroke-width":Math.min(2,f.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){a.selectAll("tspan").each(function(){var t=p.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},m.style=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,n=p.select(this);n.style({opacity:r.opacity}),n.selectAll(".top path.surface").each(function(t){p.select(this).call(m.styleOne,t,r)})})},m.styleOne=function(t,e,r){var n=r.marker.line.color;Array.isArray(n)&&(n=n[e.i]||d.Color.defaultLine);var i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i,fill:e.color}).call(d.Color.stroke,n)}},{"../../plotly":333,"./attributes":398,d3:53,"fast-isnumeric":58,tinycolor2:213}],400:[function(t,e,r){var n=t("../../plotly");e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:n.Drawing.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../plotly":333}],401:[function(t,e,r){"use strict";function n(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}var i=t("../../plotly"),a=t("d3"),o=t("fast-isnumeric"),s=e.exports={};i.Plots.register(s,"scatter",["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],{}),s.PTS_LINESONLY=20,s.attributes=t("./attributes"),s.handleXYDefaults=function(t,e,r){var n,i=r("x"),a=r("y");if(i)a?(n=Math.min(i.length,a.length),n=0;i--)if(a=t[i],"scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}},s.hasLines=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},s.hasMarkers=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},s.hasText=function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},s.isBubble=function(t){return"object"==typeof t.marker&&Array.isArray(t.marker.size)},s.colorbar=function(t,e){var r=e[0].trace,n=r.marker,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),void 0===n||!n.showscale)return void i.Plots.autoMargin(t,s);var l=i.Colorscale.getScale(n.colorscale),u=n.color,c=n.cmin,h=n.cmax;o(c)||(c=i.Lib.aggNums(Math.min,null,u)),o(h)||(h=i.Lib.aggNums(Math.max,null,u));var f=e[0].t.cb=i.Colorbar(t,s);f.fillcolor(a.scale.linear().domain(l.map(function(t){return c+t[0]*(h-c)})).range(l.map(function(t){return t[1]}))).filllevels({start:c,end:h,size:(h-c)/254}).options(n.colorbar)(),i.Lib.markTime("done colorbar")},s.getBubbleSizeFn=function(t){var e=t.marker,r=e.sizeref||1,n=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return o(e)&&e>0?Math.max(e,n):0}},s.calc=function(t,e){var r=i.Axes.getFromId(t,e.xaxis||"x"),n=i.Axes.getFromId(t,e.yaxis||"y");i.Lib.markTime("in Scatter.calc");var a=r.makeCalcdata(e,"x");i.Lib.markTime("finished convert x");var l=n.makeCalcdata(e,"y");i.Lib.markTime("finished convert y");var u,c,h,f=Math.min(a.length,l.length);r._minDtick=0,n._minDtick=0,a.length>f&&a.splice(f,a.length-f),l.length>f&&l.splice(f,l.length-f);var d={padded:!0},p={padded:!0};if(s.hasMarkers(e)){if(u=e.marker,c=u.size,Array.isArray(c)){var g={type:"linear"};i.Axes.setConvert(g),c=g.makeCalcdata(e.marker,"size"),c.length>f&&c.splice(f,c.length-f)}var v,m=1.6*(e.marker.sizeref||1);v="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/m),3)}:function(t){return Math.max((t||0)/m,3)},d.ppad=p.ppad=Array.isArray(c)?c.map(v):v(c)}s.calcMarkerColorscales(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||a[0]===a[f-1]&&l[0]===l[f-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(d.padded=!1,d.ppad=0):d.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||a[0]===a[f-1]&&l[0]===l[f-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(p.padded=!1):p.tozero=!0,i.Lib.markTime("ready for Axes.expand"),i.Axes.expand(r,a,d),i.Lib.markTime("done expand x"),i.Axes.expand(n,l,p),i.Lib.markTime("done expand y");var y=new Array(f);for(h=0;f>h;h++)y[h]=o(a[h])&&o(l[h])?{x:a[h],y:l[h]}:{x:!1,y:!1};return void 0!==typeof c&&i.Lib.mergeArray(c,y,"ms"),t.firstscatter=!1,y},s.calcMarkerColorscales=function(t){if(s.hasMarkers(t)){var e=t.marker;i.Colorscale.hasColorscale(t,"marker")&&i.Colorscale.calc(t,e.color,"marker","c"),i.Colorscale.hasColorscale(t,"marker.line")&&i.Colorscale.calc(t,e.line.color,"marker.line","c")}},s.selectMarkers=function(t,e,r){var n=e.x(),i=e.y(),o=a.extent(n.range.map(n.l2c)),l=a.extent(i.range.map(i.l2c));r.forEach(function(t,e){var n=t[0].trace;if(s.hasMarkers(n)){var i=n.marker.maxdisplayed;if(0!==i){var a=t.filter(function(t){return t.x>=o[0]&&t.x<=o[1]&&t.y>=l[0]&&t.y<=l[1]}),u=Math.ceil(a.length/i),c=0;r.forEach(function(t,r){var n=t[0].trace;s.hasMarkers(n)&&n.marker.maxdisplayed>0&&e>r&&c++});var h=Math.round(c*u/3+Math.floor(c/3)*u/7.1);t.forEach(function(t){delete t.vis}),a.forEach(function(t,e){0===Math.round((e+h)%u)&&(t.vis=!0)})}}})},s.arraysToCalcdata=function(t){var e=t[0].trace,r=e.marker;if(i.Lib.mergeArray(e.text,t,"tx"),i.Lib.mergeArray(e.textposition,t,"tp"),e.textfont&&(i.Lib.mergeArray(e.textfont.size,t,"ts"),i.Lib.mergeArray(e.textfont.color,t,"tc"),i.Lib.mergeArray(e.textfont.family,t,"tf")),r&&r.line){var n=r.line;i.Lib.mergeArray(r.opacity,t,"mo"),i.Lib.mergeArray(r.symbol,t,"mx"),i.Lib.mergeArray(r.color,t,"mc"),i.Lib.mergeArray(n.color,t,"mlc"),i.Lib.mergeArray(n.width,t,"mlw")}},s.plot=function(t,e,r){function n(t){return t.filter(function(t){return t.vis})}s.selectMarkers(t,e,r);var o=e.x(),l=e.y(),u=e.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(r);u.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2);var c,h,f,d="";u.each(function(t){var e=t[0].trace,r=e.line;if(e.visible===!0&&(s.arraysToCalcdata(t),s.hasLines(e)||"none"!==e.fill)){var n,u,p,g,v=a.select(this),m="",y="";c="tozero"===e.fill.substr(0,6)||"to"===e.fill.substr(0,2)&&!d?v.append("path").classed("js-fill",!0):null,f&&(h=f.datum(t)),f=v.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(r.shape)?(u=i.Drawing.steps(r.shape),p=i.Drawing.steps(r.shape.split("").reverse().join(""))):u=p="spline"===r.shape?function(t){return i.Drawing.smoothopen(t,r.smoothing)}:function(t){return"M"+t.join("L")},g=function(t){return"L"+p(t.reverse()).substr(1)};var b=s.linePoints(t,{xaxis:o,yaxis:l,connectGaps:e.connectgaps,baseTolerance:Math.max(r.width||1,3)/4,linear:"linear"===r.shape});if(b.length){for(var x=b[0][0],_=b[b.length-1],w=_[_.length-1],k=0;k1&&v.append("path").classed("js-line",!0).attr("d",n)}c?x&&w&&("y"===e.fill.charAt(e.fill.length-1)?x[1]=w[1]=l.c2p(0,!0):x[0]=w[0]=o.c2p(0,!0),c.attr("d",m+"L"+w+"L"+x+"Z")):"tonext"===e.fill.substr(0,6)&&m&&d&&h.attr("d",m+d+"Z"),d=y}}}),u.selectAll("path:not([d])").remove(),u.append("g").attr("class","points").each(function(t){var e=t[0].trace,r=a.select(this),u=s.hasMarkers(e),c=s.hasText(e);!u&&!c||e.visible!==!0?r.remove():(u&&r.selectAll("path.point").data(e.marker.maxdisplayed?n:i.Lib.identity).enter().append("path").classed("point",!0).call(i.Drawing.translatePoints,o,l),c&&r.selectAll("g").data(e.marker.maxdisplayed?n:i.Lib.identity).enter().append("g").append("text").call(i.Drawing.translatePoints,o,l))})},s.linePoints=function(t,e){function r(e){var r=w.c2p(t[e].x),n=k.c2p(t[e].y);return r===E||n===E?!1:[r,n]}function n(t){var e=t[0]/w._length,r=t[1]/k._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*M}function a(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var o,s,l,u,c,h,f,d,p,g,v,m,y,b,x,_,w=e.xaxis,k=e.yaxis,A=e.connectGaps,M=e.baseTolerance,L=e.linear,T=[],E=i.Axes.BADNUM,C=.2,S=new Array(t.length),z=0;for(o=0;on(h))break;l=h,y=g[0]*p[0]+g[1]*p[1],y>v?(v=y,u=h,d=!1):m>y&&(m=y,c=h,d=!0)}if(d?(S[z++]=u,l!==c&&(S[z++]=c)):(c!==s&&(S[z++]=c),l!==u&&(S[z++]=u)),S[z++]=l,o>=t.length||!h)break;S[z++]=h,s=h}}else S[z++]=u}T.push(S.slice(0,z))}return T},s.style=function(t){var e=a.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){a.select(this).selectAll("path.point").call(i.Drawing.pointStyle,t.trace||t[0].trace),a.select(this).selectAll("text").call(i.Drawing.textPointStyle,t.trace||t[0].trace)}),e.selectAll("g.trace path.js-line").call(i.Drawing.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.Drawing.fillGroupStyle)},s.getTraceColor=function(t,e){var r,n;if("lines"===t.mode)return r=t.line.color,r&&i.Color.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var a=e.mcc||(t.marker||{}).color,o=e.mlcc||((t.marker||{}).line||{}).color;return n=a&&i.Color.opacity(a)?a:o&&i.Color.opacity(o)&&(e.mlw||((t.marker||{}).line||{}).width)?o:"",n?i.Color.opacity(n)<.3?i.Color.addOpacity(n,.3):n:(r=(t.line||{}).color,r&&i.Color.opacity(r)&&s.hasLines(t)&&t.line.width?r:t.fillcolor)},s.hoverPoints=function(t,e,r,n){var a=t.cd,o=a[0].trace,l=t.xa,u=t.ya,c=function(t){var r=Math.max(3,t.mrc||0);return Math.max(Math.abs(l.c2p(t.x)-l.c2p(e))-r,1-3/r)},h=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.y)-u.c2p(r))-e,1-3/e)},f=function(t){var n=Math.max(3,t.mrc||0),i=Math.abs(l.c2p(t.x)-l.c2p(e)),a=Math.abs(u.c2p(t.y)-u.c2p(r));return Math.max(Math.sqrt(i*i+a*a)-n,1-3/n)},d=i.Fx.getDistanceFunction(n,c,h,f);if(i.Fx.getClosest(a,d,t),t.index!==!1){var p=a[t.index],g=l.c2p(p.x,!0),v=u.c2p(p.y,!0),m=p.mrc||1;return t.color=s.getTraceColor(o,p),t.x0=g-m,t.x1=g+m,t.xLabelVal=p.x,t.y0=v-m,t.y1=v+m,t.yLabelVal=p.y,p.tx?t.text=p.tx:o.text&&(t.text=o.text),i.ErrorBars.hoverInfo(p,o,t),[t]}}},{"../../plotly":333,"./attributes":400,d3:53,"fast-isnumeric":58}],402:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),a=t("../../constants/gl_markers.json"),o=t("../../lib/extend").extendFlat,s=i.line,l=i.marker,u=l.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:o({},i.text,{}),mode:o({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},line:{color:s.color,width:s.width,dash:s.dash},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a),dflt:"circle",arrayOk:!0},size:o({},l.size,{dflt:8}),sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:u.color,width:o({},u.width,{arrayOk:!1}),colorscale:u.colorscale,cauto:u.cauto,cmax:u.cmax,cmin:u.cmin,autocolorscale:u.autocolorscale,reversescale:u.reversescale}},textposition:o({},i.textposition,{dflt:"top center"}),textfont:i.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl_markers.json":306,"../../lib/extend":313,"../scatter/attributes":400}],403:[function(t,e,r){"use strict";function n(t,e){function r(t,r){return t in e?e[t]:r}if(!e||!e.visible)return null;var n,i,a,o,s,l=new Array(t.length),u=r("type","percent"),c=r("symmetric",!0),h=+r("value",10),f=+r("valueminus",10),d=r("array",null),p=r("arrayminus",null);if(c&&(f=h,p=d),!("data"!==u||d&&p))return null;for(s=0;sr;++r){for(s=[[0,0,0],[0,0,0]],a=0;3>a;++a)if(l[a])for(o=0;2>o;++o)s[o][a]=l[a][r][o];e[r]=s}return e}e.exports=a},{}],404:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;ne;++e)r=t[e],r&&r.copy_zstyle!==!1&&(r=t[2]),r&&(n[e]=r.width/100,i[e]=b(r.color),a=r.thickness);return{capSize:n,color:i,lineWidth:a}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return w[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;e>o;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,d.Lib.identity);return a}function c(t,e){var r,n,i,c,h,f,p=[],g=t.fullSceneLayout,v=t.dataScale,m=t.dataCenter,y=g.xaxis,_=g.yaxis,w=g.zaxis,A=e.marker,M=e.line,L=a([e.error_x,e.error_y,e.error_z]),T=e.x||[],E=e.y||[],C=e.z||[],S=T.length;for(n=0;S>n;n++)i=y.d2l(T[n])*v[0]-m[0],c=_.d2l(E[n])*v[1]-m[1],h=w.d2l(C[n])*v[2]-m[2],p[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(S),n=0;S>n;n++)f[n]=e.text;if(r={position:p,mode:e.mode,text:f},"line"in e&&(r.lineColor=b(M.color),r.lineWidth=M.width,r.lineDashes=M.dash),"marker"in e){var z=d.Scatter.getBubbleSizeFn(e);r.scatterColor=x(A,1,S),r.scatterSize=u(A.size,S,s,20,z),r.scatterMarker=u(A.symbol,S,l,"\u25cf"),r.scatterLineWidth=A.line.width,r.scatterLineColor=x(A.line,1,S),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,S),r.textSize=u(e.textfont.size,S,d.Lib.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;3>n;++n){var j=e.projection[P[n]];(r.project[n]=j.show)&&(r.projectOpacity[n]=j.opacity,r.projectScale[n]=j.scale)}return r.errorBounds=k(e),r.errorColor=L.color,r.errorLineWidth=L.lineWidth,r.errorCapSize=L.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("../../plotly"),p=t("gl-line3d"),g=t("gl-scatter3d"),v=t("gl-error3d"),m=t("gl-mesh3d"),y=t("delaunay-triangulate"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../../constants/gl3d_dashes.json"),w=t("../../constants/gl_markers.json"),k=t("./calc_errors"),A=n.prototype;A.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},A.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=_.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in _&&(s=_[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=p(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&"number"==typeof t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=g(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=g(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=v(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=m(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.textMarkers),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes.json":305,"../../constants/gl_markers.json":306,"../../lib/gl_format_color":315,"../../lib/str2rgbarray":326,"../../plotly":333,"./calc_errors":403,"delaunay-triangulate":54,"gl-error3d":62,"gl-line3d":68,"gl-mesh3d":91,"gl-scatter3d":134}],405:[function(t,e,r){"use strict";function n(t,e,r){var n=0,i=r("x"),a=r("y"),o=r("z");return i&&a&&o&&(n=Math.min(i.length,a.length,o.length),n=0&&s("surfacecolor",c||h);for(var f=["x","y","z"],d=0;3>d;++d){var p="projection."+f[d];s(p+".show")&&(s(p+".opacity"),s(p+".scale"))}i.ErrorBars.supplyDefaults(t,e,r,{axis:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"y",inherit:"z"}),i.ErrorBars.supplyDefaults(t,e,r,{axis:"x",inherit:"z"})}},{"../../plotly":333,"./":406}],406:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"scatter3d",["gl3d","symbols","markerColorscale","showLegend"],{}),i.attributes=t("./attributes"),i.markerSymbols=t("../../constants/gl_markers.json"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Scatter.colorbar,i.calc=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n.Scatter.arraysToCalcdata(r),n.Scatter.calcMarkerColorscales(e),r}},{"../../constants/gl_markers.json":306,"../../plotly":333,"./attributes":402,"./defaults":405}],407:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=n.line,l=o.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:a({},n.mode,{dflt:"markers"}),text:a({},n.text,{}),line:{color:s.color,width:s.width,dash:s.dash},marker:{symbol:o.symbol,opacity:o.opacity,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,color:o.color,colorscale:o.colorscale,cauto:o.cauto,cmax:o.cmax,cmin:o.cmin,autocolorscale:o.autocolorscale,reversescale:o.reversescale,showscale:o.showscale,line:{color:l.color,width:l.width,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale}},textfont:n.textfont,textposition:n.textposition,hoverinfo:a({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":313,"../../plots/attributes":334,"../scatter/attributes":400}],408:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),an;n++)r[n]=[t.lon[n],t.lat[n]];return{type:"LineString",coordinates:r,trace:t}}function a(t,e){function r(e){var r=t.mockAxis;return o.Axes.tickText(r,r.c2l(e),"hover").text+"\xb0"}var n=e.hoverinfo;if("none"===n)return function(t){delete t.textLabel};var i="all"===n?o.ScatterGeo.attributes.hoverinfo.flags:n.split("+"),a=-1!==i.indexOf("location")&&Array.isArray(e.locations),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),u=-1!==i.indexOf("text");return function(t){var n=[];a?n.push(t.location):s&&l?n.push("("+r(t.lon)+", "+r(t.lat)+")"):s?n.push("lon: "+r(t.lon)):l&&n.push("lat: "+r(t.lat)),u&&n.push(t.tx||e.text),t.textLabel=n.join("
")}}var o=t("../../plotly"),s=t("d3"),l=t("../../lib/topojson_utils").getTopojsonFeatures,u=t("../../lib/geo_location_utils").locationToFeature,c=t("../../lib/array_to_calc_item"),h=e.exports={};h.calcGeoJSON=function(t,e){var r,i,a,o,s,c,h=[],f=Array.isArray(t.locations);f?(s=t.locations,r=s.length,i=l(t,e),a=function(t,e){var r=u(t.locationmode,s[e],i);return void 0!==r?r.properties.ct:void 0}):(r=t.lon.length,a=function(t,e){return[t.lon[e],t.lat[e]]});for(var d=0;r>d;d++)o=a(t,d),o&&(c={lon:o[0],lat:o[1],location:f?t.locations[d]:null},n(t,c,d),h.push(c));return h.length>0&&(h[0].trace=t),h},h.plot=function(t,e){var r=t.framework.select("g.scattergeolayer"),n=o.Scatter,l=t.topojson;r.selectAll("*").remove();var u=r.selectAll("g.trace.scatter").data(e);u.enter().append("g").attr("class","trace scattergeo"),u.each(function(t){n.hasLines(t)&&t.visible===!0&&s.select(this).append("path").datum(i(t)).attr("class","js-line")}),u.append("g").attr("class","points").each(function(e){function r(r){if(t.showHover){var n=t.projection([r.lon,r.lat]);d(r),o.Fx.loneHover({x:n[0],y:n[1],name:g?e.name:void 0,text:r.textLabel,color:r.mc||(e.marker||{}).color},{container:t.hoverContainer.node()})}}var i=s.select(this),u=n.hasMarkers(e),c=n.hasText(e);if(!u&&!c||e.visible!==!0)return void i.remove();var f=h.calcGeoJSON(e,l),d=a(t,e),p=e.hoverinfo,g="all"===p||-1!==p.indexOf("name");u&&i.selectAll("path.point").data(f).enter().append("path").attr("class","point").on("mouseover",r).on("mouseout",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mousedown",function(){o.Fx.loneUnhover(t.hoverContainer)}).on("mouseup",r),c&&i.selectAll("g").data(f).enter().append("g").append("text")}),h.style(t)},h.style=function(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t.opacity}),e.selectAll("g.points").each(function(t){s.select(this).selectAll("path.point").call(o.Drawing.pointStyle,t),s.select(this).selectAll("text").call(o.Drawing.textPointStyle,t)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=t.trace,r=e.line||{};s.select(this).call(o.Color.stroke,r.color).call(o.Drawing.dashLine,r.dash||"",r.width||0)})}},{"../../lib/array_to_calc_item":309,"../../lib/geo_location_utils":314,"../../lib/topojson_utils":328,"../../plotly":333,d3:53}],411:[function(t,e,r){var n=t("../scatter/attributes"),i=t("../../constants/gl2d_dashes.json"),a=t("../../constants/gl_markers.json"),o=t("../../lib/extend").extendFlat,s=n.line,l=n.marker,u=l.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:o({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:s.color,width:s.width,dash:{valType:"enumerated",values:Object.keys(i),dflt:"solid"}},marker:{color:l.color,symbol:{valType:"enumerated",values:Object.keys(a), +dflt:"circle",arrayOk:!0},size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,opacity:l.opacity,colorscale:l.colorscale,cauto:l.cauto,cmax:l.cmax,cmin:l.cmin,autocolorscale:l.autocolorscale,reversescale:l.reversescale,showscale:l.showscale,line:{color:u.color,width:u.width,colorscale:u.colorscale,cauto:u.cauto,cmax:u.cmax,cmin:u.cmin,autocolorscale:u.autocolorscale,reversescale:u.reversescale}},fill:o({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes.json":304,"../../constants/gl_markers.json":306,"../../lib/extend":313,"../scatter/attributes":400}],412:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array,color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=p(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=g(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=g(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array,sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=f(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=d(t.glplot,this.scatterOptions),this.fancyScatter._trace=this}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;r>a;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(A(t,r),k(e,r),r)}function s(t,e,r,n){var i=y(t,e,n);return i=Array.isArray(i[0])?i:a(h.Lib.identity,[i],n),l(i,k(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;r>i;++i){for(var a=0;3>a;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][a]*e[i]}return n}function u(t,e){if(void 0===Float32Array.slice){for(var r=new Float32Array(e),n=0;e>n;n++)r[n]=t[n];return r}return t.slice(0,e)}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("../../plotly"),f=t("gl-scatter2d"),d=t("gl-scatter2d-fancy"),p=t("gl-line2d"),g=t("gl-error2d"),v=t("fast-isnumeric"),m=t("../../lib/str2rgbarray"),y=t("../../lib/gl_format_color"),b=t("../../constants/gl_markers.json"),x=t("../../constants/gl2d_dashes.json"),_=["xaxis","yaxis"],w=n.prototype;w.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:[this.xData[e],this.yData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,hoverinfo:this.hoverinfo}},w.isFancy=function(t){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.line.width)||Array.isArray(e.opacity))return!0;var r=e.color;if(Array.isArray(r))return!0;var n=Array.isArray(e.line.color);return Array.isArray(n)?!0:this.hasErrorX?!0:this.hasErrorY?!0:!1};var k=i.bind(null,function(t){return+t}),A=i.bind(null,m),M=i.bind(null,function(t){return b[t]||"\u25cf"});w.update=function(t){t.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=h.Scatter.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=h.Scatter.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.isFancy(t)?this.updateFancy(t):this.updateFast(t),this.color=h.Scatter.getTraceColor(t,{})},w.updateFast=function(t){for(var e,r,n=this.xData=t.x,i=this.yData=t.y,a=n.length,o=new Array(a),s=new Float32Array(2*a),l=this.bounds,c=0,h=0,f=0;a>f;++f)e=n[f],r=i[f],v(e)&&v(r)&&(o[c++]=f,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=u(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var d;if(this.hasMarkers){this.scatterOptions.positions=s;var p=m(t.marker.color),g=m(t.marker.line.color),y=t.opacity*t.marker.opacity;p[3]*=y,this.scatterOptions.color=p,g[3]*=y,this.scatterOptions.borderColor=g,d=t.marker.size,this.scatterOptions.size=d,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,d)},w.updateFancy=function(t){var e,r,n,a,o,l,c,f,d=this.scene,p=d.xaxis,g=d.yaxis,v=this.bounds,m=this.xData=p.makeCalcdata(t,"x"),y=this.yData=g.makeCalcdata(t,"y"),b=h.ErrorBars.calcFromTrace(t,d.fullLayout),x=m.length,_=new Array(x),w=new Float32Array(2*x),A=new Float32Array(4*x),L=new Float32Array(4*x),T=0,E=0,C=0,S=0,z="log"===p.type?function(t){return p.d2l(t)}:function(t){return t},P="log"===g.type?function(t){return g.d2l(t)}:function(t){return t};for(e=0;x>e;++e)n=z(m[e]),a=P(y[e]),isNaN(n)||isNaN(a)||(_[T++]=e,w[E++]=n,w[E++]=a,o=A[C++]=n-b[e].xs||0,l=A[C++]=b[e].xh-n||0,A[C++]=0,A[C++]=0,L[S++]=0,L[S++]=0,c=L[S++]=a-b[e].ys||0,f=L[S++]=b[e].yh-a||0,v[0]=Math.min(v[0],n-o),v[1]=Math.min(v[1],a-c),v[2]=Math.max(v[2],n+l),v[3]=Math.max(v[3],a+f));w=u(w,E),this.idToIndex=_,this.updateLines(t,w),this.updateError("X",t,w,A),this.updateError("Y",t,w,L);var j;if(this.hasMarkers){this.scatterOptions.positions=w,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var O,I=h.Scatter.getBubbleSizeFn(t),D=t.marker,R=D.opacity,F=t.opacity,N=s(D,R,F,x),B=M(D.symbol,x),U=k(D.line.width,x),V=s(D.line,R,F,x);for(j=i(I,D.size,x),e=0;T>e;++e)for(O=_[e],this.scatterOptions.sizes[e]=4*j[O],this.scatterOptions.glyphs[e]=B[O],this.scatterOptions.borderWidths[e]=.5*U[O],r=0;4>r;++r)this.scatterOptions.colors[4*e+r]=N[4*O+r],this.scatterOptions.borderColors[4*e+r]=V[4*O+r];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(m,y,j)},w.updateLines=function(t,e){if(this.hasLines){this.lineOptions.positions=e;var r=m(t.line.color);this.hasMarkers&&(r[3]*=t.marker.opacity);for(var n=Math.round(.5*this.lineOptions.width),i=(x[t.line.dash]||[1]).slice(),a=0;ao;o++)r=this.scene[_[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},w.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};h.Axes.expand(n.xaxis,t,i),h.Axes.expand(n.yaxis,e,i)},w.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../constants/gl2d_dashes.json":304,"../../constants/gl_markers.json":306,"../../lib/gl_format_color":315,"../../lib/str2rgbarray":326,"../../plotly":333,"fast-isnumeric":58,"gl-error2d":60,"gl-line2d":66,"gl-scatter2d":131,"gl-scatter2d-fancy":126}],413:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}var s=n.Scatter,l=s.handleXYDefaults(t,e,o);return l?(o("text"),o("mode",le){for(var r=g/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],o=0;3>o;++o){var s=a(t[o]),l=u(new Float32Array(i),n);c(l,s,[r,0,0,0,r,0,0,0,1]),t[o]=l}return r}return 1}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var l=t("gl-surface3d"),u=t("ndarray"),c=t("ndarray-homography"),h=t("ndarray-fill"),f=t("ndarray-ops"),d=t("tinycolor2"),p=t("../../lib/str2rgbarray"),g=128,v=n.prototype;v.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0])*this.scene.dataScale[0]-this.scene.dataCenter[0],n.yaxis.d2l(r[1])*this.scene.dataScale[1]-this.scene.dataCenter[1],n.zaxis.d2l(r[2])*this.scene.dataScale[2]-this.scene.dataCenter[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},v.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;3>r;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},v.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,s=t.opacity,l=i(t.colorscale,s),c=t.z,f=t.x,d=t.y,g=n.xaxis,v=n.yaxis,m=n.zaxis,y=r.dataScale,b=r.dataCenter,x=c[0].length,_=c.length,w=[u(new Float32Array(x*_),[x,_]),u(new Float32Array(x*_),[x,_]),u(new Float32Array(x*_),[x,_])],k=w[0],A=w[1],M=r.contourLevels;this.data=t,h(w[2],function(t,e){return m.d2l(c[e][t])*y[2]-b[2]}),Array.isArray(f[0])?h(k,function(t,e){return g.d2l(f[e][t])*y[0]-b[0]}):h(k,function(t){return g.d2l(f[t])*y[0]-b[0]}),Array.isArray(d[0])?h(A,function(t,e){return v.d2l(d[e][t])*y[1]-b[1]}):h(A,function(t,e){return v.d2l(d[e])*y[1]-b[1]}),this.dataScale=o(w);var L={colormap:l,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1};"opacity"in t&&t.opacity<1&&(L.opacity=.25*t.opacity);var T=[!0,!0,!0],E=[!0,!0,!0],C=["x","y","z"];for(e=0;3>e;++e){var S=t.contours[C[e]];T[e]=S.highlight,E[e]=S.show,L.showContour[e]=S.show||S.highlight,L.showContour[e]&&(L.contourProject[e]=[S.project.x,S.project.y,S.project.z],S.show?(this.showContour[e]=!0,L.levels[e]=M[e],a.highlightColor[e]=L.contourColor[e]=p(S.color),S.usecolormap?a.highlightTint[e]=L.contourTint[e]=0:a.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=S.width):this.showContour[e]=!1,S.highlight&&(L.dynamicColor[e]=p(S.highlightColor),L.dynamicWidth[e]=S.highlightWidth))}L.coords=w,a.update(L),a.highlightEnable=T,a.contourEnable=E,a.visible=t.visible,a.snapToData=!0,"lighting"in t&&(a.ambientLight=t.lighting.ambient,a.diffuseLight=t.lighting.diffuse,a.specularLight=t.lighting.specular,a.roughness=t.lighting.roughness,a.fresnel=t.lighting.fresnel),s&&1>s&&(a.supportsTransparency=!0)},v.dispose=function(){this.glplot.remove(this.surface),this.surface.dispose()},e.exports=s},{"../../lib/str2rgbarray":326,"gl-surface3d":161,ndarray:189,"ndarray-fill":178,"ndarray-homography":183,"ndarray-ops":184,tinycolor2:213}],417:[function(t,e,r){"use strict";var n=t("../../plotly"),i=t("./");e.exports=function(t,e,r,a){function o(r,a){return n.Lib.coerce(t,e,i.attributes,r,a)}var s,l,u=o("z");if(!u)return void(e.visible=!1);var c=u[0].length,h=u.length;if(o("x"),o("y"),!Array.isArray(e.x))for(e.x=[],s=0;c>s;++s)e.x[s]=s;if(o("text"),!Array.isArray(e.y))for(e.y=[],s=0;h>s;++s)e.y[s]=s;o("lighting.ambient"),o("lighting.diffuse"),o("lighting.specular"),o("lighting.roughness"),o("lighting.fresnel"),o("hidesurface"),o("opacity"),o("colorscale");var f=["x","y","z"];for(s=0;3>s;++s){var d="contours."+f[s],p=o(d+".show"),g=o(d+".highlight");if(p||g)for(l=0;3>l;++l)o(d+".project."+f[l]);p&&(o(d+".color"),o(d+".width"),o(d+".usecolormap")),g&&(o(d+".highlightColor"),o(d+".highlightWidth"))}n.Colorscale.handleDefaults(t,e,a,o,{prefix:"",cLetter:"z"})}},{"../../plotly":333,"./":418}],418:[function(t,e,r){"use strict";var n=t("../../plotly"),i=e.exports={};n.Plots.register(i,"surface",["gl3d","noOpacity"],{}),i.attributes=t("./attributes"),i.supplyDefaults=t("./defaults"),i.colorbar=n.Colorbar.traceColorbar,i.calc=function(t,e){n.Colorscale.calc(e,e.z,"","z")}},{"../../plotly":333,"./attributes":415,"./defaults":417}]},{},[308])(308)}); \ No newline at end of file diff --git a/inst/htmlwidgets/plotly.yaml b/inst/htmlwidgets/plotly.yaml index 2ea013693a..da016b243b 100644 --- a/inst/htmlwidgets/plotly.yaml +++ b/inst/htmlwidgets/plotly.yaml @@ -1,192 +1,5 @@ dependencies: - plotly.js: - name: plotly.js - version: 1.2.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - 3d-view: - name: 3d-view - version: 2.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - alpha-shape: - name: alpha-shape - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - arraytools: - name: arraytools - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - convex-hull: - name: convex-hull - version: 1.0.3 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - d3: - name: d3 - version: 3.5.6 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - delaunay-triangulate: - name: delaunay-triangulate - version: 1.1.6 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - es6-promise: - name: es6-promise - version: 3.0.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - fast-isnumeric: - name: fast-isnumeric - version: 1.1.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - fs-extra: - name: fs-extra - version: 0.26.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-error2d: - name: gl-error2d - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-error3d: - name: gl-error3d - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-line2d: - name: gl-line2d - version: 1.2.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-line3d: - name: gl-line3d - version: 1.0.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-mat4: - name: gl-mat4 - version: 1.1.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-mesh3d: - name: gl-mesh3d - version: 1.0.4 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-plot2d: - name: gl-plot2d - version: 1.1.6 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-plot3d: - name: gl-plot3d - version: 1.3.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-scatter2d: - name: gl-scatter2d - version: 1.0.5 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-scatter2d-fancy: - name: gl-scatter2d-fancy + - name: plotlyjs version: 1.1.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-scatter3d: - name: gl-scatter3d - version: 1.0.4 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-select-box: - name: gl-select-box - version: 1.0.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-spikes2d: - name: gl-spikes2d - version: 1.0.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - gl-surface3d: - name: gl-surface3d - version: 1.0.6 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - mouse-change: - name: mouse-change - version: 1.1.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - mouse-wheel: - name: mouse-wheel - version: 1.0.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - ndarray: - name: ndarray - version: 1.0.16 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - ndarray-fill: - name: ndarray-fill - version: 1.0.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - ndarray-homography: - name: ndarray-homography - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - ndarray-ops: - name: ndarray-ops - version: 1.2.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - node-sass: - name: node-sass - version: 3.4.1 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - right-now: - name: right-now - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - robust-orientation: - name: robust-orientation - version: 1.1.3 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - sane-topojson: - name: sane-topojson - version: 1.2.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - superscript-text: - name: superscript-text - version: 1.0.0 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - tinycolor2: - name: tinycolor2 - version: 1.1.2 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - topojson: - name: topojson - version: 1.6.19 - src: htmlwidgets/lib/plotlyjs - script: plotly-latest.min.js - xml2js: - name: xml2js - version: 0.4.15 - src: htmlwidgets/lib/plotlyjs + src: "htmlwidgets/lib/plotlyjs" script: plotly-latest.min.js - diff --git a/inst/plotlyjs.R b/inst/plotlyjs.R index 38828167bb..a3d1c91dee 100644 --- a/inst/plotlyjs.R +++ b/inst/plotlyjs.R @@ -7,27 +7,3 @@ download.file( "https://raw.githubusercontent.com/plotly/plotly.js/master/LICENSE", "inst/htmlwidgets/lib/plotlyjs/LICENSE" ) - - -# find plotlyjs dependencies and write yaml file -library(jsonlite) -pkg <- fromJSON("https://raw.githubusercontent.com/plotly/plotly.js/master/package.json") -deps <- pkg$dependencies -nms <- c(pkg$name, names(deps)) -deps <- c(pkg$version, sub("^\\^", "", as.character(deps))) - -f <- function(x, y) { - list(name = x, - version = y, - src = "htmlwidgets/lib/plotlyjs", - script = "plotly-latest.min.js" - ) -} - - - -depz <- list(dependencies = Map(f, nms, deps)) -writeLines(yaml::as.yaml(depz), "inst/htmlwidgets/plotly.yaml") - - -